Specifying the current font

In this section, we describe the environment variables which control the rendering of fonts. Several parameters may be defined independently for each mode (the font name, variant, series and shape), whereas other parameters are uniform for all modes. Font properties may be controlled globally for the whole document in DocumentFont and locally for document fragments in FormatFont.

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”, “α”, “∑”, 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

((())).

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. For the future, it is planned to replace the font variant and font shape variables by a larger range of properties to individually control the slant, serifs, small-caps, and so on. It is also planned to systematically use Unicode fonts with possible additional glyphs for mathematics. This should automatically enable the use of Cyrillic characters inside Russian text and similarly for other languages.

fontroman

math-fontroman

prog-fontroman
(font name)

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

Computer modern roman, Pandora, Chancery, Palatino

Similarly, TeXmacs supports various mathematical fonts:

Roman: a2 + b2 = c2

Adobe: a2 + b2 = c2

New roman: a2 + b2 = c2

Concrete: a2 + b2 = c2

font-familyrm

math-font-familymr

prog-font-familytt
(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

In maths mode, a distinction is made between the mathematical variants mr (roman), mt (typewriter) and ms (sans serif) and textual variants rm (roman), bf (bold), etc. In the first case, variables and operators are usually rendered in a different slant, contrary to the second case:

ms: sin (x + y) = sin x cos y + cos x sin y

ss: sin (x + y) = sin x cos y + cos x sin y

font-seriesmedium

math-font-seriesmedium

prog-font-seriesmedium
(font weight)

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

medium, bold

font-shaperight

math-font-shapenormal

prog-font-shaperight
(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-size10
(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-size1
(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 FormatSize:

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 sqrt4 (2). Notice that the font size is also affected by the index level.

dpi600
(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".