Skip to main content

Module font

Module font 

Source

Modules§

coverage
Per-font glyph coverage — the answer \iffontchar gives.
standard_metrics
tfm
TeX font metric files: the character dimensions of a .tfm, scaled as TeX scales them.

Structs§

Font
A data structure containing Font information, but also related textual properties (such as color)

Enums§

LettersClass
The math class of a glyph \DeclareMathSymbol’d from the math italic symbol font (letters), which decides the shape a capital Greek letter takes (Font::specialize_letters).

Constants§

FLAG_EMPH
FLAG_FORCE_FAMILY
FLAG_FORCE_SERIES
FLAG_FORCE_SHAPE
FONT_MEM_SIZE
The most parameters a font’s array may grow to: TeX’s font memory, font_mem_size in TeX Live’s texmf.cnf, whose overflow stops TeX (tex.web §580, “TeX capacity exceeded, sorry [font memory=8000000]”).
MATH_FONTS
TEXT_FONTS

Statics§

FONT_TEXT_DEFAULT

Functions§

decode
decode_char_code
The glyph \char and a text \chardef print for character code code (Perl FontDecode, Package.pm:2871-2891): up to 255 the current font’s slot; above it the code point itself, as XeTeX and LuaTeX print it. The pdfTeX persona keeps it too, with a Warning naming cs where pdfTeX reports “Bad character code” and prints slot 0 (tex.web:8629-8635 scan_char_num; ruling D-42, OXIDIZED_DESIGN_DIVERGENCES #1191). A negative code, a surrogate or one past U+10FFFF prints nothing. cs: None decodes without a Warning.
decode_fontname
decode_in_font
Decode a codepoint in encoding as font draws it: through the font family’s own map, when one is declared (decoding_map). Perl FontDecode($n, $encoding, $font), as decodeMathChar calls it (Package.pm:2990): the math character’s encoding is the font info’s, its family the font’s — \mathbb{R} under bbold is U in the blackboard family, decoded through U_blackboard (bbold_sty.rs).
decode_str
Decode a codepoint, returning a SymStr that may contain multiple characters. This handles Perl font map entries like UTF(0xA0)."\x{0335}" (OT1 pos 32).
decode_string
defsize
Perl: sub DEFSIZE() { return $STATE->lookupValue(‘NOMINAL_FONT_SIZE’) || 10; } Reads NOMINAL_FONT_SIZE from state, defaulting to 10.0. Perl uses the value directly as a float (Common/Font.pm:44) — the 11pt class option is 10.95 (LaTeX’s \@xipt), so this must NOT truncate via lookup_int (#542).
font_match_xpaths
Generate XPath fragments for font matching. Perl: font_match_xpaths
font_parameters_for_name
The TFM parameters \font gives a font of this name, per point of its size — Perl’s getMetricForName (Common/Font.pm:551-562): the name’s own metric, else its family at 10pt, else Computer Modern Roman at the name’s size, else cmr10; the size is the name’s trailing digits (10 without). This port’s size-less and hand-merged entries (cmr, cmbx, cmex, …) carry no parameters and are passed over, as Perl has none of them. Perl’s Error on the cmr10 fallback is not ported: it fires for valid fonts (ecrm1000).
format_points
A font size in points as LaTeX writes \f@size: 12, 14.4, 10.95 (\strip@pt, latex.ltx:12587).
get_metric_for_name
Find a Font Metric for a given fontname, fallback to 10pt or cmr as needed. Perl: getMetricForName
is_combining_mark
Check if a character is a Unicode combining mark (category Mn).
is_unicode_encoding
Whether encoding’s slots are Unicode code points: TU, the encoding of the Unicode engines (tuenc.def; fonttext.ltx:57-68,93). A slot past the 8-bit table is then the character itself, and the Latin Modern text fonts of that format carry the TeX ligatures (tuenc.def:60 +tlig;).
lookup_font_family
Global auxiliary for font family lookup
lookup_font_series
Global auxiliary for font series lookup
lookup_font_shape
Global auxiliary for font shape lookup
lookup_tex_font
Combine family/series/shape lookups into a single Font (Perl lookupTeXFont)
match_font
Matches fonts when both are converted to toString strings. Uses regex caching for repeated lookups. Perl: match_font
nfss_family_code
The NFSS family code that selects an abstract font family: the inverse of lookup_font_family, giving the code LaTeX’s own defaults would put in \f@family (\rmdefault cmr, \sfdefault cmss, \ttdefault cmtt, all locked in sect13.rs; yfonts’ \gothdefault/\swabdefault) or the one code the table maps to a symbol or display family. None for a family no NFSS code selects — nullfont, graphic, math, and the binding-only oldstyle, caligraphic, italic, smallcaps families: switching to it leaves \f@family alone, as a raw TeX font switch does.
nfss_series_code
The NFSS series code of an abstract series (\mddefault m, \bfdefault bx), inverse of lookup_font_series.
nfss_shape_code
The NFSS shape code of an abstract shape (\updefault n, \itdefault it, \sldefault sl, \scdefault sc), inverse of lookup_font_shape. normal is the upright shape plain’s \em switches back to (plain_base.pool.ltxml:607).
rationalize_font_size
Convert stanard font size names, such as tiny, Huge, etc to f64
relative_font_size
convert size to percent
tex_font_file_name
The TeX font file of a text font, as \font names one: cmtt10, cmbx9, and cmr10 loaded at 10.95pt (Some second part) for a size with no file of its own — the Computer Modern font of the family, series and shape (None for a combination with none). LaTeX’s OT1 .fd files pick the nearest design size (ot1cmr.fd); this keeps the size or falls back to 10.

Type Aliases§

Fontmap