]> gitweb.factorcode.org Git - factor.git/blob - basis/freetype/freetype.factor
Fix permission bits
[factor.git] / basis / freetype / freetype.factor
1 ! Copyright (C) 2005, 2007 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien alien.syntax kernel system combinators ;
4 IN: freetype
5
6 << "freetype" {
7     { [ os macosx? ] [ "@executable_path/../Frameworks/libfreetype.6.dylib" "cdecl" add-library ] }
8     { [ os windows? ] [ "freetype6.dll" "cdecl" add-library ] }
9     { [ t ] [ drop ] }
10 } cond >>
11
12 LIBRARY: freetype
13
14 TYPEDEF: uchar FT_Byte
15 TYPEDEF: void* FT_Bytes
16 TYPEDEF: char FT_Char
17 TYPEDEF: int FT_Int
18 TYPEDEF: int FT_Int32
19 TYPEDEF: uint FT_UInt
20 TYPEDEF: short FT_Short
21 TYPEDEF: ushort FT_UShort
22 TYPEDEF: long FT_Long
23 TYPEDEF: ulong FT_ULong
24 TYPEDEF: uchar FT_Bool
25 TYPEDEF: cell FT_Offset
26 TYPEDEF: int FT_PtrDist
27 TYPEDEF: char FT_String
28 TYPEDEF: int FT_Tag
29 TYPEDEF: int FT_Error
30 TYPEDEF: long FT_Fixed
31 TYPEDEF: void* FT_Pointer
32 TYPEDEF: long FT_Pos
33 TYPEDEF: ushort FT_UFWord
34 TYPEDEF: short FT_F2Dot14
35 TYPEDEF: long FT_F26Dot6
36
37 FUNCTION: FT_Error FT_Init_FreeType ( void* library ) ;
38
39 ! circular reference between glyph and face
40 TYPEDEF: void face
41 TYPEDEF: void glyph
42
43 C-STRUCT: glyph
44     { "void*" "library" }
45     { "face*" "face" }
46     { "glyph*" "next" }
47     { "FT_UInt" "reserved" }
48     { "void*" "generic" }
49     { "void*" "generic" }
50
51     { "FT_Pos" "width" }
52     { "FT_Pos" "height" }
53
54     { "FT_Pos" "hori-bearing-x" }
55     { "FT_Pos" "hori-bearing-y" }
56     { "FT_Pos" "hori-advance" }
57
58     { "FT_Pos" "vert-bearing-x" }
59     { "FT_Pos" "vert-bearing-y" }
60     { "FT_Pos" "vert-advance" }
61
62     { "FT_Fixed" "linear-hori-advance" }
63     { "FT_Fixed" "linear-vert-advance" }
64     { "FT_Pos" "advance-x" }
65     { "FT_Pos" "advance-y" }
66
67     { "long" "format" }
68
69     { "int" "bitmap-rows" }
70     { "int" "bitmap-width" }
71     { "int" "bitmap-pitch" }
72     { "void*" "bitmap-buffer" }
73     { "short" "bitmap-num-grays" }
74     { "char" "bitmap-pixel-mode" }
75     { "char" "bitmap-palette-mode" }
76     { "void*" "bitmap-palette" }
77
78     { "FT_Int" "bitmap-left" }
79     { "FT_Int" "bitmap-top" }
80
81     { "short" "n-contours" }
82     { "short" "n-points" }
83
84     { "void*" "points" }
85     { "char*" "tags" }
86     { "short*" "contours" }
87
88     { "int" "outline-flags" }
89
90     { "FT_UInt" "num_subglyphs" }
91     { "void*" "subglyphs" }
92
93     { "void*" "control-data" }
94     { "long" "control-len" }
95
96     { "FT_Pos" "lsb-delta" }
97     { "FT_Pos" "rsb-delta" }
98
99     { "void*" "other" } ;
100
101 C-STRUCT: face-size
102     { "face*" "face" }
103     { "void*" "generic" }
104     { "void*" "generic" }
105
106     { "FT_UShort" "x-ppem" }
107     { "FT_UShort" "y-ppem" }
108
109     { "FT_Fixed" "x-scale" }
110     { "FT_Fixed" "y-scale" }
111
112     { "FT_Pos" "ascender" }
113     { "FT_Pos" "descender" }
114     { "FT_Pos" "height" }
115     { "FT_Pos" "max-advance" } ;
116
117 C-STRUCT: face
118     { "FT_Long" "num-faces" }
119     { "FT_Long" "index" }
120
121     { "FT_Long" "flags" }
122     { "FT_Long" "style-flags" }
123
124     { "FT_Long" "num-glyphs" }
125
126     { "FT_Char*" "family-name" }
127     { "FT_Char*" "style-name" }
128
129     { "FT_Int" "num-fixed-sizes" }
130     { "void*" "available-sizes" }
131
132     { "FT_Int" "num-charmaps" }
133     { "void*" "charmaps" }
134
135     { "void*" "generic" }
136     { "void*" "generic" }
137
138     { "FT_Pos" "x-min" }
139     { "FT_Pos" "y-min" }
140     { "FT_Pos" "x-max" }
141     { "FT_Pos" "y-max" }
142
143     { "FT_UShort" "units-per-em" }
144     { "FT_Short" "ascender" }
145     { "FT_Short" "descender" }
146     { "FT_Short" "height" }
147
148     { "FT_Short" "max-advance-width" }
149     { "FT_Short" "max-advance-height" }
150
151     { "FT_Short" "underline-position" }
152     { "FT_Short" "underline-thickness" }
153
154     { "glyph*" "glyph" }
155     { "face-size*" "size" }
156     { "void*" "charmap" } ;
157
158 C-STRUCT: FT_Bitmap
159     { "int" "rows" }
160     { "int" "width" }
161     { "int" "pitch" }
162     { "void*" "buffer" }
163     { "short" "num_grays" }
164     { "char" "pixel_mode" }
165     { "char" "palette_mode" }
166     { "void*" "palette" } ;
167
168 FUNCTION: FT_Error FT_New_Face ( void* library, FT_Char* font, FT_Long index, face* face ) ;
169
170 FUNCTION: FT_Error FT_New_Memory_Face ( void* library, FT_Byte* file_base, FT_Long file_size, FT_Long face_index, FT_Face* aface ) ;
171
172 FUNCTION: FT_Error FT_Set_Char_Size ( face* face, FT_F26Dot6 char_width, FT_F26Dot6 char_height, FT_UInt horizontal_dpi, FT_UInt vertical_dpi ) ;
173
174 FUNCTION: FT_Error FT_Load_Char ( face* face, FT_ULong charcode, FT_Int32 load_flags ) ;
175
176 C-ENUM:
177     FT_RENDER_MODE_NORMAL
178     FT_RENDER_MODE_LIGHT
179     FT_RENDER_MODE_MONO
180     FT_RENDER_MODE_LCD
181     FT_RENDER_MODE_LCD_V ;
182
183 C-ENUM:
184     FT_PIXEL_MODE_NONE
185     FT_PIXEL_MODE_MONO
186     FT_PIXEL_MODE_GRAY
187     FT_PIXEL_MODE_GRAY2
188     FT_PIXEL_MODE_GRAY4
189     FT_PIXEL_MODE_LCD
190     FT_PIXEL_MODE_LCD_V ;
191
192 FUNCTION: int FT_Render_Glyph ( glyph* slot, int render_mode ) ;
193
194 FUNCTION: void FT_Done_Face ( face* face ) ;
195
196 FUNCTION: void FT_Done_FreeType ( void* library ) ;
197
198 FUNCTION: FT_Long FT_MulFix ( FT_Long a, FT_Long b ) ;
199