Fix build error
[platform/upstream/harfbuzz.git] / docs / html / utilities.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Utilities: HarfBuzz Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="HarfBuzz Manual">
8 <link rel="up" href="user-manual.html" title="Part I. User's manual">
9 <link rel="prev" href="level-2.html" title="Level 2">
10 <link rel="next" href="utilities-common-types-apis.html" title="Common data types and APIs">
11 <meta name="generator" content="GTK-Doc V1.32 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts"></td>
17 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
18 <td><a accesskey="u" href="user-manual.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
19 <td><a accesskey="p" href="level-2.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
20 <td><a accesskey="n" href="utilities-common-types-apis.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
21 </tr></table>
22 <div class="chapter">
23 <div class="titlepage"><div><div><h2 class="title">
24 <a name="utilities"></a>Utilities</h2></div></div></div>
25 <div class="toc"><dl class="toc">
26 <dt><span class="section"><a href="utilities.html#utilities-command-line-tools">Command-line tools</a></span></dt>
27 <dd><dl>
28 <dt><span class="section"><a href="utilities.html#utilities-command-line-hbshape">hb-shape</a></span></dt>
29 <dt><span class="section"><a href="utilities.html#utilities-command-line-hbview">hb-view</a></span></dt>
30 <dt><span class="section"><a href="utilities.html#utilities-command-line-hbsubset">hb-subset</a></span></dt>
31 </dl></dd>
32 <dt><span class="section"><a href="utilities-common-types-apis.html">Common data types and APIs</a></span></dt>
33 </dl></div>
34 <p>
35     HarfBuzz includes several auxiliary components in addition to the
36     main APIs. These include a set of command-line tools, a set of
37     lower-level APIs for common data types that may be of interest to
38     client programs.
39   </p>
40 <div class="section">
41 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
42 <a name="utilities-command-line-tools"></a>Command-line tools</h2></div></div></div>
43 <p>
44       HarfBuzz include three command-line tools:
45       <span class="command"><strong>hb-shape</strong></span>, <span class="command"><strong>hb-view</strong></span>, and
46       <span class="command"><strong>hb-subset</strong></span>. They can be used to examine
47       HarfBuzz's functionality, debug font binaries, or explore the
48       various shaping models and features from a terminal.
49     </p>
50 <div class="section">
51 <div class="titlepage"><div><div><h3 class="title">
52 <a name="utilities-command-line-hbshape"></a>hb-shape</h3></div></div></div>
53 <p>
54         <span class="emphasis"><em><span class="command"><strong>hb-shape</strong></span></em></span> allows you to run HarfBuzz's
55         <code class="function">hb_shape()</code> function on an input string and
56         to examine the outcome, in human-readable form, as terminal
57         output. <span class="command"><strong>hb-shape</strong></span> does
58         <span class="emphasis"><em>not</em></span> render the results of the shaping call
59         into rendered text (you can use <span class="command"><strong>hb-view</strong></span>, below, for
60         that). Instead, it prints out the final glyph indices and
61         positions, taking all shaping operations into account, as if the
62         input string were a HarfBuzz input buffer.
63       </p>
64 <p>
65         You can specify the font to be used for shaping and, with
66         command-line options, you can add various aspects of the
67         internal state to the output that is sent to the terminal. The
68         general format is
69       </p>
70 <pre class="programlisting">
71         <span class="command"><strong>hb-shape</strong></span> [<span class="optional">[OPTIONS]</span>]
72       <em class="parameter"><code>path/to/font/file.ttf</code></em>
73       <em class="parameter"><code>yourinputtext</code></em>
74       </pre>
75 <p>
76         The default output format is plain text (although JSON output
77         can be selected instead by specifying the option
78         [<span class="optional">--output-format=json</span>]). The default output
79         syntax reports each glyph name (or glyph index if there is no
80         name) followed by its cluster value, its horizontal and vertical
81         position displacement, and its horizontal and vertical advances.
82       </p>
83 <p>
84         Output options exist to skip any of these elements in the
85         output, and to include additional data, such as Unicode
86         code-point values, glyph extents, glyph flags, or interim
87         shaping results.
88       </p>
89 <p>
90         Output can also be redirected to a file, or input read from a
91         file. Additional options enable you to enable or disable
92         specific font features, to set variation-font axis values, to
93         alter the language, script, direction, and clustering settings
94         used, to enable sanity checks, or to change which shaping engine is used.
95       </p>
96 <p>
97         For a complete explanation of the options available, run
98       </p>
99 <pre class="programlisting">
100         <span class="command"><strong>hb-shape</strong></span> <em class="parameter"><code>--help</code></em>
101       </pre>
102 </div>
103 <div class="section">
104 <div class="titlepage"><div><div><h3 class="title">
105 <a name="utilities-command-line-hbview"></a>hb-view</h3></div></div></div>
106 <p>
107         <span class="emphasis"><em><span class="command"><strong>hb-view</strong></span></em></span> allows you to
108         see the shaped output of an input string in rendered
109         form. Like <span class="command"><strong>hb-shape</strong></span>,
110         <span class="command"><strong>hb-view</strong></span> takes a font file and a text string
111         as its arguments:
112       </p>
113 <pre class="programlisting">
114         <span class="command"><strong>hb-view</strong></span> [<span class="optional">[OPTIONS]</span>]
115         <em class="parameter"><code>path/to/font/file.ttf</code></em>
116         <em class="parameter"><code>yourinputtext</code></em>
117       </pre>
118 <p>
119         By default, <span class="command"><strong>hb-view</strong></span> renders the shaped
120         text in ASCII block-character images as terminal output. By
121         appending the
122         <span class="command"><strong>--output-file=[<span class="optional">filename</span>]</strong></span>
123         switch, you can write the output to a PNG, SVG, or PDF file
124         (among other formats).
125       </p>
126 <p>
127         As with <span class="command"><strong>hb-shape</strong></span>, a lengthy set of options
128         is available, with which you can  enable or disable
129         specific font features, set variation-font axis values,
130         alter the language, script, direction, and clustering settings
131         used, enable sanity checks, or change which shaping engine is
132         used.
133       </p>
134 <p>
135         You can also set the foreground and background colors used for
136         the output, independently control the width of all four
137         margins, alter the line spacing, and annotate the output image
138         with 
139       </p>
140 <p>
141         In general, <span class="command"><strong>hb-view</strong></span> is a quick way to
142         verify that the output of HarfBuzz's shaping operation looks
143         correct for a given text-and-font combination, but you may
144         want to use <span class="command"><strong>hb-shape</strong></span> to figure out exactly
145         why something does not appear as expected.
146       </p>
147 </div>
148 <div class="section">
149 <div class="titlepage"><div><div><h3 class="title">
150 <a name="utilities-command-line-hbsubset"></a>hb-subset</h3></div></div></div>
151 <p>
152         <span class="emphasis"><em><span class="command"><strong>hb-subset</strong></span></em></span> allows you
153         to generate a subset of a given font, with a limited set of
154         supported characters, features, and variation settings.
155       </p>
156 <p>
157         By default, you provide an input font and an input text string
158         as the arguments to <span class="command"><strong>hb-subset</strong></span>, and it will
159         generate a font that covers the input text exactly like the
160         input font does, but includes no other characters or features.
161       </p>
162 <pre class="programlisting">
163         <span class="command"><strong>hb-subset</strong></span> [<span class="optional">[OPTIONS]</span>]
164         <em class="parameter"><code>path/to/font/file.ttf</code></em>
165         <em class="parameter"><code>yourinputtext</code></em>
166       </pre>
167 <p>
168         For example, to create a subset of Noto Serif that just includes the
169         numerals and the lowercase Latin alphabet, you could run
170       </p>
171 <pre class="programlisting">
172         <span class="command"><strong>hb-subset</strong></span> [<span class="optional">[OPTIONS]</span>]
173         <em class="parameter"><code>NotoSerif-Regular.ttf</code></em>
174         <em class="parameter"><code>0123456789abcdefghijklmnopqrstuvwxyz</code></em>
175       </pre>
176 <p>
177         There are options available to remove hinting from the
178         subsetted font and to specify a list of variation-axis settings.
179       </p>
180 </div>
181 </div>
182 </div>
183 <div class="footer">
184 <hr>Generated by GTK-Doc V1.32</div>
185 </body>
186 </html>