1 ! Copyright (C) 2005, 2007 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien alien.c-types alien.syntax kernel system combinators
4 alien.libraries classes.struct ;
8 { [ os macosx? ] [ "/usr/X11R6/lib/libfreetype.6.dylib" "cdecl" add-library ] }
9 { [ os windows? ] [ "freetype6.dll" "cdecl" add-library ] }
15 TYPEDEF: uchar FT_Byte
16 TYPEDEF: void* FT_Bytes
21 TYPEDEF: short FT_Short
22 TYPEDEF: ushort FT_UShort
24 TYPEDEF: ulong FT_ULong
25 TYPEDEF: uchar FT_Bool
26 TYPEDEF: ulong FT_Offset
27 TYPEDEF: int FT_PtrDist
28 TYPEDEF: char FT_String
31 TYPEDEF: long FT_Fixed
32 TYPEDEF: void* FT_Pointer
34 TYPEDEF: ushort FT_UFWord
35 TYPEDEF: short FT_F2Dot14
36 TYPEDEF: long FT_F26Dot6
38 FUNCTION: FT_Error FT_Init_FreeType ( void* library ) ;
40 ! circular reference between glyph and face
55 { hori-bearing-x FT_Pos }
56 { hori-bearing-y FT_Pos }
57 { hori-advance FT_Pos }
59 { vert-bearing-x FT_Pos }
60 { vert-bearing-y FT_Pos }
61 { vert-advance FT_Pos }
63 { linear-hori-advance FT_Fixed }
64 { linear-vert-advance FT_Fixed }
73 { bitmap-buffer void* }
74 { bitmap-num-grays short }
75 { bitmap-pixel-mode char }
76 { bitmap-palette-mode char }
77 { bitmap-palette void* }
79 { bitmap-left FT_Int }
91 { num_subglyphs FT_UInt }
94 { control-data void* }
116 { max-advance FT_Pos } ;
119 { num-faces FT_Long }
123 { style-flags FT_Long }
125 { num-glyphs FT_Long }
127 { family-name FT_Char* }
128 { style-name FT_Char* }
130 { num-fixed-sizes FT_Int }
131 { available-sizes void* }
133 { num-charmaps FT_Int }
144 { units-per-em FT_UShort }
145 { ascender FT_Short }
146 { descender FT_Short }
149 { max-advance-width FT_Short }
150 { max-advance-height FT_Short }
152 { underline-position FT_Short }
153 { underline-thickness FT_Short }
166 { palette_mode char }
171 FUNCTION: FT_Error FT_New_Face ( void* library, FT_Char* font, FT_Long index, face* face ) ;
173 FUNCTION: FT_Error FT_New_Memory_Face ( void* library, FT_Byte* file_base, FT_Long file_size, FT_Long face_index, FT_Face* aface ) ;
175 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 ) ;
177 FUNCTION: FT_Error FT_Load_Char ( face* face, FT_ULong charcode, FT_Int32 load_flags ) ;
180 FT_RENDER_MODE_NORMAL
184 FT_RENDER_MODE_LCD_V ;
193 FT_PIXEL_MODE_LCD_V ;
195 FUNCTION: int FT_Render_Glyph ( glyph* slot, int render_mode ) ;
197 FUNCTION: void FT_Done_Face ( face* face ) ;
199 FUNCTION: void FT_Done_FreeType ( void* library ) ;
201 FUNCTION: FT_Long FT_MulFix ( FT_Long a, FT_Long b ) ;