summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-virtualfonts.html
blob: 2cdef3b90d1ea0fc7c8ecf3f304165a245764bc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<head>
<title>UK TeX FAQ -- question label virtualfonts</title>
</head><body>
<h3>Virtual fonts</h3>
<p/>Virtual fonts provide a means of collecting bits and pieces together
to make the glyphs of a font: the bits and pieces may be other glyphs,
rules and other &ldquo;basic&rdquo; typesetting commands, and the positioning
information that specifies how everything comes together.
<p/>Things that match the concept of virtual fonts for TeX were first
implemented by David Fuchs in the very early days.  However, for practical
purposes for the rest of us, virtual fonts date from when Knuth
specified a format and wrote some support software, in 1989 (he
published an article in <i>TUGboat</i> at the time, and a plain text
copy is available on CTAN).
<p/>Virtual fonts provide a way of telling TeX about something more
complicated than just a one-to-one character mapping. The entities you
define in a virtual font look like characters to TeX (they appear
with their sizes in a TFM file), but the DVI processor may
expand them to something quite different.
<p/>From the virtual font file, the DVI processor learns
details of what is in the virtual font, so as to know &ldquo;what to draw,
where&rdquo;.   The virtual font may contain commands:
<ul>
<li> just to remap the glyphs of a single font,
<li> to make a composite font with glyphs drawn from several
  different fonts, or
<li> to build up an effect in arbitrarily complicated ways (since a
  virtual font may contain anything which is legal in a DVI
  file).
</ul>
<p/>

In practice, the most common use of virtual fonts is to remap
Adobe Type 1 fonts (see <a href="FAQ-metrics.html">font metrics</a>),
though there has also been useful useful work building &lsquo;fake&rsquo; maths
fonts (by bundling glyphs from several fonts into a single virtual
font).  Virtual Computer Modern fonts, making a 
<a href="FAQ-ECfonts.html">Cork encoded</a> font from Knuth&rsquo;s originals by using
remapping and fragments of DVI for single-glyph &lsquo;accented
characters&rsquo;, were the first &ldquo;Type 1 format&rdquo; Cork-encoded Computer
Modern fonts available.
<p/>Virtual fonts are normally created in a single ASCII
VPL (Virtual Property List) file, which includes both sets of
information. The <i>vptovf</i> program is then used to the create
the binary TFM and VF files.
<p/>A &ldquo;how-to&rdquo; document, explaining how to generate a VPL,
describes the endless hours of fun that may be had, doing the job by
hand.  Despite the pleasures to be had of the manual method, the
commonest way (nowadays) of generating VPL files is to use the
<i>fontinst</i> package, which is described in detail
together with the discussion of
<a href="FAQ-metrics.html">PostScript font metrics</a>.
<i>Qdtexvpl</i> is another utility for creating ad-hoc virtual
fonts (it uses TeX to parse a description of the virtual font, and
<i>qdtexvpl</i> itself processes the resulting DVI file).
<dl>
<dt><tt><i>fontinst</i></tt><dd><a href="http://www.tex.ac.uk/www.tex.ac.uk  tex-archive/fonts/utilities/fontinst.zip">fonts/utilities/fontinst</a> (or <a href="http://www.tex.ac.uk/www.tex.ac.uk  tex-archive/fonts/utilities/fontinst/">browse the directory</a>)
<dt><tt><i>Knuth on virtual fonts</i></tt><dd><a href="http://www.tex.ac.uk/www.tex.ac.uk  tex-archiveinfo/knuth/virtual-fonts">info/knuth/virtual-fonts</a>
<dt><tt><i>Virtual fonts &ldquo;how to&rdquo;</i></tt><dd><a href="http://www.tex.ac.uk/www.tex.ac.uk  tex-archiveinfo/virtualfontshowto/virtualfontshowto.txt">info/virtualfontshowto/virtualfontshowto.txt</a>
<dt><tt><i>qdtexvpl</i></tt><dd><a href="http://www.tex.ac.uk/www.tex.ac.uk  tex-archive/fonts/utilities/qdtexvpl.zip">fonts/utilities/qdtexvpl</a> (or <a href="http://www.tex.ac.uk/www.tex.ac.uk  tex-archive/fonts/utilities/qdtexvpl/">browse the directory</a>)
</dl>
<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=virtualfonts">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=virtualfonts</a>
</body>