Font Hinting Preservation in Conversion
Understand how TrueType and CFF hinting instructions survive format conversion, what gets lost, and how to preserve rendering quality at small sizes.
Key Takeaways
- • TrueType and CFF use fundamentally different hinting approaches
- • Converting TTF to OTF/CFF loses TrueType hinting instructions
- • WOFF/WOFF2 preserve all hinting from the source format
- • Modern high-DPI displays reduce the importance of hinting
In this article
Font hinting is the process of adjusting glyph outlines to render optimally on pixel grids, particularly important at small sizes on low-resolution screens. Without hinting, characters can appear blurry, stems may render at inconsistent widths, and text becomes harder to read. Understanding hinting preservation is critical when converting fonts for web use.
TrueType and CFF (Compact Font Format/PostScript) use completely different hinting mechanisms. This incompatibility means converting between these outline formats inevitably affects hinting quality. This guide explains both systems, what survives conversion, and strategies for maintaining rendering quality.
What Is Font Hinting?
Font hinting consists of instructions embedded in font files that control how glyph outlines map to the pixel grid. At large sizes, outlines render smoothly regardless of hinting. At small sizes (typically below 24px), hinting determines whether text is crisp or blurry.
What Hinting Controls
Hinting instructions manipulate outline points to align with the pixel grid before rasterization. The key properties they control are:
- Stem width consistency: Ensures vertical strokes render at uniform pixel widths—without hinting, some stems might render 1px wide and others 2px at the same font size, causing uneven text color.
- Alignment zones: Snaps baselines, x-heights, and cap heights to pixel boundaries so characters from different glyphs align precisely.
- Diagonal control: Manages anti-aliasing on diagonal strokes (letters like A, V, W) to prevent jagged or uneven appearance at small sizes.
- Symmetry preservation: Maintains visual balance in symmetric characters (m, n, H) that could render with unequal side weights at low resolutions.
The physics of pixel rendering explains why hinting matters most in a specific size range. At 12px, a capital letter occupies roughly 8–9 pixels in height. The mathematical outline of a glyph might place a stroke edge at pixel position 3.7, which the rasterizer must round to either 3 or 4 pixels. Without hinting instructions, this rounding is determined by the floating-point arithmetic of the scan conversion, producing inconsistent results across similar glyphs. With stem-alignment hinting, instructions explicitly snap the stroke edges to integer pixel boundaries, ensuring all stems of similar weight render at the same pixel width throughout the font. At 48px, the same stroke spans many pixels and sub-pixel rounding errors become proportionally negligible—hence hinting matters most below 24px and is largely irrelevant above 36px.
Platform rendering engines handle hinting differently, which affects how much the embedded instructions matter. Windows GDI (the legacy rendering pipeline) applied full hinting and grid-fitting, making fonts look sharp but occasionally geometrically distorted at mid-sizes as the hinting overrode the mathematical design. DirectWrite (Windows Vista and later) introduced ClearType sub-pixel rendering with lighter hinting, using the horizontal sub-pixel layout of LCD displays for additional effective horizontal resolution. macOS historically ignored embedded TrueType hinting entirely, relying on its own rendering engine to produce smooth anti-aliased text through aggressive curve smoothing. This means a font meticulously hinted for Windows may actually look better without those hints on macOS, and developers should test rendering on both platforms rather than assuming hinting quality transfers equally.
TrueType Hinting
TrueType hinting uses a procedural bytecode instruction set that explicitly manipulates glyph outline points. This approach offers precise control but requires significant expertise to implement well.
Required Tables for TrueType Hinting: cvt (Control Value Table) ├── Stores common values (stem widths, alignment heights) ├── Referenced by glyph instructions └── Enables global consistency across glyphs fpgm (Font Program) ├── Contains functions used by all glyphs ├── Runs once when font is loaded └── Defines reusable hinting subroutines prep (Control Value Program) ├── Runs before each glyph is rendered ├── Adjusts cvt values based on size/resolution └── Handles size-specific optimizations glyf (Glyph Data) └── Contains per-glyph hinting instructions
TrueType Hinting Complexity
Professional TrueType hinting requires tools like Microsoft's Visual TrueType (VTT) and significant manual effort. Each glyph may have dozens of instructions. Major fonts like Arial, Verdana, and Georgia have thousands of lines of hinting code per glyph family.
The TrueType bytecode instruction set is a stack-based programming language executed by the font rasterizer at render time. Instructions operate on points in the current glyph's outline and can reference values in the cvt (Control Value Table) to enforce consistency across all glyphs. A typical hinting sequence for a vertical stem might push the stem width onto the stack, call a function from fpgm that rounds it to the nearest pixel boundary, store the rounded value, move the left edge of the stem to the baseline plus this offset, and move the right edge so the total stem width matches the rounded value. This explicit procedural control allows precise rendering but requires specialized expertise to implement correctly and maintain when outlines change during font revisions.
The prep (Control Value Program) table runs once per size change before any glyph in that rendering context is hinted. Prep code typically adjusts cvt values based on the current pixels-per-em value and device characteristics—specifying tighter rounding thresholds for very small sizes where every pixel counts and looser thresholds for larger sizes where the mathematical outline already renders cleanly. This per-size adaptation makes well-hinted TrueType fonts responsive to their rendering environment in ways that CFF hinting cannot match. The cost is that prep code must be carefully tested across the full range of rendering sizes to ensure the size-conditional logic produces correct results at every point in the transition.
CFF/PostScript Hinting
CFF (Compact Font Format) uses declarative hints that describe font characteristics rather than explicit instructions. The rasterizer interprets these hints at render time, making them simpler to create but less precise than TrueType.
CFF Hint Types
Stem Hints
Declare the position and width of vertical and horizontal stems. The rasterizer uses this information to maintain consistent stem rendering.
hstem, vstem, hstemhm, vstemhmBlueValues (Alignment Zones)
Define vertical alignment zones for baseline, x-height, cap height, ascender, and descender. Edges snapping to these zones align to pixel boundaries.
BlueValues, OtherBlues, FamilyBluesHint Masks
Allow different hints to apply to different parts of a glyph, handling complex shapes where hints would otherwise conflict.
hintmask, cntrmaskHinting in Format Conversion
| Conversion | Hinting Result | Notes |
|---|---|---|
| TTF → WOFF | Preserved | All TrueType tables retained |
| TTF → WOFF2 | Preserved | All TrueType tables retained |
| OTF → WOFF | Preserved | CFF hints retained in CFF table |
| OTF → WOFF2 | Preserved | CFF hints retained in CFF table |
| TTF → OTF (CFF) | Lost | TrueType hints cannot convert to CFF |
| OTF → TTF | Lost* | CFF hints don't convert; needs auto-hinting |
Key Insight
WOFF and WOFF2 are compression wrappers that don't modify the underlying font data. All hinting from your source TTF or OTF is preserved. The risk comes from converting between TrueType and CFF outline formats, not from web font compression.
Hinting in the Modern Era
The importance of hinting has diminished significantly with the rise of high-DPI displays (Retina, 4K, etc.). On screens with 200+ PPI, the pixel grid is fine enough that unhinted fonts render well. However, hinting remains relevant for:
Still Important For
- • Standard-resolution monitors (96-120 PPI)
- • Small text sizes (under 14px)
- • UI fonts in applications
- • Users with older hardware
Less Critical For
- • High-DPI displays (200+ PPI)
- • Large display text (24px+)
- • Print output
- • Mobile devices (mostly high-DPI)
Operating systems also increasingly use their own auto-hinting (macOS ignores embedded hints; Windows uses DirectWrite auto-hinting as fallback). This means embedded hinting has less impact than it once did, but the best fonts still include quality hinting for maximum compatibility.
Convert Fonts with Confidence
Our converter preserves hinting data when converting to web font formats.
Try Font ConverterWritten by
Sarah Mitchell
Product Designer, Font Specialist
Verified by
Marcus Rodriguez
Lead Developer
Font Hinting FAQs
Common questions about hinting preservation during font conversion
