1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
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">
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>
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>
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>
32 <dt><span class="section"><a href="utilities-common-types-apis.html">Common data types and APIs</a></span></dt>
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
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>
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.
51 <div class="titlepage"><div><div><h3 class="title">
52 <a name="utilities-command-line-hbshape"></a>hb-shape</h3></div></div></div>
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.
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
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>
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.
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
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.
97 For a complete explanation of the options available, run
99 <pre class="programlisting">
100 <span class="command"><strong>hb-shape</strong></span> <em class="parameter"><code>--help</code></em>
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>
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
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>
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
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).
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
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
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.
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>
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.
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.
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>
168 For example, to create a subset of Noto Serif that just includes the
169 numerals and the lowercase Latin alphabet, you could run
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>
177 There are options available to remove hinting from the
178 subsetted font and to specify a list of variation-axis settings.
184 <hr>Generated by GTK-Doc V1.32</div>