ttfunk icon indicating copy to clipboard operation
ttfunk copied to clipboard

Documentation is very sparse

Open michaeleisel opened this issue 11 years ago • 1 comments

It would be extremely helpful to get documentation to answer basic questions, such as, what units are the ascent and descent in?

michaeleisel avatar Mar 11 '14 03:03 michaeleisel

TTFunk is both poorly documented and poorly tested, because we still pretty much treat it as an internal dependency of Prawn.

If you're using TTFunk indirectly through Prawn, and you call something like font.ascender or font.descender, you're going to get back a number that is in standard PDF points as units (i.e. 1/72 inch). But if you are talking about using TTFunk directly, it's important to understand that font metrics are not specified in absolute values, but instead are defined in relationship to an "em square", with the "units per em" defining the level of granularity. So until you apply the scale factor to some actual unit of measure, there aren't really any "units" to a font's points. Also, units-per-em are left up to the font designer, so they can be different for every font.

Extra documentation for TTFunk is absolutely welcome, but it's a low priority for us in Prawn at the moment, simply because we have many other problems to solve. That said, if you can read up on TTF a bit more and contribute documentation back to the project, that would help a lot.

You may want to start w. this document, hope it helps! https://developer.apple.com/fonts/TrueType-Reference-Manual/

practicingruby avatar Mar 11 '14 05:03 practicingruby