summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/substitutefont/substitutefont-doc.html
blob: 8df4b99b402375aa45eb6a5c8c81b978f88a0237 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>substitutefont</title>
<meta name="copyright" content="© 2010 Günter Milde &lt;milde&#64;users.sf.net&gt;" />
<link rel="stylesheet" href="../../../../Python/docutils-svn/docutils/docutils/writers/html4strict/html4css1.css" type="text/css" />
<link rel="stylesheet" href="../../../../Python/docutils-svn/docutils/docutils/writers/html4strict/html4css2.css" type="text/css" />
</head>
<body>
<div class="document" id="substitutefont">
<h1 class="title">substitutefont</h1>
<h2 class="subtitle" id="combine-font-families">Combine font families</h2>

<dl class="docinfo simple">
<dt class="copyright">Copyright</dt>
<dd class="copyright">© 2010 Günter Milde &lt;<a class="reference external" href="mailto:milde&#64;users.sf.net">milde&#64;users.sf.net</a>&gt;</dd>
<dt>Contributor</dt>
<dd><p>Special thanks to Ulrike Fischer who provided
the indirect definition with active <tt class="literal">\nfss&#64;catcodes</tt>.</p>
</dd>
<dt>Licence</dt>
<dd><p>This work may be distributed and/or modified under the
conditions of the <a class="reference external" href="http://www.latex-project.org/lppl.txt">LaTeX Project Public License</a>,
either version&nbsp;1.3 of this license or (at your option)
any later version.</p>
</dd>
</dl>
<p>In traditional 8-bit LaTeX, fonts are restricted to 256 glyphs per file.
To support different languages and scripts, the New Font Selection Scheme
uses a set of TeX font encodings <a class="citation-reference" href="#encguide" id="id1">[encguide]</a>.</p>
<p>Many Latin TeX fonts do not support Greek or Cyrillic, while many non-Latin
fonts are extensions of a Latin font family but use a different family name
due to license reasons or the creators preference.</p>
<p>The <cite>substitutefont</cite> package facilitates the task to set up a font family as
substitute for another one in a specified <a class="reference external" href="encguide">font encoding</a>.</p>
<dl class="field-list">
<dt>News</dt>
<dd><p>2013-11-04 Documentation/Test fixes.</p>
</dd>
<dt>Source</dt>
<dd><p><a class="reference external" href="substitutefont.sty">substitutefont.sty</a></p>
<p>The literate source was converted with <a class="reference external" href="http://pylit.berlios.de">PyLit</a> to <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> and
with <a class="reference external" href="http://docutils.sourceforge.net/rst.html">Docutils</a> to the HTML documentation <a class="reference external" href="substitutefont.sty.html">substitutefont.sty.html</a>.</p>
</dd>
</dl>
<div class="section" id="usage">
<h1>Usage</h1>
<p>The macro <tt class="literal"><span class="pre">\substitutefont{&lt;encoding&gt;}{&lt;family&gt;}{&lt;new-family&gt;}</span></tt> selects
the font family &lt;new-family&gt; as replacement for &lt;family&gt; in the font
encoding &lt;encoding&gt;. The substitution must be defined before the first use
of the specified font encoding, preferably in the document preamble.
In contrast to the (deprecated) <tt class="literal">\substitutefontfamily</tt> macro provided by
<a class="reference external" href="http://www.ctan.org/pkg/babel">Babel</a>, <tt class="literal">\substitutefont</tt> does not write auxiliary files.</p>
<p>The <tt class="literal">&lt;encoding&gt;</tt> is one of the LaTeX font encodings <a class="citation-reference" href="#encguide" id="id2">[encguide]</a>, e.g., T1
for Latin, T2A for Cyrillic(Russian), or LGR for Greek.</p>
<p>For <tt class="literal">&lt;family&gt;</tt> and <tt class="literal"><span class="pre">&lt;new-family&gt;</span></tt>, use the «TeX names» of the font.
There are defined by a TeX font package’s <tt class="literal">*.fd</tt> or <tt class="literal">*.sty</tt> file(s).
LaTeX stores the default family names for Roman, Sans-Serif, and Teletype
fonts in the <tt class="literal">\rmdefault</tt>, <tt class="literal">\sfdefault</tt>, and <tt class="literal">\ttdefault</tt> macros
respectively.</p>
<p>Example: Set the font family to Palatino using the standard package
<cite>mathpazo</cite> for Latin and <a class="reference external" href="http://www.ctan.org/pkg/gfsdidot">GFS Didot</a> for Greek:</p>
<pre class="literal-block">\usepackage[sc,slantedGreek]{mathpazo}
\usepackage{substitutefont}
\substitutefont{LGR}{\rmdefault}{udidot}
</pre>
<p>For details on LaTeX font selection, see <a class="citation-reference" href="#encguide" id="id3">[encguide]</a> and <a class="citation-reference" href="#fntguide" id="id4">[fntguide]</a>.</p>
</div>
<div class="section" id="tests-examples">
<h1>Tests/Examples</h1>
<ul class="simple">
<li><p>Simple test with Latin fonts:
<a class="reference external" href="substitutefont-test.tex">substitutefont-test.tex</a>, <a class="reference external" href="substitutefont-test.pdf">substitutefont-test.pdf</a></p></li>
<li><p>Palatino with Greek from <a class="reference external" href="http://www.ctan.org/pkg/gfsdidot">GFS Didot</a>:
<a class="reference external" href="greek-palatino-didot.tex">greek-palatino-didot.tex</a>, <a class="reference external" href="greek-palatino-didot.pdf">greek-palatino-didot.pdf</a></p></li>
<li><p>Times/Helvetica/Courier (<a class="reference external" href="http://www.ctan.org/pkg/newtx">newtx</a>) with <a class="reference external" href="http://www.ctan.org/pkg/gfsartemisia">GFS Artemisia</a>, <a class="reference external" href="http://www.ctan.org/pkg/gfsneohellenic">GFS
Neohellenic</a>, and teletype from the <a class="reference external" href="http://www.ctan.org/pkg/cbgreek-complete">CB</a> fonts: <a class="reference external" href="http://www.ctan.org/pkg/txfontsb">txfontsb</a>
<a class="reference external" href="greek-times-artemisia.tex">greek-times-artemisia.tex</a>, <a class="reference external" href="greek-times-artemisia.pdf">greek-times-artemisia.pdf</a></p></li>
<li><p>Latin Modern with Cyrillic from <a class="reference external" href="http://www.ctan.org/pkg/cm-lgc">CM LGC</a>:
<a class="reference external" href="cyrillic-lm-lgc.tex">cyrillic-lm-lgc.tex</a>, <a class="reference external" href="cyrillic-lm-lgc.pdf">cyrillic-lm-lgc.pdf</a></p></li>
<li><p>Times/Helvetica/Courier (TeX Gyre) with Cyrillic <a class="reference external" href="http://www.ctan.org/pkg/paratype">ParaType</a> fonts:
<a class="reference external" href="cyrillic-paratype.tex">cyrillic-paratype.tex</a>, <a class="reference external" href="cyrillic-paratype.pdf">cyrillic-paratype.pdf</a></p></li>
</ul>
</div>
<div class="section" id="references">
<h1>References</h1>
<dl class="citation"><dt class="label">[encguide]</dt>
<dd id="encguide">
<em>(<a class="fn-backref" href="#id1">1</a>, <a class="fn-backref" href="#id2">2</a>, <a class="fn-backref" href="#id3">3</a>)</em> <p class="last">Frank Mittelbach, Robin Fairbairns, Werner Lemberg,
LaTeX3 Project Team, <cite>LaTeX font encodings</cite>:
<a class="reference external" href="http://mirror.ctan.org/macros/latex/doc/encguide.pdf">http://mirror.ctan.org/macros/latex/doc/encguide.pdf</a>.</p>
</dd>
</dl>
<dl class="citation"><dt class="label"><a class="fn-backref" href="#id4">[fntguide]</a></dt>
<dd id="fntguide">
<p class="first last">LaTeX3 Project Team, <cite>LaTeX 2e font selection</cite>:
<a class="reference external" href="http://mirror.ctan.org/macros/latex/doc/fntguide.pdf">http://mirror.ctan.org/macros/latex/doc/fntguide.pdf</a>.</p>
</dd>
</dl>
</div>
</div>
</body>
</html>