class Font
All TeX fonts are represented to Lua code as tables, and internally as
C code structures. All keys in the table below are saved in the internal font
structure if they are present in the table returned by the define_font
callback, or if they result from the normal tfm/vf reading routines if there
is no define_font
callback defined.
😱 Types incomplete or incorrect? 🙏 Please contribute!
fields
Font.name
metric (file) name
Font.area
(directory) location, typically empty
Font.used
Indicates usage (initial: false). The key used
is set by the engine when a font is actively in use. This makes sure that the font's definition is written to the output file (DVI or PDF). The tfm reader sets it to false.
Font.characters
the defined glyphs of this font
Font.checksum
default: 0
Font.designsize
expected size (default: 655360 == 10pt)
Font.direction
default: 0
Font.encodingbytes
default: depends on format
Font.encodingname
encoding name
Font.fonts
locally used fonts
Font.psname
This is the PostScript fontname in the incoming font source, and it's used as fontname identifier in the PDF output. This has to be a valid string, e.g.\ no spaces and such, as the backend will not do a cleanup. This gives complete control to the loader.
Font.fullname
output font name, used as a fallback in the PDF output if the psname
is not set
Font.subfont
default: 0, index in (ttc
) font with multiple fonts. The subfont
parameter can be used to specify the subfont in a ttc
font. When given, it is used instead of the psname
and fullname
combination. The first subfont has number 1. A zero value signals using the names as lookup.
Font.header
header comments, if any
Font.hyphenchar
default: TeX's hyphenchar
Font.parameters
default: 7 parameters, all zero
Font.size
the required scaling (by default the same as designsize)
Font.skewchar
default: TeX's skewchar
Font.type
basic type of this font
Font.format
disk format type
Font.embedding
PDF inclusion
Font.filename
the name of the font on disk
Font.tounicode
When this is set to 1 LuaTeX assumes per-glyph tounicode entries are present in the font.
Font.stretch
the “stretch” value from expandglyphsinfont
Font.shrink
the “shrink” value from expandglyphsinfont
Font.step
the “step” value from expandglyphsinfont
Font.expansion_factor
the actual expansion factor of an expanded font
Font.attributes
the pdffontattr
. The key attributes
can be used to set font attributes in the PDF file.
Font.cache
This key controls caching of the Lua table on the TeX end where yes
means: use a reference to the table that is passed to LuaTeX (this is the default), and no
means: don't store the table reference, don't cache any Lua data for this font while renew
means: don't store the table reference, but save a reference to the table that is created at the first access to one of its fields in the font.
Font.nomath
This key allows a minor speedup for text fonts. If it is present and true, then LuaTeX will not check the character entries for math-specific keys.
Font.oldmath
This key flags a font as representing an old school TeX math font and disables the OpenType code path.
Font.slant
This parameter will tilt the font and does the same as SlantFont
in the map file for Type1 fonts.
Font.extend
This parameter will scale the font horizontally and does the same as ExtendFont
in the map file for Type1 fonts.
Font.squeeze
This parameter will scale the font vertically and has no equivalent in the map file.
Font.width
The backend will inject PDF operators that set the penwidth. The value is (as usual in TeX) divided by 1000. It works with the mode
file.
Font.mode
The backend will inject PDF operators that relate to the drawing mode with 0 being a fill, 1 being an outline, 2 both draw and fill and 3 no painting at all.