Set clipping region to client window in LISTBOX_Paint.
[wine.git] / include / x11font.h
blob0b99d87b1d3c8d7f2875766118069d980b9ed5f8
1 /*
2 * X11 physical font definitions
4 * Copyright 1997 Alex Korobka
5 */
7 #ifndef __WINE_X11FONT_H
8 #define __WINE_X11FONT_H
10 #include "gdi.h"
11 #include "x11drv.h"
12 #include "pshpack1.h"
14 /* this is a part of the font resource header, should
15 * make it easier to implement dynamic softfont loading */
17 typedef struct
19 INT16 dfType;
20 INT16 dfPoints;
21 INT16 dfVertRes;
22 INT16 dfHorizRes;
23 INT16 dfAscent;
24 INT16 dfInternalLeading;
25 INT16 dfExternalLeading;
26 CHAR dfItalic;
27 CHAR dfUnderline;
28 CHAR dfStrikeOut;
29 INT16 dfWeight;
30 BYTE dfCharSet;
31 INT16 dfPixWidth;
32 INT16 dfPixHeight;
33 CHAR dfPitchAndFamily;
34 INT16 dfAvgWidth;
35 INT16 dfMaxWidth;
36 CHAR dfFirstChar;
37 CHAR dfLastChar;
38 CHAR dfDefaultChar;
39 CHAR dfBreakChar;
40 INT16 dfWidthBytes;
41 LPCSTR dfDevice;
42 LPCSTR dfFace;
43 } IFONTINFO16, *LPIFONTINFO16;
45 #include "poppack.h"
47 /* internal flags */
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
63 /* code pages */
65 #define FI_ENC_ANSI 0
66 #define FI_ENC_ISO8859 1
67 #define FI_ENC_ISO646 2
68 #define FI_ENC_MICROSOFT 3
69 #define FI_ENC_KOI8 4
70 #define FI_ENC_ASCII 5
71 #define FI_ENC_VISCII 6
72 #define FI_ENC_TCVN 7
73 #define FI_ENC_TIS620 8
75 typedef struct tagFontInfo
77 struct tagFontInfo* next;
78 UINT16 fi_flags;
79 UINT16 fi_encoding;
80 UINT16 codepage;
82 /* LFD parameters can be quite different from the actual metrics */
84 UINT16 lfd_height;
85 UINT16 lfd_resolution;
86 IFONTINFO16 df;
87 } fontInfo;
89 /* Font resource list for EnumFont() purposes */
91 #define FR_SOFTFONT 0x1000 /* - .FON or .FOT file */
92 #define FR_SOFTRESOURCE 0x2000 /* - resource handle */
93 #define FR_REMOVED 0x4000 /* delayed remove */
94 #define FR_NAMESET 0x8000
96 #define LFD_FIELDS 14
97 typedef struct
99 char* foundry;
100 char* family;
101 char* weight;
102 char* slant;
103 char* set_width;
104 char* add_style;
105 char* pixel_size;
106 char* point_size;
107 char* resolution_x;
108 char* resolution_y;
109 char* spacing;
110 char* average_width;
111 char* charset_registry;
112 char* charset_encoding;
113 } LFD;
115 typedef struct tagFontResource
117 struct tagFontResource* next;
118 UINT16 fr_flags;
119 UINT16 fr_penalty;
120 UINT16 fi_count;
121 UINT16 fo_count;
122 fontInfo* fi;
123 LFD* resource;
124 HANDLE hOwner; /* For FR_SOFTFONT/FR_SOFTRESOURCE fonts */
125 CHAR lfFaceName[LF_FACESIZE];
126 } fontResource;
128 typedef struct {
129 float a,b,c,d; /* pixelsize matrix, FIXME: switch to MAT2 format */
130 unsigned long RAW_ASCENT;
131 unsigned long RAW_DESCENT;
132 float pixelsize;
133 float ascent;
134 float descent;
135 } XFONTTRANS;
137 #define FO_RESOURCE_MASK 0x000F
138 #define FO_SYSTEM 0x0001 /* resident in cache */
139 #define FO_SOFTFONT 0x0002 /* installed at runtime */
140 #define FO_SHARED 0x0004 /* MITSHM */
141 #define FO_REMOVED 0x0008 /* remove when count falls to 0 */
143 #define FO_MATCH_MASK 0x00F0
144 #define FO_MATCH_NORASTER 0x0010
145 #define FO_MATCH_PAF 0x0020
146 #define FO_MATCH_XYINDEP 0x0040
148 #define FO_SYNTH_MASK 0xFF00
149 #define FO_SYNTH_HEIGHT 0x2000
150 #define FO_SYNTH_WIDTH 0x4000
151 #define FO_SYNTH_ROTATE 0x8000
152 #define FO_SYNTH_BOLD 0x0100
153 #define FO_SYNTH_ITALIC 0x0200
154 #define FO_SYNTH_UNDERLINE 0x0400
155 #define FO_SYNTH_STRIKEOUT 0x0800
157 /* Realized screen font */
159 typedef struct
161 XFontStruct* fs; /* text metrics */
162 fontResource* fr; /* font family */
163 fontInfo* fi; /* font instance info */
164 Pixmap* lpPixmap; /* optional character bitmasks for synth fonts */
166 XFONTTRANS *lpX11Trans; /* Info for X11R6 transform */
167 float rescale; /* Rescale for large fonts */
168 INT16 foInternalLeading;
169 INT16 foAvgCharWidth;
170 INT16 foMaxCharWidth;
171 UINT16 fo_flags;
173 /* font cache housekeeping */
175 UINT16 count;
176 UINT16 lru;
177 UINT16 lfchecksum;
178 LOGFONT16 lf;
179 } fontObject;
181 typedef struct
183 fontResource* pfr;
184 fontInfo* pfi;
185 UINT16 height;
186 UINT16 flags;
187 LPLOGFONT16 plf;
188 } fontMatch;
190 typedef struct
192 LPLOGFONT16 lpLogFontParam;
193 FONTENUMPROC16 lpEnumFunc;
194 LPARAM lpData;
196 LPNEWTEXTMETRICEX16 lpTextMetric;
197 LPENUMLOGFONTEX16 lpLogFont;
198 SEGPTR segTextMetric;
199 SEGPTR segLogFont;
200 } fontEnum16;
202 typedef struct
204 LPLOGFONTW lpLogFontParam;
205 FONTENUMPROCEXW lpEnumFunc;
206 LPARAM lpData;
208 LPNEWTEXTMETRICEXW lpTextMetric;
209 LPENUMLOGFONTEXW lpLogFont;
210 DWORD dwFlags;
211 } fontEnum32;
213 extern fontObject* XFONT_GetFontObject( X_PHYSFONT pFont );
214 extern XFontStruct* XFONT_GetFontStruct( X_PHYSFONT pFont );
215 extern LPIFONTINFO16 XFONT_GetFontInfo( X_PHYSFONT pFont );
217 #endif /* __WINE_X11FONT_H */