Sam Howard Sam is a developer at IDRsolutions who specialises in font rendering and conversion. He's also enjoyed working with SVG, Java 3D, Java FX and Swing.

How does TrueType Hinting work?

1 min read

TrueType hinting use a program inside the TrueType file to modify the outlines for fonts. This allows it to do clever things like optimise for small font sizes.

TrueType hinting takes the points stored in a glyph’s outline and moves them around by running a program stored along with the points. Originally this was used for Grid Fitting – making text readable at small sizes – but it found a secondary use in that some fonts store a set of brushstrokes, then combine them to form a glyph. The hinting program is then used to change the brushstrokes to be the right shape and size.

All of this happens within a complex TrueType Virtual Machine, which has to know how to execute all 122 instructions and their many variations. Some of the documentation is a little vague, so often things don’t work quite right first time, and the only way to fix it is to jump right into the code and see what’s going on! That’s why we built a fully featured debugger – we can step through the glyph’s program seeing the whole state of the TrueType VM on a big screens.

Obviously when rendering our text normally the hinting for every character happens faster than you can blink, but we’ve recorded a video of our Debugger going through a single glyph and added some comments so you can see what goes on.



Are you a Developer working with PDF files?

Our developers guide contains a large number of technical posts to help you understand the PDF file Format.

Find out more about our software for Developers

Convert PDF to HTML5 or SVG Convert PDF to HTML5 or SVG
Convert AcroForms and XFA to HTML5Convert AcroForms and XFA to HTML5
Java PDF SDK for working with PDF files Java PDF SDK for working with PDF files
Sam Howard Sam is a developer at IDRsolutions who specialises in font rendering and conversion. He's also enjoyed working with SVG, Java 3D, Java FX and Swing.

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2022. All rights reserved.