I think I know now what the problem is: the font is not set in the
HDC, so the system provides the wrong CMAP data to the
UpdateFromHDC()/ReadCmapTable() methods. Please use SetFont() to set
the font before you call UpdateFromHDC().
Thank you for your suggestion. I didn't apply SetFont() before
calling UpdateFromHDC(). But I don't know how to generate parameters
for WinSalGraphics::SetFont in my scenario.
Mostly set ImplFontSelectData's mpFontData member and set some useful
defaults (e.g. mnHeight=mfExactHeight=16, mnWidth=0, mnOrientation=0,
mbVertical=false, etc.) before calling SetFont. I'd do all of the HDC
mangling business outside of the EnumFontFamiliesEx loop though.
So many similar classes related font such as ImplFontData,
ImplFontSelectData, ImplWinFontData make me confused very much.
I know what you mean. The class names should be renamed for more
clarity as I suggested in the vcl/inc/outfont.hxx comments (e.g.
ImplFontData to PhysicalFontFace, ImplFontCache to LogicalFontManager,
ImplDevFontListData to PhysicalFontFamily, ImplFontEntry to
LogicalFontInstance, ImplFontSelectData to PhysicalFontRequest, etc.)
On the other hand renaming classes that have been in the source tree
for much longer than even longtimers are working on the project does
not always help. Neither for developers and especially not for
automatic tools like stacktrace-matchers.
May I enumerate the fonts in mpFontList of OutPutDevice instead of
EnumFontFamiliesExW for performance consideration.
Yes, you should do it outside of the EnumFontFamilies loop. Iterate
over every ImplFontData entry of every maDevFontList element and
ignore all fonts that only provide a default ImplFontCharMap.
---
Herbert Duerr
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]