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
32 /* freetype library handle */
33 extern FT_Library DIBDRV_ftLibrary
;
35 /******************************************************************************************/
37 /* grabbed from winex11.drv/freetype.c */
38 /******************************************************************************************/
40 /* This is basically a copy of FT_Bitmap_Size with an extra element added */
47 FT_Short internal_leading
;
50 /* FT_Bitmap_Size gained 3 new elements between FreeType 2.1.4 and 2.1.5
51 So to let this compile on older versions of FreeType we'll define the
52 new structure here. */
54 FT_Short height
, width
;
55 FT_Pos size
, x_ppem
, y_ppem
;
65 typedef struct tagFace
{
73 FONTSIGNATURE fs_links
;
75 FT_Fixed font_version
;
77 Bitmap_Size size
; /* set if face is a bitmap */
78 BOOL external
; /* TRUE if we should manually add this font to the registry */
79 struct tagFamily
*family
;
80 /* Cached data for Enum */
81 struct enum_data
*cached_enum_data
;
84 typedef struct tagFamily
{
86 const WCHAR
*FamilyName
;
92 INT adv
; /* These three hold to widths of the unrotated chars */
110 typedef struct tagHFONTLIST
{
118 struct tagGdiFont
*font
;
121 typedef struct tagGdiFont
{
125 struct list hfontlist
;
126 OUTLINETEXTMETRICW
*potm
;
127 DWORD total_kern_pairs
;
128 KERNINGPAIR
*kern_pairs
;
129 struct list child_fonts
;
131 /* the following members can be accessed without locking, they are never modified after creation */
133 struct font_mapping
*mapping
;
149 struct tagGdiFont
*base_font
;
154 /* initialize freetype library */
155 BOOL
_DIBDRV_FreeType_Init(void);
157 /* terminates freetype library */
158 void _DIBDRV_FreeType_Terminate(void);
160 #define MAKE_FUNCPTR(f) extern typeof(f) * p##f;
161 MAKE_FUNCPTR(FT_Done_Face
)
162 MAKE_FUNCPTR(FT_Done_FreeType
)
163 MAKE_FUNCPTR(FT_Get_Char_Index
)
164 MAKE_FUNCPTR(FT_Get_Glyph_Name
)
165 MAKE_FUNCPTR(FT_Get_Sfnt_Name
)
166 MAKE_FUNCPTR(FT_Get_Sfnt_Name_Count
)
167 MAKE_FUNCPTR(FT_Get_Sfnt_Table
)
168 MAKE_FUNCPTR(FT_Init_FreeType
)
169 MAKE_FUNCPTR(FT_Load_Glyph
)
170 MAKE_FUNCPTR(FT_Load_Char
)
171 MAKE_FUNCPTR(FT_Get_Glyph
)
172 MAKE_FUNCPTR(FT_Glyph_Copy
)
173 MAKE_FUNCPTR(FT_Glyph_To_Bitmap
)
174 MAKE_FUNCPTR(FT_Done_Glyph
)
175 MAKE_FUNCPTR(FT_New_Face
)
176 MAKE_FUNCPTR(FT_Set_Charmap
)
177 MAKE_FUNCPTR(FT_Set_Char_Size
)
178 MAKE_FUNCPTR(FT_Set_Pixel_Sizes
)
179 MAKE_FUNCPTR(FT_Get_First_Char
)
180 MAKE_FUNCPTR(FT_Render_Glyph
)
181 MAKE_FUNCPTR(FT_Glyph_Transform
)
184 #endif /* HAVE_FREETYPE */