Skip to main content

ctfont-pack

ctfont-pack combines one or more TrueType fonts into a single .ctfont file. The first font is the main face; the others are fallbacks, used for characters the main face does not have, such as symbols or other scripts.

Common commands​

ctfont-pack data/fonts/ui.ctfont Inter-Regular.ttf NotoSansSymbols-Regular.ttf

The general form is:

ctfont-pack OUTPUT.ctfont FACE.ttf [FALLBACK.ttf ...]

Fallbacks are searched in the order you list them. An existing output file is overwritten. Register the result as a font package in your asset registry.

Limits​

  • Up to 64 fonts per package, and at most 4 GiB in total.
  • Each font must be a static (not variable) TrueType .ttf font that the engine can load. OpenType CFF (.otf) fonts are not accepted.

ctgame does not run this tool; run it yourself when your fonts change and keep the .ctfont in your project.

Getting it​

ctfont-pack comes with an engine build configured with CTURTLE_BUILD_FONT_TOOLS=ON.

Errors​

MessageWhat to do
ctfont-pack: cannot read 'PATH'The font file is missing or empty.
ctfont-pack: 'PATH' is not normalized static TrueType (N)The engine cannot load this font. Use a static TrueType version of it, or convert it with a font tool.
ctfont-pack: could not write 'PATH'The output folder does not exist or is not writable.