bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding,
wxNativeEncodingInfo *info,
+ const wxString& facename,
bool interactive)
{
wxCHECK_MSG( info, FALSE, wxT("bad pointer in GetAltForEncoding") );
+ info->facename = facename;
+
if ( encoding == wxFONTENCODING_DEFAULT )
{
encoding = wxFont::GetDefaultEncoding();
// wxFatalError doesn't return
}
- wxString configEntry = GetEncodingName(encoding);
+ wxString configEntry = facename + _T("_") + GetEncodingName(encoding);
// do we have a font spec for this encoding?
wxString pathOld;
wxFont font = retData.GetChosenFont();
*info = retData.EncodingInfo();
+ info -> encoding = retData.GetEncoding();
// remember this in the config
if ( ChangePath(FONTMAPPER_FONT_FROM_ENCODING_PATH, &pathOld) )
// now try the default mappings:
-
wxFontEncodingArray equiv = wxEncodingConverter::GetAllEquivalents(encoding);
for ( unsigned i = (equiv[0] == encoding) ? 1 : 0; i < equiv.GetCount(); i++ )
if ( TestAltEncoding(configEntry, equiv[i], info) )
return FALSE;
}
+
+
+
+bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding,
+ wxFontEncoding *alt_encoding,
+ const wxString& facename,
+ bool interactive)
+{
+ wxNativeEncodingInfo info;
+ bool r = GetAltForEncoding(encoding, &info, facename, interactive);
+ *alt_encoding = info.encoding;
+ return r;
+}
+
+
+
+bool wxFontMapper::IsEncodingAvailable(wxFontEncoding encoding,
+ const wxString& facename)
+{
+ wxNativeEncodingInfo info;
+
+ if (wxGetNativeFontEncoding(encoding, &info))
+ {
+ info.facename = facename;
+ return wxTestFontEncoding(info);
+ }
+ else
+ return FALSE;
+}