ReactOS 0.4.16-dev-251-ga17b6e9
bmfd.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS win32 subsystem
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: GDI font driver for bitmap fonts
5 * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org)
6 */
7
8#ifndef _BMFD_PCH_
9#define _BMFD_PCH_
10
11#include <stdarg.h>
12#include <windef.h>
13#include <wingdi.h>
14#include <winddi.h>
15
16#if defined(_M_IX86) || defined(_M_AMD64)
17/* on x86 and x64, unaligned access is allowed, byteorder is LE */
18#define GETVAL(x) (x)
19#else
20// FIXME: BE
21#define GETVAL(x) \
22 (sizeof(x) == 1) ? (x) : \
23 (sizeof(x) == 2) ? (((PCHAR)&(x))[0] + (((PCHAR)&(x))[1] << 8)) : \
24 (((PCHAR)&(x))[0] + (((PCHAR)&(x))[1] << 8) + (((PCHAR)&(x))[2] << 16) + \
25 (((PCHAR)&(x))[3] << 24))
26
27#endif
28
29#define FDM_MASK \
30 FDM_TYPE_CONST_BEARINGS | FDM_TYPE_ZERO_BEARINGS | \
31 FDM_TYPE_CHAR_INC_EQUAL_BM_BASE | FDM_TYPE_MAXEXT_EQUAL_BM_SIDE | \
32 FDM_TYPE_BM_SIDE_CONST
33
34#define FM_INFO_MASK \
35 FM_INFO_TECH_BITMAP | FM_INFO_1BPP | FM_INFO_INTEGER_WIDTH | \
36 FM_INFO_RETURNS_BITMAPS | FM_INFO_RIGHT_HANDED | FM_INFO_INTEGRAL_SCALING |\
37 FM_INFO_90DEGREE_ROTATIONS | FM_INFO_OPTICALLY_FIXED_PITCH | FM_INFO_NONNEGATIVE_AC
38
39#define FLOATL_1 0x3f800000
40
41#define TAG_PDEV 'veDP'
42#define TAG_GLYPHSET 'GlSt'
43#define TAG_IFIMETRICS 'Ifim'
44#define TAG_FONTINFO 'Font'
45
46
49#define IMAGE_DOS_MAGIC 0x594D // FIXME: hack hack hack
50
51#include <pshpack1.h>
52typedef struct
53{
56 WORD flags;
57 WORD id;
59 WORD usage;
61
62#define NE_RSCTYPE_FONT 0x8008
63#define NE_RSCTYPE_FONTDIR 0x8007
64typedef struct
65{
67 WORD count;
68 DWORD resloader;
69 NE_NAMEINFO nameinfo[1];
71
72typedef struct
73{
77
78// Values of dfFlags:
79#define DFF_FIXED 0x0001
80#define DFF_PROPORTIONAL 0x0002
81#define DFF_ABCFIXED 0x0004
82#define DFF_ABCPROPORTIONAL 0x0008
83#define DFF_1COLOR 0x0010
84#define DFF_16COLOR 0x0020
85#define DFF_256COLOR 0x0040
86#define DFF_RGBCOLOR 0x0080
87
88// see http://msdn.microsoft.com/en-us/library/ms648014(VS.85).aspx
89typedef struct _FONTDIRENTRY
90{
93 char dfCopyright[60];
120 char szFaceName[1];
122
123typedef struct _DIRENTRY
124{
128
129typedef struct _FONTGROUPHDR
130{
134
135typedef struct
136{
139 CHAR dfCopyright[60];
167 /* Version 3.00: */
173 DWORD dfReserved1[4];
174 BYTE dfCharTable[1];
176
177typedef struct
178{
182
183typedef struct
184{
188
189typedef union
190{
194
195#include <poppack.h>
196
197
200typedef enum
201{
204} FONTTYPE;
205
206typedef struct
207{
232
233typedef struct
234{
240 BMFD_FACE aface[1];
242
243typedef struct
244{
251
252//"Bold Italic Underline Strikeout"
253#define MAX_STYLESIZE 35
254typedef struct
255{
257 BYTE ajCharSet[16];
258 WCHAR wszFamilyName[LF_FACESIZE];
259 WCHAR wszFaceName[LF_FACESIZE];
260 WCHAR wszStyleName[MAX_STYLESIZE];
262
263
266ULONG
268
269DHPDEV
272 IN DEVMODEW *pdm,
274 IN ULONG cPat,
275 OUT HSURF *phsurfPatterns,
277 OUT ULONG *pdevcaps,
279 OUT DEVINFO *pdi,
280 IN HDEV hdev,
283
284VOID
287 IN DHPDEV dhpdev,
288 IN HDEV hdev);
289
290VOID
293 IN DHPDEV dhpdev);
294
298 ULONG cFiles,
300 PVOID *ppvView,
301 ULONG *pcjView,
305
306BOOL
310
311LONG
316 ULONG cjBuf,
317 ULONG *pulBuf);
318
319LONG
322 ULONG culCaps,
323 ULONG *pulCaps);
324
325PVOID
328 DHPDEV dhpdev,
330 ULONG iFace,
331 ULONG iMode,
332 ULONG_PTR *pid);
333
337 IN DHPDEV dhpdev,
339 IN ULONG iFace,
340 IN ULONG_PTR *pid);
341
342VOID
345 PVOID pv,
346 ULONG_PTR id);
347
351 FONTOBJ *pfo,
352 ULONG iMode);
353
354LONG
357 DHPDEV dhpdev,
358 FONTOBJ *pfo,
359 ULONG iMode,
360 HGLYPH hg,
362 PVOID pv,
363 ULONG cjSize);
364
365VOID
368 IN FONTOBJ *pfo);
369
370#endif /* _BMFD_PCH_ */
#define MAX_STYLESIZE
Definition: bmfd.h:253
BOOL APIENTRY BmfdUnloadFontFile(IN ULONG_PTR iFile)
Definition: font.c:298
struct NE_TYPEINFO * PNE_TYPEINFO
struct _DIRENTRY * PDIRENTRY
VOID APIENTRY BmfdDestroyFont(IN FONTOBJ *pfo)
Definition: font.c:683
struct _DIRENTRY DIRENTRY
VOID APIENTRY BmfdFree(PVOID pv, ULONG_PTR id)
Definition: font.c:669
struct FONTINFO16 * LPFONTINFO16
struct BMFD_FONT * PBMFD_FONT
PFD_GLYPHATTR APIENTRY BmfdQueryGlyphAttrs(FONTOBJ *pfo, ULONG iMode)
Definition: glyph.c:305
struct _FONTGROUPHDR * PFONTGROUPHDR
PVOID APIENTRY BmfdQueryFontTree(DHPDEV dhpdev, ULONG_PTR iFile, ULONG iFace, ULONG iMode, ULONG_PTR *pid)
Definition: font.c:383
struct GLYPHENTRY30 * PGLYPHENTRY30
FONTTYPE
Definition: bmfd.h:201
@ FONTTYPE_FON
Definition: bmfd.h:202
@ FONTTYPE_FNT
Definition: bmfd.h:203
struct GLYPHENTRY20 * PGLYPHENTRY20
struct BMFD_IFIMETRICS * PBMFD_IFIMETRICS
struct _FONTDIRENTRY * PFONTDIRENTRY
struct NE_NAMEINFO * PNE_NAMEINFO
struct _FONTGROUPHDR FONTGROUPHDR
union GLYPHENTRY * PGLYPHENTRY
struct _FONTDIRENTRY FONTDIRENTRY
LONG APIENTRY BmfdQueryFontFile(ULONG_PTR iFile, ULONG ulMode, ULONG cjBuf, ULONG *pulBuf)
Definition: font.c:317
LONG APIENTRY BmfdQueryFontCaps(ULONG culCaps, ULONG *pulCaps)
Definition: font.c:361
struct FONTINFO16 * PFONTINFO16
struct BMFD_FACE * PBMFD_FACE
ULONG_PTR APIENTRY BmfdLoadFontFile(ULONG cFiles, ULONG_PTR *piFile, PVOID *ppvView, ULONG *pcjView, DESIGNVECTOR *pdv, ULONG ulLangID, ULONG ulFastCheckSum)
Definition: font.c:236
PIFIMETRICS APIENTRY BmfdQueryFont(IN DHPDEV dhpdev, IN ULONG_PTR iFile, IN ULONG iFace, IN ULONG_PTR *pid)
Definition: font.c:510
VOID APIENTRY BmfdCompletePDEV(IN DHPDEV dhpdev, IN HDEV hdev)
Definition: enable.c:89
VOID APIENTRY BmfdDisablePDEV(IN DHPDEV dhpdev)
Definition: enable.c:100
struct BMFD_FILE * PBMFD_FILE
DHPDEV APIENTRY BmfdEnablePDEV(IN DEVMODEW *pdm, IN LPWSTR pwszLogAddress, IN ULONG cPat, OUT HSURF *phsurfPatterns, IN ULONG cjCaps, OUT ULONG *pdevcaps, IN ULONG cjDevInfo, OUT DEVINFO *pdi, IN HDEV hdev, IN LPWSTR pwszDeviceName, IN HANDLE hDriver)
Definition: enable.c:67
struct NE_RESTABLE * PNE_RESTABLE
LONG APIENTRY BmfdQueryFontData(DHPDEV dhpdev, FONTOBJ *pfo, ULONG iMode, HGLYPH hg, OUT GLYPHDATA *pgd, PVOID pv, ULONG cjSize)
Definition: glyph.c:316
#define LF_FACESIZE
Definition: dimm.idl:39
#define APIENTRY
Definition: api.h:79
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLbitfield flags
Definition: glext.h:7161
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLuint id
Definition: glext.h:5910
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
#define DbgPrint
Definition: hal.h:12
type_id
unsigned long FLONG
Definition: ntbasedef.h:374
BYTE * PBYTE
Definition: pedump.c:66
long LONG
Definition: pedump.c:60
WORD wWidthBytes
Definition: bmfd.h:224
WCHAR wcFirstChar
Definition: bmfd.h:218
ULONG ulVersion
Definition: bmfd.h:212
WORD wPixWidth
Definition: bmfd.h:223
CHAR chFirstChar
Definition: bmfd.h:216
PFONTDIRENTRY pFontDirEntry
Definition: bmfd.h:208
ULONG cjEntrySize
Definition: bmfd.h:211
CHAR chLastChar
Definition: bmfd.h:217
WCHAR wcLastChar
Definition: bmfd.h:219
WORD wPixHeight
Definition: bmfd.h:222
WORD wAscent
Definition: bmfd.h:228
FLONG flInfo
Definition: bmfd.h:230
PBYTE pCharTable
Definition: bmfd.h:210
WORD wDescent
Definition: bmfd.h:229
ULONG cGlyphs
Definition: bmfd.h:215
PFONTINFO16 pFontInfo
Definition: bmfd.h:209
WORD wA
Definition: bmfd.h:225
PCHAR pszCopyright
Definition: bmfd.h:214
WCHAR wcBreakChar
Definition: bmfd.h:221
WORD wC
Definition: bmfd.h:227
PCHAR pszFaceName
Definition: bmfd.h:213
WORD wB
Definition: bmfd.h:226
WCHAR wcDefaultChar
Definition: bmfd.h:220
PFONTGROUPHDR pFontDir
Definition: bmfd.h:237
PVOID pvView
Definition: bmfd.h:235
ULONG cNumFaces
Definition: bmfd.h:239
ULONG_PTR iFile
Definition: bmfd.h:236
FONTTYPE ulFontType
Definition: bmfd.h:238
FONTOBJ * pfo
Definition: bmfd.h:245
ULONG ulAngle
Definition: bmfd.h:249
LONG yScale
Definition: bmfd.h:248
LONG xScale
Definition: bmfd.h:247
PBMFD_FACE pface
Definition: bmfd.h:246
IFIMETRICS ifim
Definition: bmfd.h:256
BYTE dfDefaultChar
Definition: bmfd.h:159
WORD dfExternalLeading
Definition: bmfd.h:146
WORD dfPoints
Definition: bmfd.h:141
BYTE dfItalic
Definition: bmfd.h:147
WORD dfWidthBytes
Definition: bmfd.h:161
WORD dfInternalLeading
Definition: bmfd.h:145
DWORD dfBitsOffset
Definition: bmfd.h:165
DWORD dfFace
Definition: bmfd.h:163
BYTE dfCharSet
Definition: bmfd.h:151
BYTE dfBreakChar
Definition: bmfd.h:160
DWORD dfDevice
Definition: bmfd.h:162
WORD dfAspace
Definition: bmfd.h:169
WORD dfPixHeight
Definition: bmfd.h:153
WORD dfMaxWidth
Definition: bmfd.h:156
WORD dfVertRes
Definition: bmfd.h:142
BYTE dfReserved
Definition: bmfd.h:166
WORD dfCspace
Definition: bmfd.h:171
WORD dfWeight
Definition: bmfd.h:150
DWORD dfFlags
Definition: bmfd.h:168
DWORD dfColorPointer
Definition: bmfd.h:172
BYTE dfPitchAndFamily
Definition: bmfd.h:154
WORD dfAscent
Definition: bmfd.h:144
WORD dfPixWidth
Definition: bmfd.h:152
DWORD dfBitsPointer
Definition: bmfd.h:164
WORD dfAvgWidth
Definition: bmfd.h:155
WORD dfBspace
Definition: bmfd.h:170
BYTE dfStrikeOut
Definition: bmfd.h:149
BYTE dfUnderline
Definition: bmfd.h:148
BYTE dfFirstChar
Definition: bmfd.h:157
WORD dfHorizRes
Definition: bmfd.h:143
WORD dfType
Definition: bmfd.h:140
BYTE dfLastChar
Definition: bmfd.h:158
WORD dfVersion
Definition: bmfd.h:137
DWORD dfSize
Definition: bmfd.h:138
WORD geWidth
Definition: bmfd.h:179
WORD geOffset
Definition: bmfd.h:180
DWORD geOffset
Definition: bmfd.h:186
WORD geWidth
Definition: bmfd.h:185
WORD size_shift
Definition: bmfd.h:74
WORD fontOrdinal
Definition: bmfd.h:125
FONTDIRENTRY fde
Definition: bmfd.h:126
WORD dfAvgWidth
Definition: bmfd.h:109
BYTE dfUnderline
Definition: bmfd.h:102
WORD dfExternalLeading
Definition: bmfd.h:100
DWORD dfFace
Definition: bmfd.h:117
BYTE dfLastChar
Definition: bmfd.h:112
DWORD dfSize
Definition: bmfd.h:92
BYTE dfCharSet
Definition: bmfd.h:105
WORD dfWeight
Definition: bmfd.h:104
char szDeviceName[1]
Definition: bmfd.h:119
char szFaceName[1]
Definition: bmfd.h:120
DWORD dfDevice
Definition: bmfd.h:116
BYTE dfDefaultChar
Definition: bmfd.h:113
WORD dfPoints
Definition: bmfd.h:95
WORD dfAscent
Definition: bmfd.h:98
BYTE dfStrikeOut
Definition: bmfd.h:103
WORD dfPixHeight
Definition: bmfd.h:107
DWORD dfReserved
Definition: bmfd.h:118
BYTE dfFirstChar
Definition: bmfd.h:111
BYTE dfPitchAndFamily
Definition: bmfd.h:108
WORD dfInternalLeading
Definition: bmfd.h:99
WORD dfWidthBytes
Definition: bmfd.h:115
WORD dfMaxWidth
Definition: bmfd.h:110
BYTE dfItalic
Definition: bmfd.h:101
char dfCopyright[60]
Definition: bmfd.h:93
WORD dfPixWidth
Definition: bmfd.h:106
BYTE dfBreakChar
Definition: bmfd.h:114
WORD dfHorizRes
Definition: bmfd.h:97
WORD dfVersion
Definition: bmfd.h:91
WORD dfType
Definition: bmfd.h:94
WORD dfVertRes
Definition: bmfd.h:96
WORD NumberOfFonts
Definition: bmfd.h:131
DIRENTRY ade[1]
Definition: bmfd.h:132
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
GLYPHENTRY30 ge30
Definition: bmfd.h:192
GLYPHENTRY20 ge20
Definition: bmfd.h:191
_In_ FONTOBJ _In_ ULONG _In_ HGLYPH _In_opt_ GLYPHDATA * pgd
Definition: winddi.h:3872
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG cjDevInfo
Definition: winddi.h:3553
typedef DHPDEV(APIENTRY FN_DrvEnablePDEV)(_In_ DEVMODEW *pdm
_In_ ULONG_PTR _In_opt_ DESIGNVECTOR _In_ ULONG ulLangID
Definition: winddi.h:3724
_In_ DWORD cjBuf
Definition: winddi.h:3827
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO * pdi
Definition: winddi.h:3554
_In_ ULONG_PTR _In_ ULONG iFace
Definition: winddi.h:3836
_In_ HDEV hdev
Definition: winddi.h:3449
_In_ LPWSTR pwszLogAddress
Definition: winddi.h:3548
_In_ ULONG iMode
Definition: winddi.h:3520
_In_ LPWSTR _In_ ULONG _In_ ULONG cjCaps
Definition: winddi.h:3551
_In_ LPWSTR _In_ ULONG cPat
Definition: winddi.h:3549
_In_opt_ FONTOBJ * pfo
Definition: winddi.h:3603
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG _In_ RECTL _In_ POINTL _In_ ULONG ulMode
Definition: winddi.h:3657
_In_ ULONG_PTR _In_opt_ DESIGNVECTOR * pdv
Definition: winddi.h:3723
_In_ ULONG_PTR _In_opt_ DESIGNVECTOR _In_ ULONG _In_ ULONG ulFastCheckSum
Definition: winddi.h:3725
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
_In_ ULONG cjSize
Definition: winddi.h:3634
_In_ ULONG_PTR iFile
Definition: winddi.h:3835
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO _In_ HDEV _In_ LPWSTR pwszDeviceName
Definition: winddi.h:3556
_In_ ULONG_PTR * piFile
Definition: winddi.h:3720
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO _In_ HDEV _In_ LPWSTR _In_ HANDLE hDriver
Definition: winddi.h:3557
_In_ FONTOBJ _In_ ULONG _In_ HGLYPH hg
Definition: winddi.h:3871
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
char CHAR
Definition: xmlstorage.h:175
unsigned char BYTE
Definition: xxhash.c:193