diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2022-06-28 12:55:43 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2022-06-28 12:55:43 +0000 |
commit | 753b0048043fdb9741a78011ab7e2c862f94e9e8 (patch) | |
tree | 39a25bf97207218df545c269056de3f1a4d25152 /lib/freetype/docs/design | |
parent | 27ddba6c40aa95169621bd72815339a47da1103b (diff) |
Remove outdated parts of the freetype-doc package.
They are not used in builds and have not been updated recently.
Diffstat (limited to 'lib/freetype/docs/design')
-rw-r--r-- | lib/freetype/docs/design/basic-design.png | bin | 1960 -> 0 bytes | |||
-rw-r--r-- | lib/freetype/docs/design/design-1.html | 237 | ||||
-rw-r--r-- | lib/freetype/docs/design/design-2.html | 292 | ||||
-rw-r--r-- | lib/freetype/docs/design/design-3.html | 444 | ||||
-rw-r--r-- | lib/freetype/docs/design/design-4.html | 406 | ||||
-rw-r--r-- | lib/freetype/docs/design/design-5.html | 548 | ||||
-rw-r--r-- | lib/freetype/docs/design/design-6.html | 415 | ||||
-rw-r--r-- | lib/freetype/docs/design/detailed-design.png | bin | 2290 -> 0 bytes | |||
-rw-r--r-- | lib/freetype/docs/design/index.html | 239 | ||||
-rw-r--r-- | lib/freetype/docs/design/library-model.png | bin | 1680 -> 0 bytes | |||
-rw-r--r-- | lib/freetype/docs/design/simple-model.png | bin | 1614 -> 0 bytes |
11 files changed, 0 insertions, 2581 deletions
diff --git a/lib/freetype/docs/design/basic-design.png b/lib/freetype/docs/design/basic-design.png Binary files differdeleted file mode 100644 index f1cf00234..000000000 --- a/lib/freetype/docs/design/basic-design.png +++ /dev/null diff --git a/lib/freetype/docs/design/design-1.html b/lib/freetype/docs/design/design-1.html deleted file mode 100644 index 172dc7c76..000000000 --- a/lib/freetype/docs/design/design-1.html +++ /dev/null @@ -1,237 +0,0 @@ -<!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</title> -</head> - - -<body> - -<div id="top" - class="bar"> - <h1><a href="http://freetype.org/index.html">FreeType</a> Design</h1> -</div> - - -<div id="wrapper"> - -<div class="colmask leftmenu"> - <div class="colright"> - <div class="col1wrap"> - <div class="col1"> - - - <!-- ************************************************** --> - - <div id="introduction"> - <h2>Introduction</h2> - - <p>This document provides details on the design and - implementation of the FreeType 2 library. Its goal - is to help developers better understand how - FreeType 2 is organized, in order to let them extend, - customize, and debug it.</p> - - <p>Before anything else, it is important to understand the - <em>purpose</em> of this library, i.e., why it has been - written.</p> - - <ul> - <li> - <p>It allows client applications to <em>access font - files easily</em>, wherever they could be stored, and - as independently of the font format as possible.</p> - </li> - <li> - <p>Easy <em>retrieval of global font data</em> most - commonly found in normal font formats (i.e., global - metrics, encoding/charmaps, etc.).</p> - </li> - <li> - <p>It allows easy <em>retrieval of individual glyph - data</em> (metrics, images, name, anything else).</p> - </li> - <li> - <p><em>Access to font format-specific - ‘features’</em> whenever possible (e.g., - SFNT tables, Multiple Masters, OpenType layout tables, - font variations, etc.).</p> - </li> - </ul> - - <p>Its design has also severely been influenced by the - following requirements.</p> - - <ul> - <li> - <p><em>High portability</em>. The library must be able - to run on any kind of environment. This requirement - introduces a few drastic choices that are part of - FreeType 2's low-level system interface.</p> - </li> - <li> - <p><em>Extendability</em>. New features should be added - with the least modifications in the library's code - base. This requirement induces an extremely simple - design where nearly all operations are provided by - modules or services.</p> - </li> - <li> - <p><em>Customization</em>. It should be easy to build a - version of the library that only contains the features - needed by a specific project. This really is - important when you need to integrate it into a font - server for embedded graphics libraries, say.</p> - </li> - <li> - <p><em>Compactness</em> and <em>efficiency</em>. The - primary target for this library originally were - embedded systems with low CPU and memory resources. - Today, however, memory constraints are much less - strict, and the focus of development shifted to - support as much font features as possible.</p> - </li> - </ul> - - <p>The rest of this document is divided in several sections. - First, a few chapters will present the library's basic - design as well as the objects and data managed internally - by FreeType 2.</p> - - <p>It is intended to eventually add sections that cover - library customization, relating to topics as - system-specific interfaces, how to write your own modules - or services and how to tailor library initialization and - compilation to your needs. Those sections are not written - yet, however.</p> - </div> - - <!-- ************************************************** --> - - <div class="updated"> - <p>Last update: 13-Feb-2018</p> - </div> - </div> - </div> - - - <!-- ************************************************** --> - - <div class="col2"> - </div> - </div> -</div> - - -<!-- ************************************************** --> - -<div id="TOC"> - <ul> - <li class="funding"> - <form action="https://www.paypal.com/cgi-bin/webscr" - method="post" - target="_top"> - <input type="hidden" - name="cmd" - value="_s-xclick"> - <input type="hidden" - name="hosted_button_id" - value="SK827YKEALMT4"> - <input type="image" - src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" - name="submit" - alt="PayPal - The safer, easier way to pay online!"> - <img alt="" - border="0" - src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" - width="1" - height="1"> - </form> - </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> - <!-- 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" class="current">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">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> diff --git a/lib/freetype/docs/design/design-2.html b/lib/freetype/docs/design/design-2.html deleted file mode 100644 index 4dc3779a5..000000000 --- a/lib/freetype/docs/design/design-2.html +++ /dev/null @@ -1,292 +0,0 @@ -<!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 / I</title> -</head> - - -<body> - -<div id="top" - class="bar"> - <h1><a href="http://freetype.org/index.html">FreeType</a> - Design / I</h1> -</div> - - -<div id="wrapper"> - -<div class="colmask leftmenu"> - <div class="colright"> - <div class="col1wrap"> - <div class="col1"> - - - <!-- ************************************************** --> - - <div id="components-and-apis"> - <h2>I. Components and APIs</h2> - - <p>It is better to describe FreeType 2 as a collection - of <em>components</em>. Each one of them is a more or - less abstract part of the library that is in charge of one - specific task. We will now explain the connections and - relationships between them.</p> - - <p>A first brief description of this system of components - could be as follows.</p> - - <ul> - <li> - <p>Client applications typically call the - FreeType 2 <b>high-level API</b>, whose functions - are implemented in a single component called - the <em>Base Layer</em>.</p> - </li> - <li> - <p>Depending on the context or the task, the base layer - then calls one or more <em>module</em> components to - perform the work. In most cases, the client - application doesn't need to know which module was - called.</p> - </li> - <li> - <p>The base layer also contains a set of routines that - are used for generic things like memory allocation, - list processing, I/O stream parsing, fixed-point - computation, etc. These functions can also be called - by a module at any time, and they form what is called - the <b>low-level base API</b>.</p> - </li> - </ul> - - <p>This is illustrated by the following graphics (note that - component entry points are represented as colored - triangles).</p> - - <center> - <img src="basic-design.png" - width="394" - height="313" - alt="Basic FreeType design"> - </center> - - <p>A few additional things must be added to complete this - picture.</p> - - <ul> - <li> - <p>Some parts of the base layer can be replaced for - specific builds of the library, and can thus be - considered as components themselves. This is the case - for the <tt>ftsystem</tt> component, which is in - charge of implementing memory management and input - stream access, as well as <tt>ftinit</tt>, which is in - charge of library initialization (i.e., implementing - the <a href="../reference/ft2-base_interface.html#ft_init_freetype"><code>FT_Init_FreeType</code></a> - function).</p> - </li> - <li> - <p>FreeType 2 comes also with a set of <em>optional - components</em>, which can be used either as a - convenience layer for client applications (e.g., - the <tt>ftglyph</tt> component, used to provide a - simple API to manage glyph images independently of - their internal representation), or to access - format-specific features (e.g., the - <tt>ftmm</tt> component used to access and manage - Multiple Masters and OpenType variations fonts).</p> - </li> - <li> - <p>A module is capable of calling functions provided by - another module. This is very useful to share code and - tables between several font driver modules (for - example, the <tt>truetype</tt> and <tt>cff</tt> - modules both use the routines provided by - the <tt>sfnt</tt> module).</p> - </li> - <li> - <p>Finally, FreeType provides <em>services</em>, which - are a more light-weight way to access certain features - across multiple modules, or to access some - functionality provided by a single module.</p> - - <p>Services are internal to FreeType; similar to - modules, it is necessary to ‘load’ a - service, which can fail if the service's module is not - available.</p> - - <p>An example for a service provided by a single module - is ‘winfonts’ (see - file <tt>svwinfnt.h</tt>), which allows access to the - header of Windows bitmap fonts. An example for a - service provided by multiple modules is - ‘multi-masters’ (see file <tt>svmm.h</tt>) - to manage the abovementioned <tt>ftmm</tt> component - across the <tt>truetype</tt>, <tt>type1</tt>, - and <tt>cff</tt> modules.</p> - </li> - </ul> - - <p>The following graphics shows the additional components - (without services).</p> - - <center> - <img src="detailed-design.png" - width="390" - height="429" - alt="Detailed FreeType design"> - </center> - - <p>Please take note of the following important points.</p> - - <ul> - <li> - <p>An optional component can use either the high-level - or base API. This is the case of <tt>ftglyph</tt> in - the above picture.</p> - </li> - <li> - <p>Some optional components can use module-specific - interfaces or services ignored by the base layer. In - the above example, <tt>ftmm</tt> directly accesses the - Type 1 and TrueType modules to set and query - data.</p> - </li> - <li> - <p>A replaceable component can provide a function of the - high-level API. For example, <tt>ftinit</tt> provides - <tt>FT_Init_FreeType</tt> to client applications.</p> - </li> - </ul> - </div> - - <!-- ************************************************** --> - - <div class="updated"> - <p>Last update: 13-Feb-2018</p> - </div> - </div> - </div> - - - <!-- ************************************************** --> - - <div class="col2"> - </div> - </div> -</div> - - -<!-- ************************************************** --> - -<div id="TOC"> - <ul> - <li class="funding"> - <form action="https://www.paypal.com/cgi-bin/webscr" - method="post" - target="_top"> - <input type="hidden" - name="cmd" - value="_s-xclick"> - <input type="hidden" - name="hosted_button_id" - value="SK827YKEALMT4"> - <input type="image" - src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" - name="submit" - alt="PayPal - The safer, easier way to pay online!"> - <img alt="" - border="0" - src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" - width="1" - height="1"> - </form> - </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> - <!-- 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" class="current">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">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> diff --git a/lib/freetype/docs/design/design-3.html b/lib/freetype/docs/design/design-3.html deleted file mode 100644 index 2acf81b0d..000000000 --- a/lib/freetype/docs/design/design-3.html +++ /dev/null @@ -1,444 +0,0 @@ -<!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 / II</title> -</head> - - -<body> - -<div id="top" - class="bar"> - <h1><a href="http://freetype.org/index.html">FreeType</a> - Design / II</h1> -</div> - - -<div id="wrapper"> - -<div class="colmask leftmenu"> - <div class="colright"> - <div class="col1wrap"> - <div class="col1"> - - - <!-- ************************************************** --> - - <div id="public-objects"> - <h2>II. Public Objects and Classes</h2> - - <p>We will now explain the abstractions provided by - FreeType 2 to client applications to manage font - files and data. As you would normally expect, these are - implemented through objects and classes.</p> - - - <h3 id="section-1">1. Object Orientation in - FreeType 2</h3> - - <p>Though written in ANSI C, the library employs a few - techniques, inherited from object-oriented programming, to - make it easy to extend. Hence, the following conventions - apply in the FreeType 2 source code.</p> - - <ol> - <li> - <p>Almost all object types or classes have a - corresponding <em>structure type</em> <b>and</b> a - corresponding <em>structure pointer type</em>. The - latter is called the <em>handle type</em> for the type - or class.</p> - - <p>Consider that we need to manage objects of type - ‘foo’ in FreeType 2. We would define - the following structure and handle types as - follows.</p> - - <pre> -typedef struct FT_FooRec_* FT_Foo; - -typedef struct FT_FooRec_ -{ - /* fields for the 'foo' class */ - ... - -} FT_FooRec;</pre> - - <p>As a convention, handle types use simple but - meaningful identifiers beginning with <tt>FT_</tt>, as - in <tt>FT_Foo</tt>, while structures use the same name - with a <tt>Rec</tt> suffix appended to it - (‘Rec’ is short for - ‘record’).</p> - </li> - <li> - <p>Class derivation is achieved internally by wrapping - base class structures into new ones. As an example, - we define a ‘foobar’ class that is derived - from ‘foo’. We would do something - like this.</p> - - <pre> -typedef struct FT_FooBarRec_* FT_FooBar; - -typedef struct FT_FooBarRec_ -{ - /* the base 'foo' class fields */ - FT_FooRec root; - - /* fields proper to the 'foobar' class */ - ... -} FT_FooBarRec;</pre> - - <p>As you can see, we ensure that a ‘foobar’ - object is also a ‘foo’ object by placing - a <tt>FT_FooRec</tt> at the start of the - <tt>FT_FooBarRec</tt> definition. It is - called <b>root</b> by convention.</p> - - <p>Note that an <tt>FT_FooBar</tt> handle also points to - a ‘foo’ object and can be typecast - to <tt>FT_Foo</tt>. Similarly, when the library - returns an <tt>FT_Foo</tt> handle to client - applications, the object can be really implemented as - <tt>FT_FooBar</tt> or any derived class from - ‘foo’.</p> - </li> - </ol> - - <p>In the following sections of this chapter, we will refer - to ‘the <tt>FT_Foo</tt> class’ to indicate the - type of objects handled through <tt>FT_Foo</tt> pointers, - be they implemented as ‘foo’ or - ‘foobar’.</p> - - - <h3 id="section-2">2. The <tt>FT_Library</tt> class</h3> - - <p>This type corresponds to a handle to a single instance of - the library. Note that the corresponding - structure <tt>FT_LibraryRec</tt> is not defined in public - header files, making client applications unable to access - its internal fields.</p> - - <p>The library object is the <em>parent</em> of all other - objects in FreeType 2. You need to create a new - library instance before doing anything else with the - library. Similarly, destroying it will automatically - destroy all its children (i.e., faces and modules).</p> - - <p>Typical client applications should - call <a href="../reference/ft2-base_interface.html#ft_init_freetype"><code>FT_Init_FreeType</code></a> - in order to create a new library object, ready to be used - for further actions.</p> - - <p>Another alternative is to create a fresh new library - instance by calling the function - <a href="../reference/ft2-module_management.html#ft_new_library"><code>FT_New_Library</code></a>, - defined in the - <tt>ftmodule.h</tt> public header file. This function - will however return an ‘empty’ library - instance with no module registered in it. You can - ‘install’ modules in the instance by calling - <a href="../reference/ft2-module_management.html#ft_add_module"><code>FT_Add_Module</code></a> - manually.</p> - - <p>Calling <tt>FT_Init_FreeType</tt> is a lot more - convenient, because this function basically registers a - set of default modules into each new library instance. - The way this list is accessed or computed is determined at - build time, and depends on the content of - the <tt>ftinit</tt> component. This process is explained - in details later in this document.</p> - - <p>For now, one should consider that library objects are - created with <tt>FT_Init_FreeType</tt>, and destroyed - along with all children - with <a href="../reference/ft2-base_interface.html#ft_done_freetype"><code>FT_Done_FreeType</code></a>.</p> - - - <h3 id="section-3">3. The <tt>FT_Face</tt> class</h3> - - <p>A face object corresponds to a single <em>font face</em>, - i.e., a specific typeface with a specific style. For - example, ‘Arial’ and ‘Arial - Italic’ correspond to two distinct faces.</p> - - <p>A face object is normally created - through <a href="../reference/ft2-base_interface.html#ft_new_face"><code>FT_New_Face</code></a>. - This function takes the following parameters: - an <tt>FT_Library</tt> handle, a C file pathname used to - indicate which font file to open, an index used to decide - which face to load from the file (a single file may - contain several faces in certain cases), and the address - of an <tt>FT_Face</tt> handle. It returns an error - code.</p> - - <pre> -FT_Error FT_New_Face( FT_Library library, - const char* filepathname, - FT_Long face_index, - FT_Face* face );</pre> - - <p>In case of success, the function - returns <tt>FT_Err_Ok</tt> (which is value 0), and - the handle pointed to by the <tt>face</tt> parameter is - set to a non-NULL value.</p> - - <p>Note that the face object contains several fields used to - describe global font data that can be accessed directly by - client applications, for example, the total number of - glyphs in the face, the face's family name, style name, - the EM size for scalable formats, etc. For more details, - look at - the <a href="../reference/ft2-base_interface.html#ft_facerec"><code>FT_FaceRec</code></a> - definition in the FreeType 2 API Reference.</p> - - - <h3 id="section-4">4. The <tt>FT_Size</tt> class</h3> - - <p>Each <tt>FT_Face</tt> object has one or more - <tt>FT_Size</tt> objects. A <em>size object</em> stores - data specific to a given character width and height. Each - newly created face object has one size, which is directly - accessible as <tt>face->size</tt>.</p> - - <p>The contents of a size object can be changed by calling - <a href="../reference/ft2-base_interface.html#ft_request_size"><code>FT_Request_Size</code></a>, <a href="../reference/ft2-base_interface.html#ft_set_pixel_sizes"><code>FT_Set_Pixel_Sizes</code></a>, - or <a href="../reference/ft2-base_interface.html#ft_set_char_size"><code>FT_Set_Char_Size</code></a>.</p> - - <p>A new size object can be created - with <a href="../reference/ft2-sizes_management.html#ft_new_size"><code>FT_New_Size</code></a>, - and destroyed manually - with <a href="../reference/ft2-sizes_management.html#ft_done_size"><code>FT_Done_Size</code></a>. - Note that typical applications don't need to do this - normally: usually it is fully sufficient to use the - default size object provided with - each <tt>FT_Face</tt>.</p> - - <p>The public fields of <tt>FT_Size</tt> objects are defined - in a very small structure - named <a href="../reference/ft2-base_interface.html#ft_sizerec"><code>FT_SizeRec</code></a>. - However, it is important to understand that some font - drivers define their own derivatives of <tt>FT_Size</tt> - to store important internal data that is re-computed each - time the character size changes. Most of the time, these - are size-specific <em>font hints</em>.</p> - - <p>For example, the TrueType driver stores the scaled CVT - (Control Value Table) data that results from the execution - of the ‘prep’ program in a <tt>TT_Size</tt> - structure, while the Type 1 driver stores scaled - global metrics (like blue zones) in a <tt>T1_Size</tt> - object. Don't worry if you don't understand the current - paragraph; most of this stuff is highly font format - specific and doesn't need to be explained to client - developers :-)</p> - - - <h3 id="section-5">5. The <tt>FT_GlyphSlot</tt> class</h3> - - <p>The purpose of a <em>glyph slot</em> is to provide a - place where glyph images can be loaded one by one easily, - independently of the glyph image format (bitmap, vector - outline, or anything else).</p> - - <p>Ideally, once a glyph slot is created, any glyph image - can be loaded into it without additional memory - allocation. In practice, this is only possible with - certain formats like TrueType which explicitly provide - data to compute a slot's maximum size.</p> - - <p>Another reason for glyph slots is that they are also used - to hold format-specific hints for a given glyphs as well - as all other data necessary to correctly load the - glyph.</p> - - <p>The - base <a href="../reference/ft2-base_interface.html#ft_glyphslotrec"><code>FT_GlyphSlotRec</code></a> - structure only presents glyph metrics and images to client - applications, while the actual implementation may contain - more sophisticated data.</p> - - <p>As an example, the - TrueType-specific <tt>TT_GlyphSlotRec</tt> structure - contains additional fields to hold glyph-specific - bytecode, transient outlines used during the hinting - process, and a few other things. The - Type 1-specific <tt>T1_GlyphSlotRec</tt> structure - holds glyph hints during glyph loading, as well as - additional logic used to properly hint the glyphs when a - native Type 1 hinter is used.</p> - - <p>Each face object has a single glyph slot that is directly - accessible as <tt>face->glyph</tt>.</p> - - - <h3 id="section-6">6. The <tt>FT_CharMap</tt> class</h3> - - <p>The <tt>FT_CharMap</tt> type is a handle to character map - objects, or <em>charmaps</em>. A charmap is simply some - sort of table or dictionary to translate character codes - in a given encoding into glyph indices for the font.</p> - - <p>A single face may contain several charmaps. Each one of - them corresponds to a given character repertoire, like - Unicode, Apple Roman, Windows codepages, and other - encodings.</p> - - <p>Each <tt>FT_CharMap</tt> object contains a - ‘platform’ and an ‘encoding’ field - to precisely identify the character repertoire - corresponding to it.</p> - - <p>Each font format provides its own derivative of - <a href="../reference/ft2-base_interface.html#ft_charmaprec"><code>FT_CharMapRec</code></a> - and thus needs to implement these objects.</p> - - - <h3 id="section-7">7. Objects Relationship</h3> - - <p>The following diagram summarizes what we have just said - regarding the public objects managed by the library; it - also describes their relationship.</p> - - <center> - <img src="simple-model.png" - width="453" - height="378" - alt="Simple library model"> - </center> - - <p>Note that this picture will be updated at the end of the - next chapter, related to <em>internal objects</em>.</p> - </div> - - <!-- ************************************************** --> - - <div class="updated"> - <p>Last update: 13-Feb-2018</p> - </div> - </div> - </div> - - - <!-- ************************************************** --> - - <div class="col2"> - </div> - </div> -</div> - - -<!-- ************************************************** --> - -<div id="TOC"> - <ul> - <li class="funding"> - <form action="https://www.paypal.com/cgi-bin/webscr" - method="post" - target="_top"> - <input type="hidden" - name="cmd" - value="_s-xclick"> - <input type="hidden" - name="hosted_button_id" - value="SK827YKEALMT4"> - <input type="image" - src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" - name="submit" - alt="PayPal - The safer, easier way to pay online!"> - <img alt="" - border="0" - src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" - width="1" - height="1"> - </form> - </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> - <!-- 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" class="current">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">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> diff --git a/lib/freetype/docs/design/design-4.html b/lib/freetype/docs/design/design-4.html deleted file mode 100644 index b81fefed2..000000000 --- a/lib/freetype/docs/design/design-4.html +++ /dev/null @@ -1,406 +0,0 @@ -<!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 / III</title> -</head> - - -<body> - -<div id="top" - class="bar"> - <h1><a href="http://freetype.org/index.html">FreeType</a> - Design / III</h1> -</div> - - -<div id="wrapper"> - -<div class="colmask leftmenu"> - <div class="colright"> - <div class="col1wrap"> - <div class="col1"> - - - <!-- ************************************************** --> - - <div id="internal-objects"> - <h2>III. Internal Objects and Classes</h2> - - <p>Let us have a look now at the <em>internal</em> objects - that FreeType 2 uses, i.e., those not directly - available to client applications, and see how they fit - into the picture.</p> - - - <h3 id="section-1">1. Memory Management</h3> - - <p>Most memory management operations are performed through - three specific routines of the base - layer: <tt>FT_Alloc</tt>, <tt>FT_Realloc</tt>, - and <tt>FT_Free</tt>. Each one of these functions expects - a <tt>FT_Memory</tt> handle as its first parameter. Note, - however, that there exist more, similar variants for - specific purposes which we skip here for simplicity.</p> - - <p><tt>FT_Memory</tt> is a pointer to a simple object that - describes the current memory pool or manager. It contains - a small table of alloc, realloc, and free functions. A - memory manager is created at library initialization time - by <tt>FT_Init_FreeType</tt>, calling the (internal) - function <tt>FT_New_Memory</tt> provided by - the <tt>ftsystem</tt> component.</p> - - <p>By default, this manager uses the ANSI functions <tt>malloc</tt>, - <tt>realloc</tt>, and <tt>free</tt>. However, - as <tt>ftsystem</tt> is a replaceable part of the base - layer, a specific build of the library could provide a - different default memory manager.</p> - - <p>Even with a default build, client applications are still - able to provide their own memory manager by not calling - <tt>FT_Init_FreeType</tt> but follow these simple - steps.</p> - - <ol> - <li> - <p>Create a new <tt>FT_Memory</tt> object by hand. The - definition - of <a href="../reference/ft2-system_interface.html#ft_memoryrec"><code>FT_MemoryRec</code></a> - is located in the public header - file <tt>ftsystem.h</tt>.</p> - </li> - <li> - <p>Call <a href="../reference/ft2-module_management.html#ft_new_library"><code>FT_New_Library</code></a> - to create a new library instance using your custom - memory manager. This new library doesn't yet contain - any registered modules.</p> - </li> - <li> - <p>Register the set of default modules by calling the - function <a href="../reference/ft2-module_management.html#ft_add_default_modules"><code>FT_Add_Default_Modules</code></a> - provided by the <tt>ftinit</tt> component, or manually - register your drivers by repeatedly - calling <a href="../reference/ft2-module_management.html#ft_add_module"><code>FT_Add_Module</code></a>.</p> - </li> - </ol> - - - <h3 id="section-2">2. Input Streams</h3> - - <p>Font files are always read through <tt>FT_Stream</tt> - objects. The definition - of <a href="../reference/ft2-system_interface.html#ft_streamrec"><code>FT_StreamRec</code></a> - is located in the public header file <tt>ftsystem.h</tt>, - which allows client developers to provide their own - implementation of streams if they wish so.</p> - - <p>The - function <a href="../reference/ft2-base_interface.html#ft_new_face"><code>FT_New_Face</code></a> - always automatically creates a new stream object from the - C pathname given as its second argument. This is - achieved by calling the (internal) function - <tt>FT_Stream_Open</tt> provided by the <tt>ftsystem</tt> - component. As the latter is replaceable, the - implementation of streams may vary greatly between - platforms.</p> - - <p>As an example, the default implementation of streams is - located in the file <tt>src/base/ftsystem.c</tt> and uses - the ANSI functions <tt>fopen</tt>, <tt>fseek</tt>, - and <tt>fread</tt>. However, the Unix build of - FreeType 2 provides an alternative implementation - that uses memory-mapped files, when available on the host - platform, resulting in a significant access speed-up.</p> - - <p>FreeType distinguishes between memory-based and - disk-based streams. In the first case, all data is - directly accessed in memory (e.g., ROM-based, write-only - static data, and memory-mapped files), while in the - second, portions of the font files are read in chunks - called <em>frames</em>, and temporarily buffered similarly - through typical seek and read operations.</p> - - <p>The FreeType stream sub-system also implements extremely - efficient algorithms to very quickly load structures from - font files while ensuring complete safety in the case of a - ‘broken file’.</p> - - <p>The - function <a href="../reference/ft2-base_interface.html#ft_new_memory_face"><code>FT_New_Memory_Face</code></a> - can be used to directly create and open - an <tt>FT_Face</tt> object from data that is readily - available in memory (including ROM-based fonts).</p> - - <p>Finally, in the case where a custom input stream is - needed, client applications can use the - function <a href="../reference/ft2-base_interface.html#ft_open_face"><code>FT_Open_Face</code></a>, - which can accept custom input streams. This may be useful - in the case of compressed or remote font files, or even - embedded font files that need to be extracted from certain - documents.</p> - - <p>Note that each face owns a single stream, which is also - destroyed - by <a href="../reference/ft2-base_interface.html#ft_done_face"><code>FT_Done_Face</code></a>.</p> - - - <h3 id="section-3">3. Modules</h3> - - <p>A FreeType 2 module is itself a piece of code. - However, the library creates a single <tt>FT_Module</tt> - object for each module that is registered - when <tt>FT_Add_Module</tt> is called.</p> - - <p>The definition of <tt>FT_ModuleRec</tt> is not publicly - available to client applications. However, - each <em>module type</em> is described by a simple public - structure - named <a href="../reference/ft2-module_management.html#ft_module_class"><code>FT_Module_Class</code></a>, - defined in header file - <tt>ftmodule.h</tt>, and is described later in this - document.</p> - - <p>You need a pointer to an <tt>FT_Module_Class</tt> - structure when - calling <a href="../reference/ft2-module_management.html#ft_add_module"><code>FT_Add_Module</code></a>.</p> - - <pre> -FT_Error -FT_Add_Module( FT_Library library, - const FT_Module_Class* clazz );</pre> - - <p>This function does the following tasks.</p> - - <ul> - <li> - <p>Check whether the library already holds a module - object corresponding to the same module name as the - one found in <tt>FT_Module_Class</tt>.</p> - </li> - <li> - <p>If this is the case, compare the module version - number to see whether it is possible - to <em>upgrade</em> the module to a new version. If - the module class's version number is smaller than the - already installed one, return immediately. Similarly, - check that the version of FreeType 2 that is - running is correct compared to the one required by the - module.</p> - </li> - <li> - <p>Create a new <tt>FT_Module</tt> object, using data - and flags of the module class to determine its byte - size and how to properly initialize it.</p> - </li> - <li> - <p>If a module initializer is present in the module - class, call it to complete the module object's - initialization.</p> - </li> - <li> - <p>Add the new module to the library's list of - ‘registered’ modules. In case of an - upgrade, destroy the previous module object.</p> - </li> - </ul> - - <p>Note that this function doesn't return - an <tt>FT_Module</tt> handle, given that module objects - are completely internal to the library (and client - applications shouldn't normally mess with - them :-)</p> - - <p>Finally, it is important to understand that - FreeType 2 recognizes and manages several kinds of - modules. These will be explained later on in this - document.</p> - - <ul> - <li> - <p><em>Renderer</em> modules are used to convert native - glyph images to bitmaps or pixmaps. FreeType 2 - comes with two renderer modules by default: one to - generate monochrome bitmaps, the other to generate - anti-aliased pixmaps.</p> - </li> - <li> - <p><em>Font driver</em> modules are used to support one - or more font formats. Typically, each font driver - provides a specific implementation or derivative - of <tt>FT_Face</tt>, <tt>FT_Size</tt>, - <tt>FT_GlyphSlot</tt>, as well - as <tt>FT_CharMap</tt>.</p> - </li> - <li> - <p><em>Helper</em> modules are shared by several font - drivers. For example, the <tt>sfnt</tt> module parses - and manages tables found in SFNT-based font formats; - it is then used by both the TrueType font and CFF - drivers.</p> - </li> - <li> - <p>Finally, the <em>auto-hinter</em> module has a - specific place in the library's design, as its role is - to process vectorial glyph outlines, independently of - their native font format, to produce optimal results - at small pixel sizes.</p> - </li> - </ul> - - <p>Note that every <tt>FT_Face</tt> object is <em>owned</em> - by the corresponding font driver, depending on the - original font file's format. This means that all face - objects are destroyed when a module is removed or - unregistered from a library instance (typically by calling - the <a href="../reference/ft2-module_management.html#ft_remove_module"><code>FT_Remove_Module</code></a> - function). Because of this, you should always take care - that no <tt>FT_Face</tt> object is opened when you upgrade - or remove a module from a library, as this could cause - unexpected object deletion!</p> - - - <h3 id="section-4">4. Summary</h3> - - <p>Finally, the following picture illustrates what has been - said in this section, as well as the previous, by - presenting the complete object graph of FreeType 2's - base design.</p> - - <center> - <img src="library-model.png" - width="411" - height="405" - alt="Complete library model"> - </center> - </div> - - <!-- ************************************************** --> - - <div class="updated"> - <p>Last update: 13-Feb-2018</p> - </div> - </div> - </div> - - - <!-- ************************************************** --> - - <div class="col2"> - </div> - </div> -</div> - - -<!-- ************************************************** --> - -<div id="TOC"> - <ul> - <li class="funding"> - <form action="https://www.paypal.com/cgi-bin/webscr" - method="post" - target="_top"> - <input type="hidden" - name="cmd" - value="_s-xclick"> - <input type="hidden" - name="hosted_button_id" - value="SK827YKEALMT4"> - <input type="image" - src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" - name="submit" - alt="PayPal - The safer, easier way to pay online!"> - <img alt="" - border="0" - src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" - width="1" - height="1"> - </form> - </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> - <!-- 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" class="current">Internal Objects and Classes</a> - </li> - <li class="tertiary"> - <a href="design-5.html">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> diff --git a/lib/freetype/docs/design/design-5.html b/lib/freetype/docs/design/design-5.html deleted file mode 100644 index edc9de3ae..000000000 --- a/lib/freetype/docs/design/design-5.html +++ /dev/null @@ -1,548 +0,0 @@ -<!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 / 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 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 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 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é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 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 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 - ‘light’ 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 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 2 that is required to install this - module. The default value is 0x20000 for FreeType - version 2.x</p> - </td> - </tr> - <tr valign=top> - <td> - <p><tt>module_interface</tt></p> - </td> - <td> - <p>Most modules support one or more - ‘interfaces’, 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-Feb-2018</p> - </div> - </div> - </div> - - - <!-- ************************************************** --> - - <div class="col2"> - </div> - </div> -</div> - - -<!-- ************************************************** --> - -<div id="TOC"> - <ul> - <li class="funding"> - <form action="https://www.paypal.com/cgi-bin/webscr" - method="post" - target="_top"> - <input type="hidden" - name="cmd" - value="_s-xclick"> - <input type="hidden" - name="hosted_button_id" - value="SK827YKEALMT4"> - <input type="image" - src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" - name="submit" - alt="PayPal - The safer, easier way to pay online!"> - <img alt="" - border="0" - src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" - width="1" - height="1"> - </form> - </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> - <!-- 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> diff --git a/lib/freetype/docs/design/design-6.html b/lib/freetype/docs/design/design-6.html deleted file mode 100644 index cf7513ab7..000000000 --- a/lib/freetype/docs/design/design-6.html +++ /dev/null @@ -1,415 +0,0 @@ -<!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 / V</title> -</head> - - -<body> - -<div id="top" - class="bar"> - <h1><a href="http://freetype.org/index.html">FreeType</a> - Design / V</h1> -</div> - - -<div id="wrapper"> - -<div class="colmask leftmenu"> - <div class="colright"> - <div class="col1wrap"> - <div class="col1"> - - - <!-- ************************************************** --> - - <div id="module-classes"> - <h2>V. Interfaces and Services</h2> - - <p>We shall now go into detail about interfaces and services - in FreeType.</p> - - <p><em>Interfaces</em> in FreeType are analogous to those - found in object-oriented programming. They can be thought - of as internal public APIs, and are essentially tables of - function pointers.</p> - - <p>Interfaces only describe the form and functionality, but - the actual function body may be implemented elsewhere. - The module that is implementing the interface will then - pass the required function pointers to the table. This - gives modularity and easy extendability.</p> - - <p>There are two main kinds of interfaces: <em>module</em> - interfaces, and <em>services</em>.</p> - - <p>Module interfaces are defined for each module. For - example, every font driver provides its own set of - procedures for use in the base layer, which are registered - in an <tt>FT_Driver</tt>. This way, very different font - drivers can be used in the same way in the base layer.</p> - - <p>Services are cross-module interfaces. These provide - functionality needed in several font drivers. </p> - - <p>Services are created when code from one module needs to - be used in another. Rather than include files from - another module, a service is created instead. Now, the - other module just needs to include the header defining the - interface.</p> - - <p>Helper modules are an extreme example of this; all their - public functionality is made for use in other font drivers - and hence are in a single service.</p> - - - <h3>In-depth guide: Creating a service</h3> - - <p>This section will teach you how to write your own - service.</p> - - <ol> - <li> - <p>Make the service interface header.</p> - - <p>We will be calling our service demo for demonstration - purposes. First, create the header file, which goes - in <tt>include/freetype/internal/services</tt>, and - add the boilerplate.</p> - - <pre> -#include FT_INTERNAL_SERVICE_H -FT_BEGIN_HEADER -#define FT_SERVICE_ID_DEMO "demo" - -/* ... */ - -FT_END_HEADER</pre> - - <p>This line in particular is required to register the - new service later on.</p> - - <pre> -#define <em>service-id service-tag</em></pre> - - </li> - <li> - <p>We will have identified some functions that are - needed in another module. Extract the function - signatures of these and place them in the header.</p> - - <pre> -[typedef <em>return-type</em> - (*<em>type-name</em>)(<em>function-signature</em>);]+</pre> - - <p>Example:</p> - - <pre> -typedef FT_Error - (*SampleDoSomethingFunc)( int foo ); -typedef void - (*SampleDoAnotherFunc)( int foo, - float bar );</pre> - - </li> - <li> - <p>Define the service interface.</p> - - <p>Use the <tt>FT_DEFINE_SERVICE</tt> macro to do - this.</p> - - <pre> -FT_DEFINE_SERVICE( <em>service-name</em> ) -{ - [<em>type-name interface-entry</em>;]+ -}</pre> - - <p>Example:</p> - - <pre> -FT_DEFINE_SERVICE( Demo ) -{ - SampleDoSomethingFunc doSomething; - SampleDoAnotherFunc doAnother; -};</pre> - - <p>Here is the definition of the above macro - (in <tt>ftserv.h</tt>).</p> - - <pre> -#define FT_DEFINE_SERVICE( name ) \ - typedef struct FT_Service_ ## name ## Rec_ \ - FT_Service_ ## name ## Rec ; \ - typedef struct FT_Service_ ## name ## Rec_ \ - const * FT_Service_ ## name ; \ - struct FT_Service_ ## name ## Rec_</pre> - - <p>This defines a new struct - called <tt>FT_Service_DemoRec</tt>, along with a - handle type for the - struct, <tt>FT_Service_Demo</tt>.</p> - </li> - <li> - <p>Register (and/or implement) the functions for the - newly created interface.</p> - - <p>In the module implementing the interface, add a - definition like the following</p> - - <pre> -static const <em>service-record table-name</em> = -{ - <em>function-name</em> - [,<em>function-name2</em> [,...]] -}</pre> - - <p>which corresponds to the interface defined in - step 3. Example:</p> - - <pre> -static const FT_Service_DemoRec demo_service_rec = -{ - function1, - function2 -};</pre> - - <p>This initializes the function pointers table. In - this example, <tt>function1</tt> has the function - signature of <tt>SampleDoSomethingFunc</tt> and - implements the <tt>doSomething</tt> functionality, and - so on.</p> - </li> - <li> - <p>Register the new service.</p> - - <p>Next, add this code to define the service list in - this module, or append the new service to an existing - list.</p> - - <pre> -static const FT_ServiceDescRec <em>service-list-name</em>[] = -{ - { <em>service-id</em>, &<em>table-name</em> }, - [{ <em>service-id2</em>, &<em>table-name2</em> }, [...]] - { NULL, NULL } -}</pre> - - <p>Example:</p> - - <pre> -static const FT_ServiceDescRec demo_services[] = -{ - { FT_SERVICE_ID_DEMO, &demo_service_rec }, - { NULL, NULL } -};</pre> - - <p><em>service-id</em> is what we <tt>#define</tt>'d in - the service header file in step 1. Note that - the <tt>{NULL, NULL}</tt> sentinel value at the - end is required.</p> - - <p>Now we need a way for other modules to find this - service. First, we need to implement - the <tt>get_interface</tt> function in - <tt>FT_Module_Class</tt>. Here is a minimal example - that does not do any validation.</p> - - <pre> -FT_CALLBACK_DEF( FT_Module_Interface ) -<em>get-interface-name</em>( FT_Module module, - const char* module_interface ) -{ - return ft_service_list_lookup( <em>service-list-name</em>, - module_interface ); -}</pre> - - <p>Then, pass it into the <tt>FT_DEFINE_MODULE</tt> - macro for this module.</p> - - <pre> -(FT_Module_Requester) <em>get-interface-name</em></pre> - - <p>The last step is optional but recommended, which is - to register the new service header - in <tt>ftserv.h</tt>. - - <pre> -#define FT_SERVICE_DEMO_H <freetype/internal/services/svdemo.h></pre> - - </li> - <li> - <p>Use the new service.</p> - - <p>Now, in the file that wants to use the service, add - the following code to get the service.</p> - - <pre> -<em>service-record-handle</em> service; - - -FT_FACE_FIND_GLOBAL_SERVICE( face, - service, - <em>service-id-tail</em> );</pre> - - <p><tt>face</tt> should be of type <tt>FT_Face</tt>, - which is usually the current face instance being used - in the driver, and FreeType tries to find the service - in the driver of this face first, before searching all - other modules.</p> - - <p><em>service-id-tail</em> is the part - of <em>service-id</em> - following <tt>FT_SERVICE_ID_</tt>. - - <p>Now to call some function in the service.</p> - - <pre> -service-><em>interface-entry</em>( <em>params</em> );</pre> - - <p>Example:</p> - - <pre> -FT_Service_Demo demo; -FT_Error error; - - -FT_FACE_FIND_GLOBAL_SERVICE( face, demo, DEMO ); - -error = demo->doSomething(0); -</pre> - - </li> - </ol> - </div> - - <!-- ************************************************** --> - - <div class="updated"> - <p>Last update: 13-Feb-2018</p> - </div> - </div> - </div> - - - <!-- ************************************************** --> - - <div class="col2"> - </div> - </div> -</div> - - -<!-- ************************************************** --> - -<div id="TOC"> - <ul> - <li class="funding"> - <form action="https://www.paypal.com/cgi-bin/webscr" - method="post" - target="_top"> - <input type="hidden" - name="cmd" - value="_s-xclick"> - <input type="hidden" - name="hosted_button_id" - value="SK827YKEALMT4"> - <input type="image" - src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" - name="submit" - alt="PayPal - The safer, easier way to pay online!"> - <img alt="" - border="0" - src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" - width="1" - height="1"> - </form> - </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> - <!-- 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">Module Classes</a> - </li> - <li class="tertiary"> - <a href="design-6.html" class="current">Interfaces and - Services</a> - </li> - </ul> -</div> - -</div> <!-- id="wrapper" --> - -<div id="TOC-bottom"> -</div> - -</body> -</html> diff --git a/lib/freetype/docs/design/detailed-design.png b/lib/freetype/docs/design/detailed-design.png Binary files differdeleted file mode 100644 index 1f475db1f..000000000 --- a/lib/freetype/docs/design/detailed-design.png +++ /dev/null diff --git a/lib/freetype/docs/design/index.html b/lib/freetype/docs/design/index.html deleted file mode 100644 index 4fe800f3c..000000000 --- a/lib/freetype/docs/design/index.html +++ /dev/null @@ -1,239 +0,0 @@ -<!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</title> -</head> - - -<body> - -<div id="top" - class="bar"> - <h1><a href="http://freetype.org/index.html">FreeType</a> Design</h1> -</div> - - -<div id="wrapper"> - -<div class="colmask leftmenu"> - <div class="colright"> - <div class="col1wrap"> - <div class="col1"> - - - <!-- ************************************************** --> - - <div id="introduction"> - <p>This document gives an overview of some FreeType 2 - internals. Read this carefully if you want to understand - the innards of the library in order to hack or extend - it.</p> - - <p>Note that many, quite important details are still - missing, which are hopefully addressed in the not too - distant future. Volunteers to help with this task are - highly welcomed!</p> - </div> - - <!-- ************************************************** --> - - <div id="contents"> - <h3><a href="design-1.html">Introduction</a></h3> - - <h3><a href="design-2.html">I. Components and APIs</a></h3> - - <h3><a href="design-3.html">II. Public Objects and - Classes</a></h3> - <ul> - <li> - <a href="design-3.html#section-1">1. Object Orientation - in FreeType 2</a> - </li> - <li> - <a href="design-3.html#section-2">2. The <tt>FT_Library</tt> - class</a> - </li> - <li> - <a href="design-3.html#section-3">3. The <tt>FT_Face</tt> - class</a> - </li> - <li> - <a href="design-3.html#section-4">4. The <tt>FT_Size</tt> - class</a> - </li> - <li> - <a href="design-3.html#section-5">5. The <tt>FT_GlyphSlot</tt> - class</a> - </li> - <li> - <a href="design-3.html#section-6">6. The <tt>FT_CharMap</tt> - class</a> - </li> - <li> - <a href="design-3.html#section-7">7. Objects - Relationship</a> - </li> - </ul> - - <h3><a href="design-4.html">III. Internal Objects and - Classes</a></h3> - <ul> - <li> - <a href="design-4.html#section-1">1. Memory Management</a> - </li> - <li> - <a href="design-4.html#section-2">2. Input Streams</a> - </li> - <li> - <a href="design-4.html#section-3">3. Modules</a> - </li> - <li> - <a href="design-4.html#section-4">4. Summary</a> - </li> - </ul> - - <h3><a href="design-5.html">IV. Module Classes</a></h3> - <ul> - <li> - <a href="design-5.html#section-1">1. The <tt>FT_Module_Class</tt> - Structure</a> - </li> - <li> - <a href="design-5.html#section-2">2. The <tt>FT_Module</tt> - Type</a> - </li> - </ul> - - <h3><a href="design-6.html">V. Interfaces and - Services</a></h3> - </div> - - <!-- ************************************************** --> - - <div class="updated"> - <p>Last update: 13-Feb-2018</p> - </div> - </div> - </div> - - - <!-- ************************************************** --> - - <div class="col2"> - </div> - </div> -</div> - - -<!-- ************************************************** --> - -<div id="TOC"> - <ul> - <li class="funding"> - <form action="https://www.paypal.com/cgi-bin/webscr" - method="post" - target="_top"> - <input type="hidden" - name="cmd" - value="_s-xclick"> - <input type="hidden" - name="hosted_button_id" - value="SK827YKEALMT4"> - <input type="image" - src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" - name="submit" - alt="PayPal - The safer, easier way to pay online!"> - <img alt="" - border="0" - src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" - width="1" - height="1"> - </form> - </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> - <!-- separate primary from secondary entries --> - </li> - - <li class="secondary"> - <a href="index.html" class="current">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">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> diff --git a/lib/freetype/docs/design/library-model.png b/lib/freetype/docs/design/library-model.png Binary files differdeleted file mode 100644 index 27117884b..000000000 --- a/lib/freetype/docs/design/library-model.png +++ /dev/null diff --git a/lib/freetype/docs/design/simple-model.png b/lib/freetype/docs/design/simple-model.png Binary files differdeleted file mode 100644 index 500ad30c5..000000000 --- a/lib/freetype/docs/design/simple-model.png +++ /dev/null |