2 * Truetype font functions
4 * Copyright 2008 Massimo Del Fedele
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_DIBDRV_FREETYPE_H
20 #define __WINE_DIBDRV__FREETYPE_H
22 /* freetype library for font support */
26 #include FT_FREETYPE_H
28 #include FT_TRUETYPE_TABLES_H
29 #include FT_SFNT_NAMES_H
30 #include FT_TRUETYPE_IDS_H
33 /* freetype library handle */
34 extern FT_Library DIBDRV_ftLibrary
;
36 /******************************************************************************************/
38 /* grabbed from winex11.drv/freetype.c */
39 /******************************************************************************************/
41 /* This is basically a copy of FT_Bitmap_Size with an extra element added */
48 FT_Short internal_leading
;
51 /* FT_Bitmap_Size gained 3 new elements between FreeType 2.1.4 and 2.1.5
52 So to let this compile on older versions of FreeType we'll define the
53 new structure here. */
55 FT_Short height
, width
;
56 FT_Pos size
, x_ppem
, y_ppem
;
66 typedef struct tagFace
{
74 FONTSIGNATURE fs_links
;
76 FT_Fixed font_version
;
78 Bitmap_Size size
; /* set if face is a bitmap */
79 BOOL external
; /* TRUE if we should manually add this font to the registry */
80 struct tagFamily
*family
;
81 /* Cached data for Enum */
82 struct enum_data
*cached_enum_data
;
85 typedef struct tagFamily
{
87 const WCHAR
*FamilyName
;
93 INT adv
; /* These three hold to widths of the unrotated chars */
111 typedef struct tagHFONTLIST
{
119 struct tagGdiFont
*font
;
122 typedef struct tagGdiFont
{
126 struct list hfontlist
;
127 OUTLINETEXTMETRICW
*potm
;
128 DWORD total_kern_pairs
;
129 KERNINGPAIR
*kern_pairs
;
130 struct list child_fonts
;
132 /* the following members can be accessed without locking, they are never modified after creation */
134 struct font_mapping
*mapping
;
150 struct tagGdiFont
*base_font
;
155 /* initialize freetype library */
156 BOOL
_DIBDRV_FreeType_Init(void);
158 /* terminates freetype library */
159 void _DIBDRV_FreeType_Terminate(void);
161 #define MAKE_FUNCPTR(f) extern typeof(f) * p##f;
162 MAKE_FUNCPTR(FT_Done_Face
)
163 MAKE_FUNCPTR(FT_Done_FreeType
)
164 MAKE_FUNCPTR(FT_Get_Char_Index
)
165 MAKE_FUNCPTR(FT_Get_Glyph_Name
)
166 MAKE_FUNCPTR(FT_Get_Sfnt_Name
)
167 MAKE_FUNCPTR(FT_Get_Sfnt_Name_Count
)
168 MAKE_FUNCPTR(FT_Get_Sfnt_Table
)
169 MAKE_FUNCPTR(FT_Init_FreeType
)
170 MAKE_FUNCPTR(FT_Load_Glyph
)
171 MAKE_FUNCPTR(FT_Load_Char
)
172 MAKE_FUNCPTR(FT_Get_Glyph
)
173 MAKE_FUNCPTR(FT_Glyph_Copy
)
174 MAKE_FUNCPTR(FT_Glyph_To_Bitmap
)
175 MAKE_FUNCPTR(FT_Done_Glyph
)
176 MAKE_FUNCPTR(FT_New_Face
)
177 MAKE_FUNCPTR(FT_Set_Charmap
)
178 MAKE_FUNCPTR(FT_Set_Char_Size
)
179 MAKE_FUNCPTR(FT_Set_Pixel_Sizes
)
180 MAKE_FUNCPTR(FT_Get_First_Char
)
181 MAKE_FUNCPTR(FT_Render_Glyph
)
182 MAKE_FUNCPTR(FT_Glyph_Transform
)
183 MAKE_FUNCPTR(FT_Bitmap_New
)
184 MAKE_FUNCPTR(FT_Bitmap_Done
)
185 MAKE_FUNCPTR(FT_Bitmap_Convert
)
188 #endif /* HAVE_FREETYPE */