-// ----------------------------------------------------------------------------
-// customisation
-// ----------------------------------------------------------------------------
-
-/* static */ const wxChar *wxFontMapper::GetDefaultConfigPath()
-{
- return FONTMAPPER_ROOT_PATH;
-}
-
-void wxFontMapper::SetConfigPath(const wxString& prefix)
-{
- wxCHECK_RET( !prefix.IsEmpty() && prefix[0] == wxCONFIG_PATH_SEPARATOR,
- wxT("an absolute path should be given to "
- "wxFontMapper::SetConfigPath()") );
-
- m_configRootPath = prefix;
-}
-
-
-// ----------------------------------------------------------------------------
-// get config object and path for it
-// ----------------------------------------------------------------------------
-
-wxConfigBase *wxFontMapper::GetConfig()
-{
- if ( !m_config )
- {
- // try the default
- m_config = wxConfig::Get();
- }
-
- return m_config;
-}
-
-const wxString& wxFontMapper::GetConfigPath()
-{
- if ( !m_configRootPath )
- {
- // use the default
- m_configRootPath = GetDefaultConfigPath();
- }
-
- return m_configRootPath;
-}
-
-bool wxFontMapper::ChangePath(const wxString& pathNew, wxString *pathOld)
-{
- wxConfigBase *config = GetConfig();
- if ( !config )
- return FALSE;
-
- *pathOld = config->GetPath();
-
- wxString path = GetConfigPath();
- if ( path.IsEmpty() || path.Last() != wxCONFIG_PATH_SEPARATOR )
- {
- path += wxCONFIG_PATH_SEPARATOR;
- }
-
- wxASSERT_MSG( !pathNew || (pathNew[0] != wxCONFIG_PATH_SEPARATOR),
- wxT("should be a relative path") );
-
- path += pathNew;
-
- config->SetPath(path);
-
- return TRUE;
-}
-
-void wxFontMapper::RestorePath(const wxString& pathOld)
-{
- GetConfig()->SetPath(pathOld);
-}
-
-// ----------------------------------------------------------------------------
-// charset/encoding correspondence
-// ----------------------------------------------------------------------------
-
-/* static */
-wxString wxFontMapper::GetEncodingDescription(wxFontEncoding encoding)
-{
- size_t count = WXSIZEOF(gs_encodingDescs);
-
- wxASSERT_MSG( count == WXSIZEOF(gs_encodings),
- wxT("inconsitency detected - forgot to update one of "
- "the arrays?") );
-
- for ( size_t i = 0; i < count; i++ )
- {
- if ( gs_encodings[i] == encoding )
- {
- return wxGetTranslation(gs_encodingDescs[i]);
- }
- }
-
- wxString str;
- str.Printf(_("Unknown encoding (%d)"), encoding);
-
- return str;
-}
-
-/* static */
-wxString wxFontMapper::GetEncodingName(wxFontEncoding encoding)
-{
- size_t count = WXSIZEOF(gs_encodingNames);
-
- wxASSERT_MSG( count == WXSIZEOF(gs_encodings),
- wxT("inconsitency detected - forgot to update one of "
- "the arrays?") );
-
- for ( size_t i = 0; i < count; i++ )
- {
- if ( gs_encodings[i] == encoding )
- {
- return wxGetTranslation(gs_encodingNames[i]);
- }
- }
-
- wxString str;
- str.Printf(_("unknown-%d"), encoding);
-
- return str;
-}
-
-wxFontEncoding wxFontMapper::CharsetToEncoding(const wxString& charset,
- bool interactive)