summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype/freetype-1.5/lib/extend/ftxpost.h
blob: 942d967ed6b466dda5156e6e05b8989fa95109a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*******************************************************************
 *
 *  ftxpost.h
 *
 *    post table support API extension
 *
 *  Copyright 1996-2001 by
 *  David Turner, Robert Wilhelm, and Werner Lemberg.
 *
 *  This file is part of the FreeType project, and may only be used
 *  modified and distributed under the terms of the FreeType project
 *  license, LICENSE.TXT.  By continuing to use, modify, or distribute
 *  this file you indicate that you have read the license and
 *  understand and accept it fully.
 *
 *
 *  The post table is not completely loaded by the core engine.  This
 *  file loads the missing PS glyph names and implements an API to
 *  access them.
 *
 ******************************************************************/

#ifndef FTXPOST_H
#define FTXPOST_H

#include "freetype.h"

#ifdef __cplusplus
extern "C" {
#endif

#define TT_Err_Invalid_Post_Table_Format  0x0B00
#define TT_Err_Invalid_Post_Table         0x0B01

  /* the 258 standard Mac glyph names, used for format 1.0 and 2.5 */

  extern TT_String*  TT_Post_Default_Names[];


  /* format 2.0 table */

  struct TT_Post_20_
  {
    TT_UShort   numGlyphs;
    TT_UShort   numNames;
    TT_UShort*  glyphNameIndex;
    TT_Char**   glyphNames;
  };

  typedef struct TT_Post_20_  TT_Post_20;

  struct TT_Post_25_
  {
    TT_UShort  numGlyphs;
    TT_Char*   offset;
  };

  typedef struct TT_Post_25_  TT_Post_25;

#if 0
  /* format 4.0 table -- not implemented yet */

  struct TT_Post_40_
  {
  };

  typedef struct TT_Post_40_  TT_Post_40;
#endif


  struct TT_Post_
  {
    TT_Long  offset;
    TT_Long  length;
    TT_Bool  loaded;

    union
    {
      TT_Post_20  post20;
      TT_Post_25  post25;
#if 0
      TT_Post_40  post40;
#endif
    } p;
  };

  typedef struct TT_Post_  TT_Post;


  FT_EXPORT_DEF( TT_Error )
  TT_Init_Post_Extension( TT_Engine  engine );

  FT_EXPORT_DEF( TT_Error )
  TT_Load_PS_Names( TT_Face   face,
                    TT_Post*  post );

  FT_EXPORT_DEF( TT_Error )
  TT_Get_PS_Name( TT_Face      face,
                  TT_UShort    index,
                  TT_String**  PSname );

#ifdef __cplusplus
}
#endif

#endif /* FTXPOST_H */


/* END */