X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b3c861501a451503b31c075ccb59d16b0ae01e99..2b9eec41f97f2b63ea954f7d5dd74f2d0574eb08:/src/dfb/fontenum.cpp diff --git a/src/dfb/fontenum.cpp b/src/dfb/fontenum.cpp index 4e1f9050cc..71be1d3d1f 100644 --- a/src/dfb/fontenum.cpp +++ b/src/dfb/fontenum.cpp @@ -16,21 +16,40 @@ #endif #include "wx/fontenum.h" +#include "wx/private/fontmgr.h" + +#if wxUSE_FONTENUM // ---------------------------------------------------------------------------- // wxFontEnumerator // ---------------------------------------------------------------------------- -bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding WXUNUSED(encoding), - bool WXUNUSED(fixedWidthOnly)) +bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, + bool fixedWidthOnly) { - // FIXME_DFB - OnFacename(_T("Default")); - return true; + // we only support UTF-8 and system (which means "use any"): + if ( encoding != wxFONTENCODING_SYSTEM && encoding != wxFONTENCODING_UTF8 ) + return false; + + bool found = false; + const wxFontBundleList& list = wxFontsManager::Get()->GetBundles(); + + for ( wxFontBundleList::const_iterator f = list.begin(); f != list.end(); ++f ) + { + if ( fixedWidthOnly && !(*f)->IsFixed() ) + continue; + + found = true; + if ( !OnFacename((*f)->GetName()) ) + break; // OnFacename() requests us to stop enumeration + } + + return found; } -bool wxFontEnumerator::EnumerateEncodings(const wxString& WXUNUSED(family)) +bool wxFontEnumerator::EnumerateEncodings(const wxString& facename) { - // FIXME_DFB - return false; + return EnumerateEncodingsUTF8(facename); } + +#endif // wxUSE_FONTENUM