To render text properly in rgl using textshaping and systemfonts to handle text rendering., I need the metrics.horiBearingX and metrics.horiBearingY values returned by FT_Load_Glyph. As far as I can see, that's the only reason I would need to link Freetype into rgl. Would it be possible for systemfonts to add those measurements to the (C-level) glyph_metrics() output?
Another way to do this would be to incorporate those values into the loc result (or a new result) returned by string_shape() in the textshaping package.
That would simplify the linking requirements for rgl, and avoid the need to check that the FreeType version matches the one linked into systemfonts.
It's possible I've just missed something in the C interfaces to systemfonts and textshaping. Here's the process I am currently trying to use for rendering a string like "abg":
- Get the bitmaps for each glyph using
get_glyph_raster from systemfonts.
- Use string_shape from textshaping to find the positions of each glyph in the output.
- Use get_cached_face from systemfonts and FT_Load_Glyph to get the bearings for each glyph.
- Display the bitmaps for each glyph by combining the loc valutes from string_shape with the bearings.
BTW, it would be nice if there was an alternative to get_glyph_raster that just returned the image in a buffer so I didn't need to decode the SEXP, but It's mostly just step 3 that I'd like to be able to avoid.
To render text properly in
rglusingtextshapingandsystemfontsto handle text rendering., I need themetrics.horiBearingXandmetrics.horiBearingYvalues returned byFT_Load_Glyph. As far as I can see, that's the only reason I would need to link Freetype intorgl. Would it be possible forsystemfontsto add those measurements to the (C-level)glyph_metrics()output?Another way to do this would be to incorporate those values into the
locresult (or a new result) returned bystring_shape()in thetextshapingpackage.That would simplify the linking requirements for
rgl, and avoid the need to check that the FreeType version matches the one linked intosystemfonts.It's possible I've just missed something in the C interfaces to
systemfontsandtextshaping. Here's the process I am currently trying to use for rendering a string like "abg":get_glyph_rasterfrom systemfonts.BTW, it would be nice if there was an alternative to
get_glyph_rasterthat just returned the image in a buffer so I didn't need to decode the SEXP, but It's mostly just step 3 that I'd like to be able to avoid.