PageRenderTime 60ms CodeModel.GetById 29ms app.highlight 19ms RepoModel.GetById 1ms app.codeStats 1ms

/src/freetype/include/freetype/freetype.h

https://bitbucket.org/cabalistic/ogredeps/
C++ Header | 3945 lines | 481 code | 296 blank | 3168 comment | 0 complexity | 1144f01f2dfaa56d1237f8b041059b89 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1/***************************************************************************/
  2/*                                                                         */
  3/*  freetype.h                                                             */
  4/*                                                                         */
  5/*    FreeType high-level API and common types (specification only).       */
  6/*                                                                         */
  7/*  Copyright 1996-2012 by                                                 */
  8/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
  9/*                                                                         */
 10/*  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/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 13/*  this file you indicate that you have read the license and              */
 14/*  understand and accept it fully.                                        */
 15/*                                                                         */
 16/***************************************************************************/
 17
 18
 19#ifndef FT_FREETYPE_H
 20#error "`ft2build.h' hasn't been included yet!"
 21#error "Please always use macros to include FreeType header files."
 22#error "Example:"
 23#error "  #include <ft2build.h>"
 24#error "  #include FT_FREETYPE_H"
 25#endif
 26
 27
 28#ifndef __FREETYPE_H__
 29#define __FREETYPE_H__
 30
 31
 32#include <ft2build.h>
 33#include FT_CONFIG_CONFIG_H
 34#include FT_ERRORS_H
 35#include FT_TYPES_H
 36
 37
 38FT_BEGIN_HEADER
 39
 40
 41
 42  /*************************************************************************/
 43  /*                                                                       */
 44  /* <Section>                                                             */
 45  /*    user_allocation                                                    */
 46  /*                                                                       */
 47  /* <Title>                                                               */
 48  /*    User allocation                                                    */
 49  /*                                                                       */
 50  /* <Abstract>                                                            */
 51  /*    How client applications should allocate FreeType data structures.  */
 52  /*                                                                       */
 53  /* <Description>                                                         */
 54  /*    FreeType assumes that structures allocated by the user and passed  */
 55  /*    as arguments are zeroed out except for the actual data.  In other  */
 56  /*    words, it is recommended to use `calloc' (or variants of it)       */
 57  /*    instead of `malloc' for allocation.                                */
 58  /*                                                                       */
 59  /*************************************************************************/
 60
 61
 62
 63  /*************************************************************************/
 64  /*************************************************************************/
 65  /*                                                                       */
 66  /*                        B A S I C   T Y P E S                          */
 67  /*                                                                       */
 68  /*************************************************************************/
 69  /*************************************************************************/
 70
 71
 72  /*************************************************************************/
 73  /*                                                                       */
 74  /* <Section>                                                             */
 75  /*    base_interface                                                     */
 76  /*                                                                       */
 77  /* <Title>                                                               */
 78  /*    Base Interface                                                     */
 79  /*                                                                       */
 80  /* <Abstract>                                                            */
 81  /*    The FreeType~2 base font interface.                                */
 82  /*                                                                       */
 83  /* <Description>                                                         */
 84  /*    This section describes the public high-level API of FreeType~2.    */
 85  /*                                                                       */
 86  /* <Order>                                                               */
 87  /*    FT_Library                                                         */
 88  /*    FT_Face                                                            */
 89  /*    FT_Size                                                            */
 90  /*    FT_GlyphSlot                                                       */
 91  /*    FT_CharMap                                                         */
 92  /*    FT_Encoding                                                        */
 93  /*                                                                       */
 94  /*    FT_FaceRec                                                         */
 95  /*                                                                       */
 96  /*    FT_FACE_FLAG_SCALABLE                                              */
 97  /*    FT_FACE_FLAG_FIXED_SIZES                                           */
 98  /*    FT_FACE_FLAG_FIXED_WIDTH                                           */
 99  /*    FT_FACE_FLAG_HORIZONTAL                                            */
100  /*    FT_FACE_FLAG_VERTICAL                                              */
101  /*    FT_FACE_FLAG_SFNT                                                  */
102  /*    FT_FACE_FLAG_KERNING                                               */
103  /*    FT_FACE_FLAG_MULTIPLE_MASTERS                                      */
104  /*    FT_FACE_FLAG_GLYPH_NAMES                                           */
105  /*    FT_FACE_FLAG_EXTERNAL_STREAM                                       */
106  /*    FT_FACE_FLAG_FAST_GLYPHS                                           */
107  /*    FT_FACE_FLAG_HINTER                                                */
108  /*                                                                       */
109  /*    FT_STYLE_FLAG_BOLD                                                 */
110  /*    FT_STYLE_FLAG_ITALIC                                               */
111  /*                                                                       */
112  /*    FT_SizeRec                                                         */
113  /*    FT_Size_Metrics                                                    */
114  /*                                                                       */
115  /*    FT_GlyphSlotRec                                                    */
116  /*    FT_Glyph_Metrics                                                   */
117  /*    FT_SubGlyph                                                        */
118  /*                                                                       */
119  /*    FT_Bitmap_Size                                                     */
120  /*                                                                       */
121  /*    FT_Init_FreeType                                                   */
122  /*    FT_Done_FreeType                                                   */
123  /*                                                                       */
124  /*    FT_New_Face                                                        */
125  /*    FT_Done_Face                                                       */
126  /*    FT_New_Memory_Face                                                 */
127  /*    FT_Open_Face                                                       */
128  /*    FT_Open_Args                                                       */
129  /*    FT_Parameter                                                       */
130  /*    FT_Attach_File                                                     */
131  /*    FT_Attach_Stream                                                   */
132  /*                                                                       */
133  /*    FT_Set_Char_Size                                                   */
134  /*    FT_Set_Pixel_Sizes                                                 */
135  /*    FT_Request_Size                                                    */
136  /*    FT_Select_Size                                                     */
137  /*    FT_Size_Request_Type                                               */
138  /*    FT_Size_Request                                                    */
139  /*    FT_Set_Transform                                                   */
140  /*    FT_Load_Glyph                                                      */
141  /*    FT_Get_Char_Index                                                  */
142  /*    FT_Get_Name_Index                                                  */
143  /*    FT_Load_Char                                                       */
144  /*                                                                       */
145  /*    FT_OPEN_MEMORY                                                     */
146  /*    FT_OPEN_STREAM                                                     */
147  /*    FT_OPEN_PATHNAME                                                   */
148  /*    FT_OPEN_DRIVER                                                     */
149  /*    FT_OPEN_PARAMS                                                     */
150  /*                                                                       */
151  /*    FT_LOAD_DEFAULT                                                    */
152  /*    FT_LOAD_RENDER                                                     */
153  /*    FT_LOAD_MONOCHROME                                                 */
154  /*    FT_LOAD_LINEAR_DESIGN                                              */
155  /*    FT_LOAD_NO_SCALE                                                   */
156  /*    FT_LOAD_NO_HINTING                                                 */
157  /*    FT_LOAD_NO_BITMAP                                                  */
158  /*    FT_LOAD_CROP_BITMAP                                                */
159  /*                                                                       */
160  /*    FT_LOAD_VERTICAL_LAYOUT                                            */
161  /*    FT_LOAD_IGNORE_TRANSFORM                                           */
162  /*    FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH                                */
163  /*    FT_LOAD_FORCE_AUTOHINT                                             */
164  /*    FT_LOAD_NO_RECURSE                                                 */
165  /*    FT_LOAD_PEDANTIC                                                   */
166  /*                                                                       */
167  /*    FT_LOAD_TARGET_NORMAL                                              */
168  /*    FT_LOAD_TARGET_LIGHT                                               */
169  /*    FT_LOAD_TARGET_MONO                                                */
170  /*    FT_LOAD_TARGET_LCD                                                 */
171  /*    FT_LOAD_TARGET_LCD_V                                               */
172  /*                                                                       */
173  /*    FT_Render_Glyph                                                    */
174  /*    FT_Render_Mode                                                     */
175  /*    FT_Get_Kerning                                                     */
176  /*    FT_Kerning_Mode                                                    */
177  /*    FT_Get_Track_Kerning                                               */
178  /*    FT_Get_Glyph_Name                                                  */
179  /*    FT_Get_Postscript_Name                                             */
180  /*                                                                       */
181  /*    FT_CharMapRec                                                      */
182  /*    FT_Select_Charmap                                                  */
183  /*    FT_Set_Charmap                                                     */
184  /*    FT_Get_Charmap_Index                                               */
185  /*                                                                       */
186  /*    FT_FSTYPE_INSTALLABLE_EMBEDDING                                    */
187  /*    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING                             */
188  /*    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING                              */
189  /*    FT_FSTYPE_EDITABLE_EMBEDDING                                       */
190  /*    FT_FSTYPE_NO_SUBSETTING                                            */
191  /*    FT_FSTYPE_BITMAP_EMBEDDING_ONLY                                    */
192  /*                                                                       */
193  /*    FT_Get_FSType_Flags                                                */
194  /*                                                                       */
195  /*************************************************************************/
196
197
198  /*************************************************************************/
199  /*                                                                       */
200  /* <Struct>                                                              */
201  /*    FT_Glyph_Metrics                                                   */
202  /*                                                                       */
203  /* <Description>                                                         */
204  /*    A structure used to model the metrics of a single glyph.  The      */
205  /*    values are expressed in 26.6 fractional pixel format; if the flag  */
206  /*    @FT_LOAD_NO_SCALE has been used while loading the glyph, values    */
207  /*    are expressed in font units instead.                               */
208  /*                                                                       */
209  /* <Fields>                                                              */
210  /*    width ::                                                           */
211  /*      The glyph's width.                                               */
212  /*                                                                       */
213  /*    height ::                                                          */
214  /*      The glyph's height.                                              */
215  /*                                                                       */
216  /*    horiBearingX ::                                                    */
217  /*      Left side bearing for horizontal layout.                         */
218  /*                                                                       */
219  /*    horiBearingY ::                                                    */
220  /*      Top side bearing for horizontal layout.                          */
221  /*                                                                       */
222  /*    horiAdvance ::                                                     */
223  /*      Advance width for horizontal layout.                             */
224  /*                                                                       */
225  /*    vertBearingX ::                                                    */
226  /*      Left side bearing for vertical layout.                           */
227  /*                                                                       */
228  /*    vertBearingY ::                                                    */
229  /*      Top side bearing for vertical layout.  Larger positive values    */
230  /*      mean further below the vertical glyph origin.                    */
231  /*                                                                       */
232  /*    vertAdvance ::                                                     */
233  /*      Advance height for vertical layout.  Positive values mean the    */
234  /*      glyph has a positive advance downward.                           */
235  /*                                                                       */
236  /* <Note>                                                                */
237  /*    If not disabled with @FT_LOAD_NO_HINTING, the values represent     */
238  /*    dimensions of the hinted glyph (in case hinting is applicable).    */
239  /*                                                                       */
240  typedef struct  FT_Glyph_Metrics_
241  {
242    FT_Pos  width;
243    FT_Pos  height;
244
245    FT_Pos  horiBearingX;
246    FT_Pos  horiBearingY;
247    FT_Pos  horiAdvance;
248
249    FT_Pos  vertBearingX;
250    FT_Pos  vertBearingY;
251    FT_Pos  vertAdvance;
252
253  } FT_Glyph_Metrics;
254
255
256  /*************************************************************************/
257  /*                                                                       */
258  /* <Struct>                                                              */
259  /*    FT_Bitmap_Size                                                     */
260  /*                                                                       */
261  /* <Description>                                                         */
262  /*    This structure models the metrics of a bitmap strike (i.e., a set  */
263  /*    of glyphs for a given point size and resolution) in a bitmap font. */
264  /*    It is used for the `available_sizes' field of @FT_Face.            */
265  /*                                                                       */
266  /* <Fields>                                                              */
267  /*    height :: The vertical distance, in pixels, between two            */
268  /*              consecutive baselines.  It is always positive.           */
269  /*                                                                       */
270  /*    width  :: The average width, in pixels, of all glyphs in the       */
271  /*              strike.                                                  */
272  /*                                                                       */
273  /*    size   :: The nominal size of the strike in 26.6 fractional        */
274  /*              points.  This field is not very useful.                  */
275  /*                                                                       */
276  /*    x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional   */
277  /*              pixels.                                                  */
278  /*                                                                       */
279  /*    y_ppem :: The vertical ppem (nominal height) in 26.6 fractional    */
280  /*              pixels.                                                  */
281  /*                                                                       */
282  /* <Note>                                                                */
283  /*    Windows FNT:                                                       */
284  /*      The nominal size given in a FNT font is not reliable.  Thus when */
285  /*      the driver finds it incorrect, it sets `size' to some calculated */
286  /*      values and sets `x_ppem' and `y_ppem' to the pixel width and     */
287  /*      height given in the font, respectively.                          */
288  /*                                                                       */
289  /*    TrueType embedded bitmaps:                                         */
290  /*      `size', `width', and `height' values are not contained in the    */
291  /*      bitmap strike itself.  They are computed from the global font    */
292  /*      parameters.                                                      */
293  /*                                                                       */
294  typedef struct  FT_Bitmap_Size_
295  {
296    FT_Short  height;
297    FT_Short  width;
298
299    FT_Pos    size;
300
301    FT_Pos    x_ppem;
302    FT_Pos    y_ppem;
303
304  } FT_Bitmap_Size;
305
306
307  /*************************************************************************/
308  /*************************************************************************/
309  /*                                                                       */
310  /*                     O B J E C T   C L A S S E S                       */
311  /*                                                                       */
312  /*************************************************************************/
313  /*************************************************************************/
314
315  /*************************************************************************/
316  /*                                                                       */
317  /* <Type>                                                                */
318  /*    FT_Library                                                         */
319  /*                                                                       */
320  /* <Description>                                                         */
321  /*    A handle to a FreeType library instance.  Each `library' is        */
322  /*    completely independent from the others; it is the `root' of a set  */
323  /*    of objects like fonts, faces, sizes, etc.                          */
324  /*                                                                       */
325  /*    It also embeds a memory manager (see @FT_Memory), as well as a     */
326  /*    scan-line converter object (see @FT_Raster).                       */
327  /*                                                                       */
328  /*    For multi-threading applications each thread should have its own   */
329  /*    FT_Library object.                                                 */
330  /*                                                                       */
331  /* <Note>                                                                */
332  /*    Library objects are normally created by @FT_Init_FreeType, and     */
333  /*    destroyed with @FT_Done_FreeType.                                  */
334  /*                                                                       */
335  typedef struct FT_LibraryRec_  *FT_Library;
336
337
338  /*************************************************************************/
339  /*                                                                       */
340  /* <Type>                                                                */
341  /*    FT_Module                                                          */
342  /*                                                                       */
343  /* <Description>                                                         */
344  /*    A handle to a given FreeType module object.  Each module can be a  */
345  /*    font driver, a renderer, or anything else that provides services   */
346  /*    to the formers.                                                    */
347  /*                                                                       */
348  typedef struct FT_ModuleRec_*  FT_Module;
349
350
351  /*************************************************************************/
352  /*                                                                       */
353  /* <Type>                                                                */
354  /*    FT_Driver                                                          */
355  /*                                                                       */
356  /* <Description>                                                         */
357  /*    A handle to a given FreeType font driver object.  Each font driver */
358  /*    is a special module capable of creating faces from font files.     */
359  /*                                                                       */
360  typedef struct FT_DriverRec_*  FT_Driver;
361
362
363  /*************************************************************************/
364  /*                                                                       */
365  /* <Type>                                                                */
366  /*    FT_Renderer                                                        */
367  /*                                                                       */
368  /* <Description>                                                         */
369  /*    A handle to a given FreeType renderer.  A renderer is a special    */
370  /*    module in charge of converting a glyph image to a bitmap, when     */
371  /*    necessary.  Each renderer supports a given glyph image format, and */
372  /*    one or more target surface depths.                                 */
373  /*                                                                       */
374  typedef struct FT_RendererRec_*  FT_Renderer;
375
376
377  /*************************************************************************/
378  /*                                                                       */
379  /* <Type>                                                                */
380  /*    FT_Face                                                            */
381  /*                                                                       */
382  /* <Description>                                                         */
383  /*    A handle to a given typographic face object.  A face object models */
384  /*    a given typeface, in a given style.                                */
385  /*                                                                       */
386  /* <Note>                                                                */
387  /*    Each face object also owns a single @FT_GlyphSlot object, as well  */
388  /*    as one or more @FT_Size objects.                                   */
389  /*                                                                       */
390  /*    Use @FT_New_Face or @FT_Open_Face to create a new face object from */
391  /*    a given filepathname or a custom input stream.                     */
392  /*                                                                       */
393  /*    Use @FT_Done_Face to destroy it (along with its slot and sizes).   */
394  /*                                                                       */
395  /* <Also>                                                                */
396  /*    See @FT_FaceRec for the publicly accessible fields of a given face */
397  /*    object.                                                            */
398  /*                                                                       */
399  typedef struct FT_FaceRec_*  FT_Face;
400
401
402  /*************************************************************************/
403  /*                                                                       */
404  /* <Type>                                                                */
405  /*    FT_Size                                                            */
406  /*                                                                       */
407  /* <Description>                                                         */
408  /*    A handle to an object used to model a face scaled to a given       */
409  /*    character size.                                                    */
410  /*                                                                       */
411  /* <Note>                                                                */
412  /*    Each @FT_Face has an _active_ @FT_Size object that is used by      */
413  /*    functions like @FT_Load_Glyph to determine the scaling             */
414  /*    transformation which is used to load and hint glyphs and metrics.  */
415  /*                                                                       */
416  /*    You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes,                */
417  /*    @FT_Request_Size or even @FT_Select_Size to change the content     */
418  /*    (i.e., the scaling values) of the active @FT_Size.                 */
419  /*                                                                       */
420  /*    You can use @FT_New_Size to create additional size objects for a   */
421  /*    given @FT_Face, but they won't be used by other functions until    */
422  /*    you activate it through @FT_Activate_Size.  Only one size can be   */
423  /*    activated at any given time per face.                              */
424  /*                                                                       */
425  /* <Also>                                                                */
426  /*    See @FT_SizeRec for the publicly accessible fields of a given size */
427  /*    object.                                                            */
428  /*                                                                       */
429  typedef struct FT_SizeRec_*  FT_Size;
430
431
432  /*************************************************************************/
433  /*                                                                       */
434  /* <Type>                                                                */
435  /*    FT_GlyphSlot                                                       */
436  /*                                                                       */
437  /* <Description>                                                         */
438  /*    A handle to a given `glyph slot'.  A slot is a container where it  */
439  /*    is possible to load any of the glyphs contained in its parent      */
440  /*    face.                                                              */
441  /*                                                                       */
442  /*    In other words, each time you call @FT_Load_Glyph or               */
443  /*    @FT_Load_Char, the slot's content is erased by the new glyph data, */
444  /*    i.e., the glyph's metrics, its image (bitmap or outline), and      */
445  /*    other control information.                                         */
446  /*                                                                       */
447  /* <Also>                                                                */
448  /*    See @FT_GlyphSlotRec for the publicly accessible glyph fields.     */
449  /*                                                                       */
450  typedef struct FT_GlyphSlotRec_*  FT_GlyphSlot;
451
452
453  /*************************************************************************/
454  /*                                                                       */
455  /* <Type>                                                                */
456  /*    FT_CharMap                                                         */
457  /*                                                                       */
458  /* <Description>                                                         */
459  /*    A handle to a given character map.  A charmap is used to translate */
460  /*    character codes in a given encoding into glyph indexes for its     */
461  /*    parent's face.  Some font formats may provide several charmaps per */
462  /*    font.                                                              */
463  /*                                                                       */
464  /*    Each face object owns zero or more charmaps, but only one of them  */
465  /*    can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char.   */
466  /*                                                                       */
467  /*    The list of available charmaps in a face is available through the  */
468  /*    `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec.   */
469  /*                                                                       */
470  /*    The currently active charmap is available as `face->charmap'.      */
471  /*    You should call @FT_Set_Charmap to change it.                      */
472  /*                                                                       */
473  /* <Note>                                                                */
474  /*    When a new face is created (either through @FT_New_Face or         */
475  /*    @FT_Open_Face), the library looks for a Unicode charmap within     */
476  /*    the list and automatically activates it.                           */
477  /*                                                                       */
478  /* <Also>                                                                */
479  /*    See @FT_CharMapRec for the publicly accessible fields of a given   */
480  /*    character map.                                                     */
481  /*                                                                       */
482  typedef struct FT_CharMapRec_*  FT_CharMap;
483
484
485  /*************************************************************************/
486  /*                                                                       */
487  /* <Macro>                                                               */
488  /*    FT_ENC_TAG                                                         */
489  /*                                                                       */
490  /* <Description>                                                         */
491  /*    This macro converts four-letter tags into an unsigned long.  It is */
492  /*    used to define `encoding' identifiers (see @FT_Encoding).          */
493  /*                                                                       */
494  /* <Note>                                                                */
495  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */
496  /*    should redefine this macro in case of problems to something like   */
497  /*    this:                                                              */
498  /*                                                                       */
499  /*    {                                                                  */
500  /*      #define FT_ENC_TAG( value, a, b, c, d )  value                   */
501  /*    }                                                                  */
502  /*                                                                       */
503  /*    to get a simple enumeration without assigning special numbers.     */
504  /*                                                                       */
505
506#ifndef FT_ENC_TAG
507#define FT_ENC_TAG( value, a, b, c, d )         \
508          value = ( ( (FT_UInt32)(a) << 24 ) |  \
509                    ( (FT_UInt32)(b) << 16 ) |  \
510                    ( (FT_UInt32)(c) <<  8 ) |  \
511                      (FT_UInt32)(d)         )
512
513#endif /* FT_ENC_TAG */
514
515
516  /*************************************************************************/
517  /*                                                                       */
518  /* <Enum>                                                                */
519  /*    FT_Encoding                                                        */
520  /*                                                                       */
521  /* <Description>                                                         */
522  /*    An enumeration used to specify character sets supported by         */
523  /*    charmaps.  Used in the @FT_Select_Charmap API function.            */
524  /*                                                                       */
525  /* <Note>                                                                */
526  /*    Despite the name, this enumeration lists specific character        */
527  /*    repertories (i.e., charsets), and not text encoding methods (e.g., */
528  /*    UTF-8, UTF-16, etc.).                                              */
529  /*                                                                       */
530  /*    Other encodings might be defined in the future.                    */
531  /*                                                                       */
532  /* <Values>                                                              */
533  /*    FT_ENCODING_NONE ::                                                */
534  /*      The encoding value~0 is reserved.                                */
535  /*                                                                       */
536  /*    FT_ENCODING_UNICODE ::                                             */
537  /*      Corresponds to the Unicode character set.  This value covers     */
538  /*      all versions of the Unicode repertoire, including ASCII and      */
539  /*      Latin-1.  Most fonts include a Unicode charmap, but not all      */
540  /*      of them.                                                         */
541  /*                                                                       */
542  /*      For example, if you want to access Unicode value U+1F028 (and    */
543  /*      the font contains it), use value 0x1F028 as the input value for  */
544  /*      @FT_Get_Char_Index.                                              */
545  /*                                                                       */
546  /*    FT_ENCODING_MS_SYMBOL ::                                           */
547  /*      Corresponds to the Microsoft Symbol encoding, used to encode     */
548  /*      mathematical symbols in the 32..255 character code range.  For   */
549  /*      more information, see `http://www.ceviz.net/symbol.htm'.         */
550  /*                                                                       */
551  /*    FT_ENCODING_SJIS ::                                                */
552  /*      Corresponds to Japanese SJIS encoding.  More info at             */
553  /*      at `http://langsupport.japanreference.com/encoding.shtml'.       */
554  /*      See note on multi-byte encodings below.                          */
555  /*                                                                       */
556  /*    FT_ENCODING_GB2312 ::                                              */
557  /*      Corresponds to an encoding system for Simplified Chinese as used */
558  /*      used in mainland China.                                          */
559  /*                                                                       */
560  /*    FT_ENCODING_BIG5 ::                                                */
561  /*      Corresponds to an encoding system for Traditional Chinese as     */
562  /*      used in Taiwan and Hong Kong.                                    */
563  /*                                                                       */
564  /*    FT_ENCODING_WANSUNG ::                                             */
565  /*      Corresponds to the Korean encoding system known as Wansung.      */
566  /*      For more information see                                         */
567  /*      `http://www.microsoft.com/typography/unicode/949.txt'.           */
568  /*                                                                       */
569  /*    FT_ENCODING_JOHAB ::                                               */
570  /*      The Korean standard character set (KS~C 5601-1992), which        */
571  /*      corresponds to MS Windows code page 1361.  This character set    */
572  /*      includes all possible Hangeul character combinations.            */
573  /*                                                                       */
574  /*    FT_ENCODING_ADOBE_LATIN_1 ::                                       */
575  /*      Corresponds to a Latin-1 encoding as defined in a Type~1         */
576  /*      PostScript font.  It is limited to 256 character codes.          */
577  /*                                                                       */
578  /*    FT_ENCODING_ADOBE_STANDARD ::                                      */
579  /*      Corresponds to the Adobe Standard encoding, as found in Type~1,  */
580  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */
581  /*      codes.                                                           */
582  /*                                                                       */
583  /*    FT_ENCODING_ADOBE_EXPERT ::                                        */
584  /*      Corresponds to the Adobe Expert encoding, as found in Type~1,    */
585  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */
586  /*      codes.                                                           */
587  /*                                                                       */
588  /*    FT_ENCODING_ADOBE_CUSTOM ::                                        */
589  /*      Corresponds to a custom encoding, as found in Type~1, CFF, and   */
590  /*      OpenType/CFF fonts.  It is limited to 256 character codes.       */
591  /*                                                                       */
592  /*    FT_ENCODING_APPLE_ROMAN ::                                         */
593  /*      Corresponds to the 8-bit Apple roman encoding.  Many TrueType    */
594  /*      and OpenType fonts contain a charmap for this encoding, since    */
595  /*      older versions of Mac OS are able to use it.                     */
596  /*                                                                       */
597  /*    FT_ENCODING_OLD_LATIN_2 ::                                         */
598  /*      This value is deprecated and was never used nor reported by      */
599  /*      FreeType.  Don't use or test for it.                             */
600  /*                                                                       */
601  /*    FT_ENCODING_MS_SJIS ::                                             */
602  /*      Same as FT_ENCODING_SJIS.  Deprecated.                           */
603  /*                                                                       */
604  /*    FT_ENCODING_MS_GB2312 ::                                           */
605  /*      Same as FT_ENCODING_GB2312.  Deprecated.                         */
606  /*                                                                       */
607  /*    FT_ENCODING_MS_BIG5 ::                                             */
608  /*      Same as FT_ENCODING_BIG5.  Deprecated.                           */
609  /*                                                                       */
610  /*    FT_ENCODING_MS_WANSUNG ::                                          */
611  /*      Same as FT_ENCODING_WANSUNG.  Deprecated.                        */
612  /*                                                                       */
613  /*    FT_ENCODING_MS_JOHAB ::                                            */
614  /*      Same as FT_ENCODING_JOHAB.  Deprecated.                          */
615  /*                                                                       */
616  /* <Note>                                                                */
617  /*    By default, FreeType automatically synthesizes a Unicode charmap   */
618  /*    for PostScript fonts, using their glyph names dictionaries.        */
619  /*    However, it also reports the encodings defined explicitly in the   */
620  /*    font file, for the cases when they are needed, with the Adobe      */
621  /*    values as well.                                                    */
622  /*                                                                       */
623  /*    FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap  */
624  /*    is neither Unicode nor ISO-8859-1 (otherwise it is set to          */
625  /*    FT_ENCODING_UNICODE).  Use @FT_Get_BDF_Charset_ID to find out      */
626  /*    which encoding is really present.  If, for example, the            */
627  /*    `cs_registry' field is `KOI8' and the `cs_encoding' field is `R',  */
628  /*    the font is encoded in KOI8-R.                                     */
629  /*                                                                       */
630  /*    FT_ENCODING_NONE is always set (with a single exception) by the    */
631  /*    winfonts driver.  Use @FT_Get_WinFNT_Header and examine the        */
632  /*    `charset' field of the @FT_WinFNT_HeaderRec structure to find out  */
633  /*    which encoding is really present.  For example,                    */
634  /*    @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for       */
635  /*    Russian).                                                          */
636  /*                                                                       */
637  /*    FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
638  /*    and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to  */
639  /*    FT_ENCODING_APPLE_ROMAN).                                          */
640  /*                                                                       */
641  /*    If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function       */
642  /*    @FT_Get_CMap_Language_ID  to query the Mac language ID which may   */
643  /*    be needed to be able to distinguish Apple encoding variants.  See  */
644  /*                                                                       */
645  /*      http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT  */
646  /*                                                                       */
647  /*    to get an idea how to do that.  Basically, if the language ID      */
648  /*    is~0, don't use it, otherwise subtract 1 from the language ID.     */
649  /*    Then examine `encoding_id'.  If, for example, `encoding_id' is     */
650  /*    @TT_MAC_ID_ROMAN and the language ID (minus~1) is                  */
651  /*    `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman.        */
652  /*    @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi       */
653  /*    variant the Arabic encoding.                                       */
654  /*                                                                       */
655  typedef enum  FT_Encoding_
656  {
657    FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
658
659    FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
660    FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),
661
662    FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),
663    FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),
664    FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),
665    FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
666    FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),
667
668    /* for backwards compatibility */
669    FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,
670    FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,
671    FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,
672    FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
673    FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,
674
675    FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
676    FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E' ),
677    FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C' ),
678    FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1,  'l', 'a', 't', '1' ),
679
680    FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
681
682    FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
683
684  } FT_Encoding;
685
686
687  /*************************************************************************/
688  /*                                                                       */
689  /* <Enum>                                                                */
690  /*    ft_encoding_xxx                                                    */
691  /*                                                                       */
692  /* <Description>                                                         */
693  /*    These constants are deprecated; use the corresponding @FT_Encoding */
694  /*    values instead.                                                    */
695  /*                                                                       */
696#define ft_encoding_none            FT_ENCODING_NONE
697#define ft_encoding_unicode         FT_ENCODING_UNICODE
698#define ft_encoding_symbol          FT_ENCODING_MS_SYMBOL
699#define ft_encoding_latin_1         FT_ENCODING_ADOBE_LATIN_1
700#define ft_encoding_latin_2         FT_ENCODING_OLD_LATIN_2
701#define ft_encoding_sjis            FT_ENCODING_SJIS
702#define ft_encoding_gb2312          FT_ENCODING_GB2312
703#define ft_encoding_big5            FT_ENCODING_BIG5
704#define ft_encoding_wansung         FT_ENCODING_WANSUNG
705#define ft_encoding_johab           FT_ENCODING_JOHAB
706
707#define ft_encoding_adobe_standard  FT_ENCODING_ADOBE_STANDARD
708#define ft_encoding_adobe_expert    FT_ENCODING_ADOBE_EXPERT
709#define ft_encoding_adobe_custom    FT_ENCODING_ADOBE_CUSTOM
710#define ft_encoding_apple_roman     FT_ENCODING_APPLE_ROMAN
711
712
713  /*************************************************************************/
714  /*                                                                       */
715  /* <Struct>                                                              */
716  /*    FT_CharMapRec                                                      */
717  /*                                                                       */
718  /* <Description>                                                         */
719  /*    The base charmap structure.                                        */
720  /*                                                                       */
721  /* <Fields>                                                              */
722  /*    face        :: A handle to the parent face object.                 */
723  /*                                                                       */
724  /*    encoding    :: An @FT_Encoding tag identifying the charmap.  Use   */
725  /*                   this with @FT_Select_Charmap.                       */
726  /*                                                                       */
727  /*    platform_id :: An ID number describing the platform for the        */
728  /*                   following encoding ID.  This comes directly from    */
729  /*                   the TrueType specification and should be emulated   */
730  /*                   for other formats.                                  */
731  /*                                                                       */
732  /*    encoding_id :: A platform specific encoding number.  This also     */
733  /*                   comes from the TrueType specification and should be */
734  /*                   emulated similarly.                                 */
735  /*                                                                       */
736  typedef struct  FT_CharMapRec_
737  {
738    FT_Face      face;
739    FT_Encoding  encoding;
740    FT_UShort    platform_id;
741    FT_UShort    encoding_id;
742
743  } FT_CharMapRec;
744
745
746  /*************************************************************************/
747  /*************************************************************************/
748  /*                                                                       */
749  /*                 B A S E   O B J E C T   C L A S S E S                 */
750  /*                                                                       */

Large files files are truncated, but you can click here to view the full file