ReactOS 0.4.15-dev-5666-gc548b97
bmfd.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <wingdi.h>
#include <winddi.h>
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for bmfd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  NE_NAMEINFO
 
struct  NE_TYPEINFO
 
struct  NE_RESTABLE
 
struct  _FONTDIRENTRY
 
struct  _DIRENTRY
 
struct  _FONTGROUPHDR
 
struct  FONTINFO16
 
struct  GLYPHENTRY20
 
struct  GLYPHENTRY30
 
union  GLYPHENTRY
 
struct  BMFD_FACE
 
struct  BMFD_FILE
 
struct  BMFD_FONT
 
struct  BMFD_IFIMETRICS
 

Macros

#define GETVAL(x)
 
#define FDM_MASK
 
#define FM_INFO_MASK
 
#define FLOATL_1   0x3f800000
 
#define TAG_PDEV   'veDP'
 
#define TAG_GLYPHSET   'GlSt'
 
#define TAG_IFIMETRICS   'Ifim'
 
#define TAG_FONTINFO   'Font'
 
#define IMAGE_DOS_MAGIC   0x594D
 
#define NE_RSCTYPE_FONT   0x8008
 
#define NE_RSCTYPE_FONTDIR   0x8007
 
#define DFF_FIXED   0x0001
 
#define DFF_PROPORTIONAL   0x0002
 
#define DFF_ABCFIXED   0x0004
 
#define DFF_ABCPROPORTIONAL   0x0008
 
#define DFF_1COLOR   0x0010
 
#define DFF_16COLOR   0x0020
 
#define DFF_256COLOR   0x0040
 
#define DFF_RGBCOLOR   0x0080
 
#define MAX_STYLESIZE   35
 

Typedefs

typedef struct NE_NAMEINFOPNE_NAMEINFO
 
typedef struct NE_TYPEINFOPNE_TYPEINFO
 
typedef struct NE_RESTABLEPNE_RESTABLE
 
typedef struct _FONTDIRENTRY FONTDIRENTRY
 
typedef struct _FONTDIRENTRYPFONTDIRENTRY
 
typedef struct _DIRENTRY DIRENTRY
 
typedef struct _DIRENTRYPDIRENTRY
 
typedef struct _FONTGROUPHDR FONTGROUPHDR
 
typedef struct _FONTGROUPHDRPFONTGROUPHDR
 
typedef struct FONTINFO16LPFONTINFO16
 
typedef struct FONTINFO16PFONTINFO16
 
typedef struct GLYPHENTRY20PGLYPHENTRY20
 
typedef struct GLYPHENTRY30PGLYPHENTRY30
 
typedef union GLYPHENTRYPGLYPHENTRY
 
typedef struct BMFD_FACEPBMFD_FACE
 
typedef struct BMFD_FILEPBMFD_FILE
 
typedef struct BMFD_FONTPBMFD_FONT
 
typedef struct BMFD_IFIMETRICSPBMFD_IFIMETRICS
 

Enumerations

enum  FONTTYPE { FONTTYPE_FON , FONTTYPE_FNT }
 

Functions

ULONG DbgPrint (IN PCHAR Format, IN ...)
 
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)
 
VOID APIENTRY BmfdCompletePDEV (IN DHPDEV dhpdev, IN HDEV hdev)
 
VOID APIENTRY BmfdDisablePDEV (IN DHPDEV dhpdev)
 
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)
 
PFD_GLYPHATTR APIENTRY BmfdQueryGlyphAttrs (FONTOBJ *pfo, ULONG iMode)
 
LONG APIENTRY BmfdQueryFontData (DHPDEV dhpdev, FONTOBJ *pfo, ULONG iMode, HGLYPH hg, OUT GLYPHDATA *pgd, PVOID pv, ULONG cjSize)
 
VOID APIENTRY BmfdDestroyFont (IN FONTOBJ *pfo)
 

Macro Definition Documentation

◆ DFF_16COLOR

#define DFF_16COLOR   0x0020

Definition at line 84 of file bmfd.h.

◆ DFF_1COLOR

#define DFF_1COLOR   0x0010

Definition at line 83 of file bmfd.h.

◆ DFF_256COLOR

#define DFF_256COLOR   0x0040

Definition at line 85 of file bmfd.h.

◆ DFF_ABCFIXED

#define DFF_ABCFIXED   0x0004

Definition at line 81 of file bmfd.h.

◆ DFF_ABCPROPORTIONAL

#define DFF_ABCPROPORTIONAL   0x0008

Definition at line 82 of file bmfd.h.

◆ DFF_FIXED

#define DFF_FIXED   0x0001

Definition at line 79 of file bmfd.h.

◆ DFF_PROPORTIONAL

#define DFF_PROPORTIONAL   0x0002

Definition at line 80 of file bmfd.h.

◆ DFF_RGBCOLOR

#define DFF_RGBCOLOR   0x0080

Definition at line 86 of file bmfd.h.

◆ FDM_MASK

#define FDM_MASK
Value:
#define FDM_TYPE_ZERO_BEARINGS
Definition: winddi.h:591
#define FDM_TYPE_CHAR_INC_EQUAL_BM_BASE
Definition: winddi.h:590
#define FDM_TYPE_MAXEXT_EQUAL_BM_SIDE
Definition: winddi.h:589
#define FDM_TYPE_CONST_BEARINGS
Definition: winddi.h:592
#define FDM_TYPE_BM_SIDE_CONST
Definition: winddi.h:588

Definition at line 29 of file bmfd.h.

◆ FLOATL_1

#define FLOATL_1   0x3f800000

Definition at line 39 of file bmfd.h.

◆ FM_INFO_MASK

#define FM_INFO_MASK
Value:
#define FM_INFO_NONNEGATIVE_AC
Definition: winddi.h:1037
#define FM_INFO_1BPP
Definition: winddi.h:1013
#define FM_INFO_OPTICALLY_FIXED_PITCH
Definition: winddi.h:1030
#define FM_INFO_TECH_BITMAP
Definition: winddi.h:1009
#define FM_INFO_RIGHT_HANDED
Definition: winddi.h:1027
#define FM_INFO_INTEGER_WIDTH
Definition: winddi.h:1019
#define FM_INFO_RETURNS_BITMAPS
Definition: winddi.h:1025
#define FM_INFO_INTEGRAL_SCALING
Definition: winddi.h:1028
#define FM_INFO_90DEGREE_ROTATIONS
Definition: winddi.h:1029

Definition at line 34 of file bmfd.h.

◆ GETVAL

#define GETVAL (   x)
Value:
(sizeof(x) == 1) ? (x) : \
(sizeof(x) == 2) ? (((PCHAR)&(x))[0] + (((PCHAR)&(x))[1] << 8)) : \
(((PCHAR)&(x))[0] + (((PCHAR)&(x))[1] << 8) + (((PCHAR)&(x))[2] << 16) + \
(((PCHAR)&(x))[3] << 24))
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
signed char * PCHAR
Definition: retypes.h:7
#define PCHAR
Definition: match.c:90

Definition at line 21 of file bmfd.h.

◆ IMAGE_DOS_MAGIC

#define IMAGE_DOS_MAGIC   0x594D

FON / FNT specific types

Definition at line 49 of file bmfd.h.

◆ MAX_STYLESIZE

#define MAX_STYLESIZE   35

Definition at line 253 of file bmfd.h.

◆ NE_RSCTYPE_FONT

#define NE_RSCTYPE_FONT   0x8008

Definition at line 62 of file bmfd.h.

◆ NE_RSCTYPE_FONTDIR

#define NE_RSCTYPE_FONTDIR   0x8007

Definition at line 63 of file bmfd.h.

◆ TAG_FONTINFO

#define TAG_FONTINFO   'Font'

Definition at line 44 of file bmfd.h.

◆ TAG_GLYPHSET

#define TAG_GLYPHSET   'GlSt'

Definition at line 42 of file bmfd.h.

◆ TAG_IFIMETRICS

#define TAG_IFIMETRICS   'Ifim'

Definition at line 43 of file bmfd.h.

◆ TAG_PDEV

#define TAG_PDEV   'veDP'

Definition at line 41 of file bmfd.h.

Typedef Documentation

◆ DIRENTRY

◆ FONTDIRENTRY

◆ FONTGROUPHDR

◆ LPFONTINFO16

◆ PBMFD_FACE

◆ PBMFD_FILE

◆ PBMFD_FONT

◆ PBMFD_IFIMETRICS

◆ PDIRENTRY

◆ PFONTDIRENTRY

◆ PFONTGROUPHDR

◆ PFONTINFO16

◆ PGLYPHENTRY

typedef union GLYPHENTRY * PGLYPHENTRY

◆ PGLYPHENTRY20

◆ PGLYPHENTRY30

◆ PNE_NAMEINFO

◆ PNE_RESTABLE

◆ PNE_TYPEINFO

Enumeration Type Documentation

◆ FONTTYPE

Driver specific types

Enumerator
FONTTYPE_FON 
FONTTYPE_FNT 

Definition at line 200 of file bmfd.h.

201{
204} FONTTYPE;
FONTTYPE
Definition: bmfd.h:201
@ FONTTYPE_FON
Definition: bmfd.h:202
@ FONTTYPE_FNT
Definition: bmfd.h:203

Function Documentation

◆ BmfdCompletePDEV()

VOID APIENTRY BmfdCompletePDEV ( IN DHPDEV  dhpdev,
IN HDEV  hdev 
)

Definition at line 89 of file enable.c.

92{
93 DbgPrint("BmfdCompletePDEV()\n");
94 /* Nothing to do */
95}
#define DbgPrint
Definition: hal.h:12

◆ BmfdDestroyFont()

VOID APIENTRY BmfdDestroyFont ( IN FONTOBJ pfo)

Definition at line 683 of file font.c.

685{
686 /* Free the font realization info */
687 EngFreeMem(pfo->pvProducer);
688 pfo->pvProducer = NULL;
689}
#define NULL
Definition: types.h:112
#define EngFreeMem
Definition: polytest.cpp:56
_In_opt_ FONTOBJ * pfo
Definition: winddi.h:3603

◆ BmfdDisablePDEV()

VOID APIENTRY BmfdDisablePDEV ( IN DHPDEV  dhpdev)

Definition at line 100 of file enable.c.

102{
103 DbgPrint("BmfdDisablePDEV()\n");
104 /* Nothing to do */
105}

◆ BmfdEnablePDEV()

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 at line 67 of file enable.c.

79{
80 DbgPrint("BmfdEnablePDEV(hdev=%p)\n", hdev);
81
82 /* Return a dummy DHPDEV */
83 return (PVOID)1;
84}
_In_ HDEV hdev
Definition: winddi.h:3449

◆ BmfdFree()

VOID APIENTRY BmfdFree ( PVOID  pv,
ULONG_PTR  id 
)

Definition at line 669 of file font.c.

672{
673 DbgPrint("BmfdFree()\n");
674 if (id)
675 {
676 EngFreeMem((PVOID)id);
677 }
678}

◆ BmfdLoadFontFile()

ULONG_PTR APIENTRY BmfdLoadFontFile ( ULONG  cFiles,
ULONG_PTR piFile,
PVOID ppvView,
ULONG pcjView,
DESIGNVECTOR pdv,
ULONG  ulLangID,
ULONG  ulFastCheckSum 
)

Public Interface

Definition at line 236 of file font.c.

244{
245 PBMFD_FILE pfile = NULL;
246 PVOID pvView;
247 ULONG cjView;
248
249 DbgPrint("BmfdLoadFontFile()\n");
250 __debugbreak();
251
252 /* Check parameters */
253 if (cFiles != 1)
254 {
255 DbgPrint("Only 1 File is allowed, got %ld!\n", cFiles);
256 return HFF_INVALID;
257 }
258
259 /* Map the font file */
260 if (!EngMapFontFileFD(*piFile, (PULONG*)&pvView, &cjView))
261 {
262 DbgPrint("Could not map font file!\n", cFiles);
263 return HFF_INVALID;
264 }
265
266 DbgPrint("mapped font file to %p, site if %ld\n", pvView, cjView);
267
268 /* Try to parse a .fon file */
269 pfile = ParseFonFile(pvView, cjView);
270
271 if (!pfile)
272 {
273 /* Could be a .fnt file */
274 pfile = ParseFntFile(pvView, cjView);
275 }
276
277 /* Check whether we succeeded finding a font */
278 if (!pfile)
279 {
280 DbgPrint("No font data found\n");
281
282 /* Unmap the file */
284
285 /* Failure! */
286 return HFF_INVALID;
287 }
288
289 pfile->iFile = *piFile;
290 pfile->pvView = pvView;
291
292 /* Success, return the pointer to font info structure */
293 return (ULONG_PTR)pfile;
294}
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
PVOID pvView
Definition: bmfd.h:235
ULONG_PTR iFile
Definition: bmfd.h:236
uint32_t ULONG_PTR
Definition: typedefs.h:65
static PVOID ParseFntFile(PVOID pvView, ULONG cjView)
Definition: font.c:106
static PVOID ParseFonFile(PVOID pvView, ULONG cjView)
Definition: font.c:117
#define HFF_INVALID
Definition: winddi.h:156
ENGAPI VOID APIENTRY EngUnmapFontFileFD(_In_ ULONG_PTR iFile)
Definition: mapping.c:564
_In_ ULONG_PTR * piFile
Definition: winddi.h:3720

◆ BmfdQueryFont()

PIFIMETRICS APIENTRY BmfdQueryFont ( IN DHPDEV  dhpdev,
IN ULONG_PTR  iFile,
IN ULONG  iFace,
IN ULONG_PTR pid 
)

Definition at line 510 of file font.c.

515{
516 PBMFD_FILE pfile = (PBMFD_FILE)iFile;
517 PBMFD_FACE pface;
518 PFONTINFO16 pFontInfo;
519 PIFIMETRICS pifi;
520 PBMFD_IFIMETRICS pifiX;
521 PANOSE panose = {0};
522
523 DbgPrint("BmfdQueryFont()\n");
524// __debugbreak();
525
526 /* Validate parameters */
527 if (iFace > pfile->cNumFaces || !pid)
528 {
529 return NULL;
530 }
531
532 pface = &pfile->aface[iFace - 1];
533 pFontInfo = pface->pFontInfo;
534
535 /* Allocate the structure */
537 if (!pifiX)
538 {
539 return NULL;
540 }
541
542 /* Return a pointer to free it later */
543 *pid = (ULONG_PTR)pifiX;
544
545 /* Fill IFIMETRICS */
546 pifi = &pifiX->ifim;
547 pifi->cjThis = sizeof(BMFD_IFIMETRICS);
548 pifi->cjIfiExtra = 0;
549 pifi->dpwszFamilyName = FIELD_OFFSET(BMFD_IFIMETRICS, wszFamilyName);
550 pifi->dpwszStyleName = FIELD_OFFSET(BMFD_IFIMETRICS, wszFamilyName);
551 pifi->dpwszFaceName = FIELD_OFFSET(BMFD_IFIMETRICS, wszFaceName);
552 pifi->dpwszUniqueName = FIELD_OFFSET(BMFD_IFIMETRICS, wszFaceName);
553 pifi->dpFontSim = 0;
554 pifi->lEmbedId = 0;
555 pifi->lItalicAngle = 0;
556 pifi->lCharBias = 0;
557 pifi->dpCharSets = 0;
558 pifi->jWinCharSet = pFontInfo->dfCharSet;
559 pifi->jWinPitchAndFamily = pFontInfo->dfPitchAndFamily;
560 pifi->usWinWeight = GETVAL(pFontInfo->dfWeight);
561 pifi->flInfo = pface->flInfo;
562 pifi->fsSelection = 0;
563 pifi->fsType = 0;
564 pifi->fwdUnitsPerEm = GETVAL(pFontInfo->dfPixHeight);
565 pifi->fwdLowestPPEm = 0;
566 pifi->fwdWinAscender = GETVAL(pFontInfo->dfAscent);
567 pifi->fwdWinDescender = pifi->fwdUnitsPerEm - pifi->fwdWinAscender;
568 pifi->fwdMacAscender = pifi->fwdWinAscender;
569 pifi->fwdMacDescender = - pifi->fwdWinDescender;
570 pifi->fwdMacLineGap = 0;
571 pifi->fwdTypoAscender = pifi->fwdWinAscender;
572 pifi->fwdTypoDescender = - pifi->fwdWinDescender;
573 pifi->fwdTypoLineGap = 0;
574 pifi->fwdAveCharWidth = GETVAL(pFontInfo->dfAvgWidth);
575 pifi->fwdMaxCharInc = GETVAL(pFontInfo->dfMaxWidth);
576 pifi->fwdCapHeight = pifi->fwdUnitsPerEm / 2;
577 pifi->fwdXHeight = pifi->fwdUnitsPerEm / 4;
578 pifi->fwdSubscriptXSize = 0;
579 pifi->fwdSubscriptYSize = 0;
580 pifi->fwdSubscriptXOffset = 0;
581 pifi->fwdSubscriptYOffset = 0;
582 pifi->fwdSuperscriptXSize = 0;
583 pifi->fwdSuperscriptYSize = 0;
584 pifi->fwdSuperscriptXOffset = 0;
585 pifi->fwdSuperscriptYOffset = 0;
586 pifi->fwdUnderscoreSize = 01;
587 pifi->fwdUnderscorePosition = -1;
588 pifi->fwdStrikeoutSize = 1;
589 pifi->fwdStrikeoutPosition = pifi->fwdXHeight + 1;
590 pifi->chFirstChar = pFontInfo->dfFirstChar;
591 pifi->chLastChar = pFontInfo->dfLastChar;
592 pifi->chDefaultChar = pFontInfo->dfFirstChar + pFontInfo->dfDefaultChar;
593 pifi->chBreakChar = pFontInfo->dfFirstChar + pFontInfo->dfBreakChar;
594 pifi->wcFirstChar = pface->wcFirstChar;
595 pifi->wcLastChar = pface->wcLastChar;
596 pifi->wcDefaultChar = pface->wcDefaultChar;
597 pifi->wcBreakChar = pface->wcBreakChar;
598 pifi->ptlBaseline.x = 1;
599 pifi->ptlBaseline.y = 0;
600 pifi->ptlAspect.x = pFontInfo->dfVertRes; // CHECKME
601 pifi->ptlAspect.y = pFontInfo->dfHorizRes;
602 pifi->ptlCaret.x = 0;
603 pifi->ptlCaret.y = 1;
604 pifi->rclFontBox.left = 0;
605 pifi->rclFontBox.right = pifi->fwdAveCharWidth;
606 pifi->rclFontBox.top = pifi->fwdWinAscender;
607 pifi->rclFontBox.bottom = - pifi->fwdWinDescender;
608 *(DWORD*)&pifi->achVendId = 0x30303030; // FIXME
609 pifi->cKerningPairs = 0;
611 pifi->panose = panose;
612
613 /* Set char sets */
614 pifiX->ajCharSet[0] = pifi->jWinCharSet;
615 pifiX->ajCharSet[1] = DEFAULT_CHARSET;
616
619
620#if 0
622 LF_FACESIZE * sizeof(WCHAR),
623 NULL,
624 pFontInfo->,
625 strnlen(pDesc, LF_FACESIZE));
626#endif
627 wcscpy(pifiX->wszFaceName, L"Courier-X");
628 wcscpy(pifiX->wszFamilyName, L"Courier-X");
629
630 /* Initialize font weight style flags and string */
631 if (pifi->usWinWeight == FW_REGULAR)
632 {
633 // pifi->fsSelection |= FM_SEL_REGULAR;
634 }
635 else if (pifi->usWinWeight > FW_SEMIBOLD)
636 {
637 pifi->fsSelection |= FM_SEL_BOLD;
638 wcscat(pifiX->wszStyleName, L"Bold ");
639 }
640 else if (pifi->usWinWeight <= FW_LIGHT)
641 {
642 wcscat(pifiX->wszStyleName, L"Light ");
643 }
644
645 if (pFontInfo->dfItalic)
646 {
647 pifi->fsSelection |= FM_SEL_ITALIC;
648 wcscat(pifiX->wszStyleName, L"Italic ");
649 }
650
651 if (pFontInfo->dfUnderline)
652 {
654 wcscat(pifiX->wszStyleName, L"Underscore ");
655 }
656
657 if (pFontInfo->dfStrikeOut)
658 {
660 wcscat(pifiX->wszStyleName, L"Strikeout ");
661 }
662
663 return pifi;
664}
#define GETVAL(x)
Definition: bmfd.h:21
struct BMFD_FILE * PBMFD_FILE
#define TAG_IFIMETRICS
Definition: bmfd.h:43
#define LF_FACESIZE
Definition: dimm.idl:39
#define ULONG_PTR
Definition: config.h:101
unsigned long DWORD
Definition: ntddk_ex.h:95
if(dx< 0)
Definition: linetemp.h:194
#define L(x)
Definition: ntvdm.h:50
#define FL_ZERO_MEMORY
Definition: polytest.cpp:58
void * EngAllocMem(int zero, unsigned long size, int tag=0)
Definition: polytest.cpp:70
_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 wcFirstChar
Definition: bmfd.h:218
WCHAR wcLastChar
Definition: bmfd.h:219
FLONG flInfo
Definition: bmfd.h:230
PFONTINFO16 pFontInfo
Definition: bmfd.h:209
WCHAR wcBreakChar
Definition: bmfd.h:221
WCHAR wcDefaultChar
Definition: bmfd.h:220
ULONG cNumFaces
Definition: bmfd.h:239
BMFD_FACE aface[1]
Definition: bmfd.h:240
WCHAR wszFamilyName[LF_FACESIZE]
Definition: bmfd.h:258
WCHAR wszStyleName[MAX_STYLESIZE]
Definition: bmfd.h:260
IFIMETRICS ifim
Definition: bmfd.h:256
BYTE ajCharSet[16]
Definition: bmfd.h:257
WCHAR wszFaceName[LF_FACESIZE]
Definition: bmfd.h:259
BYTE dfDefaultChar
Definition: bmfd.h:159
BYTE dfItalic
Definition: bmfd.h:147
BYTE dfCharSet
Definition: bmfd.h:151
BYTE dfBreakChar
Definition: bmfd.h:160
WORD dfPixHeight
Definition: bmfd.h:153
WORD dfMaxWidth
Definition: bmfd.h:156
WORD dfVertRes
Definition: bmfd.h:142
WORD dfWeight
Definition: bmfd.h:150
BYTE dfPitchAndFamily
Definition: bmfd.h:154
WORD dfAscent
Definition: bmfd.h:144
WORD dfAvgWidth
Definition: bmfd.h:155
BYTE dfStrikeOut
Definition: bmfd.h:149
BYTE dfUnderline
Definition: bmfd.h:148
BYTE dfFirstChar
Definition: bmfd.h:157
WORD dfHorizRes
Definition: bmfd.h:143
BYTE dfLastChar
Definition: bmfd.h:158
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
FWORD fwdWinDescender
Definition: winddi.h:1067
PTRDIFF dpCharSets
Definition: winddi.h:1057
ULONG cjThis
Definition: winddi.h:1047
FWORD fwdUnderscoreSize
Definition: winddi.h:1086
BYTE chDefaultChar
Definition: winddi.h:1092
BYTE chFirstChar
Definition: winddi.h:1090
ULONG cjIfiExtra
Definition: winddi.h:1048
BYTE chBreakChar
Definition: winddi.h:1093
FWORD fwdTypoAscender
Definition: winddi.h:1071
ULONG ulPanoseCulture
Definition: winddi.h:1104
USHORT fsSelection
Definition: winddi.h:1062
PTRDIFF dpwszUniqueName
Definition: winddi.h:1052
PTRDIFF dpwszFamilyName
Definition: winddi.h:1049
FWORD fwdStrikeoutPosition
Definition: winddi.h:1089
PTRDIFF dpwszStyleName
Definition: winddi.h:1050
FWORD fwdSubscriptYSize
Definition: winddi.h:1079
FWORD fwdSubscriptXSize
Definition: winddi.h:1078
FWORD fwdSuperscriptYSize
Definition: winddi.h:1083
POINTL ptlAspect
Definition: winddi.h:1099
WCHAR wcLastChar
Definition: winddi.h:1095
FWORD fwdMacDescender
Definition: winddi.h:1069
LONG lCharBias
Definition: winddi.h:1056
FWORD fwdUnitsPerEm
Definition: winddi.h:1064
FWORD fwdAveCharWidth
Definition: winddi.h:1074
ULONG flInfo
Definition: winddi.h:1061
FWORD fwdCapHeight
Definition: winddi.h:1076
FWORD fwdTypoDescender
Definition: winddi.h:1072
FWORD fwdUnderscorePosition
Definition: winddi.h:1087
POINTL ptlBaseline
Definition: winddi.h:1098
FWORD fwdMacAscender
Definition: winddi.h:1068
FWORD fwdSubscriptYOffset
Definition: winddi.h:1081
BYTE jWinPitchAndFamily
Definition: winddi.h:1059
FWORD fwdTypoLineGap
Definition: winddi.h:1073
FWORD fwdSuperscriptXSize
Definition: winddi.h:1082
FWORD fwdXHeight
Definition: winddi.h:1077
FWORD fwdSuperscriptYOffset
Definition: winddi.h:1085
FWORD fwdMacLineGap
Definition: winddi.h:1070
BYTE chLastChar
Definition: winddi.h:1091
PANOSE panose
Definition: winddi.h:1105
BYTE jWinCharSet
Definition: winddi.h:1058
LONG lItalicAngle
Definition: winddi.h:1055
USHORT usWinWeight
Definition: winddi.h:1060
FWORD fwdLowestPPEm
Definition: winddi.h:1065
PTRDIFF dpwszFaceName
Definition: winddi.h:1051
BYTE achVendId[4]
Definition: winddi.h:1102
RECTL rclFontBox
Definition: winddi.h:1101
WCHAR wcBreakChar
Definition: winddi.h:1097
FWORD fwdMaxCharInc
Definition: winddi.h:1075
USHORT fsType
Definition: winddi.h:1063
FWORD fwdStrikeoutSize
Definition: winddi.h:1088
LONG lEmbedId
Definition: winddi.h:1054
FWORD fwdSubscriptXOffset
Definition: winddi.h:1080
PTRDIFF dpFontSim
Definition: winddi.h:1053
ULONG cKerningPairs
Definition: winddi.h:1103
WCHAR wcFirstChar
Definition: winddi.h:1094
FWORD fwdWinAscender
Definition: winddi.h:1066
POINTL ptlCaret
Definition: winddi.h:1100
FWORD fwdSuperscriptXOffset
Definition: winddi.h:1084
WCHAR wcDefaultChar
Definition: winddi.h:1096
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define FM_SEL_ITALIC
Definition: winddi.h:694
_In_ ULONG_PTR _In_ ULONG iFace
Definition: winddi.h:3836
#define FM_INFO_CONSTANT_WIDTH
Definition: winddi.h:1020
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
Definition: winddi.h:3837
#define FM_SEL_BOLD
Definition: winddi.h:699
#define FM_SEL_STRIKEOUT
Definition: winddi.h:698
_In_ ULONG_PTR iFile
Definition: winddi.h:3835
#define FM_PANOSE_CULTURE_LATIN
Definition: winddi.h:1044
#define FM_SEL_UNDERSCORE
Definition: winddi.h:695
#define FIXED_PITCH
Definition: wingdi.h:444
#define FW_REGULAR
Definition: wingdi.h:374
#define FW_LIGHT
Definition: wingdi.h:372
#define FW_SEMIBOLD
Definition: wingdi.h:376
#define DEFAULT_CHARSET
Definition: wingdi.h:384
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ BmfdQueryFontCaps()

LONG APIENTRY BmfdQueryFontCaps ( ULONG  culCaps,
ULONG pulCaps 
)

Definition at line 361 of file font.c.

364{
365 DbgPrint("BmfdQueryFontCaps()\n");
366
367 /* We need room for 2 ULONGs */
368 if (culCaps < 2)
369 {
370 return FD_ERROR;
371 }
372
373 /* We only support 1 bpp */
374 pulCaps[0] = 2;
375 pulCaps[1] = QC_1BIT;
376
377 return 2;
378}
#define FD_ERROR
Definition: winddi.h:153
#define QC_1BIT
Definition: winddi.h:3843

◆ BmfdQueryFontData()

LONG APIENTRY BmfdQueryFontData ( DHPDEV  dhpdev,
FONTOBJ pfo,
ULONG  iMode,
HGLYPH  hg,
OUT GLYPHDATA pgd,
PVOID  pv,
ULONG  cjSize 
)

Definition at line 316 of file glyph.c.

324{
325 PBMFD_FILE pfile = (PBMFD_FILE)pfo->iFile;
326 PBMFD_FACE pface = &pfile->aface[pfo->iFace - 1];
327 PBMFD_FONT pfont= BmfdGetFontInstance(pfo, pface);
328
329 DbgPrint("BmfdQueryFontData(pfo=%p, iMode=%ld, hg=%p, pgd=%p, pv=%p, cjSize=%ld)\n",
330 pfo, iMode, hg, pgd, pv, cjSize);
331// __debugbreak();
332
333 switch (iMode)
334 {
335 case QFD_GLYPHANDBITMAP: /* 1 */
336 return BmfdQueryGlyphAndBitmap(pfont, hg, pgd, pv, cjSize);
337
338 case QFD_MAXEXTENTS: /* 3 */
339 return BmfdQueryMaxExtents(pfont, pv, cjSize);
340
341 /* we support nothing else */
342 default:
343 return FD_ERROR;
344
345 }
346
347 return FD_ERROR;
348}
PBMFD_FONT BmfdGetFontInstance(FONTOBJ *pfo, PBMFD_FACE pface)
Definition: glyph.c:40
ULONG BmfdQueryGlyphAndBitmap(PBMFD_FONT pfont, HGLYPH hg, GLYPHDATA *pgd, GLYPHBITS *pgb, ULONG cjSize)
Definition: glyph.c:75
ULONG BmfdQueryMaxExtents(PBMFD_FONT pfont, PFD_DEVICEMETRICS pfddm, ULONG cjSize)
Definition: glyph.c:227
_In_ FONTOBJ _In_ ULONG _In_ HGLYPH _In_opt_ GLYPHDATA * pgd
Definition: winddi.h:3872
_In_ ULONG iMode
Definition: winddi.h:3520
_In_ ULONG cjSize
Definition: winddi.h:3634
#define QFD_MAXEXTENTS
Definition: winddi.h:3857
_In_ FONTOBJ _In_ ULONG _In_ HGLYPH hg
Definition: winddi.h:3871
#define QFD_GLYPHANDBITMAP
Definition: winddi.h:3855

◆ BmfdQueryFontFile()

LONG APIENTRY BmfdQueryFontFile ( ULONG_PTR  iFile,
ULONG  ulMode,
ULONG  cjBuf,
ULONG pulBuf 
)

Definition at line 317 of file font.c.

322{
323 PBMFD_FILE pfile = (PBMFD_FILE)iFile;
324
325 DbgPrint("BmfdQueryFontFile()\n");
326// __debugbreak();
327
328 switch (ulMode)
329 {
330 case QFF_DESCRIPTION:
331 {
332 /* We copy the face name of the 1st face */
333 PCHAR pDesc = pfile->aface[0].pszFaceName;
334 ULONG cOutSize;
335 if (pulBuf)
336 {
338 cjBuf,
339 &cOutSize,
340 pDesc,
341 strnlen(pDesc, LF_FACESIZE));
342 }
343 else
344 {
345 cOutSize = (strnlen(pDesc, LF_FACESIZE) + 1) * sizeof(WCHAR);
346 }
347 return cOutSize;
348 }
349
350 case QFF_NUMFACES:
351 /* return the number of faces in the file */
352 return pfile->cNumFaces;
353
354 default:
355 return FD_ERROR;
356 }
357}
PCHAR pszFaceName
Definition: bmfd.h:213
_In_ DWORD cjBuf
Definition: winddi.h:3827
#define QFF_DESCRIPTION
Definition: winddi.h:3879
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG _In_ RECTL _In_ POINTL _In_ ULONG ulMode
Definition: winddi.h:3657
#define QFF_NUMFACES
Definition: winddi.h:3880
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ BmfdQueryFontTree()

PVOID APIENTRY BmfdQueryFontTree ( DHPDEV  dhpdev,
ULONG_PTR  iFile,
ULONG  iFace,
ULONG  iMode,
ULONG_PTR pid 
)

Definition at line 383 of file font.c.

389{
390 PBMFD_FILE pfile = (PBMFD_FILE)iFile;
391 PBMFD_FACE pface;
392 ULONG i, j, cjSize, cGlyphs, cRuns;
393 CHAR ch, chFirst, ach[256];
394 WCHAR wc, awc[256];
395 PFD_GLYPHSET pGlyphSet;
396 WCRUN *pwcrun;
397 HGLYPH * phglyphs;
398
399 DbgPrint("DrvQueryFontTree(iMode=%ld)\n", iMode);
400// __debugbreak();
401
402 /* Check parameters, we only support QFT_GLYPHSET */
403 if (!iFace || iFace > pfile->cNumFaces || iMode != QFT_GLYPHSET)
404 {
405 DbgPrint("iFace = %ld, cNumFaces = %ld\n", iFace, pfile->cNumFaces);
406 return NULL;
407 }
408
409 /* Get a pointer to the face data */
410 pface = &pfile->aface[iFace - 1];
411
412 /* Get the number of characters in the face */
413 cGlyphs = pface->cGlyphs;
414
415 chFirst = pface->pFontInfo->dfFirstChar;
416
417 /* Build array of supported chars */
418 for (i = 0; i < cGlyphs; i++)
419 {
420 ach[i] = chFirst + i;
421 }
422
423 /* Convert the chars to unicode */
424 EngMultiByteToUnicodeN(awc, sizeof(awc), NULL, ach, cGlyphs);
425
426 /* Sort both arrays in wchar order */
427 for (i = 0; i < cGlyphs - 1; i++)
428 {
429 wc = awc[i];
430 for (j = i + 1; j < cGlyphs; j++)
431 {
432 if (awc[j] < wc)
433 {
434 awc[i] = awc[j];
435 awc[j] = wc;
436 wc = awc[i];
437 ch = ach[i];
438 ach[i] = ach[j];
439 ach[j] = ch;
440 }
441 }
442 }
443
444 /* Find number of WCRUNs */
445 cRuns = 1;
446 for (i = 1; i < cGlyphs; i++)
447 {
448 if (awc[i] != awc[i - 1] + 1)
449 {
450 cRuns++;
451 }
452 }
453
454 /* Calculate FD_GLYPHSET size */
455 cjSize = sizeof(FD_GLYPHSET)
456 + (cRuns - 1) * sizeof(WCRUN)
457 + cGlyphs * sizeof(HGLYPH);
458
459 /* Allocate the FD_GLYPHSET structure */
460 pGlyphSet = EngAllocMem(0, cjSize, TAG_GLYPHSET);
461 if (!pGlyphSet)
462 {
463 return NULL;
464 }
465
466 /* Initialize FD_GLYPHSET */
467 pGlyphSet->cjThis = cjSize;
468 pGlyphSet->flAccel = 0;
469 pGlyphSet->cGlyphsSupported = cGlyphs;
470 pGlyphSet->cRuns = cRuns;
471
472 /* Initialize 1st WCRUN */
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 /* Walk through all supported chars */
481 for (i = 1, j = 0; i < cGlyphs; i++)
482 {
483 /* Use offset to glyph entry as hglyph */
484 phglyphs[i] = (ach[i] - chFirst) * pface->cjEntrySize;
485
486 /* Check whether we can append the wchar to a run */
487 if (awc[i] == awc[i - 1] + 1)
488 {
489 /* Append to current WCRUN */
490 pwcrun[j].cGlyphs++;
491 }
492 else
493 {
494 /* Add a new WCRUN */
495 j++;
496 pwcrun[j].wcLow = awc[i];
497 pwcrun[j].cGlyphs = 1;
498 pwcrun[j].phg = &phglyphs[i];
499 }
500 }
501
502 /* Set *pid to the allocated structure for use in BmfdFree */
503 *pid = (ULONG_PTR)pGlyphSet;
504
505 return pGlyphSet;
506}
#define TAG_GLYPHSET
Definition: bmfd.h:42
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
Definition: glfuncs.h:248
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
Definition: glfuncs.h:250
#define for
Definition: utility.h:88
ULONG cjEntrySize
Definition: bmfd.h:211
ULONG cGlyphs
Definition: bmfd.h:215
ULONG cjThis
Definition: winddi.h:641
ULONG cRuns
Definition: winddi.h:644
ULONG cGlyphsSupported
Definition: winddi.h:643
FLONG flAccel
Definition: winddi.h:642
Definition: winddi.h:634
HGLYPH * phg
Definition: winddi.h:637
WCHAR wcLow
Definition: winddi.h:635
USHORT cGlyphs
Definition: winddi.h:636
struct _WCRUN WCRUN
#define QFT_GLYPHSET
Definition: winddi.h:3895
struct _FD_GLYPHSET FD_GLYPHSET
HGLYPH * PHGLYPH
Definition: winddi.h:131
_In_ FONTOBJ _In_ ULONG _In_ ULONG cGlyphs
Definition: winddi.h:3799
char CHAR
Definition: xmlstorage.h:175

◆ BmfdQueryGlyphAttrs()

PFD_GLYPHATTR APIENTRY BmfdQueryGlyphAttrs ( FONTOBJ pfo,
ULONG  iMode 
)

Public Interface

Definition at line 305 of file glyph.c.

308{
309 DbgPrint("BmfdQueryGlyphAttrs()\n");
310 /* We don't support FO_ATTR_MODE_ROTATE */
311 return NULL;
312}

◆ BmfdUnloadFontFile()

BOOL APIENTRY BmfdUnloadFontFile ( IN ULONG_PTR  iFile)

Definition at line 298 of file font.c.

300{
301 PBMFD_FILE pfile = (PBMFD_FILE)iFile;
302
303 DbgPrint("BmfdUnloadFontFile()\n");
304
305 /* Unmap the font file */
307
308 /* Free the memory that was allocated for the font */
309 EngFreeMem(pfile);
310
311 return TRUE;
312}
#define TRUE
Definition: types.h:120

◆ DbgPrint()

ULONG DbgPrint ( IN PCHAR  Format,
IN ...   
)

Function prototypes

Definition at line 29 of file enable.c.

30{
32
34 EngDebugPrint("Bmfd: ", Format, args);
35 va_end(args);
36 return 0;
37}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define args
Definition: format.c:66
Definition: match.c:390
ENGAPI VOID APIENTRY EngDebugPrint(_In_z_ PCHAR StandardPrefix, _In_z_ PCHAR DebugMessage, _In_ va_list ap)
Definition: debug.c:19