Thank you, @dnkl, for this library, I am a contributor who is trying to improve the GUI code of a certain big-name open source library using your work. However a few questions are on my mind...
-
What is the best way of querying text extents? I am currently just looping over the glyphs, adding the x advance onto a "width" variable and doing h = max(h, (font->ascent - glyph->y + glyph->height)) for this, sometimes the calculated bounding box is noticeably off, especially in width, compared to what I am measuring with an image editor.
-
How do I calculate the perfect ascender value for a glyph array so I can perfectly position text? Using the one in the font struct as shown in the docs does work, but it often slides down a bit compared to what I am expecting, I had a similar issue with the X11 core fonts system, I fixed it by using the ascent field in the XCharStruct returned by XTextExtents rather than using the font ascent.
I would appreciate any help!