Font rendering
libSceFont rasterizes title-supplied TrueType and OpenType faces with FreeType. System-font requests use the bundled Noto Sans substitute for Latin, Greek and Cyrillic.
Repository notes through October 10, 2026
Faces, scale and lifetime
A title opens a font library, creates a face from bytes it supplies or from a system-font request, and then asks for glyph metrics and coverage. Each face keeps its own scale, render scale, slant and lifetime. Closing the library releases its faces, and process teardown clears the font state. The font bytes are copied on open, so a later unmap of the title's source buffer cannot invalidate the rasterizer.
Noto Sans is a substitute, not a byte-identical copy of every firmware font. It covers Latin, Greek and Cyrillic. A face the title supplies can contain other glyphs, including CJK, and those outlines are used. The system-font request itself does not substitute a CJK face.
Glyphs, kerning and atlases
The glyph path returns real metrics, horizontal layout, basic pair kerning, antialiased coverage, clipping and render-result descriptors. A bounded glyph cache avoids rasterizing the same character again, and a separate pair cache reuses kerning across sizes. Writes check CPU permissions and invalidate GPU page watches before they touch a texture atlas.
A valid Unicode scalar that the face does not contain uses the face's .notdef outline, including control codes encountered while a title builds a complete atlas range. That missing-glyph path is what lets Jurassic Park Classic Games Collection finish building its font atlas. Invalid Unicode scalars and out-of-range explicit glyph identifiers still return an error. Coverage is written to pixels of one to four bytes.
What text layout is left to the title
Many titles never call libSceFont. They draw text with their own engine font, and this implementation does not change those pixels. The HLE path is for titles that ask the firmware to rasterize.
Text shaping, bidirectional layout, synthetic weight, CJK system-font substitution, collection-face selection and the higher-level FontWriting and String APIs are not implemented. Focused checks live behind zig build test-hle with the font filter.
What is implemented
- FreeType rasterization of title-supplied TrueType and OpenType faces.
- Noto Sans fallback for system-font requests in Latin, Greek and Cyrillic.
- Metrics, horizontal layout, pair kerning, slant, clipping and a glyph cache.
- .notdef fallback for missing Unicode scalars, which unblocks Jurassic Park's atlas.
What is still missing
- Shaping, bidirectional layout and the FontWriting APIs are absent.
- System-font requests do not substitute a CJK face.
- Titles that draw text entirely in their own engine do not use this path.
Related mechanisms
What these pages are