22#include <wx/fontenum.h>
31 int nChoices, wxString* aChoices,
int aStyle ) :
32 wxChoice( aParent, aId, aPosition, aSize, nChoices, aChoices, aStyle )
36 std::vector<std::string> fontNames;
37 Fontconfig()->ListFonts( fontNames, std::string(
Pgm().GetLanguageTag().utf8_str() ) );
39 wxArrayString menuList;
49 Append(
_(
"Default Font" ) );
54 for(
const std::string&
name : fontNames )
55 menuList.Add( wxString(
name ) );
81 bool result = SetStringSelection( aFont->
GetName() );
86 SetSelection( GetCount() - 1 );
91 SendSelectionChangedEvent( wxEVT_CHOICE );
97 int sel = GetSelection();
111 if( GetSelection() <= 0 )
void SetFontSelection(KIFONT::FONT *aFont, bool aSilentMode=false)
Set the selection in wxChoice widget.
KIFONT::FONT * GetFontSelection(bool aBold, bool aItalic, bool aForDrawingSheet=false) const
bool HaveFontSelection() const
FONT_CHOICE(wxWindow *aParent, int aId, wxPoint aPosition, wxSize aSize, int nChoices, wxString *aChoices, int aStyle)
FONT is an abstract base class for both outline and stroke fonts.
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false, const std::vector< wxString > *aEmbeddedFiles=nullptr, bool aForDrawingSheet=false)
const wxString & GetName() const
FONTCONFIG * Fontconfig()
PGM_BASE & Pgm()
The global Program "get" accessor.