Skip to content
Prev 61900 / 63421 Next

Help requested: writing text to a raster in memory

I'm somewhat aware of how tricky it all is.  For now I'm going to do it 
in R (usng textshaping for layout and base graphics on the 
ragg::agg_capture device to draw to the bitmap).  I'll avoid allowing 
changes to happen in the C++ code.

Eventually I'll see if I can translate the code into C++.  I know 
textshaping has a C interface, but for the actual drawing I'll have to 
work something else out.  Or maybe just leave it in R, and only try to 
write a new bitmap when it's safe.

For future reference, will the measurements reported by 
textshaping::shape_text() match the values used by your Cairo package, 
or are equivalent measurements available elsewhere?

Duncan Murdoch
On 24/09/2023 6:55 p.m., Simon Urbanek wrote: