Device Font Support

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.


[Back: Dithering / Color Mapping Interface]
[Next: OS2_PM_DRV_ENABLE: Subfunction 0Eh - QueryDeviceSurface - Topics]

AltStyle によって変換されたページ (->オリジナル) /