diff options
Diffstat (limited to '')
-rw-r--r-- | doc/groff.html.node/Selecting-Fonts.html | 227 |
1 files changed, 227 insertions, 0 deletions
diff --git a/doc/groff.html.node/Selecting-Fonts.html b/doc/groff.html.node/Selecting-Fonts.html new file mode 100644 index 0000000..d6a59e7 --- /dev/null +++ b/doc/groff.html.node/Selecting-Fonts.html @@ -0,0 +1,227 @@ +<!DOCTYPE html> +<html> +<!-- Created by GNU Texinfo 7.0.3, https://www.gnu.org/software/texinfo/ --> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> +<!-- This manual documents GNU troff version 1.23.0. + +Copyright © 1994-2023 Free Software Foundation, Inc. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A +copy of the license is included in the section entitled "GNU Free +Documentation License". --> +<title>Selecting Fonts (The GNU Troff Manual)</title> + +<meta name="description" content="Selecting Fonts (The GNU Troff Manual)"> +<meta name="keywords" content="Selecting Fonts (The GNU Troff Manual)"> +<meta name="resource-type" content="document"> +<meta name="distribution" content="global"> +<meta name="Generator" content="makeinfo"> +<meta name="viewport" content="width=device-width,initial-scale=1"> + +<link href="index.html" rel="start" title="Top"> +<link href="Request-Index.html" rel="index" title="Request Index"> +<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> +<link href="Using-Fonts.html" rel="up" title="Using Fonts"> +<link href="Font-Families.html" rel="next" title="Font Families"> +<link href="Using-Fonts.html" rel="prev" title="Using Fonts"> +<style type="text/css"> +<!-- +a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em} +div.example {margin-left: 3.2em} +span.r {font-family: initial; font-weight: normal; font-style: normal} +span:hover a.copiable-link {visibility: visible} +strong.def-name {font-family: monospace; font-weight: bold; font-size: larger} +--> +</style> + + +</head> + +<body lang="en"> +<div class="subsection-level-extent" id="Selecting-Fonts"> +<div class="nav-panel"> +<p> +Next: <a href="Font-Families.html" accesskey="n" rel="next">Font Families</a>, Previous: <a href="Using-Fonts.html" accesskey="p" rel="prev">Using Fonts</a>, Up: <a href="Using-Fonts.html" accesskey="u" rel="up">Using Fonts</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Request-Index.html" title="Index" rel="index">Index</a>]</p> +</div> +<hr> +<h4 class="subsection" id="Selecting-Fonts-1">5.19.1 Selecting Fonts</h4> +<a class="index-entry-id" id="index-font_002c-selection"></a> + +<p>We use <em class="dfn">font</em> to refer to any of several means of identifying a +font: by mounting position (‘<samp class="samp">3</samp>’), by abstract style (‘<samp class="samp">B</samp>’), or +by its identifier (‘<samp class="samp">TB</samp>’). +</p> +<dl class="first-deffn"> +<dt class="deffn" id="index-_002eft"><span class="category-def">Request: </span><span><strong class="def-name"><code class="t">.ft</code></strong> <var class="def-var-arguments">[<span class="r"><i class="slanted">font</i></span>]</var><a class="copiable-link" href='#index-_002eft'> ¶</a></span></dt> +<dd><a class="index-entry-id" id="index-ft"></a> +</dd><dt class="deffnx def-cmd-deffn" id="index-_005cff"><span class="category-def">Escape sequence: </span><span><strong class="def-name"><code class="t">\f</code><span class="r"><i class="slanted">f</i></span><code class="t"></code></strong><a class="copiable-link" href='#index-_005cff'> ¶</a></span></dt> +<dd><a class="index-entry-id" id="index-_005cf"></a> +</dd><dt class="deffnx def-cmd-deffn" id="index-_005cf_0028fn"><span class="category-def">Escape sequence: </span><span><strong class="def-name"><code class="t">\f(</code><span class="r"><i class="slanted">fn</i></span><code class="t"></code></strong><a class="copiable-link" href='#index-_005cf_0028fn'> ¶</a></span></dt> +<dt class="deffnx def-cmd-deffn" id="index-_005cf_005bfont_005d"><span class="category-def">Escape sequence: </span><span><strong class="def-name"><code class="t">\f[</code><span class="r"><i class="slanted">font</i></span><code class="t">]</code></strong><a class="copiable-link" href='#index-_005cf_005bfont_005d'> ¶</a></span></dt> +<dt class="deffnx def-cmd-deffn" id="index-_005cn_005b_002efn_005d"><span class="category-def">Register: </span><span><strong class="def-name"><code class="t">\n[.fn]</code></strong><a class="copiable-link" href='#index-_005cn_005b_002efn_005d'> ¶</a></span></dt> +<dd><a class="index-entry-id" id="index-_002efn"></a> +<a class="index-entry-id" id="index-changing-fonts-_0028ft_002c-_005cf_0029"></a> +<a class="index-entry-id" id="index-fonts_002c-changing-_0028ft_002c-_005cf_0029"></a> +<a class="index-entry-id" id="index-sty-request_002c-and-changing-fonts"></a> +<a class="index-entry-id" id="index-fam-request_002c-and-changing-fonts"></a> +<a class="index-entry-id" id="index-_005cF_002c-and-changing-fonts"></a> +<a class="index-entry-id" id="index-styles"></a> +<a class="index-entry-id" id="index-family"></a> +<a class="index-entry-id" id="index-DESC"></a> +<a class="index-entry-id" id="index-selecting-the-previous-font-_0028ft_0029"></a> +<a class="index-entry-id" id="index-previous-font_002c-selecting-_0028ft_0029"></a> +<a class="index-entry-id" id="index-font_002c-previous_002c-slecting-_0028ft_0029"></a> +<p>The <code class="code">ft</code> request selects the typeface <var class="var">font</var>. If the argument +is absent or ‘<samp class="samp">P</samp>’, it selects the previously chosen font. If +<var class="var">font</var> is a non-negative integer, it is interpreted as mounting +position; the font mounted there is selected. If that position refers +to an abstract style, it is combined with the default family (see +<code class="code">fam</code> and <code class="code">\F</code> below) to make a resolved font name. If the +mounting position is not a style and no font is mounted there, GNU +<code class="code">troff</code> emits a warning in category ‘<samp class="samp">font</samp>’ and ignores the +request. +</p> +<p>If <var class="var">font</var> matches a style name, it is combined with the current +family to make a resolved font name. Otherwise, <var class="var">font</var> is assumed +to already be a resolved font name. +</p> +<a class="index-entry-id" id="index-automatic-font-mounting"></a> +<a class="index-entry-id" id="index-font-mounting_002c-automatic"></a> +<a class="index-entry-id" id="index-mounting_002c-font_002c-automatic"></a> +<p>The resolved font name is subject to translation (see request <code class="code">ftr</code> +below). Next, the (possibly translated) font name’s mounting position +is looked up; if not mounted, <var class="var">font</var> is sought on the file system as +a font description file and, if located, automatically mounted at the +next available position (see register <code class="code">.fp</code> below). If the font +was mounted using an identifier different from its font description file +name (see request <code class="code">fp</code> below), that file name is then looked up. +If a font description file for the resolved font name is not found, GNU +<code class="code">troff</code> emits a warning in category ‘<samp class="samp">font</samp>’ and ignores the +request. +</p> +<p>The <code class="code">\f</code> escape sequence is similar, using one-character name (or +mounting position) <var class="var">f</var>, two-character name <var class="var">fn</var>, or a name +<var class="var">font</var> of arbitrary length. +<a class="index-entry-id" id="index-previous-font_002c-selecting-_0028_005cf_005b_005d_002c-_005cfP_0029"></a> +<a class="index-entry-id" id="index-font_002c-previous_002c-selecting-_0028_005cf_005b_005d_002c-_005cfP_0029"></a> +‘<samp class="samp">\f[]</samp>’ selects the previous font. The syntax form ‘<samp class="samp">\fP</samp>’ is +supported for backward compatibility, and ‘<samp class="samp">\f[P]</samp>’ for consistency. +</p> +<div class="example"> +<div class="group"><pre class="example-preformatted">eggs, bacon, +.ft I +spam, +.ft +and sausage. +.br +eggs, bacon, \fIspam,\fP and sausage. + ⇒ eggs, bacon, <i class="slanted">spam,</i> and sausage + ⇒ eggs, bacon, <i class="slanted">spam,</i> and sausage +</pre></div></div> + +<p>The current and previously selected fonts are properties of the +environment (see <a class="pxref" href="Environments.html">Environments</a>). +</p> +<p>The read-only string-valued register <code class="code">.fn</code> contains the resolved +font name of the selected font. +</p> +<p><code class="code">\f</code> doesn’t produce an input token in GNU <code class="code">troff</code>; it thus +can be used in requests that expect a single-character argument. We can +assign a font to a margin character as follows (see <a class="pxref" href="Miscellaneous.html">Miscellaneous</a>). +</p> +<div class="example"> +<div class="group"><pre class="example-preformatted">.mc \f[I]x\f[] +</pre></div></div> +</dd></dl> + +<dl class="first-deffn"> +<dt class="deffn" id="index-_002eftr"><span class="category-def">Request: </span><span><strong class="def-name"><code class="t">.ftr</code></strong> <var class="def-var-arguments">f [<span class="r"><i class="slanted">g</i></span>]</var><a class="copiable-link" href='#index-_002eftr'> ¶</a></span></dt> +<dd><a class="index-entry-id" id="index-ftr"></a> +<a class="index-entry-id" id="index-font-translation-_0028ftr_0029"></a> +<a class="index-entry-id" id="index-ft-request_002c-and-font-translations"></a> +<a class="index-entry-id" id="index-ul-request_002c-and-font-translations"></a> +<a class="index-entry-id" id="index-bd-request_002c-and-font-translations"></a> +<a class="index-entry-id" id="index-_005cf_002c-and-font-translations"></a> +<a class="index-entry-id" id="index-cs-request_002c-and-font-translations"></a> +<a class="index-entry-id" id="index-tkf-request_002c-and-font-translations"></a> +<a class="index-entry-id" id="index-special-request_002c-and-font-translations"></a> +<a class="index-entry-id" id="index-fspecial-request_002c-and-font-translations"></a> +<a class="index-entry-id" id="index-fp-request_002c-and-font-translations"></a> +<a class="index-entry-id" id="index-sty-request_002c-and-font-translations"></a> +<a class="index-entry-id" id="index-if-request_002c-and-font-translations"></a> +<a class="index-entry-id" id="index-ie-request_002c-and-font-translations"></a> +<a class="index-entry-id" id="index-while-request_002c-and-font-translations"></a> +<p>Translate font <var class="var">f</var> to font <var class="var">g</var>. Whenever a font +named <var class="var">f</var> is referred to in a <code class="code">\f</code> escape sequence, in the +<code class="code">F</code> and <code class="code">S</code> conditional operators, or in the <code class="code">ft</code>, +<code class="code">ul</code>, <code class="code">bd</code>, <code class="code">cs</code>, <code class="code">tkf</code>, <code class="code">special</code>, +<code class="code">fspecial</code>, <code class="code">fp</code>, or <code class="code">sty</code> requests, font <var class="var">g</var> is +used. If <var class="var">g</var> is missing or equal to <var class="var">f</var> the translation is +undone. +</p> +<p>Font translations cannot be chained. +</p> +<div class="example"> +<div class="group"><pre class="example-preformatted">.ftr XXX TR +.ftr XXX YYY +.ft XXX + error→ warning: can't find font 'XXX' +</pre></div></div> +</dd></dl> + +<dl class="first-deffn"> +<dt class="deffn" id="index-_002efzoom"><span class="category-def">Request: </span><span><strong class="def-name"><code class="t">.fzoom</code></strong> <var class="def-var-arguments">f [<span class="r"><i class="slanted">zoom</i></span>]</var><a class="copiable-link" href='#index-_002efzoom'> ¶</a></span></dt> +<dd><a class="index-entry-id" id="index-fzoom"></a> +</dd><dt class="deffnx def-cmd-deffn" id="index-_005cn_005b_002ezoom_005d"><span class="category-def">Register: </span><span><strong class="def-name"><code class="t">\n[.zoom]</code></strong><a class="copiable-link" href='#index-_005cn_005b_002ezoom_005d'> ¶</a></span></dt> +<dd><a class="index-entry-id" id="index-_002ezoom"></a> +<a class="index-entry-id" id="index-magnification-of-a-font-_0028fzoom_0029"></a> +<a class="index-entry-id" id="index-font_002c-magnification-_0028fzoom_0029"></a> +<a class="index-entry-id" id="index-zoom-factor-of-a-font-_0028fzoom_0029"></a> +<a class="index-entry-id" id="index-factor_002c-zoom_002c-of-a-font-_0028fzoom_0029"></a> +<a class="index-entry-id" id="index-font_002c-zoom-factor-_0028fzoom_0029"></a> +<a class="index-entry-id" id="index-optical-size-of-a-font"></a> +<a class="index-entry-id" id="index-font_002c-optical-size"></a> +<a class="index-entry-id" id="index-size_002c-optical_002c-of-a-font"></a> +<p>Set magnification of font <var class="var">f</var> to factor <var class="var">zoom</var>, which must +be a non-negative integer multiple of 1/1000th. This request is useful +to adjust the optical size of a font in relation to the others. In the +example below, font <code class="code">CR</code> is magnified by 10% (the zoom factor is +thus 1.1). +</p> +<div class="example"> +<div class="group"><pre class="example-preformatted">.fam P +.fzoom CR 1100 +.ps 12 +Palatino and \f[CR]Courier\f[] +</pre></div></div> + +<p>A missing or zero value of <var class="var">zoom</var> is the same as a value of 1000, +which means no magnification. <var class="var">f</var> must be a resolved font +name, not an abstract style. +</p> +<p>The magnification of a font is completely transparent to GNU +<code class="code">troff</code>; a change of the zoom factor doesn’t cause any effect +except that the dimensions of glyphs, (word) spaces, kerns, etc., of the +affected font are adjusted accordingly. +</p> +<p>The zoom factor of the current font is available in the read-only +register ‘<samp class="samp">.zoom</samp>’, in multiples of 1/1000th. It returns zero if +there is no magnification. +</p></dd></dl> + + +</div> +<hr> +<div class="nav-panel"> +<p> +Next: <a href="Font-Families.html">Font Families</a>, Previous: <a href="Using-Fonts.html">Using Fonts</a>, Up: <a href="Using-Fonts.html">Using Fonts</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Request-Index.html" title="Index" rel="index">Index</a>]</p> +</div> + + + +</body> +</html> |