Cross platform font face selection

16 views
Skip to first unread message

Filip Sykala

unread,
Dec 16, 2022, 3:35:59 AM12/16/22
to wx-users
I know about function wxFont:: GetNativeFontInfoDesc, which is serialization into string for store and restore wxFont object on same platform, but what about moving between Operating systems? Is there some way?

I serialize font data separately(size, family, face name, style, weight) by myself and re-create wxFont object by constructor wxFont::wxFont(const wxFontInfo &fontInfo). When I set face name I got wxFont which is ok(isOk() return true) and when I ask for face name it give me string which I fill into wxFontInfo no matter if the font is installed or not.

Exist (somewhere) conversion table for similar font face name?

Vadim Zeitlin

unread,
Dec 17, 2022, 10:39:28 AM12/17/22
to wx-u...@googlegroups.com, Filip Sykala
On Fri, 16 Dec 2022 00:35:59 -0800 (PST) Filip Sykala wrote:

FS> I know about function wxFont:: GetNativeFontInfoDesc
FS> <https://docs.wxwidgets.org/3.0/classwx_font.html#ac78bab66824b38f42669cfc0b4dc7c9f>,
FS> which is serialization into string for store and restore wxFont object on
FS> same platform, but what about moving between Operating systems? Is there
FS> some way?
...
FS> Exist (somewhere) conversion table for similar font face name?

No, sorry, we don't have anything like this. The only mechanism for
selecting a font in platform-independent way that we have is by using the
font family, but it's very coarse-grained and it would be nice to have
something more precise. Unfortunately so far nobody had had time to do it
yet.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Reply all
Reply to author
Forward
0 new messages