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 ;
7 { [ os macosx? ] [ "/usr/X11R6/lib/libfreetype.6.dylib" "cdecl" add-library ] }
8 { [ os windows? ] [ "freetype6.dll" "cdecl" add-library ] }
14 TYPEDEF: uchar FT_Byte
15 TYPEDEF: void* FT_Bytes
20 TYPEDEF: short FT_Short
21 TYPEDEF: ushort FT_UShort
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
30 TYPEDEF: long FT_Fixed
31 TYPEDEF: void* FT_Pointer
33 TYPEDEF: ushort FT_UFWord
34 TYPEDEF: short FT_F2Dot14
35 TYPEDEF: long FT_F26Dot6
37 FUNCTION: FT_Error FT_Init_FreeType ( void* library ) ;
39 ! circular reference between glyph and face
47 { "FT_UInt" "reserved" }
54 { "FT_Pos" "hori-bearing-x" }
55 { "FT_Pos" "hori-bearing-y" }
56 { "FT_Pos" "hori-advance" }
58 { "FT_Pos" "vert-bearing-x" }
59 { "FT_Pos" "vert-bearing-y" }
60 { "FT_Pos" "vert-advance" }
62 { "FT_Fixed" "linear-hori-advance" }
63 { "FT_Fixed" "linear-vert-advance" }
64 { "FT_Pos" "advance-x" }
65 { "FT_Pos" "advance-y" }
67 { "intptr_t" "format" }
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" }
78 { "FT_Int" "bitmap-left" }
79 { "FT_Int" "bitmap-top" }
81 { "short" "n-contours" }
82 { "short" "n-points" }
86 { "short*" "contours" }
88 { "int" "outline-flags" }
90 { "FT_UInt" "num_subglyphs" }
91 { "void*" "subglyphs" }
93 { "void*" "control-data" }
94 { "long" "control-len" }
96 { "FT_Pos" "lsb-delta" }
97 { "FT_Pos" "rsb-delta" }
103 { "void*" "generic" }
104 { "void*" "generic" }
106 { "FT_UShort" "x-ppem" }
107 { "FT_UShort" "y-ppem" }
109 { "FT_Fixed" "x-scale" }
110 { "FT_Fixed" "y-scale" }
112 { "FT_Pos" "ascender" }
113 { "FT_Pos" "descender" }
114 { "FT_Pos" "height" }
115 { "FT_Pos" "max-advance" } ;
118 { "FT_Long" "num-faces" }
119 { "FT_Long" "index" }
121 { "FT_Long" "flags" }
122 { "FT_Long" "style-flags" }
124 { "FT_Long" "num-glyphs" }
126 { "FT_Char*" "family-name" }
127 { "FT_Char*" "style-name" }
129 { "FT_Int" "num-fixed-sizes" }
130 { "void*" "available-sizes" }
132 { "FT_Int" "num-charmaps" }
133 { "void*" "charmaps" }
135 { "void*" "generic" }
136 { "void*" "generic" }
143 { "FT_UShort" "units-per-em" }
144 { "FT_Short" "ascender" }
145 { "FT_Short" "descender" }
146 { "FT_Short" "height" }
148 { "FT_Short" "max-advance-width" }
149 { "FT_Short" "max-advance-height" }
151 { "FT_Short" "underline-position" }
152 { "FT_Short" "underline-thickness" }
155 { "face-size*" "size" }
156 { "void*" "charmap" } ;
163 { "short" "num_grays" }
164 { "char" "pixel_mode" }
165 { "char" "palette_mode" }
166 { "void*" "palette" } ;
168 FUNCTION: FT_Error FT_New_Face ( void* library, FT_Char* font, FT_Long index, face* face ) ;
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 ) ;
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 ) ;
174 FUNCTION: FT_Error FT_Load_Char ( face* face, FT_ULong charcode, FT_Int32 load_flags ) ;
177 FT_RENDER_MODE_NORMAL
181 FT_RENDER_MODE_LCD_V ;
190 FT_PIXEL_MODE_LCD_V ;
192 FUNCTION: int FT_Render_Glyph ( glyph* slot, int render_mode ) ;
194 FUNCTION: void FT_Done_Face ( face* face ) ;
196 FUNCTION: void FT_Done_FreeType ( void* library ) ;
198 FUNCTION: FT_Long FT_MulFix ( FT_Long a, FT_Long b ) ;