OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998-2004 David Turner and Werner Lemberg | 2 * Copyright (C) 1998-2004 David Turner and Werner Lemberg |
3 * Copyright (C) 2006 Behdad Esfahbod | 3 * Copyright (C) 2006 Behdad Esfahbod |
4 * | 4 * |
5 * This is part of HarfBuzz, an OpenType Layout engine library. | 5 * This is part of HarfBuzz, an OpenType Layout engine library. |
6 * | 6 * |
7 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
8 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
9 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
10 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 #ifndef HARFBUZZ_GSUB_H | 26 #ifndef HARFBUZZ_GSUB_H |
27 #define HARFBUZZ_GSUB_H | 27 #define HARFBUZZ_GSUB_H |
28 | 28 |
29 #include "harfbuzz-gdef.h" | 29 #include "harfbuzz-gdef.h" |
30 #include "harfbuzz-buffer.h" | 30 #include "harfbuzz-buffer.h" |
31 | 31 |
32 HB_BEGIN_HEADER | 32 HB_BEGIN_HEADER |
33 | 33 |
34 | 34 |
| 35 #ifdef HB_USE_PACKED_STRUCTS |
| 36 #pragma pack(push, 1) |
| 37 #endif |
| 38 |
35 /* Lookup types for glyph substitution */ | 39 /* Lookup types for glyph substitution */ |
36 | 40 |
37 #define HB_GSUB_LOOKUP_SINGLE 1 | 41 #define HB_GSUB_LOOKUP_SINGLE 1 |
38 #define HB_GSUB_LOOKUP_MULTIPLE 2 | 42 #define HB_GSUB_LOOKUP_MULTIPLE 2 |
39 #define HB_GSUB_LOOKUP_ALTERNATE 3 | 43 #define HB_GSUB_LOOKUP_ALTERNATE 3 |
40 #define HB_GSUB_LOOKUP_LIGATURE 4 | 44 #define HB_GSUB_LOOKUP_LIGATURE 4 |
41 #define HB_GSUB_LOOKUP_CONTEXT 5 | 45 #define HB_GSUB_LOOKUP_CONTEXT 5 |
42 #define HB_GSUB_LOOKUP_CHAIN 6 | 46 #define HB_GSUB_LOOKUP_CHAIN 6 |
43 #define HB_GSUB_LOOKUP_EXTENSION 7 | 47 #define HB_GSUB_LOOKUP_EXTENSION 7 |
44 #define HB_GSUB_LOOKUP_REVERSE_CHAIN 8 | 48 #define HB_GSUB_LOOKUP_REVERSE_CHAIN 8 |
45 | 49 |
46 | 50 |
47 /* A pointer to a function which selects the alternate glyph. `pos' is | 51 /* A pointer to a function which selects the alternate glyph. `pos' is |
48 the position of the glyph with index `glyphID', `num_alternates' | 52 the position of the glyph with index `glyphID', `num_alternates' |
49 gives the number of alternates in the `alternates' array. `data' | 53 gives the number of alternates in the `alternates' array. `data' |
50 points to the user-defined structure specified during a call to | 54 points to the user-defined structure specified during a call to |
51 HB_GSUB_Register_Alternate_Function(). The function must return an | 55 HB_GSUB_Register_Alternate_Function(). The function must return an |
52 index into the `alternates' array. */ | 56 index into the `alternates' array. */ |
53 | 57 |
54 typedef HB_UShort (*HB_AltFunction)(HB_UInt pos, | 58 typedef HB_UShort (*HB_AltFunction)(HB_UInt pos, |
55 HB_UShort glyphID, | 59 HB_UShort glyphID, |
56 HB_UShort num_alternates, | 60 HB_UShort num_alternates, |
57 HB_UShort* alternates, | 61 HB_UShort* alternates, |
58 void* data ); | 62 void* data ); |
59 | 63 |
60 | 64 |
61 struct HB_GSUBHeader_ | 65 struct HB_GSUBHeader_ |
62 { | 66 { |
| 67 HB_GDEFHeader* gdef; |
| 68 |
| 69 /* the next two fields are used for an alternate substitution callback |
| 70 function to select the proper alternate glyph. */ |
| 71 |
| 72 void* data; |
| 73 HB_AltFunction altfunc; |
| 74 |
63 HB_UInt offset; | 75 HB_UInt offset; |
64 | 76 |
65 HB_16Dot16 Version; | 77 HB_16Dot16 Version; |
66 | 78 |
67 HB_ScriptList ScriptList; | 79 HB_ScriptList ScriptList; |
68 HB_FeatureList FeatureList; | 80 HB_FeatureList FeatureList; |
69 HB_LookupList LookupList; | 81 HB_LookupList LookupList; |
70 | |
71 HB_GDEFHeader* gdef; | |
72 | |
73 /* the next two fields are used for an alternate substitution callback | |
74 function to select the proper alternate glyph. */ | |
75 | |
76 HB_AltFunction altfunc; | |
77 void* data; | |
78 }; | 82 }; |
79 | 83 |
80 typedef struct HB_GSUBHeader_ HB_GSUBHeader; | 84 typedef struct HB_GSUBHeader_ HB_GSUBHeader; |
81 typedef HB_GSUBHeader* HB_GSUB; | 85 typedef HB_GSUBHeader* HB_GSUB; |
82 | 86 |
83 | 87 |
84 HB_Error HB_Load_GSUB_Table( HB_Stream stream, | 88 HB_Error HB_Load_GSUB_Table( HB_Stream stream, |
85 HB_GSUBHeader** gsub, | 89 HB_GSUBHeader** gsub, |
86 HB_GDEFHeader* gdef, | 90 HB_GDEFHeader* gdef, |
87 HB_Stream gdefStream ); | 91 HB_Stream gdefStream ); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 132 |
129 | 133 |
130 HB_Error HB_GSUB_Register_Alternate_Function( HB_GSUBHeader* gsub, | 134 HB_Error HB_GSUB_Register_Alternate_Function( HB_GSUBHeader* gsub, |
131 HB_AltFunction altfunc, | 135 HB_AltFunction altfunc, |
132 void* data ); | 136 void* data ); |
133 | 137 |
134 | 138 |
135 HB_Error HB_GSUB_Apply_String( HB_GSUBHeader* gsub, | 139 HB_Error HB_GSUB_Apply_String( HB_GSUBHeader* gsub, |
136 HB_Buffer buffer ); | 140 HB_Buffer buffer ); |
137 | 141 |
| 142 #ifdef HB_USE_PACKED_STRUCTS |
| 143 #pragma pack(pop) |
| 144 #endif |
138 | 145 |
139 HB_END_HEADER | 146 HB_END_HEADER |
140 | 147 |
141 #endif /* HARFBUZZ_GSUB_H */ | 148 #endif /* HARFBUZZ_GSUB_H */ |
OLD | NEW |