// ----------------------------------------------------------------------------
// the config paths we use
-static const wxChar* FONTMAPPER_ROOT_PATH = wxT("FontMapper");
+static const wxChar* FONTMAPPER_ROOT_PATH = wxT("wxWindows/FontMapper");
static const wxChar* FONTMAPPER_CHARSET_PATH = wxT("Charsets");
static const wxChar* FONTMAPPER_CHARSET_ALIAS_PATH = wxT("Aliases");
static const wxChar* FONTMAPPER_FONT_FROM_ENCODING_PATH = wxT("Encodings");
if ( !m_config )
{
// try the default
- m_config = wxConfig::Get();
+ m_config = wxConfig::Get(FALSE/*don't create on demand*/);
}
return m_config;
// the message
wxString msg;
- msg.Printf(_("The charset '%s' is unknown. You may select another "
- "charset to replace it with or choose [Cancel] if it "
- "cannot be replaced"), charset.c_str());
+ msg.Printf(_("The charset '%s' is unknown. You may select\n"
+ "another charset to replace it with or choose\n"
+ "[Cancel] if it cannot be replaced"), charset.c_str());
// the list of choices
size_t count = WXSIZEOF(gs_encodingDescs);
// 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) )
const wxString& facename)
{
wxNativeEncodingInfo info;
-
- wxGetNativeFontEncoding(encoding, &info);
- info.facename = facename;
- return wxTestFontEncoding(info);
+
+ if (wxGetNativeFontEncoding(encoding, &info))
+ {
+ info.facename = facename;
+ return wxTestFontEncoding(info);
+ }
+ else
+ return FALSE;
}