GNU TeXmacsUser manualReferenceAboutEnglishยทDeutsch
Specifying the current font

In this section, we describe the environment variables which control the rendering of fonts. Font properties may be controlled globally for the whole document in Document\(\rightarrow\)Font and locally for document fragments in Format\(\rightarrow\)Font.

From an abstract point of view, a font is defined to be a graphically consistent way of rendering strings. Fonts are usually made up from glyphs like “x”, “ffi”, “\(\alpha\)”, “\(\sum\)”, etc. When rendering a string, the string is decomposed into glyphs so as to take into account ligatures (like fi, fl, ff, ffi, ffl). Next, the individual glyphs are positioned while taking into account kerning information (in “xo” the “o” character is slightly shifted to the left so as to take profit out of the hole in the “x”). In the case of mathematical fonts, TeXmacs also provides a coherent rendering for resizable characters, like the large brackets in

\(\displaystyle \left( (()^{^{\ensuremath{\mathord{}}}})^{^{^{\ensuremath{\mathord{}}}}} \right) .\)

Similarly, a font family is a family of fonts with different characteristics (like font weight, slant, etc.), but with a globally consistent rendering. One also says that the fonts in a font family “mix well together”. For instance, the standard computer modern roman font and its bold and italic variants mix well together, but the computer modern roman font and the Avant Garde font do not.

Remark 1. In versions of TeXmacs prior to 1.99.1, the fonts for the mathematical and programming modes could be controlled independently using the environment variables math-font, math-font-family, math-font-series, math-font-shape, prog-font, prog-font-family, prog-font-series, prog-font-shape. In more recent versions of TeXmacs, the environment variables font, font-family, font-series and font-shape directly control the font for all modes. The mode specific variables still exist, but only play a secondary role: in mathematical mode, the math-font is only used when font is set to roman (the default), the values ms and mt of math-font-family select sans serif and typewriter variants of the text font, and the value right of math-font-shape selects upright mathematics (see smart_font in

Graphics/Fonts/smart_font.cpp

).

font\(:=\)roman
(font name)

These variables control the main name of the font, also called the font family. For instance:

Computer modern roman, Linux Libertine, Chancery, Palatino

Similarly, TeXmacs supports various mathematical fonts:

Roman: \(a^2 + b^2 = c^2\)

Adobe: \(a^2 + b^2 = c^2\)

New roman: \(a^2 + b^2 = c^2\)

Concrete: \(a^2 + b^2 = c^2\)

Most fonts only implement a subset of all Unicode glyphs. Sometimes, the user might wish to combine several fonts to cover a larger subset. For instance, when specifying roman,IPAMincho or cjk=IPAMincho,roman as the font name, ordinary text and mathematics will be typeset using the default roman font, whereas Chinese text will use the IPAMincho font. Similarly, when specifying math=Stix,roman as the font name, ordinary text will be typeset using the default roman font, but mathematical formulas using the Stix font.

font-family\(:=\)rm
(font variant)

This variable selects a variant of the major font, like a sans serif font, a typewriter font, and so on. As explained above, variants of a given font are designed to mix well together. Physically speaking, many fonts do not come with all possible variants (sans serif, typewriter, etc.), in which case TeXmacs tries to fall back on a suitable alternative font.

Typical variants for text fonts are rm (roman), tt (typewriter) and ss (sans serif):

roman, typewriter and sans serif

Sans serif formula: \(\sin (x + y) = \sin x \cos y + \cos x \sin y\)

font-series\(:=\)medium
(font weight)

The font series determines the weight of the font. Most fonts only provide medium and bold font weights. Some fonts also provide light as a possible value.

medium, bold

font-shape\(:=\)right
(font shape)

The font shape determines other characters of a font, like its slant, whether we use small capitals, whether it is condensed, and so on. For instance,

upright, slanted, italic, left slanted, Small Capitals, proportional typewriter, bold condensed, flat sans serif, long

font-base-size\(:=\)10
(font base size)

The base font size is specified in pt units and is usually invariant throughout the document. Usually, the base font size is 9pt, 10pt, 11pt or 12pt. Other font sizes are usually obtained by changing the magnification or the relative font-size.

9pt, 10pt, 11pt, 12pt

font-size\(:=\)1
(font size)

The real font size is obtained by multiplying the font-base-size by the font-size multiplier. The following standard font sizes are available from Format\(\rightarrow\)Size:

size multiplier size multiplier
Tiny 0.59 Very small 0.71
Small 0.84 Normal 1
Large 1.19 Very large 1.41
Huge 1.68 Really huge 2

Table 1. Standard font sizes.

From a mathematical point of view, the multipliers are in a geometric progression with factor \(\sqrt[4]{2}\). Notice that the font size is also affected by the index level.

font-effects\(:=\)
(additional font effects)

A comma separated list of artificial effects which are applied to the current font, each of the form effect=value. Supported effects include bold, bbb (blackboard bold), slant, hmagnify, vmagnify, hextended, mono, degraded, distorted, gnawed, blurred and enhanced (see apply_effects in

Graphics/Fonts/smart_font.cpp

). For instance, bold=2,slant=0.25 produces a poor man's bold slanted variant of the current font.

dpi\(:=\)600
(fonts rendering quality)

The rendering quality of raster fonts (also called Type 3 fonts), such as the fonts generated by the Metafont program is controlled through its discretization precision in dots per inch. Nowadays, most laser printers offer a printing quality of at least 600dpi, which is also the default dpi setting for TeXmacs. For really high quality printing, professionals usually use a precision of 1200dpi. The dpi is usually set once and for all for the whole document.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".