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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220 | with
freetype_c.FT_BBox,
freetype_c.FT_Face,
freetype_c.FT_Bitmap,
freetype_c.FT_Library,
freetype_c.FT_Size_Metrics,
freetype_c.FT_CharMapRec,
freetype_c.FT_Size,
freetype_c.FT_Vector,
freetype_c.FT_GlyphSlot,
freetype_c.FT_CharMap,
freetype_c.Pointers,
Interfaces.C.Pointers,
Interfaces.C.Strings;
package freetype_c.Binding
--
-- Provides the Freetype library functions.
--
is
use freetype_c.Pointers;
-- unsigned_char_Pointer
--
type unsigned_char_Array is array (C.size_t range <>) of aliased C.unsigned_Char;
package c_unsigned_char_Pointers is new C.Pointers (Index => C.size_t,
Element => C.unsigned_Char,
element_Array => unsigned_char_Array,
default_Terminator => 0);
subtype unsigned_char_Pointer is c_unsigned_char_Pointers.Pointer;
---------------
-- Subprograms
--
procedure FT_Outline_Get_CBox (Outline : in FT_Outline_Pointer;
acBox : in FT_BBox.Pointer);
function FT_Init_FreeType (aLibrary : in FT_Library.Pointer) return FT_Error;
function FT_Done_FreeType (aLibrary : in FT_Library.Item) return FT_Error;
function FT_Render_Glyph (Slot : in FT_GlyphSlot.Item;
render_Mode : in FT_Render_Mode) return FT_Error;
function FT_Set_Char_Size (Face : in FT_Face.Item;
char_Width : in FT_F26Dot6;
char_Height : in FT_F26Dot6;
horz_Resolution : in FT_UInt;
vert_Resolution : in FT_UInt) return FT_Error;
function FT_Done_Face (Face : in FT_Face.Item) return FT_Error;
function FT_Attach_File (Face : in FT_Face.Item;
FilePathname : in C.strings.chars_ptr) return FT_Error;
function FT_Set_Charmap (Face : in FT_Face.Item;
charMap : in FT_CharMap.Item) return FT_Error;
function FT_Select_Charmap (Face : in FT_Face.Item;
Encoding : in FT_Encoding) return FT_Error;
function FT_Get_Char_Index (Face : in FT_Face.Item;
charCode : in FT_ULong) return FT_UInt;
function FT_Get_Kerning (Face : in FT_Face.Item;
left_Glyph : in FT_UInt;
right_Glyph : in FT_UInt;
kern_Mode : in FT_UInt;
aKerning : in FT_Vector.Pointer) return FT_Error;
function FT_Load_Glyph (Face : in FT_Face.Item;
Glyph_Index : in FT_UInt;
Load_Flags : in FT_Int32) return FT_Error;
function FT_GlyphSlot_Get_Outline (Self : in FT_GlyphSlot.Item) return access FT_Outline;
function FT_GlyphSlot_Get_Advance (Self : in FT_GlyphSlot.Item) return FT_Vector.Item;
function FT_GlyphSlot_Get_Bitmap (Self : in FT_GlyphSlot.Item) return FT_Bitmap.Item;
function FT_GlyphSlot_Get_bitmap_left (Self : in FT_GlyphSlot.Item) return FT_Int;
function FT_GlyphSlot_Get_bitmap_top (Self : in FT_GlyphSlot.Item) return FT_Int;
function FT_GlyphSlot_Get_Format (Self : in FT_GlyphSlot.Item) return C.unsigned;
function FT_Size_Get_Metrics (Self : in FT_Size.Item) return FT_Size_Metrics.Item;
function new_FT_Face (Library : in FT_Library.Item;
FontFilePath : in C.strings.chars_ptr) return access FT_FaceRec;
function new_FT_Memory_Face (Library : in FT_Library.Item;
pBufferBytes : in unsigned_char_Pointer;
BufferSizeInBytes : in C.int) return access FT_FaceRec;
function FT_Face_Get_Size (Self : in FT_Face.Item) return access FT_SizeRec;
function FT_Face_IS_SCALABLE (Self : in FT_Face.Item) return FT_Long;
function FT_Face_HAS_KERNING (Self : in FT_Face.Item) return FT_Long;
function FT_Face_Get_BBox (Self : in FT_Face.Item) return FT_BBox.Item;
function FT_Face_Get_units_per_EM (Self : in FT_Face.Item) return FT_UShort;
function FT_Face_Get_num_glyphs (Self : in FT_Face.Item) return FT_Long;
function FT_Face_Get_charmap (Self : in FT_Face.Item) return access FT_CharMapRec.Item;
function FT_Face_Get_charmap_at (Self : in FT_Face.Item; Index : in C.int) return access FT_CharMapRec.Item;
function FT_Face_Get_num_charmaps (Self : in FT_Face.Item) return FT_Int;
function FT_Face_Get_glyph (Self : in FT_Face.Item) return access FT_GlyphSlotRec;
function FT_Face_Attach_Stream (Self : in FT_Face.Item; pBufferBytes : in unsigned_char_Pointer;
BufferSizeInBytes : in C.size_t) return FT_Error;
function get_FT_GLYPH_FORMAT_NONE return C.unsigned;
function get_FT_GLYPH_FORMAT_COMPOSITE return C.unsigned;
function get_FT_GLYPH_FORMAT_BITMAP return C.unsigned;
function get_FT_GLYPH_FORMAT_OUTLINE return C.unsigned;
function get_FT_GLYPH_FORMAT_PLOTTER return C.unsigned;
function FT_ENCODING_NONE_enum return FT_Encoding;
function FT_ENCODING_MS_SYMBOL_enum return FT_Encoding;
function FT_ENCODING_UNICODE_enum return FT_Encoding;
function FT_ENCODING_SJIS_enum return FT_Encoding;
function FT_ENCODING_GB2312_enum return FT_Encoding;
function FT_ENCODING_BIG5_enum return FT_Encoding;
function FT_ENCODING_WANSUNG_enum return FT_Encoding;
function FT_ENCODING_JOHAB_enum return FT_Encoding;
function FT_ENCODING_ADOBE_STANDARD_enum return FT_Encoding;
function FT_ENCODING_ADOBE_EXPERT_enum return FT_Encoding;
function FT_ENCODING_ADOBE_CUSTOM_enum return FT_Encoding;
function FT_ENCODING_ADOBE_LATIN_1_enum return FT_Encoding;
function FT_ENCODING_OLD_LATIN_2_enum return FT_Encoding;
function FT_ENCODING_APPLE_ROMAN_enum return FT_Encoding;
function FT_LOAD_DEFAULT_flag return C.unsigned;
function FT_LOAD_NO_SCALE_flag return C.unsigned;
function FT_LOAD_NO_HINTING_flag return C.unsigned;
function FT_LOAD_RENDER_flag return C.unsigned;
function FT_LOAD_NO_BITMAP_flag return C.unsigned;
function FT_LOAD_VERTICAL_LAYOUT_flag return C.unsigned;
function FT_LOAD_FORCE_AUTOHINT_flag return C.unsigned;
function FT_LOAD_CROP_BITMAP_flag return C.unsigned;
function FT_LOAD_PEDANTIC_flag return C.unsigned;
function FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH_flag
return C.unsigned;
function FT_LOAD_NO_RECURSE_flag return C.unsigned;
function FT_LOAD_IGNORE_TRANSFORM_flag return C.unsigned;
function FT_LOAD_MONOCHROME_flag return C.unsigned;
function FT_LOAD_LINEAR_DESIGN_flag return C.unsigned;
function FT_LOAD_NO_AUTOHINT_flag return C.unsigned;
private
pragma Import (C, FT_Outline_Get_CBox, "FT_Outline_Get_CBox");
pragma Import (C, FT_Init_FreeType, "FT_Init_FreeType");
pragma Import (C, FT_Done_FreeType, "FT_Done_FreeType");
pragma Import (C, FT_Render_Glyph, "FT_Render_Glyph");
pragma Import (C, FT_Set_Char_Size, "FT_Set_Char_Size");
pragma Import (C, FT_Done_Face, "FT_Done_Face");
pragma Import (C, FT_Attach_File, "FT_Attach_File");
pragma Import (C, FT_Set_Charmap, "FT_Set_Charmap");
pragma Import (C, FT_Select_Charmap, "FT_Select_Charmap");
pragma Import (C, FT_Get_Char_Index, "FT_Get_Char_Index");
pragma Import (C, FT_Get_Kerning, "FT_Get_Kerning");
pragma Import (C, FT_Load_Glyph, "FT_Load_Glyph");
pragma Import (C, FT_GlyphSlot_Get_Outline, "FT_GlyphSlot_Get_Outline");
pragma Import (C, FT_GlyphSlot_Get_Advance, "FT_GlyphSlot_Get_Advance");
pragma Import (C, FT_GlyphSlot_Get_Bitmap, "FT_GlyphSlot_Get_Bitmap");
pragma Import (C, FT_GlyphSlot_Get_bitmap_left, "FT_GlyphSlot_Get_bitmap_left");
pragma Import (C, FT_GlyphSlot_Get_bitmap_top, "FT_GlyphSlot_Get_bitmap_top");
pragma Import (C, FT_GlyphSlot_Get_Format, "FT_GlyphSlot_Get_Format");
pragma Import (C, FT_Size_Get_Metrics, "FT_Size_Get_Metrics");
pragma Import (C, new_FT_Face, "new_FT_Face");
pragma Import (C, new_FT_Memory_Face, "new_FT_Memory_Face");
pragma Import (C, FT_Face_Get_Size, "FT_Face_Get_Size");
pragma Import (C, FT_Face_IS_SCALABLE, "FT_Face_IS_SCALABLE");
pragma Import (C, FT_Face_HAS_KERNING, "FT_Face_HAS_KERNING");
pragma Import (C, FT_Face_Get_BBox, "FT_Face_Get_BBox");
pragma Import (C, FT_Face_Get_units_per_EM, "FT_Face_Get_units_per_EM");
pragma Import (C, FT_Face_Get_num_glyphs, "FT_Face_Get_num_glyphs");
pragma Import (C, FT_Face_Get_charmap, "FT_Face_Get_charmap");
pragma Import (C, FT_Face_Get_charmap_at, "FT_Face_Get_charmap_at");
pragma Import (C, FT_Face_Get_num_charmaps, "FT_Face_Get_num_charmaps");
pragma Import (C, FT_Face_Get_glyph, "FT_Face_Get_glyph");
pragma Import (C, FT_Face_Attach_Stream, "FT_Face_Attach_Stream");
pragma Import (C, get_FT_GLYPH_FORMAT_NONE, "get_FT_GLYPH_FORMAT_NONE");
pragma Import (C, get_FT_GLYPH_FORMAT_COMPOSITE, "get_FT_GLYPH_FORMAT_COMPOSITE");
pragma Import (C, get_FT_GLYPH_FORMAT_BITMAP, "get_FT_GLYPH_FORMAT_BITMAP");
pragma Import (C, get_FT_GLYPH_FORMAT_OUTLINE, "get_FT_GLYPH_FORMAT_OUTLINE");
pragma Import (C, get_FT_GLYPH_FORMAT_PLOTTER, "get_FT_GLYPH_FORMAT_PLOTTER");
pragma Import (C, FT_ENCODING_NONE_enum, "FT_ENCODING_NONE_enum");
pragma Import (C, FT_ENCODING_MS_SYMBOL_enum, "FT_ENCODING_MS_SYMBOL_enum");
pragma Import (C, FT_ENCODING_UNICODE_enum, "FT_ENCODING_UNICODE_enum");
pragma Import (C, FT_ENCODING_SJIS_enum, "FT_ENCODING_SJIS_enum");
pragma Import (C, FT_ENCODING_GB2312_enum, "FT_ENCODING_GB2312_enum");
pragma Import (C, FT_ENCODING_BIG5_enum, "FT_ENCODING_BIG5_enum");
pragma Import (C, FT_ENCODING_WANSUNG_enum, "FT_ENCODING_WANSUNG_enum");
pragma Import (C, FT_ENCODING_JOHAB_enum, "FT_ENCODING_JOHAB_enum");
pragma Import (C, FT_ENCODING_ADOBE_STANDARD_enum, "FT_ENCODING_ADOBE_STANDARD_enum");
pragma Import (C, FT_ENCODING_ADOBE_EXPERT_enum, "FT_ENCODING_ADOBE_EXPERT_enum");
pragma Import (C, FT_ENCODING_ADOBE_CUSTOM_enum, "FT_ENCODING_ADOBE_CUSTOM_enum");
pragma Import (C, FT_ENCODING_ADOBE_LATIN_1_enum, "FT_ENCODING_ADOBE_LATIN_1_enum");
pragma Import (C, FT_ENCODING_OLD_LATIN_2_enum, "FT_ENCODING_OLD_LATIN_2_enum");
pragma Import (C, FT_ENCODING_APPLE_ROMAN_enum, "FT_ENCODING_APPLE_ROMAN_enum");
pragma Import (C, FT_LOAD_DEFAULT_flag, "FT_LOAD_DEFAULT_flag");
pragma Import (C, FT_LOAD_NO_SCALE_flag, "FT_LOAD_NO_SCALE_flag");
pragma Import (C, FT_LOAD_NO_HINTING_flag, "FT_LOAD_NO_HINTING_flag");
pragma Import (C, FT_LOAD_RENDER_flag, "FT_LOAD_RENDER_flag");
pragma Import (C, FT_LOAD_NO_BITMAP_flag, "FT_LOAD_NO_BITMAP_flag");
pragma Import (C, FT_LOAD_VERTICAL_LAYOUT_flag, "FT_LOAD_VERTICAL_LAYOUT_flag");
pragma Import (C, FT_LOAD_FORCE_AUTOHINT_flag, "FT_LOAD_FORCE_AUTOHINT_flag");
pragma Import (C, FT_LOAD_CROP_BITMAP_flag, "FT_LOAD_CROP_BITMAP_flag");
pragma Import (C, FT_LOAD_PEDANTIC_flag, "FT_LOAD_PEDANTIC_flag");
pragma Import (C, FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH_flag,
"FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH_flag");
pragma Import (C, FT_LOAD_NO_RECURSE_flag, "FT_LOAD_NO_RECURSE_flag");
pragma Import (C, FT_LOAD_IGNORE_TRANSFORM_flag, "FT_LOAD_IGNORE_TRANSFORM_flag");
pragma Import (C, FT_LOAD_MONOCHROME_flag, "FT_LOAD_MONOCHROME_flag");
pragma Import (C, FT_LOAD_LINEAR_DESIGN_flag, "FT_LOAD_LINEAR_DESIGN_flag");
pragma Import (C, FT_LOAD_NO_AUTOHINT_flag, "FT_LOAD_NO_AUTOHINT_flag");
end freetype_c.Binding;
|