This file is indexed.

/usr/share/doc/libfreetype6/design/design-5.html is in libfreetype6-dev 2.8.1-2ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd">

<html lang="en">

<head>
  <meta http-equiv="Content-Type"
        content="text/html; charset=utf-8">
  <meta http-equiv="Content-Style-Type"
        content="text/css">
  <meta http-equiv="Content-Script-Type"
        content="text/javascript">
  <meta name="description"
        content="FreeType Documentation">
  <meta name="Author"
        content="David Turner">

  <link rel="icon"
        href="../image/favicon_-90.ico">
  <link rel="shortcut icon"
        href="../image/favicon_-90.ico">
  <link rel="stylesheet"
        type="text/css"
        href="../css/freetype2_-90.css">

  <script type="text/javascript"
          src="../../../js/jquery-1.11.0.min.js">
  </script>
  <script type="text/javascript"
          src="../../../js/jquery.ba-resize.min.js">
  </script>
  <script type="text/javascript"
          src="../../../js/freetype2.js">
  </script>

  <title>FreeType Design / IV</title>
</head>


<body>

<div id="top"
     class="bar">
  <h1><a href="http://freetype.org/index.html">FreeType</a>
    Design&nbsp;/&nbsp;IV</h1>
</div>


<div id="wrapper">

<div class="colmask leftmenu">
  <div class="colright">
    <div class="col1wrap">
      <div class="col1">


        <!-- ************************************************** -->

        <div id="module-classes">
          <h2>IV. Module Classes</h2>

          <p>We will now try to explain more precisely
            the <em>types</em> of modules that FreeType&nbsp;2 is
            capable of managing.</p>

          <ul>
            <li>
              <p><em>Renderer</em> modules manage scalable glyph
                images.  This means <em>transforming</em> them,
                computing their <em>bounding box</em>,
                and <em>converting</em> them to
                either <em>monochrome</em> or <em>anti-aliased</em>
                bitmaps.</p>

              <p>Note that FreeType&nbsp;2 is capable of dealing
                with <em>any</em> kind of glyph images, as long as a
                renderer module is provided for it.  The library comes
                by default with two renderers.</p>

              <table>
                <tr valign=top>
                  <td>
                    <p><tt>raster</tt></p>
                  </td>
                  <td>
                    <p>Supports the conversion of vectorial outlines
                    (described by
                    an <a href="../reference/ft2-outline_processing.html#FT_Outline"><code>FT_Outline</code></a>
                    object) to <em>monochrome</em> bitmaps.</p>
                  </td>
                </tr>
                <tr valign=top>
                  <td>
                    <p><tt>smooth</tt></p>
                  </td>
                  <td>
                    <p>Supports the conversion of the same outlines to
                    <em>anti-aliased</em> pixmaps (using 256 levels of
                    gray).  Note that this renderer also supports
                    direct span generation, this is, it provides a
                    hook into the engine so that the application can
                    manipulate the rendering results itself, instead
                    of letting the rasterizer fill a pixmap.
                    See <a href="../tutorial/example4.cpp">this
                    tutorial demo file</a> for an example.</p>
                  </td>
                </tr>
              </table>
            </li>
            <li>
              <p><em>Font driver</em> modules support one or more
                specific font formats.  Here is a list with the most
                important ones.</p>

              <table>
                <tr valign=top>
                  <td>
                    <p><tt>truetype</tt></p>
                  </td>
                  <td>
                    <p>TrueType fonts.</p>
                  </td>
                </tr>
                <tr valign=top>
                  <td>
                    <p><tt>type1</tt></p>
                  </td>
                  <td>
                    <p>Postscript Type&nbsp;1 fonts, both in binary
                      (<tt>.pfb</tt>) or ASCII (<tt>.pfa</tt>)
                      formats, including Multiple Master fonts.</p>
                  </td>
                </tr>
                <tr valign=top>
                  <td>
                    <p><tt>cid</tt></p>
                  </td>
                  <td>
                    <p>Postscript CID-keyed fonts.</p>
                  </td>
                </tr>
                <tr valign=top>
                  <td>
                    <p><tt>cff</tt></p>
                  </td>
                  <td>
                    <p>OpenType CFF and CFF2, bare CFF, and CEF fonts
                      (CEF is a derivative of CFF used by Adobe in its
                      SVG viewer).</p>
                  </td>
                </tr>
                <tr valign=top>
                  <td>
                    <p><tt>winfonts</tt></p>
                  </td>
                  <td>
                    <p>Windows bitmap fonts (i.e., <tt>.fon</tt> and
                      <tt>.fnt</tt>).</p>
                  </td>
                </tr>
              </table>

              <p>Note that font drivers can support bitmapped or
                scalable glyph images.  A given font driver that
                supports B&eacute;zier outlines
                through <tt>FT_Outline</tt> can also provide its own
                hinter, or rely on FreeType's <tt>autofit</tt>
                module for auto-hinting.</p>
            </li>
            <li>
              <p><em>Helper</em> modules are used to hold shared code
                that is often used by several font drivers, or even
                other modules.  The most important are as follows.</p>

              <table>
                <tr valign=top>
                  <td>
                    <p><tt>sfnt</tt></p>
                  </td>
                  <td>
                    <p>Support for font formats based on
                      the <tt>SFNT</tt> storage scheme: TrueType,
                      OpenType, as well as other variants (like
                      TrueType fonts that only contain embedded
                      bitmaps).</p>
                  </td>
                </tr>
                <tr valign=top>
                  <td>
                    <p><tt>psnames</tt></p>
                  </td>
                  <td>
                    <p>Various useful functions related to glyph name
                      ordering and Postscript encodings and charsets.
                      For example, this module is capable of
                      automatically synthetizing a Unicode charmap
                      from a Type&nbsp;1 glyph name dictionary.</p>
                  </td>
                </tr>
                <tr valign=top>
                  <td>
                    <p><tt>psaux</tt></p>
                  </td>
                  <td>
                    <p>Auxiliary functions related to Postscript
                      charstring decoding, as needed by
                      the <tt>type1</tt>, <tt>cid</tt>,
                      and <tt>cff</tt> drivers.</p>
                  </td>
                </tr>
              </table>
            </li>
            <li>
              <p>Finally, the <em>auto-hinter</em> module
                (<tt>autofit</tt>) has a specific role in
                FreeType&nbsp;2, as it can be used automatically
                during glyph loading to process individual glyph
                outlines when a font driver doesn't provide its own
                hinting engine.</p>

              <p>A paper published in the EuroTeX 2003 proceedings,
                titled <a href="http://www.tug.org/TUGboat/tb24-3/lemberg.pdf"><em>Real-Time
                Grid Fitting of Typographic Outlines</em></a>, gives
                further insight into the auto-hinting system's inner
                workings.</p>
            </li>
          </ul>

          <p>We will now study how modules are described, then managed
            by the library.</p>


          <h3 id="section-1">1. The <tt>FT_Module_Class</tt>
            Structure</h3>

          <p>Here is the definition of <tt>FT_Module_Class</tt>, with
            some explanations.  The following code is taken from
            <tt>ftmodapi.h</tt>.</p>

          <pre>
typedef struct  FT_Module_Class_
{
  FT_ULong               module_flags;
  FT_Int                 module_size;
  const FT_String*       module_name;
  FT_Fixed               module_version;
  FT_Fixed               module_requires;

  const void*            module_interface;

  FT_Module_Constructor  module_init;
  FT_Module_Destructor   module_done;
  FT_Module_Requester    get_interface;

} FT_Module_Class;</pre>

          <p>A description of its fields.</p>

          <table>
            <tr valign=top>
              <td>
                <p><tt>module_flags</tt></p>
              </td>
              <td>
                <p>A set of bit flags to describe the module's
                  category.  Valid values are listed below.</p>

                <ul>
                  <li>
                    <tt>FT_MODULE_FONT_DRIVER</tt> if the module is a
                    font driver
                  </li>
                  <li>
                    <tt>FT_MODULE_RENDERER</tt> if the module is a
                    renderer
                  </li>
                  <li>
                    <tt>FT_MODULE_HINTER</tt> if the module is an
                    auto-hinter
                  </li>
                  <li>
                    <tt>FT_MODULE_DRIVER_SCALABLE</tt> if the module
                    is a font driver supporting scalable glyph formats
                  </li>
                  <li>
                    <tt>FT_MODULE_DRIVER_NO_OUTLINES</tt> if the
                    module is a font driver supporting scalable glyph
                    formats that <em>cannot</em> be described by
                    an <tt>FT_Outline</tt> object
                  </li>
                  <li>
                    <tt>FT_MODULE_DRIVER_HAS_HINTER</tt> if the module
                    is a font driver that provides its own hinting
                    scheme/algorithm
                  </li>
                  <li>
                    <tt>FT_MODULE_DRIVER_HINTS_LIGHTLY</tt> if the
                    module is a font driver that generates
                    &lsquo;light&rsquo; hints (this is, only along the
                    vertical axis).
                  </li>
                </ul>
              </td>
            </tr>
            <tr valign=top>
              <td>
                <p><tt>module_size</tt></p>
              </td>
              <td>
                <p>An integer that gives the size in <em>bytes</em> of
                  a given module object.  This should <em>never</em>
                  be less than <tt>sizeof(FT_ModuleRec)</tt>, but can
                  be more if the module needs to sub-class the
                  base <tt>FT_ModuleRec</tt> class.</p>
              </td>
            </tr>
            <tr valign=top>
              <td>
                <p><tt>module_name</tt></p>
              </td>
              <td>
                <p>The module's internal name, coded as a simple ASCII
                  C&nbsp;string.  There can't be two modules with the
                  same name registered in a given <tt>FT_Library</tt>
                  object.  However, <tt>FT_Add_Module</tt> uses
                  the <tt>module_version</tt> field to detect module
                  upgrades and perform them cleanly, even at
                  run-time.</p>
              </td>
            </tr>
            <tr valign=top>
              <td>
                <p><tt>module_version</tt></p>
              </td>
              <td>
                <p>A 16.16 fixed-point number giving the module's
                  major and minor version numbers.  It is used to
                  determine whether a module needs to be upgraded when
                  calling <tt>FT_Add_Module</tt>.</p>
              </td>
            </tr>
            <tr valign=top>
              <td>
                <p><tt>module_requires</tt></p>
              </td>
              <td>
                <p>A 16.16 fixed-point number giving the version of
                  FreeType&nbsp;2 that is required to install this
                  module.  The default value is 0x20000 for FreeType
                  version&nbsp;2.x</p>
              </td>
            </tr>
            <tr valign=top>
              <td>
                <p><tt>module_interface</tt></p>
              </td>
              <td>
                <p>Most modules support one or more
                  &lsquo;interfaces&rsquo;, i.e., tables of function
                  pointers.  This field points to the module's main
                  interface, if there is one.  It is a short-cut that
                  prevents users of the module to
                  call <tt>get_interface</tt> each time they need to
                  access one of the object's common entry points.</p>

                <p>Note that it is optional, and can be set to NULL.
                  Other interfaces can also be accessed through
                  the <tt>get_interface</tt> field.</p>
              </td>
            </tr>
            <tr valign=top>
              <td>
                <p><tt>module_init</tt></p>
              </td>
              <td>
                <p>A pointer to a function to initialize the fields of
                  a fresh new <tt>FT_Module</tt> object.  It is
                  called <em>after</em> the module's base fields have
                  been set by the library, and is generally used to
                  initialize the fields of <tt>FT_ModuleRec</tt>
                  subclasses.</p>

                <p>Most module classes set it to NULL to indicate that
                  no extra initialization is necessary.</p>
              </td>
            </tr>
            <tr valign=top>
              <td>
                <p><tt>module_done</tt></p>
              </td>
              <td>
                <p>A pointer to a function to finalize the fields of a
                  given <tt>FT_Module</tt> object.  Note that it is
                  called <em>before</em> the library unsets the
                  module's base fields, and is generally used to
                  finalize the fields of <tt>FT_ModuleRec</tt>
                  subclasses.</p>

                <p>Most module classes set it to NULL to indicate that
                  no extra finalization is necessary</p>
              </td>
            </tr>
            <tr valign=top>
              <td>
                <p><tt>get_interface</tt></p>
              </td>
              <td>
                <p>A pointer to a function to request the address of a
                  given module interface.  Set it to NULL if you don't
                  need to support additional interfaces but the main
                  one.</p>
              </td>
            </tr>
          </table>


          <h3 id="section-2">2. The <tt>FT_Module</tt> Type</h3>

          <p>The <tt>FT_Module</tt> type is a handle (i.e., a pointer)
            to a given module object or instance, whose base structure
            is given by the internal <tt>FT_ModuleRec</tt> type.  We
            will intentionally <em>not</em> describe this structure
            here, as there is no point to look so far into the
            library's design.</p>

          <p>When <tt>FT_Add_Module</tt> is called, it first allocates
            a new module instance, using the <tt>module_size</tt>
            class field to determine its byte size.  The function
            initializes the root <tt>FT_ModuleRec</tt> field, then
            calls the class-specific initializer <tt>module_init</tt>
            when this field is not set to NULL.</p>

          <p>Note that the library defines several sub-classes of
            <tt>FT_ModuleRec</tt>.</p>

          <ul>
            <li>
              <p><tt>FT_Renderer</tt> for renderer modules</p>
            </li>
            <li>
              <p><tt>FT_Driver</tt> for font driver modules</p>
            </li>
            <li>
              <p><tt>FT_AutoHinter</tt> for the auto-hinter</p>
            </li>
          </ul>

          <p>Helper modules use the base <tt>FT_ModuleRec</tt>
            type.</p>
        </div>

         <!-- ************************************************** -->

        <div class="updated">
          <p>Last update: 13-May-2017</p>
        </div>
      </div>
    </div>


    <!-- ************************************************** -->

    <div class="col2">
    </div>
  </div>
</div>


<!-- ************************************************** -->

<div id="TOC">
  <ul>
    <li class="funding">
      <p><a href="https://pledgie.com/campaigns/24434">
        <img alt="Click here to lend your support to the FreeType project and make a donation at pledgie.com!"
             src="https://pledgie.com/campaigns/24434.png?skin_name=chrome"
             border="0"
             align="middle">
      </a></p>

      <p><a href="https://flattr.com/submit/auto?fid=mq2xxp&amp;url=https%3A%2F%2Fwww.freetype.org"
         target="_blank">
        <img class="with-border"
             src="https://button.flattr.com/flattr-badge-large.png"
             alt="Flattr this"
             title="Flattr this"
             border="0"
             align="middle">
      </a></p>
    </li>
    <li class="primary">
      <a href="http://freetype.org/index.html">Home</a>
    </li>
    <li class="primary">
      <a href="http://freetype.org/index.html#news">News</a>
    </li>
    <li class="primary">
      <a href="../index.html">Overview</a>
    </li>
    <li class="primary">
      <a href="../documentation.html">Documentation</a>
    </li>
    <li class="primary">
      <a href="http://freetype.org/developer.html">Development</a>
    </li>
    <li class="primary">
      <a href="http://freetype.org/contact.html"
         class="emphasis">Contact</a>
    </li>

    <li>
      &nbsp; <!-- separate primary from secondary entries -->
    </li>

    <li class="secondary">
      <a href="index.html">FreeType Design</a>
    </li>
    <li class="tertiary">
      <a href="design-1.html">Introduction</a>
    </li>
    <li class="tertiary">
      <a href="design-2.html">Components and APIs</a>
    </li>
    <li class="tertiary">
      <a href="design-3.html">Public Objects and Classes</a>
    </li>
    <li class="tertiary">
      <a href="design-4.html">Internal Objects and Classes</a>
    </li>
    <li class="tertiary">
      <a href="design-5.html" class="current">Module Classes</a>
    </li>
    <li class="tertiary">
      <a href="design-6.html">Interfaces and Services</a>
    </li>
  </ul>
</div>

</div> <!-- id="wrapper" -->

<div id="TOC-bottom">
</div>

</body>
</html>