2 * X11 physical font definitions
4 * Copyright 1997 Alex Korobka
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_X11FONT_H
22 #define __WINE_X11FONT_H
24 #include "wine/wingdi16.h"
28 /* this is a part of the font resource header, should
29 * make it easier to implement dynamic softfont loading */
38 INT16 dfInternalLeading
;
39 INT16 dfExternalLeading
;
47 CHAR dfPitchAndFamily
;
57 } IFONTINFO16
, *LPIFONTINFO16
;
63 #define FI_POLYWEIGHT 0x0001
64 #define FI_POLYSLANT 0x0002
65 #define FI_OBLIQUE 0x0004
66 #define FI_SCALABLE 0x0008
67 #define FI_FW_BOOK 0x0010
68 #define FI_FW_DEMI 0x0020
69 #define FI_VARIABLEPITCH 0x0040
70 #define FI_FIXEDPITCH 0x0080
72 #define FI_FIXEDEX 0x1000
73 #define FI_NORMAL 0x2000
74 #define FI_SUBSET 0x4000
75 #define FI_TRUETYPE 0x8000
80 #define FI_ENC_ISO8859 1
81 #define FI_ENC_ISO646 2
82 #define FI_ENC_MICROSOFT 3
84 #define FI_ENC_ASCII 5
85 #define FI_ENC_VISCII 6
87 #define FI_ENC_TIS620 8
92 X11DRV_CPTABLE_UNICODE
,
97 X11DRV_CPTABLE_SYMBOL
,
101 typedef struct tagFontInfo
103 struct tagFontInfo
* next
;
108 WORD internal_charset
;
110 /* LFD parameters can be quite different from the actual metrics */
113 UINT16 lfd_resolution
;
117 /* Font resource list for EnumFont() purposes */
119 #define FR_SOFTFONT 0x1000 /* - .FON or .FOT file */
120 #define FR_SOFTRESOURCE 0x2000 /* - resource handle */
121 #define FR_REMOVED 0x4000 /* delayed remove */
122 #define FR_NAMESET 0x8000
124 #define LFD_FIELDS 14
131 const char* set_width
;
132 const char* add_style
;
133 const char* pixel_size
;
134 const char* point_size
;
135 const char* resolution_x
;
136 const char* resolution_y
;
138 const char* average_width
;
139 const char* charset_registry
;
140 const char* charset_encoding
;
143 typedef struct tagFontResource
145 struct tagFontResource
* next
;
152 HANDLE hOwner
; /* For FR_SOFTFONT/FR_SOFTRESOURCE fonts */
153 CHAR lfFaceName
[LF_FACESIZE
];
157 float a
,b
,c
,d
; /* pixelsize matrix, FIXME: switch to MAT2 format */
158 unsigned long RAW_ASCENT
;
159 unsigned long RAW_DESCENT
;
165 #define FO_RESOURCE_MASK 0x000F
166 #define FO_SYSTEM 0x0001 /* resident in cache */
167 #define FO_SOFTFONT 0x0002 /* installed at runtime */
168 #define FO_SHARED 0x0004 /* MITSHM */
169 #define FO_REMOVED 0x0008 /* remove when count falls to 0 */
171 #define FO_MATCH_MASK 0x00F0
172 #define FO_MATCH_NORASTER 0x0010
173 #define FO_MATCH_PAF 0x0020
174 #define FO_MATCH_XYINDEP 0x0040
176 #define FO_SYNTH_MASK 0xFF00
177 #define FO_SYNTH_HEIGHT 0x2000
178 #define FO_SYNTH_WIDTH 0x4000
179 #define FO_SYNTH_ROTATE 0x8000
180 #define FO_SYNTH_BOLD 0x0100
181 #define FO_SYNTH_ITALIC 0x0200
182 #define FO_SYNTH_UNDERLINE 0x0400
183 #define FO_SYNTH_STRIKEOUT 0x0800
185 /* Realized screen font */
187 #define X11FONT_REFOBJS_MAX 4
191 XFontStruct
* fs
; /* text metrics */
192 fontResource
* fr
; /* font family */
193 fontInfo
* fi
; /* font instance info */
194 Pixmap
* lpPixmap
; /* optional character bitmasks for synth fonts */
195 X_PHYSFONT prefobjs
[X11FONT_REFOBJS_MAX
]; /* font objects for DBCS charsets */
197 XFONTTRANS
*lpX11Trans
; /* Info for X11R6 transform */
198 float rescale
; /* Rescale for large fonts */
199 INT16 foInternalLeading
;
200 INT16 foAvgCharWidth
;
201 INT16 foMaxCharWidth
;
204 /* font cache housekeeping */
219 WORD internal_charset
;
222 extern fontObject
* XFONT_GetFontObject( X_PHYSFONT pFont
);
223 extern XFontStruct
* XFONT_GetFontStruct( X_PHYSFONT pFont
);
224 extern LPIFONTINFO16
XFONT_GetFontInfo( X_PHYSFONT pFont
);
226 /* internal charset(hibyte must be set) */
227 /* lobyte is DEFAULT_CHARSET(=0). */
228 #define X11FONT_JISX0201_CHARSET 0x100
229 #define X11FONT_JISX0212_CHARSET 0x200
231 typedef struct tagX11DRV_CP
233 WORD (*penum_subfont_charset
)( UINT index
);
234 XChar2b
* (*punicode_to_char2b
)( fontObject
* pfo
,
235 LPCWSTR lpwstr
, UINT count
);
236 void (*pDrawString
)( fontObject
* pfo
, Display
* pdisp
, Drawable d
, GC gc
,
237 int x
, int y
, XChar2b
* pstr
, int count
);
238 int (*pTextWidth
)( fontObject
* pfo
, XChar2b
* pstr
, int count
);
239 void (*pDrawText
)( fontObject
* pfo
, Display
* pdisp
, Drawable d
, GC gc
,
240 int x
, int y
, XTextItem16
* pitems
, int count
);
241 void (*pTextExtents
)( fontObject
* pfo
, XChar2b
* pstr
, int count
,
242 int* pdir
, int* pascent
, int* pdescent
,
244 void (*pGetTextMetricsW
)( fontObject
* pfo
, LPTEXTMETRICW pTM
);
247 extern const X11DRV_CP X11DRV_cptable
[X11DRV_CPTABLE_COUNT
];
249 #endif /* __WINE_X11FONT_H */