Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation is very sparse #12

Closed
michaeleisel opened this issue Mar 11, 2014 · 1 comment
Closed

Documentation is very sparse #12

michaeleisel opened this issue Mar 11, 2014 · 1 comment

Comments

@michaeleisel
Copy link

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

@practicingruby
Copy link
Member

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants