Devices now have a couple of new font options. One option is to have the system download its own fonts to the device driver. The other option is to let the system manage text queries and strings while letting the device actually render the images.
Download Fonts
Two things must be done to tell the graphics subsystem that your device driver wants to be font-download enabled:
Once this has been done, the graphics subsystem sends all text output to the device driver via pfnTextBlt.
APIRET APIENTRY pfnTextBlt(PTEXTBLTINFO ptbi, ULONG hddc);
TEXTBLTINFO
ULONG ulLength sizeof(TEXTBLTINFO)
ULONG flOptions 00
ULONG lGlyphCnt Count of Glyphs to render
PLONG pGlyphIndices pointer to glyph indicies
ULONG ulFGMix Foreground mix mode
ULONG ulBGMix Background mix mode
ULONG ulFGColor Foreground text color
ULONG ulBGColor Background text color
PBMAPINFO pDstBmapInfo Destination bitmap information
PDEVFONTINFO pDevFntInfo Device font information
ULONG ulClpCnt Non-Clipping Drivers Ignore
PBLTRECT abrClipRects Non-Clipping Drivers Ignore
PPOINTL aptlSrcOrg Clipping Drivers Ignore
PBLTRECT abrDst Clipping Drivers Ignore .ulXExt & ulYExt
DEVFONTINFO
ULONG ulFntCnt Maximum glyphs contained in this font
ULONG fFontInfo Flags
ULONG ulEngTag Renderer Tag - i.e. 'GRE'
ULONG ulUniqueFntID Unique font ID
ULONG ulMaxHeight Font maximum height
ULONG ulMaxWidth Font maximum width
PGHBTBL pghbTbl Pointer to glyph high-byte table see below
ULONG ulHalfWidth N/A
CHAR szGlyphlist[16] Glyph list name (ie. PM383)
ULONG ulReserved1 N/A
ULONG ulReserved2 N/A
DFI_FIXED_FONT Font is a fixed-width font
DFI_DBCS_FONT Font is a DBCS font
GRETAG "GRE_" Font is a PM system style font
WINTAG "WIN_" Font is a WIN system style font
The Glyph Table is designed to be a dynamic 2-byte font table. As an example, lets take a PM383 font with three cached entries, index 34, 36 and 301:
GHBTBL
ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿
0 ³ pglbtbl1 ³ÄÄÄÄÄ¿ ÚÄÄÄ>³ A Space ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
1 ³ pglbtbl2 ³ÄÄ¿ ³ ³ ³ B Space ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
2 ³ ³ ³ ³ ³ ³ C Space ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
n ³ ³ ³ ³ ³ ³ Pad ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
³ ³ ³ ³ Bitmapinfo ³
³ ³ GLBTBL ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ
³ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³
³ ÃÄÄÄ>34 ³ pGlyphInfo ³ÄÄÄÙ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ÚÄÄÄÄ>³ A Space ³
³ ³ 35 ³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ ³ B Space ³
³ ÀÄÄÄ>36 ³ pGlyphInfo ³ÄÄÄÄÄÄÄÙ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
³ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ C Space ³
³ 37 ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ Pad ³
³ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
³ GLBTBL ³ Bitmapinfo ³
³ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ
³ 44 ³ ³
³ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿
ÀÄÄÄÄÄÄ>45 ³ pGlyphInfo ³ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>³ A Space ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
46 ³ ³ ³ B Space ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
47 ³ ³ ³ C Space ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
³ Pad ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
³ Bitmapinfo ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ
GHBTBL
PGLBTBL pglbTbl[1] Up to 256 entries per table
GLBTBL
PGLYPHINFO pGlyphInfo[1] Up to 256 entries per table
GLYPHINFO
char bAspace
char bBspace
char bCspace
char bPad
BMAPINFO bmapinfo
Device Fonts Handled By The System
Here again, the DS_DEVICE_FONTS flag needs to be set and the pfnTextBlt function must be hooked out and handled by the device driver. In order for the system to handle font queries and text positioning of the device font, the system will query the fonts and font attributes for all the supported device fonts.
The system will need to know what fonts the driver wants supported. The system will query the driver the first time a device font request is initiated via the following new dispatch entry:
APIRET APIENTRY QueryDeviceFontMetrics(HDC hdc,
PDEVFONTMETRICS abDFM,
ULONG lDFMFlags,
ULONG hddc,
ULONG ulFunN)
return: Count of device fonts
DEVFONTMETRICS
ULONG flOptions Device font metrics options
PFOCAFONT pFoca pointer to focafont information
PVOID pUniPanhose pointer to panhose info for uni fonts
char achFileName[260] if pFoca is null then font file name to use
PSZ pszFullFamilyName pointer family name null if pFoca null
PSZ pszFullFaceName pointer to face name null if pFoca null
char achGlyphListName[16] glyph list name
PFN pfnDevQueryCodePage pointer to code page functionality (defaulted to PM383 )
LONG lDevMatch Devices lmatch number (negative)
Options for flOptions of DEVFONTMETRICS
DEVFONT_DEFAULT selects which font in the array of DEVFONTMETRICS
is the device's default font.