On Wed, 22 Sep 2021 03:51:58 -0700 (PDT) Filip Sykala wrote:
FS> I've three issues.
FS> 1) Is there a way to filtrate fonts inside dialog?
This depends on what do you mean by filtering. You can't filter by font
names, but you can filter by their more global characteristics, e.g. you
can restrict the fonts to fixed-pitch ones only.
FS> On my Windows 10, it looks like there is more than 200 fonts. And not all
FS> are TTF.
I think you should be able to see only TTF fonts if you use
wxFontData::RestrictSelection(wxFONTRESTRICT_SCALABLE).
FS> 2) How Can I recognize TTF font from wxFont?
We don't have anything in the API to distinguish vector fonts from the
bitmap ones.
FS> 3) How to open dialog with previous selected font?
FS> It looks like it should work with constructor, but not for me.
FS> static wxFontData data;
FS> wxFontDialog font_dialog((wxWindow *)mainframe, data);
FS> nor this one:
FS> static wxFontDialog font_dialog(nullptr);
You need to call wxFontData::SetInitialFont(), see the dialogs sample.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/