2 * X11 physical font definitions
4 * Copyright 1997 Alex Korobka
7 #ifndef __WINE_X11FONT_H
8 #define __WINE_X11FONT_H
14 /* this is a part of the font resource header, should
15 * make it easier to implement dynamic softfont loading */
24 INT16 dfInternalLeading;
25 INT16 dfExternalLeading;
33 CHAR dfPitchAndFamily;
43 } IFONTINFO16, *LPIFONTINFO16;
49 #define FI_POLYWEIGHT 0x0001
50 #define FI_POLYSLANT 0x0002
51 #define FI_OBLIQUE 0x0004
52 #define FI_SCALABLE 0x0008
53 #define FI_FW_BOOK 0x0010
54 #define FI_FW_DEMI 0x0020
55 #define FI_VARIABLEPITCH 0x0040
56 #define FI_FIXEDPITCH 0x0080
58 #define FI_FIXEDEX 0x1000
59 #define FI_NORMAL 0x2000
60 #define FI_SUBSET 0x4000
61 #define FI_TRUETYPE 0x8000
66 #define FI_ENC_ISO8859 1
67 #define FI_ENC_ISO646 2
68 #define FI_ENC_MICROSOFT 3
70 #define FI_ENC_ASCII 5
71 #define FI_ENC_VISCII 6
73 #define FI_ENC_TIS620 8
78 X11DRV_CPTABLE_UNICODE,
86 typedef struct tagFontInfo
88 struct tagFontInfo* next;
93 WORD internal_charset;
95 /* LFD parameters can be quite different from the actual metrics */
98 UINT16 lfd_resolution;
102 /* Font resource list for EnumFont() purposes */
104 #define FR_SOFTFONT 0x1000 /* - .FON or .FOT file */
105 #define FR_SOFTRESOURCE 0x2000 /* - resource handle */
106 #define FR_REMOVED 0x4000 /* delayed remove */
107 #define FR_NAMESET 0x8000
109 #define LFD_FIELDS 14
116 const char* set_width;
117 const char* add_style;
118 const char* pixel_size;
119 const char* point_size;
120 const char* resolution_x;
121 const char* resolution_y;
123 const char* average_width;
124 const char* charset_registry;
125 const char* charset_encoding;
128 typedef struct tagFontResource
130 struct tagFontResource* next;
137 HANDLE hOwner; /* For FR_SOFTFONT/FR_SOFTRESOURCE fonts */
138 CHAR lfFaceName[LF_FACESIZE];
142 float a,b,c,d; /* pixelsize matrix, FIXME: switch to MAT2 format */
143 unsigned long RAW_ASCENT;
144 unsigned long RAW_DESCENT;
150 #define FO_RESOURCE_MASK 0x000F
151 #define FO_SYSTEM 0x0001 /* resident in cache */
152 #define FO_SOFTFONT 0x0002 /* installed at runtime */
153 #define FO_SHARED 0x0004 /* MITSHM */
154 #define FO_REMOVED 0x0008 /* remove when count falls to 0 */
156 #define FO_MATCH_MASK 0x00F0
157 #define FO_MATCH_NORASTER 0x0010
158 #define FO_MATCH_PAF 0x0020
159 #define FO_MATCH_XYINDEP 0x0040
161 #define FO_SYNTH_MASK 0xFF00
162 #define FO_SYNTH_HEIGHT 0x2000
163 #define FO_SYNTH_WIDTH 0x4000
164 #define FO_SYNTH_ROTATE 0x8000
165 #define FO_SYNTH_BOLD 0x0100
166 #define FO_SYNTH_ITALIC 0x0200
167 #define FO_SYNTH_UNDERLINE 0x0400
168 #define FO_SYNTH_STRIKEOUT 0x0800
170 /* Realized screen font */
172 #define X11FONT_REFOBJS_MAX 4
176 XFontStruct* fs; /* text metrics */
177 fontResource* fr; /* font family */
178 fontInfo* fi; /* font instance info */
179 Pixmap* lpPixmap; /* optional character bitmasks for synth fonts */
180 X_PHYSFONT prefobjs[X11FONT_REFOBJS_MAX]; /* font objects for DBCS charsets */
182 XFONTTRANS *lpX11Trans; /* Info for X11R6 transform */
183 float rescale; /* Rescale for large fonts */
184 INT16 foInternalLeading;
185 INT16 foAvgCharWidth;
186 INT16 foMaxCharWidth;
189 /* font cache housekeeping */
204 WORD internal_charset;
209 LPLOGFONT16 lpLogFontParam;
210 FONTENUMPROC16 lpEnumFunc;
213 LPNEWTEXTMETRICEX16 lpTextMetric;
214 LPENUMLOGFONTEX16 lpLogFont;
215 SEGPTR segTextMetric;
221 LPLOGFONTW lpLogFontParam;
222 FONTENUMPROCEXW lpEnumFunc;
225 LPNEWTEXTMETRICEXW lpTextMetric;
226 LPENUMLOGFONTEXW lpLogFont;
230 extern fontObject* XFONT_GetFontObject( X_PHYSFONT pFont );
231 extern XFontStruct* XFONT_GetFontStruct( X_PHYSFONT pFont );
232 extern LPIFONTINFO16 XFONT_GetFontInfo( X_PHYSFONT pFont );
234 /* internal charset(hibyte must be set) */
235 /* lobyte is DEFAULT_CHARSET(=0). */
236 #define X11FONT_JISX0201_CHARSET 0x100
237 #define X11FONT_JISX0212_CHARSET 0x200
239 typedef struct tagX11DRV_CP
241 WORD (*penum_subfont_charset)( UINT index );
242 XChar2b* (*punicode_to_char2b)( fontObject* pfo,
243 LPCWSTR lpwstr, UINT count );
244 void (*pDrawString)( fontObject* pfo, Display* pdisp, Drawable d, GC gc,
245 int x, int y, XChar2b* pstr, int count );
246 int (*pTextWidth)( fontObject* pfo, XChar2b* pstr, int count );
247 void (*pDrawText)( fontObject* pfo, Display* pdisp, Drawable d, GC gc,
248 int x, int y, XTextItem16* pitems, int count );
249 void (*pTextExtents)( fontObject* pfo, XChar2b* pstr, int count,
250 int* pdir, int* pascent, int* pdescent,
252 void (*pGetTextMetricsA)( fontObject* pfo, LPTEXTMETRICA pTM );
255 extern const X11DRV_CP X11DRV_cptable[X11DRV_CPTABLE_COUNT];
257 #endif /* __WINE_X11FONT_H */