Skip to main content

Module coverage

Module coverage 

Source
Expand description

Per-font glyph coverage — the answer \iffontchar gives.

eTeX’s \iffontchar <font><charcode> (etex_man §3.7) is true iff the font’s metric file has a character in that slot: for a TFM the char_info word’s width index is non-zero (tftopl.web §“char_info”), for an OpenType/TrueType font (LuaTeX/XeTeX) the cmap maps the code point to a non-zero glyph. Perl LaTeXML leaves \iffontchar undefined (eTeX.pool.ltxml:335) and our former stub answered TRUE for every code point, which made unicodefonttable’s \displayfonttable emit one cell per code point of the requested range (262k cells for the samples doc: Fatal:Timeout:MemoryBudget at 4.8 GB) instead of one per glyph the font actually covers (~6,500 across its five tables). Real coverage is the only faithful bound — a constant FALSE would skip every row.

Font files are read from the host TeX Live tree (the ecosystem is in scope; owned resources are embedded). Coverage is parsed once per file and cached for the thread.

Structs§

GlyphCoverage
The set of code points (TFM: character codes) a font file covers.

Functions§

coverage_for_file
Coverage of the font file at path (.tfm, .otf, .ttf, .ttc); None when the file is missing or unparseable. Cached per path. A confined conversion reads only a file its roots admit (\lx@fontspec@usefile takes any name): a refused one is a test’s Warning and has no coverage (OXIDIZED_DESIGN_DIVERGENCES #1183).
font_file_path
Full path of a font file given its basename (any case), from ls-R.
resolve_fontspec_file
Resolve a fontspec font specification (family name or file name, optionally bracketed as [file.otf]) to a font file on disk.