Replies: 1 comment
-
The outline orientation is a lawless wasteland and some fonts don't have consistent behavior with all of the glyphs they contain, so you can make no assumptions about the font as a whole. Fontdue makes an educated guess on a glyph by glyph basis based on an aggregation of the area of the line segements. See below https://github.com/mooman219/fontdue/blob/master/src/math.rs#L434 I can probably store it on the Glyph, but that's an extreme implementation detail. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello there,
I'm implementing my font render. Instead of building a rasterizer, I want to convert text into geometries so that they can be freely resized in a gaming environment for example.
To do that, I need to know the positive orientation of the outlines (clock-wise or counter-clock-wise). I don't know how to get this information reliably from a font file, and I have seen inconsistent orientation used, for example in some otf files, counter-clock means positive, whereas a hole use clock-wise. In some ttf files, this is the opposite.
Secondly, I don't know how to match outlines with their corresponding holes. This is needed for the triangulation step. But in the font files, it seems there is no grouping of an outline with its holes?
Thank you for your insights.
Beta Was this translation helpful? Give feedback.
All reactions