Rev 1882 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1882 | Rev 4744 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /******************************************************************* |
1 | /***************************************************************************/ |
2 | * |
- | |
- | 2 | /* */ |
|
3 | * freetype.h |
3 | /* freetype.h */ |
4 | * |
- | |
- | 4 | /* */ |
|
5 | * High-level interface specification. |
5 | /* FreeType high-level API and common types (specification only). */ |
6 | * |
- | |
- | 6 | /* */ |
|
7 | * Copyright 1996-1999 by |
7 | /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ |
- | 8 | /* 2010 by */ |
|
8 | * David Turner, Robert Wilhelm, and Werner Lemberg. |
9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
9 | * |
- | |
- | 10 | /* */ |
|
10 | * This file is part of the FreeType project and may only be used, |
11 | /* This file is part of the FreeType project, and may only be used, */ |
11 | * modified, and distributed under the terms of the FreeType project |
12 | /* modified, and distributed under the terms of the FreeType project */ |
12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute |
13 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
13 | * this file you indicate that you have read the license and |
14 | /* this file you indicate that you have read the license and */ |
14 | * understand and accept it fully. |
15 | /* understand and accept it fully. */ |
15 | * |
- | |
16 | * Note: |
- | |
17 | * |
- | |
18 | * This is the only file that should be included by client |
- | |
19 | * application sources. All other types and functions defined |
- | |
20 | * in the `tt*.h' files are library internals and should not be |
16 | /* */ |
21 | * included. |
- | |
22 | * |
- | |
23 | ******************************************************************/ |
17 | /***************************************************************************/ |
24 | - | ||
25 | #ifndef FREETYPE_H |
- | |
26 | #define FREETYPE_H |
- | |
27 | 18 | ||
28 | 19 | ||
29 | #define TT_FREETYPE_MAJOR 1 |
- | |
30 | #define TT_FREETYPE_MINOR 3 |
20 | #ifndef FT_FREETYPE_H |
31 | - | ||
32 | - | ||
33 | #include "fterrid.h" |
- | |
34 | #include "ftnameid.h" |
- | |
35 | - | ||
36 | /* To make freetype.h independent from configuration files we check */ |
21 | #error "`ft2build.h' hasn't been included yet!" |
37 | /* whether EXPORT_DEF has been defined already. */ |
22 | #error "Please always use macros to include FreeType header files." |
38 | - | ||
39 | #ifndef EXPORT_DEF |
23 | #error "Example:" |
40 | #define EXPORT_DEF extern |
24 | #error " #include |
41 | #endif |
- | |
42 | - | ||
43 | /* The same for TT_Text. If you define the HAVE_TT_TEXT macro, you */ |
- | |
44 | /* have to provide a typedef declaration for TT_Text before */ |
- | |
45 | /* including this file. */ |
- | |
46 | - | ||
47 | #ifndef HAVE_TT_TEXT |
- | |
48 | #define HAVE_TT_TEXT |
25 | #error " #include FT_FREETYPE_H" |
49 | typedef char TT_Text; /* The data type to represent */ |
- | |
50 | /* file name string elements. */ |
- | |
51 | #endif |
- | |
52 | - | ||
53 | #ifdef __cplusplus |
- | |
54 | extern "C" { |
- | |
55 | #endif |
26 | #endif |
Line 56... | Line -... | ||
56 | - | ||
57 | - | ||
58 | /*******************************************************************/ |
- | |
59 | /* */ |
- | |
60 | /* FreeType types definitions. */ |
- | |
61 | /* */ |
- | |
62 | /* All these begin with a 'TT_' prefix. */ |
- | |
63 | /* */ |
- | |
64 | /*******************************************************************/ |
- | |
65 | - | ||
66 | typedef int TT_Bool; |
- | |
67 | - | ||
68 | typedef signed long TT_Fixed; /* signed fixed 16.16 float */ |
- | |
69 | - | ||
70 | typedef signed short TT_FWord; /* distance in FUnits */ |
- | |
71 | typedef unsigned short TT_UFWord; /* unsigned distance */ |
- | |
72 | - | ||
73 | typedef char TT_String; |
- | |
74 | typedef signed char TT_Char; |
- | |
75 | typedef unsigned char TT_Byte; |
- | |
76 | typedef signed short TT_Short; |
27 | |
77 | typedef unsigned short TT_UShort; |
28 | |
78 | typedef int TT_Int; |
- | |
79 | typedef unsigned int TT_UInt; |
- | |
80 | typedef signed long TT_Long; |
- | |
81 | typedef unsigned long TT_ULong; |
- | |
82 | - | ||
83 | typedef signed short TT_F2Dot14; /* Signed fixed float 2.14 used for */ |
- | |
84 | /* unit vectors, with layout */ |
- | |
85 | /* */ |
- | |
86 | /* s : 1 -- sign bit */ |
- | |
87 | /* m : 1 -- integer bit */ |
- | |
88 | /* f : 14 -- unsigned fractional */ |
- | |
89 | /* */ |
- | |
90 | /* `s:m' is the 2-bit signed int */ |
- | |
91 | /* value to which the positive */ |
- | |
92 | /* fractional part should be added. */ |
- | |
93 | - | ||
94 | typedef signed long TT_F26Dot6; /* 26.6 fixed float, used for */ |
- | |
95 | /* glyph points pixel coordinates. */ |
- | |
96 | - | ||
97 | typedef signed long TT_Pos; /* Point position, expressed either */ |
- | |
98 | /* in fractional pixels or notional */ |
- | |
99 | /* units, depending on context. */ |
- | |
100 | /* For example, glyph coordinates */ |
- | |
101 | /* returned by TT_Load_Glyph() are */ |
- | |
102 | /* expressed in font units if */ |
- | |
103 | /* scaling wasn't requested, and */ |
- | |
Line -... | Line 29... | ||
- | 29 | #ifndef __FREETYPE_H__ |
|
- | 30 | #define __FREETYPE_H__ |
|
- | 31 | ||
- | 32 | ||
- | 33 | #include |
|
- | 34 | #include FT_CONFIG_CONFIG_H |
|
- | 35 | #include FT_ERRORS_H |
|
- | 36 | #include FT_TYPES_H |
|
- | 37 | ||
- | 38 | ||
- | 39 | FT_BEGIN_HEADER |
|
- | 40 | ||
- | 41 | ||
- | 42 | ||
- | 43 | /*************************************************************************/ |
|
- | 44 | /* */ |
|
- | 45 | /* |
|
- | 46 | /* user_allocation */ |
|
- | 47 | /* */ |
|
- | 48 | /* |
|
- | 49 | /* User allocation */ |
|
- | 50 | /* */ |
|
- | 51 | /* |
|
- | 52 | /* How client applications should allocate FreeType data structures. */ |
|
- | 53 | /* */ |
|
- | 54 | /* |
|
- | 55 | /* FreeType assumes that structures allocated by the user and passed */ |
|
- | 56 | /* as arguments are zeroed out except for the actual data. In other */ |
|
- | 57 | /* words, it is recommended to use `calloc' (or variants of it) */ |
|
- | 58 | /* instead of `malloc' for allocation. */ |
|
- | 59 | /* */ |
|
- | 60 | /*************************************************************************/ |
|
- | 61 | ||
- | 62 | ||
- | 63 | ||
- | 64 | /*************************************************************************/ |
|
- | 65 | /*************************************************************************/ |
|
- | 66 | /* */ |
|
- | 67 | /* B A S I C T Y P E S */ |
|
- | 68 | /* */ |
|
- | 69 | /*************************************************************************/ |
|
- | 70 | /*************************************************************************/ |
|
- | 71 | ||
- | 72 | ||
- | 73 | /*************************************************************************/ |
|
- | 74 | /* */ |
|
- | 75 | /* |
|
- | 76 | /* base_interface */ |
|
- | 77 | /* */ |
|
- | 78 | /* |
|
- | 79 | /* Base Interface */ |
|
- | 80 | /* */ |
|
- | 81 | /* |
|
- | 82 | /* The FreeType~2 base font interface. */ |
|
- | 83 | /* */ |
|
- | 84 | /* |
|
- | 85 | /* This section describes the public high-level API of FreeType~2. */ |
|
- | 86 | /* */ |
|
- | 87 | /* |
|
- | 88 | /* FT_Library */ |
|
- | 89 | /* FT_Face */ |
|
- | 90 | /* FT_Size */ |
|
- | 91 | /* FT_GlyphSlot */ |
|
- | 92 | /* FT_CharMap */ |
|
- | 93 | /* FT_Encoding */ |
|
- | 94 | /* */ |
|
- | 95 | /* FT_FaceRec */ |
|
- | 96 | /* */ |
|
- | 97 | /* FT_FACE_FLAG_SCALABLE */ |
|
- | 98 | /* FT_FACE_FLAG_FIXED_SIZES */ |
|
- | 99 | /* FT_FACE_FLAG_FIXED_WIDTH */ |
|
- | 100 | /* FT_FACE_FLAG_HORIZONTAL */ |
|
- | 101 | /* FT_FACE_FLAG_VERTICAL */ |
|
- | 102 | /* FT_FACE_FLAG_SFNT */ |
|
- | 103 | /* FT_FACE_FLAG_KERNING */ |
|
- | 104 | /* FT_FACE_FLAG_MULTIPLE_MASTERS */ |
|
- | 105 | /* FT_FACE_FLAG_GLYPH_NAMES */ |
|
- | 106 | /* FT_FACE_FLAG_EXTERNAL_STREAM */ |
|
- | 107 | /* FT_FACE_FLAG_FAST_GLYPHS */ |
|
- | 108 | /* FT_FACE_FLAG_HINTER */ |
|
- | 109 | /* */ |
|
- | 110 | /* FT_STYLE_FLAG_BOLD */ |
|
- | 111 | /* FT_STYLE_FLAG_ITALIC */ |
|
- | 112 | /* */ |
|
- | 113 | /* FT_SizeRec */ |
|
- | 114 | /* FT_Size_Metrics */ |
|
- | 115 | /* */ |
|
- | 116 | /* FT_GlyphSlotRec */ |
|
- | 117 | /* FT_Glyph_Metrics */ |
|
- | 118 | /* FT_SubGlyph */ |
|
- | 119 | /* */ |
|
- | 120 | /* FT_Bitmap_Size */ |
|
- | 121 | /* */ |
|
- | 122 | /* FT_Init_FreeType */ |
|
- | 123 | /* FT_Done_FreeType */ |
|
- | 124 | /* */ |
|
- | 125 | /* FT_New_Face */ |
|
- | 126 | /* FT_Done_Face */ |
|
- | 127 | /* FT_New_Memory_Face */ |
|
- | 128 | /* FT_Open_Face */ |
|
- | 129 | /* FT_Open_Args */ |
|
- | 130 | /* FT_Parameter */ |
|
- | 131 | /* FT_Attach_File */ |
|
- | 132 | /* FT_Attach_Stream */ |
|
- | 133 | /* */ |
|
- | 134 | /* FT_Set_Char_Size */ |
|
- | 135 | /* FT_Set_Pixel_Sizes */ |
|
- | 136 | /* FT_Request_Size */ |
|
- | 137 | /* FT_Select_Size */ |
|
- | 138 | /* FT_Size_Request_Type */ |
|
- | 139 | /* FT_Size_Request */ |
|
- | 140 | /* FT_Set_Transform */ |
|
- | 141 | /* FT_Load_Glyph */ |
|
- | 142 | /* FT_Get_Char_Index */ |
|
- | 143 | /* FT_Get_Name_Index */ |
|
- | 144 | /* FT_Load_Char */ |
|
- | 145 | /* */ |
|
- | 146 | /* FT_OPEN_MEMORY */ |
|
- | 147 | /* FT_OPEN_STREAM */ |
|
- | 148 | /* FT_OPEN_PATHNAME */ |
|
- | 149 | /* FT_OPEN_DRIVER */ |
|
- | 150 | /* FT_OPEN_PARAMS */ |
|
- | 151 | /* */ |
|
- | 152 | /* FT_LOAD_DEFAULT */ |
|
- | 153 | /* FT_LOAD_RENDER */ |
|
- | 154 | /* FT_LOAD_MONOCHROME */ |
|
- | 155 | /* FT_LOAD_LINEAR_DESIGN */ |
|
- | 156 | /* FT_LOAD_NO_SCALE */ |
|
- | 157 | /* FT_LOAD_NO_HINTING */ |
|
- | 158 | /* FT_LOAD_NO_BITMAP */ |
|
- | 159 | /* FT_LOAD_CROP_BITMAP */ |
|
- | 160 | /* */ |
|
- | 161 | /* FT_LOAD_VERTICAL_LAYOUT */ |
|
- | 162 | /* FT_LOAD_IGNORE_TRANSFORM */ |
|
- | 163 | /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */ |
|
- | 164 | /* FT_LOAD_FORCE_AUTOHINT */ |
|
- | 165 | /* FT_LOAD_NO_RECURSE */ |
|
- | 166 | /* FT_LOAD_PEDANTIC */ |
|
- | 167 | /* */ |
|
- | 168 | /* FT_LOAD_TARGET_NORMAL */ |
|
- | 169 | /* FT_LOAD_TARGET_LIGHT */ |
|
- | 170 | /* FT_LOAD_TARGET_MONO */ |
|
- | 171 | /* FT_LOAD_TARGET_LCD */ |
|
- | 172 | /* FT_LOAD_TARGET_LCD_V */ |
|
- | 173 | /* */ |
|
- | 174 | /* FT_Render_Glyph */ |
|
- | 175 | /* FT_Render_Mode */ |
|
- | 176 | /* FT_Get_Kerning */ |
|
- | 177 | /* FT_Kerning_Mode */ |
|
- | 178 | /* FT_Get_Track_Kerning */ |
|
- | 179 | /* FT_Get_Glyph_Name */ |
|
- | 180 | /* FT_Get_Postscript_Name */ |
|
- | 181 | /* */ |
|
- | 182 | /* FT_CharMapRec */ |
|
- | 183 | /* FT_Select_Charmap */ |
|
- | 184 | /* FT_Set_Charmap */ |
|
- | 185 | /* FT_Get_Charmap_Index */ |
|
- | 186 | /* */ |
|
- | 187 | /* FT_FSTYPE_INSTALLABLE_EMBEDDING */ |
|
- | 188 | /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */ |
|
- | 189 | /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */ |
|
- | 190 | /* FT_FSTYPE_EDITABLE_EMBEDDING */ |
|
- | 191 | /* FT_FSTYPE_NO_SUBSETTING */ |
|
- | 192 | /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */ |
|
- | 193 | /* */ |
|
- | 194 | /* FT_Get_FSType_Flags */ |
|
- | 195 | /* */ |
|
- | 196 | /*************************************************************************/ |
|
- | 197 | ||
- | 198 | ||
- | 199 | /*************************************************************************/ |
|
- | 200 | /* */ |
|
104 | /* in 26.6 fractional pixels if it */ |
201 | /* |
- | 202 | /* FT_Glyph_Metrics */ |
|
- | 203 | /* */ |
|
- | 204 | /* |
|
- | 205 | /* A structure used to model the metrics of a single glyph. The */ |
|
- | 206 | /* values are expressed in 26.6 fractional pixel format; if the flag */ |
|
- | 207 | /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */ |
|
- | 208 | /* are expressed in font units instead. */ |
|
- | 209 | /* */ |
|
- | 210 | /* |
|
- | 211 | /* width :: */ |
|
- | 212 | /* The glyph's width. */ |
|
- | 213 | /* */ |
|
- | 214 | /* height :: */ |
|
- | 215 | /* The glyph's height. */ |
|
- | 216 | /* */ |
|
- | 217 | /* horiBearingX :: */ |
|
- | 218 | /* Left side bearing for horizontal layout. */ |
|
- | 219 | /* */ |
|
- | 220 | /* horiBearingY :: */ |
|
- | 221 | /* Top side bearing for horizontal layout. */ |
|
- | 222 | /* */ |
|
- | 223 | /* horiAdvance :: */ |
|
- | 224 | /* Advance width for horizontal layout. */ |
|
- | 225 | /* */ |
|
- | 226 | /* vertBearingX :: */ |
|
- | 227 | /* Left side bearing for vertical layout. */ |
|
- | 228 | /* */ |
|
- | 229 | /* vertBearingY :: */ |
|
- | 230 | /* Top side bearing for vertical layout. */ |
|
- | 231 | /* */ |
|
- | 232 | /* vertAdvance :: */ |
|
- | 233 | /* Advance height for vertical layout. */ |
|
- | 234 | /* */ |
|
- | 235 | /* |
|
105 | /* was. */ |
236 | /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */ |
106 | 237 | /* dimensions of the hinted glyph (in case hinting is applicable). */ |
|
107 | 238 | /* */ |
|
108 | struct TT_UnitVector_ /* guess what... */ |
- | |
Line -... | Line 239... | ||
- | 239 | typedef struct FT_Glyph_Metrics_ |
|
- | 240 | { |
|
- | 241 | FT_Pos width; |
|
- | 242 | FT_Pos height; |
|
- | 243 | ||
- | 244 | FT_Pos horiBearingX; |
|
109 | { |
245 | FT_Pos horiBearingY; |
- | 246 | FT_Pos horiAdvance; |
|
- | 247 | ||
110 | TT_F2Dot14 x; |
248 | FT_Pos vertBearingX; |
111 | TT_F2Dot14 y; |
249 | FT_Pos vertBearingY; |
- | 250 | FT_Pos vertAdvance; |
|
- | 251 | ||
112 | }; |
252 | } FT_Glyph_Metrics; |
- | 253 | ||
- | 254 | ||
- | 255 | /*************************************************************************/ |
|
- | 256 | /* */ |
|
- | 257 | /* |
|
- | 258 | /* FT_Bitmap_Size */ |
|
- | 259 | /* */ |
|
- | 260 | /* |
|
- | 261 | /* This structure models the metrics of a bitmap strike (i.e., a set */ |
|
- | 262 | /* of glyphs for a given point size and resolution) in a bitmap font. */ |
|
- | 263 | /* It is used for the `available_sizes' field of @FT_Face. */ |
|
- | 264 | /* */ |
|
- | 265 | /* |
|
- | 266 | /* height :: The vertical distance, in pixels, between two */ |
|
- | 267 | /* consecutive baselines. It is always positive. */ |
|
- | 268 | /* */ |
|
- | 269 | /* width :: The average width, in pixels, of all glyphs in the */ |
|
- | 270 | /* strike. */ |
|
- | 271 | /* */ |
|
- | 272 | /* size :: The nominal size of the strike in 26.6 fractional */ |
|
- | 273 | /* points. This field is not very useful. */ |
|
- | 274 | /* */ |
|
- | 275 | /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */ |
|
- | 276 | /* pixels. */ |
|
- | 277 | /* */ |
|
- | 278 | /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */ |
|
- | 279 | /* pixels. */ |
|
- | 280 | /* */ |
|
- | 281 | /* |
|
- | 282 | /* Windows FNT: */ |
|
- | 283 | /* The nominal size given in a FNT font is not reliable. Thus when */ |
|
- | 284 | /* the driver finds it incorrect, it sets `size' to some calculated */ |
|
- | 285 | /* values and sets `x_ppem' and `y_ppem' to the pixel width and */ |
|
- | 286 | /* height given in the font, respectively. */ |
|
- | 287 | /* */ |
|
- | 288 | /* TrueType embedded bitmaps: */ |
|
113 | 289 | /* `size', `width', and `height' values are not contained in the */ |
|
114 | typedef struct TT_UnitVector_ TT_UnitVector; |
290 | /* bitmap strike itself. They are computed from the global font */ |
115 | 291 | /* parameters. */ |
|
116 | - | ||
Line 117... | Line 292... | ||
117 | struct TT_Vector_ /* simple vector type */ |
292 | /* */ |
Line -... | Line 293... | ||
- | 293 | typedef struct FT_Bitmap_Size_ |
|
- | 294 | { |
|
Line -... | Line 295... | ||
- | 295 | FT_Short height; |
|
- | 296 | FT_Short width; |
|
- | 297 | ||
- | 298 | FT_Pos size; |
|
- | 299 | ||
- | 300 | FT_Pos x_ppem; |
|
- | 301 | FT_Pos y_ppem; |
|
- | 302 | ||
- | 303 | } FT_Bitmap_Size; |
|
- | 304 | ||
- | 305 | ||
- | 306 | /*************************************************************************/ |
|
- | 307 | /*************************************************************************/ |
|
- | 308 | /* */ |
|
- | 309 | /* O B J E C T C L A S S E S */ |
|
- | 310 | /* */ |
|
- | 311 | /*************************************************************************/ |
|
- | 312 | /*************************************************************************/ |
|
- | 313 | ||
- | 314 | /*************************************************************************/ |
|
- | 315 | /* */ |
|
- | 316 | /* |
|
- | 317 | /* FT_Library */ |
|
- | 318 | /* */ |
|
- | 319 | /* |
|
- | 320 | /* A handle to a FreeType library instance. Each `library' is */ |
|
- | 321 | /* completely independent from the others; it is the `root' of a set */ |
|
- | 322 | /* of objects like fonts, faces, sizes, etc. */ |
|
- | 323 | /* */ |
|
- | 324 | /* It also embeds a memory manager (see @FT_Memory), as well as a */ |
|
- | 325 | /* scan-line converter object (see @FT_Raster). */ |
|
- | 326 | /* */ |
|
- | 327 | /* For multi-threading applications each thread should have its own */ |
|
- | 328 | /* FT_Library object. */ |
|
- | 329 | /* */ |
|
- | 330 | /* |
|
- | 331 | /* Library objects are normally created by @FT_Init_FreeType, and */ |
|
- | 332 | /* destroyed with @FT_Done_FreeType. */ |
|
- | 333 | /* */ |
|
- | 334 | typedef struct FT_LibraryRec_ *FT_Library; |
|
- | 335 | ||
- | 336 | ||
- | 337 | /*************************************************************************/ |
|
- | 338 | /* */ |
|
- | 339 | /* |
|
- | 340 | /* FT_Module */ |
|
- | 341 | /* */ |
|
- | 342 | /* |
|
- | 343 | /* A handle to a given FreeType module object. Each module can be a */ |
|
- | 344 | /* font driver, a renderer, or anything else that provides services */ |
|
- | 345 | /* to the formers. */ |
|
- | 346 | /* */ |
|
- | 347 | typedef struct FT_ModuleRec_* FT_Module; |
|
- | 348 | ||
- | 349 | ||
- | 350 | /*************************************************************************/ |
|
- | 351 | /* */ |
|
- | 352 | /* |
|
- | 353 | /* FT_Driver */ |
|
- | 354 | /* */ |
|
- | 355 | /* |
|
- | 356 | /* A handle to a given FreeType font driver object. Each font driver */ |
|
- | 357 | /* is a special module capable of creating faces from font files. */ |
|
- | 358 | /* */ |
|
- | 359 | typedef struct FT_DriverRec_* FT_Driver; |
|
- | 360 | ||
- | 361 | ||
- | 362 | /*************************************************************************/ |
|
- | 363 | /* */ |
|
- | 364 | /* |
|
- | 365 | /* FT_Renderer */ |
|
- | 366 | /* */ |
|
- | 367 | /* |
|
- | 368 | /* A handle to a given FreeType renderer. A renderer is a special */ |
|
- | 369 | /* module in charge of converting a glyph image to a bitmap, when */ |
|
- | 370 | /* necessary. Each renderer supports a given glyph image format, and */ |
|
- | 371 | /* one or more target surface depths. */ |
|
- | 372 | /* */ |
|
- | 373 | typedef struct FT_RendererRec_* FT_Renderer; |
|
- | 374 | ||
- | 375 | ||
- | 376 | /*************************************************************************/ |
|
- | 377 | /* */ |
|
- | 378 | /* |
|
- | 379 | /* FT_Face */ |
|
- | 380 | /* */ |
|
- | 381 | /* |
|
- | 382 | /* A handle to a given typographic face object. A face object models */ |
|
- | 383 | /* a given typeface, in a given style. */ |
|
- | 384 | /* */ |
|
- | 385 | /* |
|
- | 386 | /* Each face object also owns a single @FT_GlyphSlot object, as well */ |
|
- | 387 | /* as one or more @FT_Size objects. */ |
|
- | 388 | /* */ |
|
- | 389 | /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */ |
|
- | 390 | /* a given filepathname or a custom input stream. */ |
|
- | 391 | /* */ |
|
- | 392 | /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */ |
|
- | 393 | /* */ |
|
- | 394 | /* |
|
- | 395 | /* See @FT_FaceRec for the publicly accessible fields of a given face */ |
|
- | 396 | /* object. */ |
|
- | 397 | /* */ |
|
- | 398 | typedef struct FT_FaceRec_* FT_Face; |
|
118 | { |
399 | |
- | 400 | ||
- | 401 | /*************************************************************************/ |
|
- | 402 | /* */ |
|
- | 403 | /* |
|
- | 404 | /* FT_Size */ |
|
- | 405 | /* */ |
|
- | 406 | /* |
|
- | 407 | /* A handle to an object used to model a face scaled to a given */ |
|
- | 408 | /* character size. */ |
|
- | 409 | /* */ |
|
- | 410 | /* |
|
- | 411 | /* Each @FT_Face has an _active_ @FT_Size object that is used by */ |
|
- | 412 | /* functions like @FT_Load_Glyph to determine the scaling */ |
|
- | 413 | /* transformation which is used to load and hint glyphs and metrics. */ |
|
- | 414 | /* */ |
|
- | 415 | /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */ |
|
- | 416 | /* @FT_Request_Size or even @FT_Select_Size to change the content */ |
|
- | 417 | /* (i.e., the scaling values) of the active @FT_Size. */ |
|
- | 418 | /* */ |
|
- | 419 | /* You can use @FT_New_Size to create additional size objects for a */ |
|
- | 420 | /* given @FT_Face, but they won't be used by other functions until */ |
|
- | 421 | /* you activate it through @FT_Activate_Size. Only one size can be */ |
|
- | 422 | /* activated at any given time per face. */ |
|
- | 423 | /* */ |
|
- | 424 | /* |
|
- | 425 | /* See @FT_SizeRec for the publicly accessible fields of a given size */ |
|
- | 426 | /* object. */ |
|
- | 427 | /* */ |
|
- | 428 | typedef struct FT_SizeRec_* FT_Size; |
|
- | 429 | ||
- | 430 | ||
- | 431 | /*************************************************************************/ |
|
- | 432 | /* */ |
|
- | 433 | /* |
|
- | 434 | /* FT_GlyphSlot */ |
|
- | 435 | /* */ |
|
- | 436 | /* |
|
- | 437 | /* A handle to a given `glyph slot'. A slot is a container where it */ |
|
- | 438 | /* is possible to load any of the glyphs contained in its parent */ |
|
- | 439 | /* face. */ |
|
- | 440 | /* */ |
|
- | 441 | /* In other words, each time you call @FT_Load_Glyph or */ |
|
- | 442 | /* @FT_Load_Char, the slot's content is erased by the new glyph data, */ |
|
- | 443 | /* i.e., the glyph's metrics, its image (bitmap or outline), and */ |
|
- | 444 | /* other control information. */ |
|
- | 445 | /* */ |
|
- | 446 | /* |
|
- | 447 | /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */ |
|
- | 448 | /* */ |
|
- | 449 | typedef struct FT_GlyphSlotRec_* FT_GlyphSlot; |
|
- | 450 | ||
- | 451 | ||
- | 452 | /*************************************************************************/ |
|
- | 453 | /* */ |
|
- | 454 | /* |
|
- | 455 | /* FT_CharMap */ |
|
- | 456 | /* */ |
|
- | 457 | /* |
|
- | 458 | /* A handle to a given character map. A charmap is used to translate */ |
|
- | 459 | /* character codes in a given encoding into glyph indexes for its */ |
|
- | 460 | /* parent's face. Some font formats may provide several charmaps per */ |
|
- | 461 | /* font. */ |
|
119 | TT_F26Dot6 x; |
462 | /* */ |
- | 463 | /* Each face object owns zero or more charmaps, but only one of them */ |
|
- | 464 | /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */ |
|
- | 465 | /* */ |
|
- | 466 | /* The list of available charmaps in a face is available through the */ |
|
- | 467 | /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */ |
|
- | 468 | /* */ |
|
- | 469 | /* The currently active charmap is available as `face->charmap'. */ |
|
- | 470 | /* You should call @FT_Set_Charmap to change it. */ |
|
- | 471 | /* */ |
|
- | 472 | /* |
|
- | 473 | /* When a new face is created (either through @FT_New_Face or */ |
|
- | 474 | /* @FT_Open_Face), the library looks for a Unicode charmap within */ |
|
- | 475 | /* the list and automatically activates it. */ |
|
- | 476 | /* */ |
|
- | 477 | /* |
|
- | 478 | /* See @FT_CharMapRec for the publicly accessible fields of a given */ |
|
- | 479 | /* character map. */ |
|
- | 480 | /* */ |
|
- | 481 | typedef struct FT_CharMapRec_* FT_CharMap; |
|
- | 482 | ||
- | 483 | ||
- | 484 | /*************************************************************************/ |
|
- | 485 | /* */ |
|
- | 486 | /* |
|
- | 487 | /* FT_ENC_TAG */ |
|
- | 488 | /* */ |
|
- | 489 | /* |
|
120 | TT_F26Dot6 y; |
490 | /* This macro converts four-letter tags into an unsigned long. It is */ |
- | 491 | /* used to define `encoding' identifiers (see @FT_Encoding). */ |
|
121 | }; |
492 | /* */ |
122 | 493 | /* |
|
- | 494 | /* Since many 16-bit compilers don't like 32-bit enumerations, you */ |
|
123 | typedef struct TT_Vector_ TT_Vector; |
495 | /* should redefine this macro in case of problems to something like */ |
- | 496 | /* this: */ |
|
- | 497 | /* */ |
|
- | 498 | /* { */ |
|
- | 499 | /* #define FT_ENC_TAG( value, a, b, c, d ) value */ |
|
- | 500 | /* } */ |
|
- | 501 | /* */ |
|
- | 502 | /* to get a simple enumeration without assigning special numbers. */ |
|
- | 503 | /* */ |
|
- | 504 | ||
- | 505 | #ifndef FT_ENC_TAG |
|
124 | 506 | #define FT_ENC_TAG( value, a, b, c, d ) \ |
|
- | 507 | value = ( ( (FT_UInt32)(a) << 24 ) | \ |
|
- | 508 | ( (FT_UInt32)(b) << 16 ) | \ |
|
- | 509 | ( (FT_UInt32)(c) << 8 ) | \ |
|
- | 510 | (FT_UInt32)(d) ) |
|
- | 511 | ||
- | 512 | #endif /* FT_ENC_TAG */ |
|
- | 513 | ||
- | 514 | ||
- | 515 | /*************************************************************************/ |
|
- | 516 | /* */ |
|
- | 517 | /* |
|
- | 518 | /* FT_Encoding */ |
|
- | 519 | /* */ |
|
- | 520 | /* |
|
- | 521 | /* An enumeration used to specify character sets supported by */ |
|
- | 522 | /* charmaps. Used in the @FT_Select_Charmap API function. */ |
|
- | 523 | /* */ |
|
- | 524 | /* |
|
- | 525 | /* Despite the name, this enumeration lists specific character */ |
|
- | 526 | /* repertories (i.e., charsets), and not text encoding methods (e.g., */ |
|
- | 527 | /* UTF-8, UTF-16, etc.). */ |
|
- | 528 | /* */ |
|
- | 529 | /* Other encodings might be defined in the future. */ |
|
- | 530 | /* */ |
|
- | 531 | /* |
|
- | 532 | /* FT_ENCODING_NONE :: */ |
|
- | 533 | /* The encoding value~0 is reserved. */ |
|
- | 534 | /* */ |
|
- | 535 | /* FT_ENCODING_UNICODE :: */ |
|
- | 536 | /* Corresponds to the Unicode character set. This value covers */ |
|
- | 537 | /* all versions of the Unicode repertoire, including ASCII and */ |
|
- | 538 | /* Latin-1. Most fonts include a Unicode charmap, but not all */ |
|
- | 539 | /* of them. */ |
|
- | 540 | /* */ |
|
- | 541 | /* For example, if you want to access Unicode value U+1F028 (and */ |
|
- | 542 | /* the font contains it), use value 0x1F028 as the input value for */ |
|
- | 543 | /* @FT_Get_Char_Index. */ |
|
- | 544 | /* */ |
|
- | 545 | /* FT_ENCODING_MS_SYMBOL :: */ |
|
- | 546 | /* Corresponds to the Microsoft Symbol encoding, used to encode */ |
|
- | 547 | /* mathematical symbols in the 32..255 character code range. For */ |
|
- | 548 | /* more information, see `http://www.ceviz.net/symbol.htm'. */ |
|
- | 549 | /* */ |
|
- | 550 | /* FT_ENCODING_SJIS :: */ |
|
- | 551 | /* Corresponds to Japanese SJIS encoding. More info at */ |
|
- | 552 | /* at `http://langsupport.japanreference.com/encoding.shtml'. */ |
|
- | 553 | /* See note on multi-byte encodings below. */ |
|
- | 554 | /* */ |
|
- | 555 | /* FT_ENCODING_GB2312 :: */ |
|
- | 556 | /* Corresponds to an encoding system for Simplified Chinese as used */ |
|
- | 557 | /* used in mainland China. */ |
|
- | 558 | /* */ |
|
- | 559 | /* FT_ENCODING_BIG5 :: */ |
|
- | 560 | /* Corresponds to an encoding system for Traditional Chinese as */ |
|
- | 561 | /* used in Taiwan and Hong Kong. */ |
|
- | 562 | /* */ |
|
- | 563 | /* FT_ENCODING_WANSUNG :: */ |
|
- | 564 | /* Corresponds to the Korean encoding system known as Wansung. */ |
|
- | 565 | /* For more information see */ |
|
- | 566 | /* `http://www.microsoft.com/typography/unicode/949.txt'. */ |
|
- | 567 | /* */ |
|
- | 568 | /* FT_ENCODING_JOHAB :: */ |
|
- | 569 | /* The Korean standard character set (KS~C 5601-1992), which */ |
|
- | 570 | /* corresponds to MS Windows code page 1361. This character set */ |
|
- | 571 | /* includes all possible Hangeul character combinations. */ |
|
- | 572 | /* */ |
|
- | 573 | /* FT_ENCODING_ADOBE_LATIN_1 :: */ |
|
- | 574 | /* Corresponds to a Latin-1 encoding as defined in a Type~1 */ |
|
- | 575 | /* PostScript font. It is limited to 256 character codes. */ |
|
- | 576 | /* */ |
|
- | 577 | /* FT_ENCODING_ADOBE_STANDARD :: */ |
|
- | 578 | /* Corresponds to the Adobe Standard encoding, as found in Type~1, */ |
|
- | 579 | /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ |
|
- | 580 | /* codes. */ |
|
- | 581 | /* */ |
|
- | 582 | /* FT_ENCODING_ADOBE_EXPERT :: */ |
|
- | 583 | /* Corresponds to the Adobe Expert encoding, as found in Type~1, */ |
|
- | 584 | /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ |
|
- | 585 | /* codes. */ |
|
- | 586 | /* */ |
|
- | 587 | /* FT_ENCODING_ADOBE_CUSTOM :: */ |
|
- | 588 | /* Corresponds to a custom encoding, as found in Type~1, CFF, and */ |
|
- | 589 | /* OpenType/CFF fonts. It is limited to 256 character codes. */ |
|
- | 590 | /* */ |
|
- | 591 | /* FT_ENCODING_APPLE_ROMAN :: */ |
|
- | 592 | /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */ |
|
- | 593 | /* and OpenType fonts contain a charmap for this encoding, since */ |
|
- | 594 | /* older versions of Mac OS are able to use it. */ |
|
- | 595 | /* */ |
|
- | 596 | /* FT_ENCODING_OLD_LATIN_2 :: */ |
|
- | 597 | /* This value is deprecated and was never used nor reported by */ |
|
- | 598 | /* FreeType. Don't use or test for it. */ |
|
- | 599 | /* */ |
|
- | 600 | /* FT_ENCODING_MS_SJIS :: */ |
|
- | 601 | /* Same as FT_ENCODING_SJIS. Deprecated. */ |
|
- | 602 | /* */ |
|
- | 603 | /* FT_ENCODING_MS_GB2312 :: */ |
|
- | 604 | /* Same as FT_ENCODING_GB2312. Deprecated. */ |
|
- | 605 | /* */ |
|
- | 606 | /* FT_ENCODING_MS_BIG5 :: */ |
|
- | 607 | /* Same as FT_ENCODING_BIG5. Deprecated. */ |
|
- | 608 | /* */ |
|
- | 609 | /* FT_ENCODING_MS_WANSUNG :: */ |
|
- | 610 | /* Same as FT_ENCODING_WANSUNG. Deprecated. */ |
|
- | 611 | /* */ |
|
- | 612 | /* FT_ENCODING_MS_JOHAB :: */ |
|
- | 613 | /* Same as FT_ENCODING_JOHAB. Deprecated. */ |
|
- | 614 | /* */ |
|
- | 615 | /* |
|
- | 616 | /* By default, FreeType automatically synthesizes a Unicode charmap */ |
|
- | 617 | /* for PostScript fonts, using their glyph names dictionaries. */ |
|
- | 618 | /* However, it also reports the encodings defined explicitly in the */ |
|
- | 619 | /* font file, for the cases when they are needed, with the Adobe */ |
|
- | 620 | /* values as well. */ |
|
- | 621 | /* */ |
|
- | 622 | /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */ |
|
- | 623 | /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */ |
|
- | 624 | /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */ |
|
- | 625 | /* which encoding is really present. If, for example, the */ |
|
- | 626 | /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */ |
|
- | 627 | /* the font is encoded in KOI8-R. */ |
|
- | 628 | /* */ |
|
- | 629 | /* FT_ENCODING_NONE is always set (with a single exception) by the */ |
|
- | 630 | /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */ |
|
- | 631 | /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */ |
|
- | 632 | /* which encoding is really present. For example, */ |
|
- | 633 | /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */ |
|
- | 634 | /* Russian). */ |
|
- | 635 | /* */ |
|
- | 636 | /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */ |
|
- | 637 | /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */ |
|
- | 638 | /* FT_ENCODING_APPLE_ROMAN). */ |
|
- | 639 | /* */ |
|
- | 640 | /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */ |
|
- | 641 | /* @FT_Get_CMap_Language_ID to query the Mac language ID which may */ |
|
- | 642 | /* be needed to be able to distinguish Apple encoding variants. See */ |
|
- | 643 | /* */ |
|
- | 644 | /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */ |
|
- | 645 | /* */ |
|
125 | 646 | /* to get an idea how to do that. Basically, if the language ID */ |
|
126 | /* A simple 2x2 matrix used for transformations. */ |
647 | /* is~0, don't use it, otherwise subtract 1 from the language ID. */ |
127 | /* You should use 16.16 fixed floats. */ |
- | |
128 | /* */ |
- | |
129 | /* x' = xx*x + xy*y */ |
- | |
130 | /* y' = yx*x + yy*y */ |
- | |
131 | /* */ |
648 | /* Then examine `encoding_id'. If, for example, `encoding_id' is */ |
Line -... | Line 649... | ||
- | 649 | /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */ |
|
- | 650 | /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */ |
|
Line -... | Line 651... | ||
- | 651 | /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */ |
|
- | 652 | /* variant the Arabic encoding. */ |
|
- | 653 | /* */ |
|
- | 654 | typedef enum FT_Encoding_ |
|
- | 655 | { |
|
- | 656 | FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ), |
|
- | 657 | ||
- | 658 | FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ), |
|
- | 659 | FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ), |
|
- | 660 | ||
- | 661 | FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ), |
|
- | 662 | FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ), |
|
- | 663 | FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ), |
|
- | 664 | FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ), |
|
- | 665 | FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ), |
|
- | 666 | ||
- | 667 | /* for backwards compatibility */ |
|
- | 668 | FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS, |
|
- | 669 | FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312, |
|
- | 670 | FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5, |
|
- | 671 | FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG, |
|
- | 672 | FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB, |
|
- | 673 | ||
- | 674 | FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ), |
|
- | 675 | FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ), |
|
- | 676 | FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ), |
|
- | 677 | FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ), |
|
- | 678 | ||
- | 679 | FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ), |
|
- | 680 | ||
- | 681 | FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' ) |
|
132 | 682 | ||
- | 683 | } FT_Encoding; |
|
- | 684 | ||
- | 685 | ||
- | 686 | /*************************************************************************/ |
|
- | 687 | /* */ |
|
- | 688 | /* |
|
- | 689 | /* ft_encoding_xxx */ |
|
- | 690 | /* */ |
|
- | 691 | /* |
|
- | 692 | /* These constants are deprecated; use the corresponding @FT_Encoding */ |
|
- | 693 | /* values instead. */ |
|
- | 694 | /* */ |
|
- | 695 | #define ft_encoding_none FT_ENCODING_NONE |
|
- | 696 | #define ft_encoding_unicode FT_ENCODING_UNICODE |
|
- | 697 | #define ft_encoding_symbol FT_ENCODING_MS_SYMBOL |
|
- | 698 | #define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1 |
|
- | 699 | #define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2 |
|
- | 700 | #define ft_encoding_sjis FT_ENCODING_SJIS |
|
133 | struct TT_Matrix_ |
701 | #define ft_encoding_gb2312 FT_ENCODING_GB2312 |
- | 702 | #define ft_encoding_big5 FT_ENCODING_BIG5 |
|
- | 703 | #define ft_encoding_wansung FT_ENCODING_WANSUNG |
|
- | 704 | #define ft_encoding_johab FT_ENCODING_JOHAB |
|
- | 705 | ||
- | 706 | #define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD |
|
- | 707 | #define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT |
|
- | 708 | #define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM |
|
- | 709 | #define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN |
|
- | 710 | ||
- | 711 | ||
- | 712 | /*************************************************************************/ |
|
- | 713 | /* */ |
|
- | 714 | /* |
|
- | 715 | /* FT_CharMapRec */ |
|
- | 716 | /* */ |
|
- | 717 | /* |
|
- | 718 | /* The base charmap structure. */ |
|
- | 719 | /* */ |
|
- | 720 | /* |
|
- | 721 | /* face :: A handle to the parent face object. */ |
|
- | 722 | /* */ |
|
- | 723 | /* encoding :: An @FT_Encoding tag identifying the charmap. Use */ |
|
- | 724 | /* this with @FT_Select_Charmap. */ |
|
134 | { |
725 | /* */ |
135 | TT_Fixed xx, xy; |
726 | /* platform_id :: An ID number describing the platform for the */ |
209 | /* The same is true for `bearingY', which is the top-side bearing */ |
902 | /* */ |
- | 903 | /* size :: The current active size for this face. */ |
|
210 | /* defined by the TT_Spec, i.e., the distance from the baseline to */ |
904 | /* */ |
Line 211... | Line 905... | ||
211 | /* the top of the glyph's bbox. According to our current convention, */ |
905 | /* charmap :: The current active charmap for this face. */ |
212 | /* this is always the same as `bbox.yMax' but we make it appear for */ |
906 | /* */ |
Line 213... | Line 907... | ||
213 | /* consistency in its proper field. */ |
907 | /* |
214 | /* */ |
- | |
Line -... | Line 908... | ||
- | 908 | /* Fields may be changed after a call to @FT_Attach_File or */ |
|
- | 909 | /* @FT_Attach_Stream. */ |
|
- | 910 | /* */ |
|
- | 911 | typedef struct FT_FaceRec_ |
|
- | 912 | { |
|
- | 913 | FT_Long num_faces; |
|
- | 914 | FT_Long face_index; |
|
- | 915 | ||
- | 916 | FT_Long face_flags; |
|
- | 917 | FT_Long style_flags; |
|
- | 918 | ||
- | 919 | FT_Long num_glyphs; |
|
- | 920 | ||
- | 921 | FT_String* family_name; |
|
- | 922 | FT_String* style_name; |
|
- | 923 | ||
- | 924 | FT_Int num_fixed_sizes; |
|
- | 925 | FT_Bitmap_Size* available_sizes; |
|
- | 926 | ||
- | 927 | FT_Int num_charmaps; |
|
- | 928 | FT_CharMap* charmaps; |
|
- | 929 | ||
- | 930 | FT_Generic generic; |
|
- | 931 | ||
- | 932 | /*# The following member variables (down to `underline_thickness') */ |
|
- | 933 | /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */ |
|
- | 934 | /*# for bitmap fonts. */ |
|
215 | /* The `advance' field is the advance width for horizontal layout, */ |
935 | FT_BBox bbox; |
- | 936 | ||
- | 937 | FT_UShort units_per_EM; |
|
- | 938 | FT_Short ascender; |
|
- | 939 | FT_Short descender; |
|
- | 940 | FT_Short height; |
|
- | 941 | ||
- | 942 | FT_Short max_advance_width; |
|
- | 943 | FT_Short max_advance_height; |
|
- | 944 | ||
- | 945 | FT_Short underline_position; |
|
- | 946 | FT_Short underline_thickness; |
|
- | 947 | ||
- | 948 | FT_GlyphSlot glyph; |
|
- | 949 | FT_Size size; |
|
- | 950 | FT_CharMap charmap; |
|
- | 951 | ||
- | 952 | /*@private begin */ |
|
- | 953 | ||
- | 954 | FT_Driver driver; |
|
216 | /* and advance height for vertical layouts. */ |
955 | FT_Memory memory; |
217 | 956 | FT_Stream stream; |
|
- | 957 | ||
- | 958 | FT_ListRec sizes_list; |
|
- | 959 | ||
- | 960 | FT_Generic autohint; |
|
- | 961 | void* extensions; |
|
- | 962 | ||
- | 963 | FT_Face_Internal internal; |
|
- | 964 | ||
- | 965 | /*@private end */ |
|
- | 966 | ||
- | 967 | } FT_FaceRec; |
|
- | 968 | ||
- | 969 | ||
- | 970 | /*************************************************************************/ |
|
- | 971 | /* */ |
|
- | 972 | /* |
|
- | 973 | /* FT_FACE_FLAG_XXX */ |
|
- | 974 | /* */ |
|
- | 975 | /* |
|
- | 976 | /* A list of bit flags used in the `face_flags' field of the */ |
|
- | 977 | /* @FT_FaceRec structure. They inform client applications of */ |
|
- | 978 | /* properties of the corresponding face. */ |
|
- | 979 | /* */ |
|
- | 980 | /* |
|
- | 981 | /* FT_FACE_FLAG_SCALABLE :: */ |
|
- | 982 | /* Indicates that the face contains outline glyphs. This doesn't */ |
|
- | 983 | /* prevent bitmap strikes, i.e., a face can have both this and */ |
|
- | 984 | /* and @FT_FACE_FLAG_FIXED_SIZES set. */ |
|
- | 985 | /* */ |
|
- | 986 | /* FT_FACE_FLAG_FIXED_SIZES :: */ |
|
- | 987 | /* Indicates that the face contains bitmap strikes. See also the */ |
|
- | 988 | /* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */ |
|
- | 989 | /* */ |
|
218 | struct TT_Glyph_Metrics_ |
990 | /* FT_FACE_FLAG_FIXED_WIDTH :: */ |
- | 991 | /* Indicates that the face contains fixed-width characters (like */ |
|
- | 992 | /* Courier, Lucido, MonoType, etc.). */ |
|
- | 993 | /* */ |
|
- | 994 | /* FT_FACE_FLAG_SFNT :: */ |
|
- | 995 | /* Indicates that the face uses the `sfnt' storage scheme. For */ |
|
- | 996 | /* now, this means TrueType and OpenType. */ |
|
- | 997 | /* */ |
|
- | 998 | /* FT_FACE_FLAG_HORIZONTAL :: */ |
|
- | 999 | /* Indicates that the face contains horizontal glyph metrics. This */ |
|
- | 1000 | /* should be set for all common formats. */ |
|
- | 1001 | /* */ |
|
- | 1002 | /* FT_FACE_FLAG_VERTICAL :: */ |
|
- | 1003 | /* Indicates that the face contains vertical glyph metrics. This */ |
|
- | 1004 | /* is only available in some formats, not all of them. */ |
|
- | 1005 | /* */ |
|
- | 1006 | /* FT_FACE_FLAG_KERNING :: */ |
|
219 | { |
1007 | /* Indicates that the face contains kerning information. If set, */ |
- | 1008 | /* the kerning distance can be retrieved through the function */ |
|
- | 1009 | /* @FT_Get_Kerning. Otherwise the function always return the */ |
|
- | 1010 | /* vector (0,0). Note that FreeType doesn't handle kerning data */ |
|
- | 1011 | /* from the `GPOS' table (as present in some OpenType fonts). */ |
|
- | 1012 | /* */ |
|
220 | TT_BBox bbox; /* glyph bounding box */ |
1013 | /* FT_FACE_FLAG_FAST_GLYPHS :: */ |
- | 1014 | /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */ |
|
- | 1015 | /* */ |
|
- | 1016 | /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */ |
|
221 | 1017 | /* Indicates that the font contains multiple masters and is capable */ |
|
- | 1018 | /* of interpolating between them. See the multiple-masters */ |
|
- | 1019 | /* specific API for details. */ |
|
- | 1020 | /* */ |
|
- | 1021 | /* FT_FACE_FLAG_GLYPH_NAMES :: */ |
|
- | 1022 | /* Indicates that the font contains glyph names that can be */ |
|
- | 1023 | /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */ |
|
- | 1024 | /* fonts contain broken glyph name tables. Use the function */ |
|
- | 1025 | /* @FT_Has_PS_Glyph_Names when needed. */ |
|
- | 1026 | /* */ |
|
- | 1027 | /* FT_FACE_FLAG_EXTERNAL_STREAM :: */ |
|
- | 1028 | /* Used internally by FreeType to indicate that a face's stream was */ |
|
- | 1029 | /* provided by the client application and should not be destroyed */ |
|
- | 1030 | /* when @FT_Done_Face is called. Don't read or test this flag. */ |
|
- | 1031 | /* */ |
|
- | 1032 | /* FT_FACE_FLAG_HINTER :: */ |
|
- | 1033 | /* Set if the font driver has a hinting machine of its own. For */ |
|
- | 1034 | /* example, with TrueType fonts, it makes sense to use data from */ |
|
- | 1035 | /* the SFNT `gasp' table only if the native TrueType hinting engine */ |
|
- | 1036 | /* (with the bytecode interpreter) is available and active. */ |
|
- | 1037 | /* */ |
|
- | 1038 | /* FT_FACE_FLAG_CID_KEYED :: */ |
|
- | 1039 | /* Set if the font is CID-keyed. In that case, the font is not */ |
|
- | 1040 | /* accessed by glyph indices but by CID values. For subsetted */ |
|
- | 1041 | /* CID-keyed fonts this has the consequence that not all index */ |
|
- | 1042 | /* values are a valid argument to FT_Load_Glyph. Only the CID */ |
|
- | 1043 | /* values for which corresponding glyphs in the subsetted font */ |
|
- | 1044 | /* exist make FT_Load_Glyph return successfully; in all other cases */ |
|
- | 1045 | /* you get an `FT_Err_Invalid_Argument' error. */ |
|
- | 1046 | /* */ |
|
- | 1047 | /* Note that CID-keyed fonts which are in an SFNT wrapper don't */ |
|
- | 1048 | /* have this flag set since the glyphs are accessed in the normal */ |
|
- | 1049 | /* way (using contiguous indices); the `CID-ness' isn't visible to */ |
|
- | 1050 | /* the application. */ |
|
- | 1051 | /* */ |
|
- | 1052 | /* FT_FACE_FLAG_TRICKY :: */ |
|
- | 1053 | /* Set if the font is `tricky', this is, it always needs the */ |
|
- | 1054 | /* font format's native hinting engine to get a reasonable result. */ |
|
- | 1055 | /* A typical example is the Chinese font `mingli.ttf' which uses */ |
|
- | 1056 | /* TrueType bytecode instructions to move and scale all of its */ |
|
- | 1057 | /* subglyphs. */ |
|
- | 1058 | /* */ |
|
- | 1059 | /* It is not possible to autohint such fonts using */ |
|
- | 1060 | /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */ |
|
- | 1061 | /* @FT_LOAD_NO_HINTING. You have to set both FT_LOAD_NO_HINTING */ |
|
- | 1062 | /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */ |
|
- | 1063 | /* probably never want this except for demonstration purposes. */ |
|
- | 1064 | /* */ |
|
- | 1065 | /* Currently, there are six TrueType fonts in the list of tricky */ |
|
- | 1066 | /* fonts; they are hard-coded in file `ttobjs.c'. */ |
|
- | 1067 | /* */ |
|
- | 1068 | #define FT_FACE_FLAG_SCALABLE ( 1L << 0 ) |
|
- | 1069 | #define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 ) |
|
- | 1070 | #define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 ) |
|
- | 1071 | #define FT_FACE_FLAG_SFNT ( 1L << 3 ) |
|
- | 1072 | #define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 ) |
|
- | 1073 | #define FT_FACE_FLAG_VERTICAL ( 1L << 5 ) |
|
- | 1074 | #define FT_FACE_FLAG_KERNING ( 1L << 6 ) |
|
- | 1075 | #define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 ) |
|
- | 1076 | #define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 ) |
|
- | 1077 | #define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 ) |
|
- | 1078 | #define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 ) |
|
- | 1079 | #define FT_FACE_FLAG_HINTER ( 1L << 11 ) |
|
- | 1080 | #define FT_FACE_FLAG_CID_KEYED ( 1L << 12 ) |
|
- | 1081 | #define FT_FACE_FLAG_TRICKY ( 1L << 13 ) |
|
- | 1082 | ||
- | 1083 | ||
- | 1084 | /************************************************************************* |
|
- | 1085 | * |
|
- | 1086 | * @macro: |
|
- | 1087 | * FT_HAS_HORIZONTAL( face ) |
|
- | 1088 | * |
|
- | 1089 | * @description: |
|
- | 1090 | * A macro that returns true whenever a face object contains |
|
- | 1091 | * horizontal metrics (this is true for all font formats though). |
|
- | 1092 | * |
|
- | 1093 | * @also: |
|
- | 1094 | * @FT_HAS_VERTICAL can be used to check for vertical metrics. |
|
- | 1095 | * |
|
- | 1096 | */ |
|
- | 1097 | #define FT_HAS_HORIZONTAL( face ) \ |
|
- | 1098 | ( face->face_flags & FT_FACE_FLAG_HORIZONTAL ) |
|
- | 1099 | ||
- | 1100 | ||
- | 1101 | /************************************************************************* |
|
- | 1102 | * |
|
- | 1103 | * @macro: |
|
- | 1104 | * FT_HAS_VERTICAL( face ) |
|
- | 1105 | * |
|
- | 1106 | * @description: |
|
- | 1107 | * A macro that returns true whenever a face object contains vertical |
|
- | 1108 | * metrics. |
|
- | 1109 | * |
|
- | 1110 | */ |
|
- | 1111 | #define FT_HAS_VERTICAL( face ) \ |
|
- | 1112 | ( face->face_flags & FT_FACE_FLAG_VERTICAL ) |
|
- | 1113 | ||
- | 1114 | ||
- | 1115 | /************************************************************************* |
|
- | 1116 | * |
|
- | 1117 | * @macro: |
|
- | 1118 | * FT_HAS_KERNING( face ) |
|
- | 1119 | * |
|
- | 1120 | * @description: |
|
- | 1121 | * A macro that returns true whenever a face object contains kerning |
|
- | 1122 | * data that can be accessed with @FT_Get_Kerning. |
|
- | 1123 | * |
|
- | 1124 | */ |
|
- | 1125 | #define FT_HAS_KERNING( face ) \ |
|
- | 1126 | ( face->face_flags & FT_FACE_FLAG_KERNING ) |
|
- | 1127 | ||
- | 1128 | ||
- | 1129 | /************************************************************************* |
|
- | 1130 | * |
|
- | 1131 | * @macro: |
|
- | 1132 | * FT_IS_SCALABLE( face ) |
|
- | 1133 | * |
|
- | 1134 | * @description: |
|
- | 1135 | * A macro that returns true whenever a face object contains a scalable |
|
- | 1136 | * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF, |
|
- | 1137 | * and PFR font formats. |
|
- | 1138 | * |
|
- | 1139 | */ |
|
- | 1140 | #define FT_IS_SCALABLE( face ) \ |
|
- | 1141 | ( face->face_flags & FT_FACE_FLAG_SCALABLE ) |
|
- | 1142 | ||
- | 1143 | ||
- | 1144 | /************************************************************************* |
|
- | 1145 | * |
|
- | 1146 | * @macro: |
|
- | 1147 | * FT_IS_SFNT( face ) |
|
- | 1148 | * |
|
- | 1149 | * @description: |
|
- | 1150 | * A macro that returns true whenever a face object contains a font |
|
- | 1151 | * whose format is based on the SFNT storage scheme. This usually |
|
- | 1152 | * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded |
|
- | 1153 | * bitmap fonts. |
|
- | 1154 | * |
|
- | 1155 | * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and |
|
- | 1156 | * @FT_TRUETYPE_TABLES_H are available. |
|
- | 1157 | * |
|
- | 1158 | */ |
|
- | 1159 | #define FT_IS_SFNT( face ) \ |
|
- | 1160 | ( face->face_flags & FT_FACE_FLAG_SFNT ) |
|
- | 1161 | ||
- | 1162 | ||
- | 1163 | /************************************************************************* |
|
- | 1164 | * |
|
- | 1165 | * @macro: |
|
- | 1166 | * FT_IS_FIXED_WIDTH( face ) |
|
- | 1167 | * |
|
- | 1168 | * @description: |
|
- | 1169 | * A macro that returns true whenever a face object contains a font face |
|
- | 1170 | * that contains fixed-width (or `monospace', `fixed-pitch', etc.) |
|
- | 1171 | * glyphs. |
|
- | 1172 | * |
|
- | 1173 | */ |
|
- | 1174 | #define FT_IS_FIXED_WIDTH( face ) \ |
|
- | 1175 | ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) |
|
- | 1176 | ||
- | 1177 | ||
- | 1178 | /************************************************************************* |
|
- | 1179 | * |
|
- | 1180 | * @macro: |
|
- | 1181 | * FT_HAS_FIXED_SIZES( face ) |
|
- | 1182 | * |
|
- | 1183 | * @description: |
|
- | 1184 | * A macro that returns true whenever a face object contains some |
|
- | 1185 | * embedded bitmaps. See the `available_sizes' field of the |
|
- | 1186 | * @FT_FaceRec structure. |
|
- | 1187 | * |
|
- | 1188 | */ |
|
- | 1189 | #define FT_HAS_FIXED_SIZES( face ) \ |
|
- | 1190 | ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES ) |
|
- | 1191 | ||
- | 1192 | ||
- | 1193 | /************************************************************************* |
|
- | 1194 | * |
|
- | 1195 | * @macro: |
|
- | 1196 | * FT_HAS_FAST_GLYPHS( face ) |
|
- | 1197 | * |
|
- | 1198 | * @description: |
|
- | 1199 | * Deprecated. |
|
- | 1200 | * |
|
- | 1201 | */ |
|
- | 1202 | #define FT_HAS_FAST_GLYPHS( face ) 0 |
|
- | 1203 | ||
- | 1204 | ||
- | 1205 | /************************************************************************* |
|
- | 1206 | * |
|
- | 1207 | * @macro: |
|
- | 1208 | * FT_HAS_GLYPH_NAMES( face ) |
|
- | 1209 | * |
|
- | 1210 | * @description: |
|
- | 1211 | * A macro that returns true whenever a face object contains some glyph |
|
- | 1212 | * names that can be accessed through @FT_Get_Glyph_Name. |
|
- | 1213 | * |
|
- | 1214 | */ |
|
- | 1215 | #define FT_HAS_GLYPH_NAMES( face ) \ |
|
- | 1216 | ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) |
|
- | 1217 | ||
- | 1218 | ||
- | 1219 | /************************************************************************* |
|
- | 1220 | * |
|
- | 1221 | * @macro: |
|
- | 1222 | * FT_HAS_MULTIPLE_MASTERS( face ) |
|
- | 1223 | * |
|
- | 1224 | * @description: |
|
- | 1225 | * A macro that returns true whenever a face object contains some |
|
- | 1226 | * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H |
|
- | 1227 | * are then available to choose the exact design you want. |
|
- | 1228 | * |
|
- | 1229 | */ |
|
- | 1230 | #define FT_HAS_MULTIPLE_MASTERS( face ) \ |
|
- | 1231 | ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) |
|
- | 1232 | ||
- | 1233 | ||
- | 1234 | /************************************************************************* |
|
- | 1235 | * |
|
- | 1236 | * @macro: |
|
- | 1237 | * FT_IS_CID_KEYED( face ) |
|
- | 1238 | * |
|
- | 1239 | * @description: |
|
- | 1240 | * A macro that returns true whenever a face object contains a CID-keyed |
|
- | 1241 | * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more |
|
- | 1242 | * details. |
|
- | 1243 | * |
|
- | 1244 | * If this macro is true, all functions defined in @FT_CID_H are |
|
- | 1245 | * available. |
|
- | 1246 | * |
|
- | 1247 | */ |
|
- | 1248 | #define FT_IS_CID_KEYED( face ) \ |
|
- | 1249 | ( face->face_flags & FT_FACE_FLAG_CID_KEYED ) |
|
- | 1250 | ||
- | 1251 | ||
- | 1252 | /************************************************************************* |
|
- | 1253 | * |
|
- | 1254 | * @macro: |
|
- | 1255 | * FT_IS_TRICKY( face ) |
|
- | 1256 | * |
|
- | 1257 | * @description: |
|
- | 1258 | * A macro that returns true whenever a face represents a `tricky' font. |
|
222 | TT_Pos bearingX; /* left-side bearing */ |
1259 | * See the discussion of @FT_FACE_FLAG_TRICKY for more details. |
- | 1260 | * |
|
- | 1261 | */ |
|
- | 1262 | #define FT_IS_TRICKY( face ) \ |
|
- | 1263 | ( face->face_flags & FT_FACE_FLAG_TRICKY ) |
|
- | 1264 | ||
- | 1265 | ||
- | 1266 | /*************************************************************************/ |
|
- | 1267 | /* */ |
|
- | 1268 | /* |
|
- | 1269 | /* FT_STYLE_FLAG_XXX */ |
|
- | 1270 | /* */ |
|
- | 1271 | /* |
|
- | 1272 | /* A list of bit-flags used to indicate the style of a given face. */ |
|
- | 1273 | /* These are used in the `style_flags' field of @FT_FaceRec. */ |
|
- | 1274 | /* */ |
|
- | 1275 | /* |
|
- | 1276 | /* FT_STYLE_FLAG_ITALIC :: */ |
|
- | 1277 | /* Indicates that a given face style is italic or oblique. */ |
|
- | 1278 | /* */ |
|
- | 1279 | /* FT_STYLE_FLAG_BOLD :: */ |
|
- | 1280 | /* Indicates that a given face is bold. */ |
|
- | 1281 | /* */ |
|
- | 1282 | /* |
|
- | 1283 | /* The style information as provided by FreeType is very basic. More */ |
|
223 | TT_Pos bearingY; /* top-side bearing, per se the TT spec */ |
1284 | /* details are beyond the scope and should be done on a higher level */ |
- | 1285 | /* (for example, by analyzing various fields of the `OS/2' table in */ |
|
- | 1286 | /* SFNT based fonts). */ |
|
- | 1287 | /* */ |
|
- | 1288 | #define FT_STYLE_FLAG_ITALIC ( 1 << 0 ) |
|
- | 1289 | #define FT_STYLE_FLAG_BOLD ( 1 << 1 ) |
|
224 | 1290 | ||
- | 1291 | ||
- | 1292 | /*************************************************************************/ |
|
- | 1293 | /* */ |
|
- | 1294 | /* |
|
- | 1295 | /* FT_Size_Internal */ |
|
- | 1296 | /* */ |
|
- | 1297 | /* |
|
- | 1298 | /* An opaque handle to an `FT_Size_InternalRec' structure, used to */ |
|
- | 1299 | /* model private data of a given @FT_Size object. */ |
|
- | 1300 | /* */ |
|
- | 1301 | typedef struct FT_Size_InternalRec_* FT_Size_Internal; |
|
- | 1302 | ||
- | 1303 | ||
- | 1304 | /*************************************************************************/ |
|
- | 1305 | /* */ |
|
- | 1306 | /* |
|
- | 1307 | /* FT_Size_Metrics */ |
|
- | 1308 | /* */ |
|
- | 1309 | /* |
|
- | 1310 | /* The size metrics structure gives the metrics of a size object. */ |
|
- | 1311 | /* */ |
|
- | 1312 | /* |
|
- | 1313 | /* x_ppem :: The width of the scaled EM square in pixels, hence */ |
|
- | 1314 | /* the term `ppem' (pixels per EM). It is also */ |
|
- | 1315 | /* referred to as `nominal width'. */ |
|
- | 1316 | /* */ |
|
- | 1317 | /* y_ppem :: The height of the scaled EM square in pixels, */ |
|
- | 1318 | /* hence the term `ppem' (pixels per EM). It is also */ |
|
- | 1319 | /* referred to as `nominal height'. */ |
|
- | 1320 | /* */ |
|
- | 1321 | /* x_scale :: A 16.16 fractional scaling value used to convert */ |
|
- | 1322 | /* horizontal metrics from font units to 26.6 */ |
|
- | 1323 | /* fractional pixels. Only relevant for scalable */ |
|
- | 1324 | /* font formats. */ |
|
- | 1325 | /* */ |
|
- | 1326 | /* y_scale :: A 16.16 fractional scaling value used to convert */ |
|
- | 1327 | /* vertical metrics from font units to 26.6 */ |
|
- | 1328 | /* fractional pixels. Only relevant for scalable */ |
|
- | 1329 | /* font formats. */ |
|
- | 1330 | /* */ |
|
- | 1331 | /* ascender :: The ascender in 26.6 fractional pixels. See */ |
|
- | 1332 | /* @FT_FaceRec for the details. */ |
|
- | 1333 | /* */ |
|
- | 1334 | /* descender :: The descender in 26.6 fractional pixels. See */ |
|
- | 1335 | /* @FT_FaceRec for the details. */ |
|
- | 1336 | /* */ |
|
- | 1337 | /* height :: The height in 26.6 fractional pixels. See */ |
|
- | 1338 | /* @FT_FaceRec for the details. */ |
|
- | 1339 | /* */ |
|
- | 1340 | /* max_advance :: The maximal advance width in 26.6 fractional */ |
|
- | 1341 | /* pixels. See @FT_FaceRec for the details. */ |
|
- | 1342 | /* */ |
|
- | 1343 | /* |
|
- | 1344 | /* The scaling values, if relevant, are determined first during a */ |
|
- | 1345 | /* size changing operation. The remaining fields are then set by the */ |
|
225 | TT_Pos advance; /* advance width (or height) */ |
1346 | /* driver. For scalable formats, they are usually set to scaled */ |
226 | }; |
1347 | /* values of the corresponding fields in @FT_FaceRec. */ |
227 | - | ||
228 | typedef struct TT_Glyph_Metrics_ TT_Glyph_Metrics; |
- | |
229 | - | ||
230 | - | ||
231 | /* A structure used to return horizontal _and_ vertical glyph */ |
- | |
232 | /* metrics. */ |
- | |
233 | /* */ |
- | |
234 | /* A glyph can be used either in a horizontal or vertical layout. */ |
- | |
235 | /* Its glyph metrics vary with orientation. The TT_Big_Glyph_Metrics */ |
- | |
236 | /* structure is used to return _all_ metrics in one call. */ |
- | |
237 | - | ||
238 | struct TT_Big_Glyph_Metrics_ |
- | |
239 | { |
- | |
240 | TT_BBox bbox; /* glyph bounding box */ |
- | |
241 | 1348 | /* */ |
|
242 | TT_Pos horiBearingX; /* left side bearing in horizontal layouts */ |
- | |
243 | TT_Pos horiBearingY; /* top side bearing in horizontal layouts */ |
- | |
244 | - | ||
245 | TT_Pos vertBearingX; /* left side bearing in vertical layouts */ |
1349 | /* Note that due to glyph hinting, these values might not be exact */ |
246 | TT_Pos vertBearingY; /* top side bearing in vertical layouts */ |
- | |
247 | - | ||
248 | TT_Pos horiAdvance; /* advance width for horizontal layout */ |
- | |
249 | TT_Pos vertAdvance; /* advance height for vertical layout */ |
- | |
250 | - | ||
251 | /* The following fields represent unhinted scaled metrics values. */ |
- | |
252 | /* They can be useful for applications needing to do some device */ |
- | |
253 | /* independent placement of glyphs. */ |
- | |
254 | /* */ |
- | |
255 | /* Applying these metrics to hinted glyphs will most surely ruin */ |
- | |
Line -... | Line 1350... | ||
- | 1350 | /* for certain fonts. Thus they must be treated as unreliable */ |
|
256 | /* the grid fitting performed by the bytecode interpreter. These */ |
1351 | /* with an error margin of at least one pixel! */ |
Line -... | Line 1352... | ||
- | 1352 | /* */ |
|
- | 1353 | /* Indeed, the only way to get the exact metrics is to render _all_ */ |
|
- | 1354 | /* glyphs. As this would be a definite performance hit, it is up to */ |
|
- | 1355 | /* client applications to perform such computations. */ |
|
- | 1356 | /* */ |
|
257 | /* values are better used to compute accumulated positioning */ |
1357 | /* The FT_Size_Metrics structure is valid for bitmap fonts also. */ |
- | 1358 | /* */ |
|
- | 1359 | typedef struct FT_Size_Metrics_ |
|
- | 1360 | { |
|
- | 1361 | FT_UShort x_ppem; /* horizontal pixels per EM */ |
|
- | 1362 | FT_UShort y_ppem; /* vertical pixels per EM */ |
|
- | 1363 | ||
- | 1364 | FT_Fixed x_scale; /* scaling values used to convert font */ |
|
- | 1365 | FT_Fixed y_scale; /* units to 26.6 fractional pixels */ |
|
- | 1366 | ||
- | 1367 | FT_Pos ascender; /* ascender in 26.6 frac. pixels */ |
|
- | 1368 | FT_Pos descender; /* descender in 26.6 frac. pixels */ |
|
- | 1369 | FT_Pos height; /* text height in 26.6 frac. pixels */ |
|
- | 1370 | FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */ |
|
- | 1371 | ||
- | 1372 | } FT_Size_Metrics; |
|
- | 1373 | ||
- | 1374 | ||
- | 1375 | /*************************************************************************/ |
|
- | 1376 | /* */ |
|
- | 1377 | /* |
|
- | 1378 | /* FT_SizeRec */ |
|
- | 1379 | /* */ |
|
258 | /* distances. */ |
1380 | /* |
317 | /* - for a WxH bitmap: */ |
1590 | /* */ |
- | 1591 | /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */ |
|
- | 1592 | /* origin_x -= 64; */ |
|
- | 1593 | /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */ |
|
318 | /* */ |
1594 | /* origin_x += 64; */ |
- | 1595 | /* */ |
|
- | 1596 | /* prev_rsb_delta = face->glyph->rsb_delta; */ |
|
- | 1597 | /* */ |
|
- | 1598 | /* |
|
- | 1599 | /* */ |
|
- | 1600 | /* origin_x += face->glyph->advance.x; */ |
|
- | 1601 | /* endfor */ |
|
- | 1602 | /* } */ |
|
- | 1603 | /* */ |
|
- | 1604 | typedef struct FT_GlyphSlotRec_ |
|
- | 1605 | { |
|
- | 1606 | FT_Library library; |
|
- | 1607 | FT_Face face; |
|
- | 1608 | FT_GlyphSlot next; |
|
- | 1609 | FT_UInt reserved; /* retained for binary compatibility */ |
|
- | 1610 | FT_Generic generic; |
|
- | 1611 | ||
- | 1612 | FT_Glyph_Metrics metrics; |
|
- | 1613 | FT_Fixed linearHoriAdvance; |
|
- | 1614 | FT_Fixed linearVertAdvance; |
|
- | 1615 | FT_Vector advance; |
|
- | 1616 | ||
- | 1617 | FT_Glyph_Format format; |
|
- | 1618 | ||
- | 1619 | FT_Bitmap bitmap; |
|
- | 1620 | FT_Int bitmap_left; |
|
- | 1621 | FT_Int bitmap_top; |
|
- | 1622 | ||
- | 1623 | FT_Outline outline; |
|
- | 1624 | ||
- | 1625 | FT_UInt num_subglyphs; |
|
- | 1626 | FT_SubGlyph subglyphs; |
|
- | 1627 | ||
319 | /* rows = H */ |
1628 | void* control_data; |
320 | /* cols = (W+7) / 8 */ |
1629 | long control_len; |
321 | /* width = W */ |
1630 | |
- | 1631 | FT_Pos lsb_delta; |
|
- | 1632 | FT_Pos rsb_delta; |
|
- | 1633 | ||
322 | /* flow = your_choice */ |
1634 | void* other; |
- | 1635 | ||
- | 1636 | FT_Slot_Internal internal; |
|
- | 1637 | ||
- | 1638 | } FT_GlyphSlotRec; |
|
- | 1639 | ||
- | 1640 | ||
- | 1641 | /*************************************************************************/ |
|
- | 1642 | /*************************************************************************/ |
|
- | 1643 | /* */ |
|
- | 1644 | /* F U N C T I O N S */ |
|
323 | /* */ |
1645 | /* */ |
- | 1646 | /*************************************************************************/ |
|
- | 1647 | /*************************************************************************/ |
|
- | 1648 | ||
- | 1649 | ||
- | 1650 | /*************************************************************************/ |
|
- | 1651 | /* */ |
|
- | 1652 | /* |
|
- | 1653 | /* FT_Init_FreeType */ |
|
324 | /* - for a WxH pixmap: */ |
1654 | /* */ |
- | 1655 | /* |
|
- | 1656 | /* Initialize a new FreeType library object. The set of modules */ |
|
325 | /* */ |
1657 | /* that are registered by this function is determined at build time. */ |
326 | /* rows = H */ |
1658 | /* */ |
- | 1659 | /* |
|
- | 1660 | /* alibrary :: A handle to a new library object. */ |
|
- | 1661 | /* */ |
|
- | 1662 | /* |
|
- | 1663 | /* FreeType error code. 0~means success. */ |
|
- | 1664 | /* */ |
|
- | 1665 | /* |
|
- | 1666 | /* In case you want to provide your own memory allocating routines, */ |
|
- | 1667 | /* use @FT_New_Library instead, followed by a call to */ |
|
- | 1668 | /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */ |
|
- | 1669 | /* */ |
|
- | 1670 | FT_EXPORT( FT_Error ) |
|
- | 1671 | FT_Init_FreeType( FT_Library *alibrary ); |
|
- | 1672 | ||
- | 1673 | ||
- | 1674 | /*************************************************************************/ |
|
327 | /* cols = (W+3) & ~3 */ |
1675 | /* */ |
328 | /* width = cols */ |
1676 | /* |
329 | /* flow = your_choice */ |
1677 | /* FT_Done_FreeType */ |
- | 1678 | /* */ |
|
- | 1679 | /* |
|
- | 1680 | /* Destroy a given FreeType library object and all of its children, */ |
|
- | 1681 | /* including resources, drivers, faces, sizes, etc. */ |
|
- | 1682 | /* */ |
|
- | 1683 | /* */ |
|
- | 1684 | /* library :: A handle to the target library object. */ |
|
- | 1685 | /* */ |
|
- | 1686 | /* |
|
- | 1687 | /* FreeType error code. 0~means success. */ |
|
- | 1688 | /* */ |
|
- | 1689 | FT_EXPORT( FT_Error ) |
|
330 | 1690 | FT_Done_FreeType( FT_Library library ); |
|
- | 1691 | ||
- | 1692 | ||
- | 1693 | /*************************************************************************/ |
|
- | 1694 | /* */ |
|
- | 1695 | /* |
|
- | 1696 | /* FT_OPEN_XXX */ |
|
- | 1697 | /* */ |
|
- | 1698 | /* |
|
- | 1699 | /* A list of bit-field constants used within the `flags' field of the */ |
|
- | 1700 | /* @FT_Open_Args structure. */ |
|
- | 1701 | /* */ |
|
- | 1702 | /* |
|
- | 1703 | /* FT_OPEN_MEMORY :: This is a memory-based stream. */ |
|
- | 1704 | /* */ |
|
- | 1705 | /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */ |
|
- | 1706 | /* */ |
|
- | 1707 | /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */ |
|
- | 1708 | /* name. */ |
|
- | 1709 | /* */ |
|
- | 1710 | /* FT_OPEN_DRIVER :: Use the `driver' field. */ |
|
- | 1711 | /* */ |
|
- | 1712 | /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */ |
|
- | 1713 | /* */ |
|
- | 1714 | /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */ |
|
- | 1715 | /* */ |
|
- | 1716 | /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */ |
|
- | 1717 | /* */ |
|
- | 1718 | /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */ |
|
- | 1719 | /* */ |
|
- | 1720 | /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */ |
|
- | 1721 | /* */ |
|
- | 1722 | /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */ |
|
- | 1723 | /* */ |
|
- | 1724 | /* |
|
331 | struct TT_Raster_Map_ |
1725 | /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */ |
- | 1726 | /* flags are mutually exclusive. */ |
|
- | 1727 | /* */ |
|
- | 1728 | #define FT_OPEN_MEMORY 0x1 |
|
- | 1729 | #define FT_OPEN_STREAM 0x2 |
|
- | 1730 | #define FT_OPEN_PATHNAME 0x4 |
|
- | 1731 | #define FT_OPEN_DRIVER 0x8 |
|
- | 1732 | #define FT_OPEN_PARAMS 0x10 |
|
- | 1733 | ||
- | 1734 | #define ft_open_memory FT_OPEN_MEMORY /* deprecated */ |
|
- | 1735 | #define ft_open_stream FT_OPEN_STREAM /* deprecated */ |
|
- | 1736 | #define ft_open_pathname FT_OPEN_PATHNAME /* deprecated */ |
|
- | 1737 | #define ft_open_driver FT_OPEN_DRIVER /* deprecated */ |
|
- | 1738 | #define ft_open_params FT_OPEN_PARAMS /* deprecated */ |
|
- | 1739 | ||
- | 1740 | ||
- | 1741 | /*************************************************************************/ |
|
- | 1742 | /* */ |
|
- | 1743 | /* |
|
332 | { |
1744 | /* FT_Parameter */ |
333 | int rows; /* number of rows */ |
1745 | /* */ |
334 | int cols; /* number of columns (bytes) per row */ |
- | |
335 | int width; /* number of pixels per line */ |
- | |
336 | int flow; /* bitmap orientation */ |
- | |
337 | - | ||
338 | void* bitmap; /* bit/pixmap buffer */ |
- | |
339 | long size; /* bit/pixmap size in bytes */ |
- | |
340 | }; |
- | |
341 | - | ||
342 | typedef struct TT_Raster_Map_ TT_Raster_Map; |
- | |
343 | - | ||
344 | - | ||
345 | /* ------ The font header TrueType table structure ------ */ |
- | |
346 | - | ||
347 | struct TT_Header_ |
- | |
348 | { |
1746 | /* |
349 | TT_Fixed Table_Version; |
1747 | /* A simple structure used to pass more or less generic parameters to */ |
350 | TT_Fixed Font_Revision; |
- | |
351 | - | ||
352 | TT_Long CheckSum_Adjust; |
- | |
353 | TT_Long Magic_Number; |
- | |
354 | - | ||
355 | TT_UShort Flags; |
- | |
356 | TT_UShort Units_Per_EM; |
- | |
357 | - | ||
358 | TT_Long Created [2]; |
- | |
359 | TT_Long Modified[2]; |
- | |
Line -... | Line 1748... | ||
- | 1748 | /* @FT_Open_Face. */ |
|
Line 360... | Line -... | ||
360 | - | ||
Line 361... | Line 1749... | ||
361 | TT_FWord xMin; |
1749 | /* */ |
- | 1750 | /* |
|
- | 1751 | /* tag :: A four-byte identification tag. */ |
|
- | 1752 | /* */ |
|
- | 1753 | /* data :: A pointer to the parameter data. */ |
|
- | 1754 | /* */ |
|
362 | TT_FWord yMin; |
1755 | /* |
- | 1756 | /* The ID and function of parameters are driver-specific. See the */ |
|
- | 1757 | /* various FT_PARAM_TAG_XXX flags for more information. */ |
|
- | 1758 | /* */ |
|
- | 1759 | typedef struct FT_Parameter_ |
|
- | 1760 | { |
|
- | 1761 | FT_ULong tag; |
|
- | 1762 | FT_Pointer data; |
|
- | 1763 | ||
- | 1764 | } FT_Parameter; |
|
- | 1765 | ||
- | 1766 | ||
- | 1767 | /*************************************************************************/ |
|
- | 1768 | /* */ |
|
- | 1769 | /* |
|
- | 1770 | /* FT_Open_Args */ |
|
363 | TT_FWord xMax; |
1771 | /* */ |
- | 1772 | /* |
|
- | 1773 | /* A structure used to indicate how to open a new font file or */ |
|
- | 1774 | /* stream. A pointer to such a structure can be used as a parameter */ |
|
- | 1775 | /* for the functions @FT_Open_Face and @FT_Attach_Stream. */ |
|
364 | TT_FWord yMax; |
1776 | /* */ |
365 | - | ||
- | 1777 | /* |
|
- | 1778 | /* flags :: A set of bit flags indicating how to use the */ |
|
- | 1779 | /* structure. */ |
|
- | 1780 | /* */ |
|
- | 1781 | /* memory_base :: The first byte of the file in memory. */ |
|
- | 1782 | /* */ |
|
- | 1783 | /* memory_size :: The size in bytes of the file in memory. */ |
|
- | 1784 | /* */ |
|
- | 1785 | /* pathname :: A pointer to an 8-bit file pathname. */ |
|
- | 1786 | /* */ |
|
- | 1787 | /* stream :: A handle to a source stream object. */ |
|
- | 1788 | /* */ |
|
- | 1789 | /* driver :: This field is exclusively used by @FT_Open_Face; */ |
|
- | 1790 | /* it simply specifies the font driver to use to open */ |
|
- | 1791 | /* the face. If set to~0, FreeType tries to load the */ |
|
- | 1792 | /* face with each one of the drivers in its list. */ |
|
- | 1793 | /* */ |
|
- | 1794 | /* num_params :: The number of extra parameters. */ |
|
- | 1795 | /* */ |
|
- | 1796 | /* params :: Extra parameters passed to the font driver when */ |
|
- | 1797 | /* opening a new face. */ |
|
- | 1798 | /* */ |
|
- | 1799 | /* |
|
- | 1800 | /* The stream type is determined by the contents of `flags' which */ |
|
- | 1801 | /* are tested in the following order by @FT_Open_Face: */ |
|
- | 1802 | /* */ |
|
- | 1803 | /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */ |
|
- | 1804 | /* memory file of `memory_size' bytes, located at `memory_address'. */ |
|
- | 1805 | /* The data are are not copied, and the client is responsible for */ |
|
- | 1806 | /* releasing and destroying them _after_ the corresponding call to */ |
|
366 | TT_UShort Mac_Style; |
1807 | /* @FT_Done_Face. */ |
367 | TT_UShort Lowest_Rec_PPEM; |
1808 | /* */ |
408 | /* The following fields are not defined by the TrueType specification */ |
2120 | /* determine the horizontal scaling value; the vertical scaling */ |
- | 2121 | /* value is determined the same way as */ |
|
- | 2122 | /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */ |
|
409 | /* but they're used to connect the metrics header to the relevant */ |
2123 | /* values are set to the smaller one. This type is useful if you */ |
410 | /* `HMTX' or `VMTX' table. */ |
2124 | /* want to specify the font size for, say, a window of a given */ |
411 | 2125 | /* dimension and 80x24 cells. */ |
|
- | 2126 | /* */ |
|
412 | void* long_metrics; |
2127 | /* FT_SIZE_REQUEST_TYPE_SCALES :: */ |
413 | void* short_metrics; |
2128 | /* Specify the scaling values directly. */ |
414 | }; |
2129 | /* */ |
- | 2130 | /* |
|
415 | 2131 | /* The above descriptions only apply to scalable formats. For bitmap */ |
|
- | 2132 | /* formats, the behaviour is up to the driver. */ |
|
416 | typedef struct TT_Horizontal_Header_ TT_Horizontal_Header; |
2133 | /* */ |
417 | 2134 | /* See the note section of @FT_Size_Metrics if you wonder how size */ |
|
- | 2135 | /* requesting relates to scaling values. */ |
|
418 | 2136 | /* */ |
|
419 | /*******************************************************/ |
2137 | typedef enum FT_Size_Request_Type_ |
420 | /* This structure is the one defined by the TrueType */ |
2138 | { |
421 | /* specification. Note that it has exactly the same */ |
2139 | FT_SIZE_REQUEST_TYPE_NOMINAL, |
422 | /* layout as the horizontal header (both are loaded */ |
- | |
423 | /* by the same function). */ |
2140 | FT_SIZE_REQUEST_TYPE_REAL_DIM, |
424 | 2141 | FT_SIZE_REQUEST_TYPE_BBOX, |
|
425 | struct TT_Vertical_Header_ |
2142 | FT_SIZE_REQUEST_TYPE_CELL, |
426 | { |
2143 | FT_SIZE_REQUEST_TYPE_SCALES, |
427 | TT_Fixed Version; |
- | |
428 | TT_FWord Ascender; |
2144 | |
429 | TT_FWord Descender; |
2145 | FT_SIZE_REQUEST_TYPE_MAX |
430 | TT_FWord Line_Gap; |
- | |
431 | 2146 | ||
432 | TT_UFWord advance_Height_Max; /* advance height maximum */ |
2147 | } FT_Size_Request_Type; |
- | 2148 | ||
433 | 2149 | ||
434 | TT_FWord min_Top_Side_Bearing; /* minimum left-sb or top-sb */ |
- | |
435 | TT_FWord min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */ |
2150 | /*************************************************************************/ |
436 | TT_FWord yMax_Extent; /* xmax or ymax extents */ |
2151 | /* */ |
437 | TT_FWord caret_Slope_Rise; |
- | |
438 | TT_FWord caret_Slope_Run; |
- | |
439 | TT_FWord caret_Offset; |
2152 | /* |
440 | - | ||
441 | TT_Short Reserved1, |
- | |
442 | Reserved2, |
2153 | /* FT_Size_RequestRec */ |
443 | Reserved3, |
- | |
444 | Reserved4; |
2154 | /* */ |
445 | 2155 | /* |
|
446 | TT_Short metric_Data_Format; |
2156 | /* A structure used to model a size request. */ |
447 | TT_UShort number_Of_VMetrics; |
2157 | /* */ |
448 | - | ||
- | 2158 | /* |
|
449 | /* The following fields are not defined by the TrueType specification */ |
2159 | /* type :: See @FT_Size_Request_Type. */ |
450 | /* but they're used to connect the metrics header to the relevant */ |
2160 | /* */ |
529 | }; |
2685 | /* This mode corresponds to vertical RGB and BGR sub-pixel displays */ |
530 | 2686 | /* (like PDA screens, rotated LCD displays, etc.). It produces */ |
|
531 | typedef struct TT_Postscript_ TT_Postscript; |
2687 | /* 8-bit bitmaps that are 3~times the height of the original */ |
- | 2688 | /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */ |
|
- | 2689 | /* */ |
|
- | 2690 | /* |
|
- | 2691 | /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */ |
|
- | 2692 | /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */ |
|
- | 2693 | /* (not active in the default builds). It is up to the caller to */ |
|
532 | 2694 | /* either call @FT_Library_SetLcdFilter (if available) or do the */ |
|
533 | 2695 | /* filtering itself. */ |
|
534 | /* ------ The horizontal device metrics table (`hdmx') ------ */ |
2696 | /* */ |
- | 2697 | /* The selected render mode only affects vector glyphs of a font. */ |
|
- | 2698 | /* Embedded bitmaps often have a different pixel mode like */ |
|
- | 2699 | /* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */ |
|
- | 2700 | /* them into 8-bit pixmaps. */ |
|
- | 2701 | /* */ |
|
- | 2702 | typedef enum FT_Render_Mode_ |
|
- | 2703 | { |
|
- | 2704 | FT_RENDER_MODE_NORMAL = 0, |
|
- | 2705 | FT_RENDER_MODE_LIGHT, |
|
- | 2706 | FT_RENDER_MODE_MONO, |
|
- | 2707 | FT_RENDER_MODE_LCD, |
|
- | 2708 | FT_RENDER_MODE_LCD_V, |
|
- | 2709 | ||
535 | 2710 | FT_RENDER_MODE_MAX |
|
- | 2711 | ||
536 | struct TT_Hdmx_Record_ |
2712 | } FT_Render_Mode; |
537 | { |
2713 | |
- | 2714 | ||
- | 2715 | /*************************************************************************/ |
|
- | 2716 | /* */ |
|
- | 2717 | /* |
|
- | 2718 | /* ft_render_mode_xxx */ |
|
- | 2719 | /* */ |
|
- | 2720 | /* |
|
- | 2721 | /* These constants are deprecated. Use the corresponding */ |
|
- | 2722 | /* @FT_Render_Mode values instead. */ |
|
- | 2723 | /* */ |
|
- | 2724 | /* |
|
- | 2725 | /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */ |
|
- | 2726 | /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */ |
|
- | 2727 | /* */ |
|
- | 2728 | #define ft_render_mode_normal FT_RENDER_MODE_NORMAL |
|
- | 2729 | #define ft_render_mode_mono FT_RENDER_MODE_MONO |
|
- | 2730 | ||
- | 2731 | ||
- | 2732 | /*************************************************************************/ |
|
- | 2733 | /* */ |
|
- | 2734 | /* |
|
- | 2735 | /* FT_Render_Glyph */ |
|
- | 2736 | /* */ |
|
- | 2737 | /* |
|
538 | TT_Byte ppem; |
2738 | /* Convert a given glyph image to a bitmap. It does so by inspecting */ |
- | 2739 | /* the glyph image format, finding the relevant renderer, and */ |
|
539 | TT_Byte max_width; |
2740 | /* invoking it. */ |
- | 2741 | /* */ |
|
- | 2742 | /* |
|
- | 2743 | /* slot :: A handle to the glyph slot containing the image to */ |
|
- | 2744 | /* convert. */ |
|
- | 2745 | /* */ |
|
- | 2746 | /* */ |
|
- | 2747 | /* render_mode :: This is the render mode used to render the glyph */ |
|
- | 2748 | /* image into a bitmap. See @FT_Render_Mode for a */ |
|
- | 2749 | /* list of possible values. */ |
|
- | 2750 | /* */ |
|
- | 2751 | /* |
|
- | 2752 | /* FreeType error code. 0~means success. */ |
|
- | 2753 | /* */ |
|
- | 2754 | FT_EXPORT( FT_Error ) |
|
- | 2755 | FT_Render_Glyph( FT_GlyphSlot slot, |
|
- | 2756 | FT_Render_Mode render_mode ); |
|
- | 2757 | ||
- | 2758 | ||
- | 2759 | /*************************************************************************/ |
|
540 | TT_Byte* widths; |
2760 | /* */ |
541 | }; |
2761 | /* |
Line 728... | Line -... | ||
728 | /* will be re-opened automatically on the next disk access. */ |
- | |
729 | - | ||
730 | EXPORT_DEF |
- | |
731 | TT_Error TT_Flush_Face( TT_Face face ); |
- | |
732 | - | ||
733 | /* Get a face's glyph metrics expressed in font units. Returns any */ |
- | |
734 | /* number of arrays. Set the fields to NULL if you are not interested */ |
- | |
735 | /* by a given array. */ |
- | |
736 | - | ||
737 | EXPORT_DEF |
- | |
738 | TT_Error TT_Get_Face_Metrics( TT_Face face, |
- | |
739 | TT_UShort firstGlyph, |
- | |
740 | TT_UShort lastGlyph, |
- | |
741 | TT_Short* leftBearings, |
- | |
742 | TT_UShort* widths, |
- | |
743 | TT_Short* topBearings, |
- | |
744 | TT_UShort* heights ); |
- | |
745 | - | ||
746 | - | ||
747 | /* Close a given font object, destroying all associated */ |
- | |
748 | /* instances. */ |
- | |
749 | - | ||
750 | EXPORT_DEF |
- | |
751 | TT_Error TT_Close_Face( TT_Face face ); |
- | |
752 | - | ||
753 | - | ||
754 | /* Get font or table data. */ |
- | |
755 | - | ||
756 | EXPORT_DEF |
- | |
757 | TT_Error TT_Get_Font_Data( TT_Face face, |
- | |
758 | TT_ULong tag, |
- | |
759 | TT_Long offset, |
- | |
760 | void* buffer, |
- | |
761 | TT_Long* length ); |
- | |
762 | - | ||
763 | - | ||
764 | /* A simple macro to build table tags from ASCII chars */ |
- | |
765 | - | ||
766 | #define MAKE_TT_TAG( _x1, _x2, _x3, _x4 ) \ |
- | |
767 | (((TT_ULong)_x1 << 24) | \ |
- | |
768 | ((TT_ULong)_x2 << 16) | \ |
- | |
769 | ((TT_ULong)_x3 << 8) | \ |
- | |
770 | (TT_ULong)_x4) |
- | |
771 | - | ||
772 | - | ||
773 | - | ||
774 | /* ----------------------- instance management -------------------- */ |
- | |
775 | - | ||
776 | /* Open a new font instance and returns an instance handle */ |
- | |
777 | /* for it in `*instance'. */ |
- | |
778 | - | ||
779 | EXPORT_DEF |
- | |
780 | TT_Error TT_New_Instance( TT_Face face, |
- | |
781 | TT_Instance* instance ); |
- | |
782 | - | ||
783 | - | ||
784 | /* Set device resolution for a given instance. The values are */ |
- | |
785 | /* given in dpi (Dots Per Inch). Default is 96 in both directions. */ |
- | |
786 | - | ||
787 | EXPORT_DEF |
- | |
788 | TT_Error TT_Set_Instance_Resolutions( TT_Instance instance, |
- | |
789 | TT_UShort xResolution, |
- | |
790 | TT_UShort yResolution ); |
- | |
791 | - | ||
792 | - | ||
793 | /* Set the pointsize for a given instance. Default is 10pt. */ |
- | |
794 | - | ||
795 | EXPORT_DEF |
- | |
796 | TT_Error TT_Set_Instance_CharSize( TT_Instance instance, |
- | |
797 | TT_F26Dot6 charSize ); |
- | |
798 | - | ||
799 | EXPORT_DEF |
- | |
800 | TT_Error TT_Set_Instance_CharSizes( TT_Instance instance, |
- | |
801 | TT_F26Dot6 charWidth, |
- | |
802 | TT_F26Dot6 charHeight ); |
- | |
803 | - | ||
804 | #define TT_Set_Instance_PointSize( ins, ptsize ) \ |
- | |
805 | TT_Set_Instance_CharSize( ins, ptsize*64L ) |
- | |
806 | - | ||
807 | EXPORT_DEF |
- | |
808 | TT_Error TT_Set_Instance_PixelSizes( TT_Instance instance, |
- | |
809 | TT_UShort pixelWidth, |
- | |
810 | TT_UShort pixelHeight, |
- | |
811 | TT_F26Dot6 pointSize ); |
- | |
812 | - | ||
813 | - | ||
814 | /* This function has been deprecated! Do not use it, as it */ |
- | |
815 | /* doesn't work reliably. You can perfectly control hinting */ |
- | |
816 | /* yourself when loading glyphs, then apply transforms as usual. */ |
- | |
817 | - | ||
818 | EXPORT_DEF |
- | |
819 | TT_Error TT_Set_Instance_Transform_Flags( TT_Instance instance, |
- | |
820 | TT_Bool rotated, |
- | |
821 | TT_Bool stretched ); |
- | |
822 | - | ||
823 | - | ||
824 | /* Return instance metrics in `metrics'. */ |
- | |
825 | - | ||
826 | EXPORT_DEF |
- | |
827 | TT_Error TT_Get_Instance_Metrics( TT_Instance instance, |
- | |
828 | TT_Instance_Metrics* metrics ); |
- | |
829 | - | ||
830 | - | ||
831 | /* Set an instance's generic pointer. */ |
- | |
832 | - | ||
833 | EXPORT_DEF |
- | |
834 | TT_Error TT_Set_Instance_Pointer( TT_Instance instance, |
- | |
835 | void* data ); |
- | |
836 | - | ||
837 | - | ||
838 | /* Get an instance's generic pointer. */ |
- | |
839 | - | ||
840 | EXPORT_DEF |
- | |
841 | void* TT_Get_Instance_Pointer( TT_Instance instance ); |
- | |
842 | - | ||
843 | - | ||
844 | /* Close a given instance object, destroying all associated data. */ |
- | |
845 | - | ||
846 | EXPORT_DEF |
- | |
847 | TT_Error TT_Done_Instance( TT_Instance instance ); |
- | |
848 | - | ||
849 | - | ||
850 | - | ||
851 | /* ----------------------- glyph management ----------------------- */ |
- | |
852 | - | ||
853 | /* Create a new glyph object related to the given `face'. */ |
- | |
854 | - | ||
855 | EXPORT_DEF |
- | |
856 | TT_Error TT_New_Glyph( TT_Face face, |
- | |
857 | TT_Glyph* glyph ); |
- | |
858 | - | ||
859 | - | ||
860 | /* Discard (and destroy) a given glyph object. */ |
- | |
861 | - | ||
862 | EXPORT_DEF |
- | |
863 | TT_Error TT_Done_Glyph( TT_Glyph glyph ); |
- | |
864 | - | ||
865 | - | ||
866 | #define TTLOAD_SCALE_GLYPH 1 |
- | |
867 | #define TTLOAD_HINT_GLYPH 2 |
- | |
868 | #define TTLOAD_PEDANTIC 128 |
- | |
869 | #define TTLOAD_IGNORE_GLOBAL_ADVANCE_WIDTH 256 |
- | |
870 | - | ||
871 | #define TTLOAD_DEFAULT (TTLOAD_SCALE_GLYPH | TTLOAD_HINT_GLYPH) |
- | |
872 | - | ||
873 | - | ||
874 | /* Load and process (scale/transform and hint) a glyph from the */ |
- | |
875 | /* given `instance'. The glyph and instance handles must be */ |
- | |
876 | /* related to the same face object. The glyph index can be */ |
3633 | /* */ |
877 | /* computed with a call to TT_Char_Index(). */ |
- | |
878 | /* */ |
- | |
879 | /* The 'load_flags' argument is a combination of the macros */ |
- | |
880 | /* TTLOAD_SCALE_GLYPH and TTLOAD_HINT_GLYPH. Hinting will be */ |
- | |
881 | /* applied only if the scaling is selected. */ |
- | |
882 | /* */ |
- | |
883 | /* If scaling is off (i.e., load_flags = 0), the returned */ |
- | |
884 | /* outlines are in EM square coordinates (also called FUnits), */ |
- | |
885 | /* extracted directly from the font with no hinting. Other */ |
- | |
886 | /* glyph metrics are also in FUnits. */ |
- | |
887 | /* */ |
- | |
888 | /* If scaling is on, the returned outlines are in fractional */ |
- | |
889 | /* pixel units (i.e. TT_F26Dot6 = 26.6 fixed floats). */ |
- | |
890 | /* */ |
- | |
891 | /* NOTE: The glyph index must be in the range 0..num_glyphs-1, */ |
- | |
892 | /* where `num_glyphs' is the total number of glyphs in */ |
- | |
893 | /* the font file (given in the face properties). */ |
- | |
894 | - | ||
895 | EXPORT_DEF |
- | |
896 | TT_Error TT_Load_Glyph( TT_Instance instance, |
- | |
897 | TT_Glyph glyph, |
- | |
898 | TT_UShort glyphIndex, |
- | |
899 | TT_UShort loadFlags ); |
- | |
900 | - | ||
901 | - | ||
902 | /* Return glyph outline pointers in `outline'. Note that the returned */ |
- | |
903 | /* pointers are owned by the glyph object, and will be destroyed with */ |
- | |
904 | /* it. The client application should _not_ change the pointers. */ |
- | |
905 | - | ||
906 | EXPORT_DEF |
- | |
907 | TT_Error TT_Get_Glyph_Outline( TT_Glyph glyph, |
- | |
908 | TT_Outline* outline ); |
- | |
909 | - | ||
910 | - | ||
911 | /* Copy the glyph metrics into `metrics'. */ |
- | |
912 | - | ||
913 | EXPORT_DEF |
- | |
914 | TT_Error TT_Get_Glyph_Metrics( TT_Glyph glyph, |
- | |
915 | TT_Glyph_Metrics* metrics ); |
- | |
916 | - | ||
917 | - | ||
918 | /* Copy the glyph's big metrics into `metrics'. */ |
- | |
919 | /* Necessary to obtain vertical metrics. */ |
- | |
920 | - | ||
921 | EXPORT_DEF |
- | |
922 | TT_Error TT_Get_Glyph_Big_Metrics( TT_Glyph glyph, |
- | |
923 | TT_Big_Glyph_Metrics* metrics ); |
- | |
924 | - | ||
925 | - | ||
926 | /* Render the glyph into a bitmap, with given position offsets. */ |
- | |
927 | /* */ |
- | |
928 | /* Note: Only use integer pixel offsets to preserve the fine */ |
- | |
929 | /* hinting of the glyph and the `correct' anti-aliasing */ |
- | |
930 | /* (where vertical and horizontal stems aren't grayed). This */ |
- | |
931 | /* means that `xOffset' and `yOffset' must be multiples */ |
- | |
932 | /* of 64! */ |
- | |
933 | - | ||
934 | EXPORT_DEF |
- | |
935 | TT_Error TT_Get_Glyph_Bitmap( TT_Glyph glyph, |
- | |
936 | TT_Raster_Map* map, |
- | |
937 | TT_F26Dot6 xOffset, |
- | |
938 | TT_F26Dot6 yOffset ); |
- | |
939 | - | ||
940 | - | ||
941 | /* Render the glyph into a pixmap, with given position offsets. */ |
- | |
942 | /* */ |
- | |
943 | /* Note: Only use integer pixel offsets to preserve the fine */ |
- | |
944 | /* hinting of the glyph and the `correct' anti-aliasing */ |
- | |
945 | /* (where vertical and horizontal stems aren't grayed). This */ |
- | |
946 | /* means that `xOffset' and `yOffset' must be multiples */ |
- | |
947 | /* of 64! */ |
- | |
948 | - | ||
949 | EXPORT_DEF |
- | |
950 | TT_Error TT_Get_Glyph_Pixmap( TT_Glyph glyph, |
- | |
951 | TT_Raster_Map* map, |
- | |
952 | TT_F26Dot6 xOffset, |
- | |
953 | TT_F26Dot6 yOffset ); |
- | |
954 | - | ||
955 | - | ||
956 | - | ||
957 | /* ----------------------- outline support ------------------------ */ |
- | |
958 | - | ||
959 | /* Allocate a new outline. Reserve space for `numPoints' and */ |
- | |
960 | /* `numContours'. */ |
- | |
961 | - | ||
962 | EXPORT_DEF |
- | |
963 | TT_Error TT_New_Outline( TT_UShort numPoints, |
- | |
964 | TT_Short numContours, |
- | |
965 | TT_Outline* outline ); |
- | |
966 | - | ||
967 | - | ||
968 | /* Release an outline. */ |
- | |
969 | - | ||
970 | EXPORT_DEF |
- | |
971 | TT_Error TT_Done_Outline( TT_Outline* outline ); |
- | |
972 | - | ||
973 | - | ||
974 | /* Copy an outline into another one. */ |
- | |
975 | - | ||
976 | EXPORT_DEF |
- | |
977 | TT_Error TT_Copy_Outline( TT_Outline* source, |
- | |
978 | TT_Outline* target ); |
- | |
979 | - | ||
980 | - | ||
981 | /* Render an outline into a bitmap. */ |
- | |
982 | - | ||
983 | EXPORT_DEF |
- | |
984 | TT_Error TT_Get_Outline_Bitmap( TT_Engine engine, |
- | |
985 | TT_Outline* outline, |
- | |
986 | TT_Raster_Map* map ); |
- | |
987 | - | ||
988 | - | ||
989 | /* Render an outline into a pixmap. */ |
- | |
990 | - | ||
991 | EXPORT_DEF |
- | |
992 | TT_Error TT_Get_Outline_Pixmap( TT_Engine engine, |
- | |
993 | TT_Outline* outline, |
- | |
994 | TT_Raster_Map* map ); |
- | |
995 | - | ||
996 | - | ||
997 | /* Return an outline's bounding box -- this function is slow as it */ |
- | |
998 | /* performs a complete scan-line process, without drawing, to get */ |
- | |
999 | /* the most accurate values. */ |
- | |
1000 | - | ||
1001 | EXPORT_DEF |
- | |
1002 | TT_Error TT_Get_Outline_BBox( TT_Outline* outline, |
- | |
1003 | TT_BBox* bbox ); |
- | |
1004 | - | ||
1005 | - | ||
1006 | /* Apply a transformation to a glyph outline. */ |
- | |
1007 | - | ||
1008 | EXPORT_DEF |
- | |
1009 | void TT_Transform_Outline( TT_Outline* outline, |
- | |
1010 | TT_Matrix* matrix ); |
- | |
1011 | - | ||
1012 | - | ||
1013 | /* Apply a translation to a glyph outline. */ |
- | |
1014 | - | ||
1015 | EXPORT_DEF |
- | |
1016 | void TT_Translate_Outline( TT_Outline* outline, |
- | |
1017 | TT_F26Dot6 xOffset, |
- | |
1018 | TT_F26Dot6 yOffset ); |
- | |
1019 | - | ||
1020 | - | ||
1021 | /* Apply a transformation to a vector. */ |
- | |
1022 | - | ||
1023 | EXPORT_DEF |
- | |
1024 | void TT_Transform_Vector( TT_F26Dot6* x, |
- | |
1025 | TT_F26Dot6* y, |
- | |
1026 | TT_Matrix* matrix ); |
- | |
1027 | - | ||
1028 | - | ||
1029 | /* Compute A*B/C with 64 bits intermediate precision. */ |
- | |
1030 | - | ||
1031 | EXPORT_DEF |
- | |
1032 | TT_Long TT_MulDiv( TT_Long A, |
- | |
1033 | TT_Long B, |
- | |
1034 | TT_Long C ); |
- | |
1035 | - | ||
1036 | - | ||
1037 | /* Compute A*B/0x10000 with 64 bits intermediate precision. */ |
- | |
1038 | /* Useful to multiply by a 16.16 fixed float value. */ |
- | |
1039 | - | ||
1040 | EXPORT_DEF |
3634 | /* |
1041 | TT_Long TT_MulFix( TT_Long A, |
- | |
1042 | TT_Long B ); |
- | |
1043 | - | ||
1044 | - | ||
1045 | /* ----------------- character mapping support --------------- */ |
- | |
1046 | - | ||
1047 | /* Return the number of character mappings found in this file. */ |
- | |
1048 | /* Returns -1 in case of failure (invalid face handle). */ |
- | |
1049 | /* */ |
- | |
1050 | /* DON'T USE THIS FUNCTION! IT HAS BEEN DEPRECATED! */ |
- | |
1051 | /* */ |
- | |
1052 | /* It is retained for backwards compatibility only and will */ |
- | |
1053 | /* fail on 16bit systems. */ |
- | |
1054 | /* */ |
- | |
1055 | /* You can now get the charmap count in the `num_CharMaps' */ |
- | |
1056 | /* field of a face's properties. */ |
- | |
1057 | /* */ |
- | |
1058 | - | ||
1059 | EXPORT_DEF |
- | |
1060 | int TT_Get_CharMap_Count( TT_Face face ); |
- | |
1061 | - | ||
1062 | - | ||
1063 | /* Return the ID of charmap number `charmapIndex' of a given face */ |
- | |
1064 | /* used to enumerate the charmaps present in a TrueType file. */ |
- | |
1065 | - | ||
1066 | EXPORT_DEF |
- | |
1067 | TT_Error TT_Get_CharMap_ID( TT_Face face, |
- | |
1068 | TT_UShort charmapIndex, |
- | |
1069 | TT_UShort* platformID, |
- | |
1070 | TT_UShort* encodingID ); |
- | |
1071 | - | ||
1072 | - | ||
1073 | /* Look up the character maps found in `face' and return a handle */ |
- | |
1074 | /* for the one matching `platformID' and `platformEncodingID' */ |
- | |
1075 | /* (see the TrueType specs relating to the `cmap' table for */ |
- | |
1076 | /* information on these ID numbers). Returns an error code. */ |
- | |
1077 | /* In case of failure, the handle is set to NULL and is invalid. */ |
- | |
1078 | - | ||
1079 | EXPORT_DEF |
- | |
1080 | TT_Error TT_Get_CharMap( TT_Face face, |
- | |
1081 | TT_UShort charmapIndex, |
- | |
1082 | TT_CharMap* charMap ); |
- | |
1083 | - | ||
1084 | - | ||
1085 | /* Translate a character code through a given character map */ |
- | |
1086 | /* and return the corresponding glyph index to be used in */ |
- | |
1087 | /* a TT_Load_Glyph() call. This function returns 0 in case */ |
- | |
1088 | /* of failure. */ |
- | |
1089 | - | ||
1090 | EXPORT_DEF |
- | |
1091 | TT_UShort TT_Char_Index( TT_CharMap charMap, |
- | |
1092 | TT_UShort charCode ); |
- | |
1093 | - | ||
1094 | - | ||
1095 | - | ||
Line 1096... | Line 3635... | ||
1096 | /* --------------------- names table support ------------------- */ |
3635 | /* The result of `(a*b)/0x10000'. */ |
1097 | - | ||
1098 | /* Return the number of name strings found in the name table. */ |
- | |
1099 | /* Returns -1 in case of failure (invalid face handle). */ |
3636 | /* */ |
- | 3637 | /* |
|
1100 | /* */ |
3638 | /* This function has been optimized for the case where the absolute */ |
1101 | /* DON'T USE THIS FUNCTION! IT HAS BEEN DEPRECATED! */ |
3639 | /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */ |
1102 | /* */ |
3640 | /* As this happens mainly when scaling from notional units to */ |
- | 3641 | /* fractional pixels in FreeType, it resulted in noticeable speed */ |
|
Line -... | Line 3642... | ||
- | 3642 | /* improvements between versions 2.x and 1.x. */ |
|
- | 3643 | /* */ |
|
- | 3644 | /* As a conclusion, always try to place a 16.16 factor as the */ |
|
- | 3645 | /* _second_ argument of this function; this can make a great */ |
|
- | 3646 | /* difference. */ |
|
- | 3647 | /* */ |
|
- | 3648 | FT_EXPORT( FT_Long ) |
|
- | 3649 | FT_MulFix( FT_Long a, |
|
- | 3650 | FT_Long b ); |
|
- | 3651 | ||
- | 3652 | /* */ |
|
- | 3653 | #endif |
|
- | 3654 | ||
- | 3655 | #ifdef FT_MULFIX_INLINED |
|
- | 3656 | #define FT_MulFix( a, b ) FT_MULFIX_INLINED( a, b ) |
|
- | 3657 | #else |
|
- | 3658 | FT_EXPORT( FT_Long ) |
|
- | 3659 | FT_MulFix( FT_Long a, |
|
- | 3660 | FT_Long b ); |
|
- | 3661 | #endif |
|
- | 3662 | ||
- | 3663 | ||
- | 3664 | /*************************************************************************/ |
|
- | 3665 | /* */ |
|
- | 3666 | /* |
|
- | 3667 | /* FT_DivFix */ |
|
- | 3668 | /* */ |
|
- | 3669 | /* |
|
- | 3670 | /* A very simple function used to perform the computation */ |
|
- | 3671 | /* `(a*0x10000)/b' with maximal accuracy. Most of the time, this is */ |
|
- | 3672 | /* used to divide a given value by a 16.16 fixed float factor. */ |
|
- | 3673 | /* */ |
|
- | 3674 | /* */ |
|
- | 3675 | /* a :: The first multiplier. */ |
|
- | 3676 | /* b :: The second multiplier. Use a 16.16 factor here whenever */ |
|
- | 3677 | /* possible (see note below). */ |
|
- | 3678 | /* */ |
|
- | 3679 | /* |
|
- | 3680 | /* The result of `(a*0x10000)/b'. */ |
|
1103 | /* It is retained for backwards compatibility only and will */ |
3681 | /* */ |
- | 3682 | /* |
|
- | 3683 | /* The optimization for FT_DivFix() is simple: If (a~<<~16) fits in */ |
|
- | 3684 | /* 32~bits, then the division is computed directly. Otherwise, we */ |
|
- | 3685 | /* use a specialized version of @FT_MulDiv. */ |
|
- | 3686 | /* */ |
|
- | 3687 | FT_EXPORT( FT_Long ) |
|
- | 3688 | FT_DivFix( FT_Long a, |
|
- | 3689 | FT_Long b ); |
|
- | 3690 | ||
- | 3691 | ||
- | 3692 | /*************************************************************************/ |
|
- | 3693 | /* */ |
|
- | 3694 | /* |
|
- | 3695 | /* FT_RoundFix */ |
|
- | 3696 | /* */ |
|
- | 3697 | /* |
|
1104 | /* fail on 16bit systems. */ |
3698 | /* A very simple function used to round a 16.16 fixed number. */ |
- | 3699 | /* */ |
|
- | 3700 | /* */ |
|
- | 3701 | /* a :: The number to be rounded. */ |
|
- | 3702 | /* */ |
|
- | 3703 | /* |
|
- | 3704 | /* The result of `(a + 0x8000) & -0x10000'. */ |
|
- | 3705 | /* */ |
|
- | 3706 | FT_EXPORT( FT_Fixed ) |
|
- | 3707 | FT_RoundFix( FT_Fixed a ); |
|
- | 3708 | ||
- | 3709 | ||
- | 3710 | /*************************************************************************/ |
|
- | 3711 | /* */ |
|
- | 3712 | /* |
|
- | 3713 | /* FT_CeilFix */ |
|
- | 3714 | /* */ |
|
- | 3715 | /* |
|
- | 3716 | /* A very simple function used to compute the ceiling function of a */ |
|
- | 3717 | /* 16.16 fixed number. */ |
|
- | 3718 | /* */ |
|
- | 3719 | /* */ |
|
- | 3720 | /* a :: The number for which the ceiling function is to be computed. */ |
|
- | 3721 | /* */ |
|
- | 3722 | /* |
|
- | 3723 | /* The result of `(a + 0x10000 - 1) & -0x10000'. */ |
|
- | 3724 | /* */ |
|
- | 3725 | FT_EXPORT( FT_Fixed ) |
|
- | 3726 | FT_CeilFix( FT_Fixed a ); |
|
- | 3727 | ||
- | 3728 | ||
- | 3729 | /*************************************************************************/ |
|
- | 3730 | /* */ |
|
- | 3731 | /* |
|
- | 3732 | /* FT_FloorFix */ |
|
- | 3733 | /* */ |
|
- | 3734 | /* |
|
- | 3735 | /* A very simple function used to compute the floor function of a */ |
|
- | 3736 | /* 16.16 fixed number. */ |
|
- | 3737 | /* */ |
|
1105 | /* */ |
3738 | /* */ |
- | 3739 | /* a :: The number for which the floor function is to be computed. */ |
|
- | 3740 | /* */ |
|
- | 3741 | /* |
|
- | 3742 | /* The result of `a & -0x10000'. */ |
|
- | 3743 | /* */ |
|
- | 3744 | FT_EXPORT( FT_Fixed ) |
|
- | 3745 | FT_FloorFix( FT_Fixed a ); |
|
- | 3746 | ||
- | 3747 | ||
- | 3748 | /*************************************************************************/ |
|
- | 3749 | /* */ |
|
- | 3750 | /* |
|
- | 3751 | /* FT_Vector_Transform */ |
|
- | 3752 | /* */ |
|
1106 | /* You can now get the number of name strings in a face with */ |
3753 | /* |
- | 3754 | /* Transform a single vector through a 2x2 matrix. */ |
|
- | 3755 | /* */ |
|
- | 3756 | /* |
|
- | 3757 | /* vector :: The target vector to transform. */ |
|
1107 | /* the `num_Names' field of its properties. */ |
3758 | /* */ |
- | 3759 | /* */ |
|
1108 | 3760 | /* matrix :: A pointer to the source 2x2 matrix. */ |
|
- | 3761 | /* */ |
|
- | 3762 | /* |
|
- | 3763 | /* The result is undefined if either `vector' or `matrix' is invalid. */ |
|
- | 3764 | /* */ |
|
- | 3765 | FT_EXPORT( void ) |
|
- | 3766 | FT_Vector_Transform( FT_Vector* vec, |
|
- | 3767 | const FT_Matrix* matrix ); |
|
- | 3768 | ||
- | 3769 | ||
- | 3770 | /*************************************************************************/ |
|
- | 3771 | /* */ |
|
- | 3772 | /* |
|
- | 3773 | /* version */ |
|
- | 3774 | /* */ |
|
- | 3775 | /* |
|
- | 3776 | /* FreeType Version */ |
|
- | 3777 | /* */ |
|
- | 3778 | /* |
|
- | 3779 | /* Functions and macros related to FreeType versions. */ |
|
- | 3780 | /* */ |
|
- | 3781 | /* |
|
- | 3782 | /* Note that those functions and macros are of limited use because */ |
|
- | 3783 | /* even a new release of FreeType with only documentation changes */ |
|
- | 3784 | /* increases the version number. */ |
|
- | 3785 | /* */ |
|
- | 3786 | /*************************************************************************/ |
|
- | 3787 | ||
- | 3788 | ||
- | 3789 | /************************************************************************* |
|
- | 3790 | * |
|
- | 3791 | * @enum: |
|
- | 3792 | * FREETYPE_XXX |
|
- | 3793 | * |
|
- | 3794 | * @description: |
|
- | 3795 | * These three macros identify the FreeType source code version. |
|
- | 3796 | * Use @FT_Library_Version to access them at runtime. |
|
- | 3797 | * |
|
- | 3798 | * @values: |
|
- | 3799 | * FREETYPE_MAJOR :: The major version number. |
|
- | 3800 | * FREETYPE_MINOR :: The minor version number. |
|
- | 3801 | * FREETYPE_PATCH :: The patch level. |
|
- | 3802 | * |
|
- | 3803 | * @note: |
|
- | 3804 | * The version number of FreeType if built as a dynamic link library |
|
- | 3805 | * with the `libtool' package is _not_ controlled by these three |
|
- | 3806 | * macros. |
|
- | 3807 | * |
|
- | 3808 | */ |
|
- | 3809 | #define FREETYPE_MAJOR 2 |
|
- | 3810 | #define FREETYPE_MINOR 4 |
|
- | 3811 | #define FREETYPE_PATCH 4 |
|
- | 3812 | ||
- | 3813 | ||
- | 3814 | /*************************************************************************/ |
|
- | 3815 | /* */ |
|
- | 3816 | /* |
|
- | 3817 | /* FT_Library_Version */ |
|
- | 3818 | /* */ |
|
- | 3819 | /* |
|
- | 3820 | /* Return the version of the FreeType library being used. This is */ |
|
- | 3821 | /* useful when dynamically linking to the library, since one cannot */ |
|
- | 3822 | /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */ |
|
- | 3823 | /* @FREETYPE_PATCH. */ |
|
- | 3824 | /* */ |
|
- | 3825 | /* */ |
|
- | 3826 | /* library :: A source library handle. */ |
|
- | 3827 | /* */ |
|
- | 3828 | /* |
|
- | 3829 | /* amajor :: The major version number. */ |
|
- | 3830 | /* */ |
|
- | 3831 | /* aminor :: The minor version number. */ |
|
- | 3832 | /* */ |
|
- | 3833 | /* apatch :: The patch version number. */ |
|
- | 3834 | /* */ |
|
- | 3835 | /* |
|
- | 3836 | /* The reason why this function takes a `library' argument is because */ |
|
- | 3837 | /* certain programs implement library initialization in a custom way */ |
|
- | 3838 | /* that doesn't use @FT_Init_FreeType. */ |
|
- | 3839 | /* */ |
|
- | 3840 | /* In such cases, the library version might not be available before */ |
|
- | 3841 | /* the library object has been created. */ |
|
- | 3842 | /* */ |
|
- | 3843 | FT_EXPORT( void ) |
|
- | 3844 | FT_Library_Version( FT_Library library, |
|
- | 3845 | FT_Int *amajor, |
|
- | 3846 | FT_Int *aminor, |
|
- | 3847 | FT_Int *apatch ); |
|
- | 3848 | ||
- | 3849 | ||
- | 3850 | /*************************************************************************/ |
|
- | 3851 | /* */ |
|
- | 3852 | /* |
|
- | 3853 | /* FT_Face_CheckTrueTypePatents */ |
|
- | 3854 | /* */ |
|
- | 3855 | /* |
|
- | 3856 | /* Parse all bytecode instructions of a TrueType font file to check */ |
|
- | 3857 | /* whether any of the patented opcodes are used. This is only useful */ |
|
- | 3858 | /* if you want to be able to use the unpatented hinter with */ |
|
- | 3859 | /* fonts that do *not* use these opcodes. */ |
|
- | 3860 | /* */ |
|
- | 3861 | /* Note that this function parses *all* glyph instructions in the */ |
|
- | 3862 | /* font file, which may be slow. */ |
|
- | 3863 | /* */ |
|
- | 3864 | /* */ |
|
- | 3865 | /* face :: A face handle. */ |
|
- | 3866 | /* */ |
|
- | 3867 | /* |
|
- | 3868 | /* 1~if this is a TrueType font that uses one of the patented */ |
|
- | 3869 | /* opcodes, 0~otherwise. */ |
|
- | 3870 | /* */ |
|
- | 3871 | /* |
|
- | 3872 | /* Since May 2010, TrueType hinting is no longer patented. */ |
|
- | 3873 | /* */ |
|
1109 | EXPORT_DEF |
3874 | /* |
- | 3875 | /* 2.3.5 */ |
|
- | 3876 | /* */ |
|
- | 3877 | FT_EXPORT( FT_Bool ) |
|
- | 3878 | FT_Face_CheckTrueTypePatents( FT_Face face ); |
|
- | 3879 | ||
- | 3880 | ||
- | 3881 | /*************************************************************************/ |
|
- | 3882 | /* */ |
|
- | 3883 | /* |
|
- | 3884 | /* FT_Face_SetUnpatentedHinting */ |
|
- | 3885 | /* */ |
|
- | 3886 | /* |
|
- | 3887 | /* Enable or disable the unpatented hinter for a given face. */ |
|
Line 1110... | Line 3888... | ||
1110 | int TT_Get_Name_Count( TT_Face face ); |
3888 | /* Only enable it if you have determined that the face doesn't */ |
1111 | - | ||
1112 | - | ||
1113 | /* Return the ID of the name number `nameIndex' of a given face */ |
- | |
1114 | /* used to enumerate the charmaps present in a TrueType file. */ |
- | |
Line 1115... | Line 3889... | ||
1115 | 3889 | /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */ |
|
1116 | EXPORT_DEF |
- | |
1117 | TT_Error TT_Get_Name_ID( TT_Face face, |
- | |
Line 1118... | Line 3890... | ||
1118 | TT_UShort nameIndex, |
3890 | /* */ |
Line 1119... | Line 3891... | ||
1119 | TT_UShort* platformID, |
3891 | /* */ |