| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 2 |
"http://www.w3.org/TR/html4/loose.dtd"> |
| 3 |
|
| 4 |
<html lang="en"> |
| 5 |
|
| 6 |
<head> |
| 7 |
<meta http-equiv="Content-Type" |
| 8 |
content="text/html; charset=utf-8"> |
| 9 |
<meta http-equiv="Content-Style-Type" |
| 10 |
content="text/css"> |
| 11 |
<meta http-equiv="Content-Script-Type" |
| 12 |
content="text/javascript"> |
| 13 |
<meta name="description" |
| 14 |
content="FreeType Documentation - Glyph Conventions - Basic |
| 15 |
Typographic Concepts"> |
| 16 |
<meta name="Author" |
| 17 |
content="David Turner"> |
| 18 |
|
| 19 |
<link rel="icon" |
| 20 |
href="../image/favicon_-90.ico"> |
| 21 |
<link rel="shortcut icon" |
| 22 |
href="../image/favicon_-90.ico"> |
| 23 |
<link rel="stylesheet" |
| 24 |
type="text/css" |
| 25 |
href="../css/freetype2_-90.css"> |
| 26 |
|
| 27 |
<script type="text/javascript" |
| 28 |
src="../../../js/freetype2.js"> |
| 29 |
</script> |
| 30 |
|
| 31 |
<title>FreeType Glyph Conventions | Basic Typographic Concepts</title> |
| 32 |
</head> |
| 33 |
|
| 34 |
|
| 35 |
<body> |
| 36 |
|
| 37 |
<div id="top" |
| 38 |
class="bar"> |
| 39 |
<h1><a href="http://freetype.org/index.html">FreeType</a> Glyph |
| 40 |
Conventions / I</h1> |
| 41 |
</div> |
| 42 |
|
| 43 |
|
| 44 |
<div id="wrapper"> |
| 45 |
|
| 46 |
<div class="colmask leftmenu"> |
| 47 |
<div class="colright"> |
| 48 |
<div class="col1wrap"> |
| 49 |
<div class="col1"> |
| 50 |
|
| 51 |
|
| 52 |
<!-- ************************************************** --> |
| 53 |
|
| 54 |
<div id="basic-typographic-concepts"> |
| 55 |
<h2>I. Basic Typographic Concepts</h2> |
| 56 |
|
| 57 |
<h3 id="section-1">1. Font files, format and |
| 58 |
information</h3> |
| 59 |
|
| 60 |
<p>A <em>font</em> is a collection of various character |
| 61 |
images that can be used to display or print text. The |
| 62 |
images in a single font share some common properties, |
| 63 |
including look, style, serifs, etc. Typographically |
| 64 |
speaking, one has to distinguish between a <em>font |
| 65 |
family</em> and its multiple <em>font faces</em>, which |
| 66 |
usually differ in style though coming from the same |
| 67 |
template.</p> |
| 68 |
|
| 69 |
<p>For example, ‘Palatino Regular’ and |
| 70 |
‘Palatino Italic’ are two distinct |
| 71 |
<em>faces</em> from the same <em>family</em>, called |
| 72 |
‘Palatino’ itself.</p> |
| 73 |
|
| 74 |
<p>The single term ‘font’ is nearly always used |
| 75 |
in ambiguous ways to refer to either a given family or |
| 76 |
given face, depending on the context. For example, most |
| 77 |
users of word-processors use ‘font’ to |
| 78 |
describe a font family (e.g., ‘Courier’, |
| 79 |
‘Palatino’, etc.); however, most of these |
| 80 |
families are implemented through several data files |
| 81 |
depending on the file format: For TrueType, this is |
| 82 |
usually one per face (i.e. <tt>arial.ttf</tt> for |
| 83 |
‘Arial Regular’, <tt>ariali.ttf</tt> for |
| 84 |
‘Arial Italic’, etc.). The file is also |
| 85 |
called a ‘font’ but really contains a font |
| 86 |
face.</p> |
| 87 |
|
| 88 |
<p>A <em>digital font</em> is thus a data file that may |
| 89 |
contain <em>one or more font faces</em>. For each of |
| 90 |
these, it contains character images, character metrics, as |
| 91 |
well as other kind of information important to the layout |
| 92 |
of text and the processing of specific character |
| 93 |
encodings. In some formats, like Adobe's Type 1, a |
| 94 |
single font face is described through several files (i.e., |
| 95 |
one contains the character images, another one the |
| 96 |
character metrics). We will ignore this implementation |
| 97 |
issue in most parts of this document and consider digital |
| 98 |
fonts as single files, though FreeType 2 is able to |
| 99 |
support multiple-files fonts correctly.</p> |
| 100 |
|
| 101 |
<p>As a convenience, a font file containing more than one |
| 102 |
face is called a <em>font collection</em>. This case is |
| 103 |
rather rare but can be seen in many Asian fonts, which |
| 104 |
contain images for two or more representation forms of a |
| 105 |
given script (usually for horizontal and vertical |
| 106 |
layout).</p> |
| 107 |
|
| 108 |
|
| 109 |
<h3 id="section-2">2. Character images and |
| 110 |
mappings</h3> |
| 111 |
|
| 112 |
<p>The character images are called <em>glyphs</em>. A |
| 113 |
single character can have several distinct images, i.e., |
| 114 |
several glyphs, depending on script, usage or context. |
| 115 |
Several characters can also take a single glyph (good |
| 116 |
examples are Roman ligatures like ‘fi’ and |
| 117 |
‘fl’ which can be represented by a single |
| 118 |
glyph). The relationship between characters and glyphs |
| 119 |
can be very complex but won't be discussed in this |
| 120 |
document. Moreover, some formats use more or less |
| 121 |
complicated schemes to store and access glyphs. For the |
| 122 |
sake of clarity, we only retain the following notions when |
| 123 |
working with FreeType:</p> |
| 124 |
|
| 125 |
<ul> |
| 126 |
<li> |
| 127 |
<p>A font file contains a set of glyphs; each one can be |
| 128 |
stored as a bitmap, a vector representation, or any |
| 129 |
other scheme (most scalable formats use a combination |
| 130 |
of mathematical representation and control |
| 131 |
data/programs). These glyphs can be stored in any |
| 132 |
order in the font file, and are typically accessed |
| 133 |
through a simple glyph index.</p> |
| 134 |
</li> |
| 135 |
<li> |
| 136 |
<p>The font file contains one or more tables, called |
| 137 |
<em>character maps</em> (also called |
| 138 |
‘charmaps’ or ‘cmaps’ for |
| 139 |
short), which are used to convert character codes for |
| 140 |
a given encoding (e.g., ASCII, Unicode, Big5, ShiftJIS, |
| 141 |
etc.) into glyph indices relative to the font file. A |
| 142 |
single font face may contain several charmaps. For |
| 143 |
example, many OpenType fonts contain an Apple-specific |
| 144 |
charmap as well as a Unicode charmap, which makes them |
| 145 |
usable on both Mac and Windows platforms.</p> |
| 146 |
</li> |
| 147 |
</ul> |
| 148 |
|
| 149 |
|
| 150 |
<h3 id="section-3">3. Character and font metrics</h3> |
| 151 |
|
| 152 |
<p>Each glyph image is associated with various metrics which |
| 153 |
describe how to place and manage it when rendering text; |
| 154 |
see <a href="glyphs-3.html">section III</a> for more. |
| 155 |
Metrics relate to glyph placement, cursor advances, as |
| 156 |
well as text layout. They are extremely important to |
| 157 |
compute the flow of text when rendering a string of |
| 158 |
text.</p> |
| 159 |
|
| 160 |
<p>Each scalable format also contains some global metrics, |
| 161 |
expressed in notional (i.e. font) units, to describe some |
| 162 |
properties of all glyphs in the same face. Examples for |
| 163 |
global metrics are the maximum glyph bounding box, the |
| 164 |
ascender, descender, and text height of the font.</p> |
| 165 |
|
| 166 |
<p>Non-scalable formats contain metrics also. However, they |
| 167 |
only apply to a set of given character dimensions and |
| 168 |
resolutions, and are usually expressed in pixels then.</p> |
| 169 |
</div> |
| 170 |
|
| 171 |
<!-- ************************************************** --> |
| 172 |
|
| 173 |
<div class="updated"> |
| 174 |
<p>Last update: 23-Oct-2022</p> |
| 175 |
</div> |
| 176 |
</div> |
| 177 |
</div> |
| 178 |
|
| 179 |
|
| 180 |
<!-- ************************************************** --> |
| 181 |
|
| 182 |
<div class="col2"> |
| 183 |
</div> |
| 184 |
</div> |
| 185 |
</div> |
| 186 |
|
| 187 |
|
| 188 |
<!-- ************************************************** --> |
| 189 |
|
| 190 |
<div id="TOC"> |
| 191 |
<ul> |
| 192 |
<li class="funding"> |
| 193 |
<form action="https://www.paypal.com/cgi-bin/webscr" |
| 194 |
method="post" |
| 195 |
target="_top"> |
| 196 |
<input type="hidden" |
| 197 |
name="cmd" |
| 198 |
value="_s-xclick"> |
| 199 |
<input type="hidden" |
| 200 |
name="hosted_button_id" |
| 201 |
value="SK827YKEALMT4"> |
| 202 |
<input type="image" |
| 203 |
src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" |
| 204 |
name="submit" |
| 205 |
alt="PayPal - The safer, easier way to pay online!"> |
| 206 |
</form> |
| 207 |
</li> |
| 208 |
<li class="primary"> |
| 209 |
<a href="http://freetype.org/index.html">Home</a> |
| 210 |
</li> |
| 211 |
<li class="primary"> |
| 212 |
<a href="http://freetype.org/index.html#news">News</a> |
| 213 |
</li> |
| 214 |
<li class="primary"> |
| 215 |
<a href="../index.html">Overview</a> |
| 216 |
</li> |
| 217 |
<li class="primary"> |
| 218 |
<a href="../documentation.html">Documentation</a> |
| 219 |
</li> |
| 220 |
<li class="primary"> |
| 221 |
<a href="http://freetype.org/developer.html">Development</a> |
| 222 |
</li> |
| 223 |
<li class="primary"> |
| 224 |
<a href="http://freetype.org/contact.html" |
| 225 |
class="emphasis">Contact</a> |
| 226 |
</li> |
| 227 |
|
| 228 |
<li> |
| 229 |
<!-- separate primary from secondary entries --> |
| 230 |
</li> |
| 231 |
|
| 232 |
<li class="secondary"> |
| 233 |
<a href="index.html">FreeType Glyph Conventions</a> |
| 234 |
</li> |
| 235 |
<li class="tertiary"> |
| 236 |
<a href="glyphs-1.html" class="current">Basic Typographic Concepts</a> |
| 237 |
</li> |
| 238 |
<li class="tertiary"> |
| 239 |
<a href="glyphs-2.html">Glyph Outlines</a> |
| 240 |
</li> |
| 241 |
<li class="tertiary"> |
| 242 |
<a href="glyphs-3.html">Glyph Metrics</a> |
| 243 |
</li> |
| 244 |
<li class="tertiary"> |
| 245 |
<a href="glyphs-4.html">Kerning</a> |
| 246 |
</li> |
| 247 |
<li class="tertiary"> |
| 248 |
<a href="glyphs-5.html">Text Processing</a> |
| 249 |
</li> |
| 250 |
<li class="tertiary"> |
| 251 |
<a href="glyphs-6.html">FreeType Outlines</a> |
| 252 |
</li> |
| 253 |
<li class="tertiary"> |
| 254 |
<a href="glyphs-7.html">FreeType Bitmaps</a> |
| 255 |
</li> |
| 256 |
</ul> |
| 257 |
</div> |
| 258 |
|
| 259 |
</div> <!-- id="wrapper" --> |
| 260 |
|
| 261 |
<div id="TOC-bottom"> |
| 262 |
</div> |
| 263 |
|
| 264 |
</body> |
| 265 |
</html> |