![]() |
The font configuration files | ![]() |
TeXmacs keeps what it knows about fonts in a handful of files. They come in two copies: the ones shipped with the program, under $TEXMACS_PATH/fonts, and the ones of your own installation, under $TEXMACS_HOME_PATH/fonts, which is ~/.TeXmacs/fonts on Unix. For the database files the local copy is the one in use, and the shipped one is its starting point and its safety net;
font-substitutions.scm
is only read from the installation.
font-database.scm
Which file holds which face. Each entry names a family and a style and gives the file, the index inside it, and its size in bytes:
((Latin\ Modern\ Math Regular) ((latinmodern-math.otf 0 733736))) |
The size is what lets TeXmacs notice that a file has been replaced by another version of itself.
font-features.scm
Which master a family belongs to and which features it carries. The master is the name a document uses: the families Fira Sans and Fira Mono both belong to the master Fira, and the variant asked for by font-family picks one of them.
font-characteristics.scm
What a face looks like, measured on its glyphs: whether it is monospaced or sans serif, its slant, its x-height, the vertical and horizontal stroke widths, the fill rate, and so on. These numbers are what the font browser filters on and what the distance between a request and a face is computed from.
font-substitutions.scm
Which family to use when a style is missing, for the families where the obvious answer is wrong: the sans serif companion of FandolSong is FandolHei and not a slanted FandolSong.
The date and the size of the shipped files from which the local database was built, the installation they came from, and the number of entries of the local database. When the shipped files or the installation differ, or the local database has lost entries, TeXmacs merges the shipped entries into the local ones at the next start, so that a version which ships new fonts does not go unnoticed by an old home directory, and several installations can share one.
Rescanning is Tools\(\rightarrow\)Fonts\(\rightarrow\)Scan disk for fonts, and emptying the whole thing is Tools\(\rightarrow\)Fonts\(\rightarrow\)Clear font cache, after which the database is rebuilt from the shipped one. If you want to contribute the fonts of your system to TeXmacs, the developer routine (font-database-save-local-delta) writes the difference with respect to the shipped database into delta-database.scm and its companions.
The translation tables of the TeX fonts: a list of TeXmacs character names, with the position at which they start in the font. This is how position 0 of cmr becomes <Gamma> and position 26 becomes <ae>.
Virtual fonts: characters described as constructions over other characters. A virtual font is loaded exactly like an encoding table, and a copy in your home directory shadows the shipped one.
The tables which map a TeXmacs character name to a Unicode code point and back. They are what makes a symbol convertible, searchable and available to the fallback search, and they are read by the converters as well as by the font system.
The modules of $TEXMACS_PATH/progs/fonts translate a request into a physical font. A rule is a pattern and a replacement, matched against the tuple made of the family, the variant, the series, the shape, the size and the resolution:
(set-font-rules
'(((roman rm medium right $s $d) (ec ecrm $s $d))
((roman mr medium $a $s $d) (math-std ecrm cmr cmmi $s $d)))) |
The variables of the pattern, written with a dollar sign, are bound to whatever they match. The right-hand side may name a physical font, such as (truetype luximr 10 600), a TeX font, a virtual font, or a compound font which is made of several of them, which is how the traditional TeXmacs mathematics font is assembled from cmr, cmmi, cmsy and the rest.
Rules are ordinary Scheme, so your personal initialization file may add its own; they are tried in the order in which they were declared, and the first which matches is used, so a rule added later only applies to requests which no earlier rule matches.
The directories
fonts/truetype
,
fonts/type1
and
fonts/tfm
hold the fonts shipped with TeXmacs, and fonts/pk in your home directory holds the bitmaps generated from Metafont sources. Fonts installed on your system are found in the usual places of the operating system and in the TeX distribution, if there is one.