]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxFontMapper::Get/Set
authorVáclav Slavík <vslavik@fastmail.fm>
Sat, 6 Apr 2002 15:04:27 +0000 (15:04 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sat, 6 Apr 2002 15:04:27 +0000 (15:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14969 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

25 files changed:
docs/changes.txt
docs/latex/wx/config.tex
docs/latex/wx/fontmap.tex
docs/latex/wx/tnoneng.tex
include/wx/fontmap.h
samples/console/console.cpp
samples/font/font.cpp
src/common/fontcmn.cpp
src/common/fontmap.cpp
src/common/intl.cpp
src/common/strconv.cpp
src/html/helpdata.cpp
src/html/m_meta.cpp
src/html/winpars.cpp
src/mac/carbon/fontenum.cpp
src/mac/fontenum.cpp
src/mgl/dc.cpp
src/msw/font.cpp
src/msw/fontenum.cpp
src/msw/utils.cpp
src/os2/font.cpp
src/os2/fontenum.cpp
src/os2/wx23.def
src/unix/fontenum.cpp
src/unix/fontutil.cpp

index 5361f5ac65ebb4a766b4e7e673480a162fd6b113..ea0a35db24171a063f8919d20b0e944db7c505b8 100644 (file)
@@ -112,6 +112,8 @@ wxBase:
 - wxLocale now works in Unicode mode
 - wxLocale can now load message catalogs in arbitrary encoding
 - fixed the bug related to the redrawing on resize introduced in 2.3.2
 - wxLocale now works in Unicode mode
 - wxLocale can now load message catalogs in arbitrary encoding
 - fixed the bug related to the redrawing on resize introduced in 2.3.2
+- added static wxFontMapper::Get() accessor (use of wxTheFontMapper is now
+  deprecated)
 
 Unix (Base/GUI):
 
 
 Unix (Base/GUI):
 
index f349c6f0fdd1c2800a87b3bfa36a33a8d8736367..920d8304062a2612cd4d14e43552b1e3ea77a5dd 100644 (file)
@@ -434,7 +434,7 @@ destructor)
 
 \membersection{wxConfigBase::Get}\label{wxconfigbaseget}
 
 
 \membersection{wxConfigBase::Get}\label{wxconfigbaseget}
 
-\func{wxConfigBase *}{Get}{\param{bool }{CreateOnDemand = TRUE}}
+\func{static wxConfigBase *}{Get}{\param{bool }{CreateOnDemand = TRUE}}
 
 Get the current config object. If there is no current object and
 {\it CreateOnDemand} is TRUE, creates one
 
 Get the current config object. If there is no current object and
 {\it CreateOnDemand} is TRUE, creates one
@@ -684,7 +684,7 @@ exists.
 
 \membersection{wxConfigBase::Set}\label{wxconfigbaseset}
 
 
 \membersection{wxConfigBase::Set}\label{wxconfigbaseset}
 
-\func{wxConfigBase *}{Set}{\param{wxConfigBase *}{pConfig}}
+\func{static wxConfigBase *}{Set}{\param{wxConfigBase *}{pConfig}}
 
 Sets the config object as the current one, returns the pointer to the previous
 current object (both the parameter and returned value may be NULL)
 
 Sets the config object as the current one, returns the pointer to the previous
 current object (both the parameter and returned value may be NULL)
index fbf85fdf192e9b10cf2816cabfaf4fbb5d901f81..fe252bc35ce2679c2e4a58ae601ddb03424ccf03 100644 (file)
@@ -23,10 +23,6 @@ and "interactive" is FALSE or user denied to choose any replacement),
 the class queries \helpref{wxEncodingConverter}{wxencodingconverter} 
 for "equivalent" encodings (e.g. iso8859-2 and cp1250) and tries them.
 
 the class queries \helpref{wxEncodingConverter}{wxencodingconverter} 
 for "equivalent" encodings (e.g. iso8859-2 and cp1250) and tries them.
 
-\wxheading{Global variables}
-
-{\tt wxFontMapper *wxTheFontMapper} is defined.
-
 \wxheading{Using wxFontMapper in conjunction with wxEncodingConverter}
 
 If you need to display text in encoding which is not available at
 \wxheading{Using wxFontMapper in conjunction with wxEncodingConverter}
 
 If you need to display text in encoding which is not available at
@@ -39,11 +35,11 @@ and convert the text to this encoding
 Following code snippet demonstrates it:
 
 \begin{verbatim}
 Following code snippet demonstrates it:
 
 \begin{verbatim}
-if (!wxTheFontMapper->IsEncodingAvailable(enc, facename))
+if (!wxFontMapper::Get()->IsEncodingAvailable(enc, facename))
 {
    wxFontEncoding alternative;
 {
    wxFontEncoding alternative;
-   if (wxTheFontMapper->GetAltForEncoding(enc, &alternative,
-                                          facename, FALSE))
+   if (wxFontMapper::Get()->GetAltForEncoding(enc, &alternative,
+                                              facename, FALSE))
    {
        wxEncodingConverter encconv;
        if (!encconv.Init(enc, alternative))
    {
        wxEncodingConverter encconv;
        if (!encconv.Init(enc, alternative))
@@ -79,12 +75,28 @@ No base class
 
 Default ctor.
 
 
 Default ctor.
 
+\wxheading{Note}
+
+The preferred way of creating a wxFontMapper instance is to call 
+\helpref{wxFontMapper::Get}{wxfontmapperget}.
+
 \membersection{wxFontMapper::\destruct{wxFontMapper}}\label{wxfontmapperdtor}
 
 \func{}{\destruct{wxFontMapper}}{\void}
 
 Virtual dtor for a base class.
 
 \membersection{wxFontMapper::\destruct{wxFontMapper}}\label{wxfontmapperdtor}
 
 \func{}{\destruct{wxFontMapper}}{\void}
 
 Virtual dtor for a base class.
 
+\membersection{wxFontMapper::Get}\label{wxfontmapperget}
+
+\func{static wxFontMapper *}{Get}{\void}
+
+Get the current font mapper object. If there is no current object, creates
+one.
+
+\wxheading{See also}
+
+\helpref{wxFontMapper::Set}{wxfontmapperset}
+
 \membersection{wxFontMapper::GetAltForEncoding}\label{wxfontmappergetaltforencoding}
 
 \func{bool}{GetAltForEncoding}{\param{wxFontEncoding }{encoding}, \param{wxNativeEncodingInfo* }{info}, \param{const wxString\& }{facename = wxEmptyString}, \param{bool }{interactive = TRUE}}
 \membersection{wxFontMapper::GetAltForEncoding}\label{wxfontmappergetaltforencoding}
 
 \func{bool}{GetAltForEncoding}{\param{wxFontEncoding }{encoding}, \param{wxNativeEncodingInfo* }{info}, \param{const wxString\& }{facename = wxEmptyString}, \param{bool }{interactive = TRUE}}
@@ -139,6 +151,18 @@ The parent window for modal dialogs.
 
 The title for the dialogs (note that default is quite reasonable).
 
 
 The title for the dialogs (note that default is quite reasonable).
 
+\membersection{wxFontMapper::Set}\label{wxfontmapperset}
+
+\func{static wxFontMapper *}{Set}{\param{wxFontMapper *}{mapper}}
+
+Set the current font mapper object and return previous one (may be NULL).
+This method is only useful if you want to plug-in an alternative font mapper
+into wxWindows.
+
+\wxheading{See also}
+
+\helpref{wxFontMapper::Get}{wxfontmapperget}
+
 \membersection{wxFontMapper::SetConfig}\label{wxfontmappersetconfig}
 
 \func{void}{SetConfig}{\param{wxConfigBase* }{config}}
 \membersection{wxFontMapper::SetConfig}\label{wxfontmappersetconfig}
 
 \func{void}{SetConfig}{\param{wxConfigBase* }{config}}
index afae77b9c8bf8418f72e924ae6b9c2c56c2f2856..084c807e94b850fa191d367cebfc49c023d77d6d 100644 (file)
@@ -94,7 +94,7 @@ You can use \helpref{wxEncodingConverter}{wxencodingconverter} and
 \helpref{wxFontMapper}{wxfontmapper} to display text:
 
 \begin{verbatim}
 \helpref{wxFontMapper}{wxfontmapper} to display text:
 
 \begin{verbatim}
-if (!wxTheFontMapper->IsEncodingAvailable(enc, facename))
+if (!wxFontMapper::Get()->IsEncodingAvailable(enc, facename))
 {
    wxFontEncoding alternative;
    if (wxTheFontMapper->GetAltForEncoding(enc, &alternative, 
 {
    wxFontEncoding alternative;
    if (wxTheFontMapper->GetAltForEncoding(enc, &alternative, 
index 70691e8afb90ac9db8ec11a9c15f1248406a64b0..53edf7f17c7fedaf4111ae5b48f07779762004cf 100644 (file)
@@ -59,6 +59,11 @@ public:
     // virtual dtor for a base class
     virtual ~wxFontMapper();
 
     // virtual dtor for a base class
     virtual ~wxFontMapper();
 
+    // return instance of the wxFontMapper singleton
+    static wxFontMapper *Get();
+    // set the sigleton to 'mapper' instance and return previous one
+    static wxFontMapper *Set(wxFontMapper *mapper);
+
 #if wxUSE_GUI
     // find an alternative for the given encoding (which is supposed to not be
     // available on this system). If successful, return TRUE and fill info
 #if wxUSE_GUI
     // find an alternative for the given encoding (which is supposed to not be
     // available on this system). If successful, return TRUE and fill info
@@ -180,6 +185,9 @@ protected:
 #endif // wxUSE_GUI
 
     friend class wxFontMapperPathChanger;
 #endif // wxUSE_GUI
 
     friend class wxFontMapperPathChanger;
+    
+private:
+    static wxFontMapper *sm_instance;
 };
 
 // ----------------------------------------------------------------------------
 };
 
 // ----------------------------------------------------------------------------
@@ -187,7 +195,8 @@ protected:
 // ----------------------------------------------------------------------------
 
 // the default font mapper for wxWindows programs
 // ----------------------------------------------------------------------------
 
 // the default font mapper for wxWindows programs
-WXDLLEXPORT_DATA(extern wxFontMapper *) wxTheFontMapper;
+// do NOT use! This is for backward compatibility, use wxFontMapper::Get() instead
+#define wxTheFontMapper (wxFontMapper::Get())
 
 #endif // wxUSE_FONTMAP
 
 
 #endif // wxUSE_FONTMAP
 
index 53990de434bb43a85091f3fcb74c47ccf0e761ef..7a9e0bb1afb4c270c46d65c967ecaab6fbe00283 100644 (file)
@@ -184,11 +184,11 @@ static void TestCharset()
 
     for ( size_t n = 0; n < WXSIZEOF(charsets); n++ )
     {
 
     for ( size_t n = 0; n < WXSIZEOF(charsets); n++ )
     {
-        wxFontEncoding enc = wxTheFontMapper->CharsetToEncoding(charsets[n]);
+        wxFontEncoding enc = wxFontMapper::Get()->CharsetToEncoding(charsets[n]);
         wxPrintf(_T("Charset: %s\tEncoding: %s (%s)\n"),
                  charsets[n],
         wxPrintf(_T("Charset: %s\tEncoding: %s (%s)\n"),
                  charsets[n],
-                 wxTheFontMapper->GetEncodingName(enc).c_str(),
-                 wxTheFontMapper->GetEncodingDescription(enc).c_str());
+                 wxFontMapper::Get()->GetEncodingName(enc).c_str(),
+                 wxFontMapper::Get()->GetEncodingDescription(enc).c_str());
     }
 }
 
     }
 }
 
index 6c9dff7a5072adae9755b90c72415894d43bbf0e..b92b86b2550c6dfb193fb9c54448115887aa0359 100644 (file)
@@ -632,7 +632,7 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
     }
 
     // ok, now get the corresponding encoding
     }
 
     // ok, now get the corresponding encoding
-    wxFontEncoding fontenc = wxTheFontMapper->CharsetToEncoding(charset);
+    wxFontEncoding fontenc = wxFontMapper::Get()->CharsetToEncoding(charset);
     if ( fontenc == wxFONTENCODING_SYSTEM )
     {
         wxLogError(wxT("Charset '%s' is unsupported."), charset.c_str());
     if ( fontenc == wxFONTENCODING_SYSTEM )
     {
         wxLogError(wxT("Charset '%s' is unsupported."), charset.c_str());
@@ -642,11 +642,11 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
     m_textctrl->LoadFile(filename);
 
     if ( fontenc == wxFONTENCODING_UTF8 ||
     m_textctrl->LoadFile(filename);
 
     if ( fontenc == wxFONTENCODING_UTF8 ||
-            !wxTheFontMapper->IsEncodingAvailable(fontenc) )
+            !wxFontMapper::Get()->IsEncodingAvailable(fontenc) )
     {
         // try to find some similar encoding:
         wxFontEncoding encAlt;
     {
         // try to find some similar encoding:
         wxFontEncoding encAlt;
-        if ( wxTheFontMapper->GetAltForEncoding(fontenc, &encAlt) )
+        if ( wxFontMapper::Get()->GetAltForEncoding(fontenc, &encAlt) )
         {
             wxEncodingConverter conv;
 
         {
             wxEncodingConverter conv;
 
@@ -732,7 +732,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
     fontInfo.Printf(wxT("Font size is %d points, family: %s, encoding: %s"),
                     m_font.GetPointSize(),
                     m_font.GetFamilyString().c_str(),
     fontInfo.Printf(wxT("Font size is %d points, family: %s, encoding: %s"),
                     m_font.GetPointSize(),
                     m_font.GetFamilyString().c_str(),
-                    wxTheFontMapper->
+                    wxFontMapper::Get()->
                         GetEncodingDescription(m_font.GetEncoding()).c_str());
 
     dc.DrawText(fontInfo, x, y);
                         GetEncodingDescription(m_font.GetEncoding()).c_str());
 
     dc.DrawText(fontInfo, x, y);
index 50b3b19db8f602d46f719a08934e6f04f634fe7a..9f09b4c8e188814e8f936c7ca7daa02877808329 100644 (file)
@@ -475,7 +475,7 @@ wxString wxNativeFontInfo::ToUserString() const
     wxFontEncoding enc = GetEncoding();
     if ( enc != wxFONTENCODING_DEFAULT && enc != wxFONTENCODING_SYSTEM )
     {
     wxFontEncoding enc = GetEncoding();
     if ( enc != wxFONTENCODING_DEFAULT && enc != wxFONTENCODING_SYSTEM )
     {
-        desc << _T(' ') << wxTheFontMapper->GetEncodingName(enc);
+        desc << _T(' ') << wxFontMapper::Get()->GetEncodingName(enc);
     }
 #endif // wxUSE_FONTMAP
 
     }
 #endif // wxUSE_FONTMAP
 
@@ -528,7 +528,7 @@ bool wxNativeFontInfo::FromUserString(const wxString& s)
             SetPointSize(size);
         }
 #if wxUSE_FONTMAP
             SetPointSize(size);
         }
 #if wxUSE_FONTMAP
-        else if ( (encoding = wxTheFontMapper->CharsetToEncoding(token, FALSE))
+        else if ( (encoding = wxFontMapper::Get()->CharsetToEncoding(token, FALSE))
                     != wxFONTENCODING_DEFAULT )
         {
             SetEncoding(encoding);
                     != wxFONTENCODING_DEFAULT )
         {
             SetEncoding(encoding);
index ab990ef8eb38007b2641395dfbc5f7a230b3683d..c976d72af6b753263a543c1e352f7f7225d8bf99 100644 (file)
@@ -178,27 +178,6 @@ static const wxChar* gs_encodingNames[] =
     wxT( "utf-8" ),
 };
 
     wxT( "utf-8" ),
 };
 
-// ----------------------------------------------------------------------------
-// global data
-// ----------------------------------------------------------------------------
-
-wxFontMapper * wxTheFontMapper = NULL;
-
-class wxFontMapperModule: public wxModule
-{
-public:
-    wxFontMapperModule() : wxModule() { }
-    virtual bool OnInit() { wxTheFontMapper = new wxFontMapper; return TRUE; }
-    virtual void OnExit()
-    {
-        delete wxTheFontMapper;
-        wxTheFontMapper = NULL;
-    }
-
-    DECLARE_DYNAMIC_CLASS(wxFontMapperModule)
-};
-
-IMPLEMENT_DYNAMIC_CLASS(wxFontMapperModule, wxModule)
 
 // ----------------------------------------------------------------------------
 // private classes
 
 // ----------------------------------------------------------------------------
 // private classes
@@ -256,6 +235,34 @@ wxFontMapper::~wxFontMapper()
 #endif // wxUSE_CONFIG
 }
 
 #endif // wxUSE_CONFIG
 }
 
+wxFontMapper *wxFontMapper::sm_instance = NULL;
+
+/*static*/ wxFontMapper *wxFontMapper::Get()
+{
+    if ( !sm_instance )
+        sm_instance = new wxFontMapper;
+    return sm_instance;
+}
+
+/*static*/ wxFontMapper *wxFontMapper::Set(wxFontMapper *mapper)
+{
+    wxFontMapper *old = sm_instance;
+    sm_instance = mapper;
+    return old;
+}
+
+class wxFontMapperModule: public wxModule
+{
+public:
+    wxFontMapperModule() : wxModule() {}
+    virtual bool OnInit() { return TRUE; }
+    virtual void OnExit() { delete wxFontMapper::Set(NULL); }
+
+    DECLARE_DYNAMIC_CLASS(wxFontMapperModule)
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxFontMapperModule, wxModule)
+
 // ----------------------------------------------------------------------------
 // customisation
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // customisation
 // ----------------------------------------------------------------------------
index 168c33334363cc89378b6b44a9907ad3843779b7..8f36b359d7beb3cb3d87265a1317c70529e6507f 100644 (file)
@@ -444,7 +444,7 @@ void wxMsgCatalogFile::FillHash(wxMessagesHash& hash, bool convertEncoding) cons
     if ( convertEncoding )
     {
         wxFontEncoding targetEnc = wxFONTENCODING_SYSTEM;
     if ( convertEncoding )
     {
         wxFontEncoding targetEnc = wxFONTENCODING_SYSTEM;
-        wxFontEncoding enc = wxTheFontMapper->CharsetToEncoding(charset, FALSE);
+        wxFontEncoding enc = wxFontMapper::Get()->CharsetToEncoding(charset, FALSE);
         if ( enc == wxFONTENCODING_SYSTEM )
         {
             convertEncoding = FALSE; // unknown encoding
         if ( enc == wxFONTENCODING_SYSTEM )
         {
             convertEncoding = FALSE; // unknown encoding
@@ -1340,7 +1340,7 @@ wxFontEncoding wxLocale::GetSystemEncoding()
     wxString encname = GetSystemEncodingName();
     if ( !encname.empty() )
     {
     wxString encname = GetSystemEncodingName();
     if ( !encname.empty() )
     {
-        wxFontEncoding enc = wxTheFontMapper->
+        wxFontEncoding enc = wxFontMapper::Get()->
             CharsetToEncoding(encname, FALSE /* not interactive */);
 
         // this should probably be considered as a bug in CharsetToEncoding():
             CharsetToEncoding(encname, FALSE /* not interactive */);
 
         // this should probably be considered as a bug in CharsetToEncoding():
index 1a5dbe119a9900f42ba3ad988906cb4f48704c11..677ad2714da717144cbda3cfc3f4c8cfb450d4c8 100644 (file)
@@ -791,7 +791,7 @@ public:
                                      enc(wxFONTENCODING_SYSTEM)
     {
         if (name)
                                      enc(wxFONTENCODING_SYSTEM)
     {
         if (name)
-            enc = wxTheFontMapper->CharsetToEncoding(name, FALSE);
+            enc = wxFontMapper::Get()->CharsetToEncoding(name, FALSE);
 
         m_ok = m2w.Init(enc, wxFONTENCODING_UNICODE) &&
                w2m.Init(wxFONTENCODING_UNICODE, enc);
 
         m_ok = m2w.Init(enc, wxFONTENCODING_UNICODE) &&
                w2m.Init(wxFONTENCODING_UNICODE, enc);
@@ -840,7 +840,7 @@ static wxCharacterSet *wxGetCharacterSet(const wxChar *name)
 {
     // check for the special case of ASCII charset
 #if wxUSE_FONTMAP
 {
     // check for the special case of ASCII charset
 #if wxUSE_FONTMAP
-    if ( wxTheFontMapper->CharsetToEncoding(name) == wxFONTENCODING_DEFAULT )
+    if ( wxFontMapper::Get()->CharsetToEncoding(name) == wxFONTENCODING_DEFAULT )
 #else // wxUSE_FONTMAP
     if ( !name )
 #endif // wxUSE_FONTMAP/!wxUSE_FONTMAP
 #else // wxUSE_FONTMAP
     if ( !name )
 #endif // wxUSE_FONTMAP/!wxUSE_FONTMAP
index 312857dedfde84d9b0d492abb350909e01102df5..44392854d328aca559ca8a164db12d991733ddfd 100644 (file)
@@ -618,7 +618,7 @@ bool wxHtmlHelpData::AddBook(const wxString& book)
 
         wxFontEncoding enc;
         if (charset == wxEmptyString) enc = wxFONTENCODING_SYSTEM;
 
         wxFontEncoding enc;
         if (charset == wxEmptyString) enc = wxFONTENCODING_SYSTEM;
-        else enc = wxTheFontMapper->CharsetToEncoding(charset);
+        else enc = wxFontMapper::Get()->CharsetToEncoding(charset);
         bool rtval = AddBookParam(*fi, enc,
                                   title, contents, index, start, fsys.GetPath());
         delete fi;
         bool rtval = AddBookParam(*fi, enc,
                                   title, contents, index, start, fsys.GetPath());
         delete fi;
index 2c707c6c824e0415607462f974ce2ba393c1d02b..9ad9eb7c4bb36a43e6b9c47200df2da5fbba35d8 100644 (file)
@@ -46,7 +46,7 @@ TAG_HANDLER_BEGIN(META, "META")
             if (content.Left(19) == _T("text/html; charset="))
             {
                 wxFontEncoding enc =
             if (content.Left(19) == _T("text/html; charset="))
             {
                 wxFontEncoding enc =
-                    wxTheFontMapper->CharsetToEncoding(content.Mid(19));
+                    wxFontMapper::Get()->CharsetToEncoding(content.Mid(19));
                 if (enc == wxFONTENCODING_SYSTEM) return FALSE;
                 if (enc == m_WParser->GetInputEncoding()) return FALSE;
 
                 if (enc == wxFONTENCODING_SYSTEM) return FALSE;
                 if (enc == m_WParser->GetInputEncoding()) return FALSE;
 
index 9d8209ddfb883e9c6b5c8c525f2579ce12473760..877341fc05cc57c89510d5d164dac2e75df3a7c0 100644 (file)
@@ -390,21 +390,21 @@ void wxHtmlWinParser::SetInputEncoding(wxFontEncoding enc)
     bool availfix, availnorm;
 
     // exact match?
     bool availfix, availnorm;
 
     // exact match?
-    availnorm = wxTheFontMapper->IsEncodingAvailable(enc, m_FontFaceNormal);
-    availfix = wxTheFontMapper->IsEncodingAvailable(enc, m_FontFaceFixed);
+    availnorm = wxFontMapper::Get()->IsEncodingAvailable(enc, m_FontFaceNormal);
+    availfix = wxFontMapper::Get()->IsEncodingAvailable(enc, m_FontFaceFixed);
     if (availnorm && availfix)
         m_OutputEnc = enc;
 
     // alternatives?
     if (availnorm && availfix)
         m_OutputEnc = enc;
 
     // alternatives?
-    else if (wxTheFontMapper->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, FALSE) &&
-             wxTheFontMapper->GetAltForEncoding(enc, &altfix, m_FontFaceFixed, FALSE) &&
+    else if (wxFontMapper::Get()->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, FALSE) &&
+             wxFontMapper::Get()->GetAltForEncoding(enc, &altfix, m_FontFaceFixed, FALSE) &&
              altnorm == altfix)
         m_OutputEnc = altnorm;
 
     // at least normal face?
     else if (availnorm)
         m_OutputEnc = enc;
              altnorm == altfix)
         m_OutputEnc = altnorm;
 
     // at least normal face?
     else if (availnorm)
         m_OutputEnc = enc;
-    else if (wxTheFontMapper->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, FALSE))
+    else if (wxFontMapper::Get()->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, FALSE))
         m_OutputEnc = altnorm;
 
     // okay, let convert to ISO_8859-1, available always
         m_OutputEnc = altnorm;
 
     // okay, let convert to ISO_8859-1, available always
index e1b1347c6de9e4f302a7a3448d155e41fee75acb..4720cc4a759e4fff7099fe62ec8e5d15f71363f8 100644 (file)
@@ -89,7 +89,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding)
     wxNativeEncodingInfo info;
     if ( !wxGetNativeFontEncoding(encoding, &info) )
     {
     wxNativeEncodingInfo info;
     if ( !wxGetNativeFontEncoding(encoding, &info) )
     {
-        if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) )
+        if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &info) )
         {
             // no such encodings at all
             return FALSE;
         {
             // no such encodings at all
             return FALSE;
index e1b1347c6de9e4f302a7a3448d155e41fee75acb..4720cc4a759e4fff7099fe62ec8e5d15f71363f8 100644 (file)
@@ -89,7 +89,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding)
     wxNativeEncodingInfo info;
     if ( !wxGetNativeFontEncoding(encoding, &info) )
     {
     wxNativeEncodingInfo info;
     if ( !wxGetNativeFontEncoding(encoding, &info) )
     {
-        if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) )
+        if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &info) )
         {
             // no such encodings at all
             return FALSE;
         {
             // no such encodings at all
             return FALSE;
index e38597f4194a84c86c188b257bd0ed61af6291ed..4a2a4909ec10484ae491edc7eda9827bf55cd51d 100644 (file)
@@ -759,7 +759,7 @@ bool wxDC::SelectMGLFont()
              !wxTestFontEncoding(nativeEnc) )
         {
 #if wxUSE_FONTMAP
              !wxTestFontEncoding(nativeEnc) )
         {
 #if wxUSE_FONTMAP
-            if ( !wxTheFontMapper->GetAltForEncoding(encoding, &nativeEnc) )
+            if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &nativeEnc) )
 #endif
             {
                 nativeEnc.mglEncoding = MGL_ENCODING_ASCII;
 #endif
             {
                 nativeEnc.mglEncoding = MGL_ENCODING_ASCII;
index 16993de87863b1204a6446b825911d04b69749ae..25ff0295e3fcabadfc2880e5a4fefdcb6f2ca6f4 100644 (file)
@@ -523,7 +523,7 @@ void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding)
     if ( !wxGetNativeFontEncoding(encoding, &info) )
     {
 #if wxUSE_FONTMAP
     if ( !wxGetNativeFontEncoding(encoding, &info) )
     {
 #if wxUSE_FONTMAP
-        if ( wxTheFontMapper->GetAltForEncoding(encoding, &info) )
+        if ( wxFontMapper::Get()->GetAltForEncoding(encoding, &info) )
         {
             if ( !info.facename.empty() )
             {
         {
             if ( !info.facename.empty() )
             {
index 80ce3c606e6415059843c7a7dd0453802db34dba..553b574f7a4700b417f6c06668ce30320f900651 100644 (file)
@@ -131,7 +131,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding)
         if ( !wxGetNativeFontEncoding(encoding, &info) )
         {
 #if wxUSE_FONTMAP
         if ( !wxGetNativeFontEncoding(encoding, &info) )
         {
 #if wxUSE_FONTMAP
-            if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) )
+            if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &info) )
 #endif // wxUSE_FONTMAP
             {
                 // no such encodings at all
 #endif // wxUSE_FONTMAP
             {
                 // no such encodings at all
index 8c8e1086504f70830dc2480b2c1a89f580a85ae2..117a19c12d6347d751480fa91b53b5f9d3f1e35c 100644 (file)
@@ -1592,7 +1592,7 @@ extern long wxCharsetToCodepage(const wxChar *name)
     if ( !name )
         return -1;
 
     if ( !name )
         return -1;
 
-    wxFontEncoding enc = wxTheFontMapper->CharsetToEncoding(name, FALSE);
+    wxFontEncoding enc = wxFontMapper::Get()->CharsetToEncoding(name, FALSE);
     if ( enc == wxFONTENCODING_SYSTEM )
         return -1;
 
     if ( enc == wxFONTENCODING_SYSTEM )
         return -1;
 
index c1839db1ca66c6da98c592b64c6cf92373e28954..443ec80ee80b61b6176d8cec91c3338aa4a24cfe 100644 (file)
@@ -702,7 +702,7 @@ void wxNativeFontInfo::SetEncoding(
                                  ))
     {
 #if wxUSE_FONTMAP
                                  ))
     {
 #if wxUSE_FONTMAP
-        if (wxTheFontMapper->GetAltForEncoding( eEncoding
+        if (wxFontMapper::Get()->GetAltForEncoding( eEncoding
                                                ,&vInfo
                                               ))
         {
                                                ,&vInfo
                                               ))
         {
index 476798911f0ab5bc727294adbd165b45071a4bed..26a10439326f4a72737550f41654ecb0cb9fd362 100644 (file)
@@ -99,7 +99,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding)
     wxNativeEncodingInfo info;
     if ( !wxGetNativeFontEncoding(encoding, &info) )
     {
     wxNativeEncodingInfo info;
     if ( !wxGetNativeFontEncoding(encoding, &info) )
     {
-        if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) )
+        if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &info) )
         {
             // no such encodings at all
             return FALSE;
         {
             // no such encodings at all
             return FALSE;
index faaea4fd6379f70771846ad6a71bae267b89a7d7..c61844d06054597f4343927d15d111420f467010 100644 (file)
@@ -2426,7 +2426,6 @@ EXPORTS
       GetEncodingName__12wxFontMapperF14wxFontEncoding
       ;wxFontMapper::~wxFontMapper()
       __dt__12wxFontMapperFv
       GetEncodingName__12wxFontMapperF14wxFontEncoding
       ;wxFontMapper::~wxFontMapper()
       __dt__12wxFontMapperFv
-      wxTheFontMapper
       ;wxFontMapper::GetDefaultConfigPath()
       GetDefaultConfigPath__12wxFontMapperFv
       ;wxFontMapper::GetEncodingDescription(wxFontEncoding)
       ;wxFontMapper::GetDefaultConfigPath()
       GetDefaultConfigPath__12wxFontMapperFv
       ;wxFontMapper::GetEncodingDescription(wxFontEncoding)
index bc76c80086df7ab67ad50027e7e7fa217dcef8ca..fdeb46a105d6b86e99d99359999791efda8691bc 100644 (file)
@@ -79,7 +79,7 @@ static char **CreateFontList(wxChar spacing,
     if ( !wxTestFontEncoding(info) )
     {
         // ask font mapper for a replacement
     if ( !wxTestFontEncoding(info) )
     {
         // ask font mapper for a replacement
-        (void)wxTheFontMapper->GetAltForEncoding(encoding, &info);
+        (void)wxFontMapper::Get()->GetAltForEncoding(encoding, &info);
     }
 #endif // wxUSE_FONTMAP
 
     }
 #endif // wxUSE_FONTMAP
 
index e161707732df204498842a5d85085b082612800f..9501ea5ee70c38940700053ee0a66b543721a3e5 100644 (file)
@@ -425,7 +425,7 @@ wxNativeFont wxLoadQueryNearestFont(int pointSize,
              !wxTestFontEncoding(info) )
         {
 #if wxUSE_FONTMAP
              !wxTestFontEncoding(info) )
         {
 #if wxUSE_FONTMAP
-            if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) )
+            if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &info) )
 #endif // wxUSE_FONTMAP
             {
                 // unspported encoding - replace it with the default
 #endif // wxUSE_FONTMAP
             {
                 // unspported encoding - replace it with the default