-
Notifications
You must be signed in to change notification settings - Fork 0
Understanding TTX TTF Format
Jped edited this page Jan 20, 2019
·
2 revisions
TTF = True Type Font
TTX = True Type XML
In this wiki we will go over the basics of how TrueType saves a glyph.
In the TTX file each glyph is contained within a <ttGlpyh> tag. This tag has several <contour> definitions.
"Each contour delimits an outer or inner region of the glyph, and can be made of either line segments and/or second-order beziers (also called "conic beziers" or "quadratics")." In other words it defines a specific region of the font.
Within each contour we have successive <pt> tags which define points. They include the x,y location and whether the point is on the curve or off the curve.
Now, there are some important rules on how to understand these points.
- If two successive points are "on" this means that they form a line
- If three points are "on" "off" "on" then this defines a quadratic bezier curve.
- If there are several "off" points with no "on" point in between them, there is a virtual "on" point in the middle of the two "off" points. This is a form of compression.
- If the first point in a contour is an "off" point go to the last point and start from there 4b.If the last point is also "off" start with a virtual "on" in between the first and the last one.
(Happy baking!) 🍞🍞🍞