Go to the source code of this file.
|
static BOOLEAN | IsValidPtr (PVOID p, ULONG cjSize, PVOID pStart, PVOID pEnd, ULONG cjAlign) |
|
static BOOL | FillFaceInfo (PBMFD_FACE pface, PFONTINFO16 pFontInfo) |
|
static PVOID | ParseFntFile (PVOID pvView, ULONG cjView) |
|
static PVOID | ParseFonFile (PVOID pvView, ULONG cjView) |
|
ULONG_PTR APIENTRY | BmfdLoadFontFile (ULONG cFiles, ULONG_PTR *piFile, PVOID *ppvView, ULONG *pcjView, DESIGNVECTOR *pdv, ULONG ulLangID, ULONG ulFastCheckSum) |
|
BOOL APIENTRY | BmfdUnloadFontFile (IN ULONG_PTR iFile) |
|
LONG APIENTRY | BmfdQueryFontFile (ULONG_PTR iFile, ULONG ulMode, ULONG cjBuf, ULONG *pulBuf) |
|
LONG APIENTRY | BmfdQueryFontCaps (ULONG culCaps, ULONG *pulCaps) |
|
PVOID APIENTRY | BmfdQueryFontTree (DHPDEV dhpdev, ULONG_PTR iFile, ULONG iFace, ULONG iMode, ULONG_PTR *pid) |
|
PIFIMETRICS APIENTRY | BmfdQueryFont (IN DHPDEV dhpdev, IN ULONG_PTR iFile, IN ULONG iFace, IN ULONG_PTR *pid) |
|
VOID APIENTRY | BmfdFree (PVOID pv, ULONG_PTR id) |
|
VOID APIENTRY | BmfdDestroyFont (IN FONTOBJ *pfo) |
|
◆ BmfdDestroyFont()
◆ BmfdFree()
Definition at line 669 of file font.c.
672{
674 if (id)
675 {
677 }
678}
◆ BmfdLoadFontFile()
Public Interface
Definition at line 236 of file font.c.
244{
248
251
252
253 if (cFiles != 1)
254 {
255 DbgPrint(
"Only 1 File is allowed, got %ld!\n", cFiles);
257 }
258
259
260 if (!EngMapFontFileFD(*
piFile, (
PULONG*)&pvView, &cjView))
261 {
262 DbgPrint(
"Could not map font file!\n", cFiles);
264 }
265
266 DbgPrint(
"mapped font file to %p, site if %ld\n", pvView, cjView);
267
268
270
271 if (!pfile)
272 {
273
275 }
276
277
278 if (!pfile)
279 {
281
282
284
285
287 }
288
291
292
294}
void __cdecl __debugbreak(void)
static PVOID ParseFntFile(PVOID pvView, ULONG cjView)
static PVOID ParseFonFile(PVOID pvView, ULONG cjView)
ENGAPI VOID APIENTRY EngUnmapFontFileFD(_In_ ULONG_PTR iFile)
◆ BmfdQueryFont()
Definition at line 510 of file font.c.
515{
522
524
525
526
528 {
530 }
531
534
535
537 if (!pifiX)
538 {
540 }
541
542
544
545
612
613
616
619
620#if 0
624 pFontInfo->,
626#endif
629
630
632 {
633
634 }
636 {
639 }
641 {
643 }
644
646 {
649 }
650
652 {
655 }
656
658 {
661 }
662
663 return pifi;
664}
struct BMFD_FILE * PBMFD_FILE
void * EngAllocMem(int zero, unsigned long size, int tag=0)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
WCHAR wszFamilyName[LF_FACESIZE]
WCHAR wszStyleName[MAX_STYLESIZE]
WCHAR wszFaceName[LF_FACESIZE]
FWORD fwdStrikeoutPosition
FWORD fwdSuperscriptYSize
FWORD fwdUnderscorePosition
FWORD fwdSubscriptYOffset
FWORD fwdSuperscriptXSize
FWORD fwdSuperscriptYOffset
FWORD fwdSubscriptXOffset
FWORD fwdSuperscriptXOffset
#define FIELD_OFFSET(t, f)
_In_ ULONG_PTR _In_ ULONG iFace
#define FM_INFO_CONSTANT_WIDTH
ENGAPI VOID APIENTRY EngMultiByteToUnicodeN(_Out_writes_bytes_to_(MaxBytesInUnicodeString, *BytesInUnicodeString) LPWSTR UnicodeString, _In_ ULONG MaxBytesInUnicodeString, _Out_opt_ PULONG BytesInUnicodeString, _In_reads_bytes_(BytesInMultiByteString) PCHAR MultiByteString, _In_ ULONG BytesInMultiByteString)
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
#define FM_PANOSE_CULTURE_LATIN
#define FM_SEL_UNDERSCORE
◆ BmfdQueryFontCaps()
Definition at line 361 of file font.c.
364{
366
367
368 if (culCaps < 2)
369 {
371 }
372
373
374 pulCaps[0] = 2;
376
377 return 2;
378}
◆ BmfdQueryFontFile()
Definition at line 317 of file font.c.
322{
324
326
327
329 {
331 {
332
335 if (pulBuf)
336 {
339 &cOutSize,
340 pDesc,
342 }
343 else
344 {
346 }
347 return cOutSize;
348 }
349
351
353
354 default:
356 }
357}
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG _In_ RECTL _In_ POINTL _In_ ULONG ulMode
◆ BmfdQueryFontTree()
Definition at line 383 of file font.c.
389{
393 CHAR ch, chFirst, ach[256];
398
400
401
402
404 {
407 }
408
409
411
412
414
416
417
419 {
420 ach[
i] = chFirst +
i;
421 }
422
423
425
426
428 {
431 {
433 {
440 }
441 }
442 }
443
444
445 cRuns = 1;
447 {
448 if (awc[
i] != awc[
i - 1] + 1)
449 {
450 cRuns++;
451 }
452 }
453
454
456 + (cRuns - 1) *
sizeof(
WCRUN)
458
459
461 if (!pGlyphSet)
462 {
464 }
465
466
470 pGlyphSet->
cRuns = cRuns;
471
472
473 pwcrun = pGlyphSet->awcrun;
474 phglyphs = (
PHGLYPH)&pGlyphSet->awcrun[cRuns];
475 pwcrun[0].wcLow = awc[0];
476 pwcrun[0].cGlyphs = 1;
477 pwcrun[0].phg = phglyphs;
478 phglyphs[0] = 0;
479
480
482 {
483
485
486
487 if (awc[
i] == awc[
i - 1] + 1)
488 {
489
491 }
492 else
493 {
494
498 pwcrun[
j].
phg = &phglyphs[
i];
499 }
500 }
501
502
504
505 return pGlyphSet;
506}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
struct _FD_GLYPHSET FD_GLYPHSET
_In_ FONTOBJ _In_ ULONG _In_ ULONG cGlyphs
◆ BmfdUnloadFontFile()
Definition at line 298 of file font.c.
300{
302
304
305
307
308
310
312}
◆ FillFaceInfo()
Definition at line 30 of file font.c.
33{
38
42
43
53
54
60
61
63 {
70 }
71 else
72 {
79 }
80
82
83
86
87
96
97
98
99
100
102}
Referenced by ParseFonFile().
◆ IsValidPtr()
◆ ParseFntFile()
◆ ParseFonFile()
Definition at line 117 of file font.c.
120{
129 ULONG i, cjOffset, cjLength;
131
132
133 pStart = pvView;
134 pEnd = pStart + cjView;
135
136
138 {
140 }
141
142
146 {
149 }
150
151
153 pStart = (
PCHAR)pOs2Header;
155 {
156 DbgPrint(
"pTInfo is invalid: 0x%p\n", pResTable);
158 }
159
163
164
166 {
167
169
170
172 {
173 DbgPrint(
"Found NE_RSCTYPE_FONT\n");
174
175
178 if (!pfile)
179 {
180 DbgPrint(
"Not enough memory: %ld\n", cjLength);
182 }
183
185
186
188 {
191 pFontInfo = (
PVOID)((
PCHAR)pDosHeader + cjOffset);
192
193 if (!
IsValidPtr(pFontInfo, cjLength, pStart, pEnd, 1))
194 {
195 DbgPrint(
"pFontInfo is invalid: 0x%p\n", pFontInfo);
198 }
199
200
202 {
203 DbgPrint(
"pFontInfo is invalid: 0x%p\n", pFontInfo);
206 }
207 }
208
209
210 break;
211 }
212
213
214 pStart = (
PCHAR)pTInfo;
215
216
218
219
221 {
222 DbgPrint(
"pTInfo is invalid: 0x%p\n", pTInfo);
224 }
225
227 }
228
229 return pfile;
230}
struct _IMAGE_DOS_HEADER IMAGE_DOS_HEADER
GLuint GLuint GLsizei count
static BOOL FillFaceInfo(PBMFD_FACE pface, PFONTINFO16 pFontInfo)
static BOOLEAN IsValidPtr(PVOID p, ULONG cjSize, PVOID pStart, PVOID pEnd, ULONG cjAlign)
Referenced by BmfdLoadFontFile().