X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/04a4a2afd54de5b3435c6d316b9071d55bc8b00f..a84ece11fffdde5d1bbd254ba58ac3cee79c2e77:/docs/latex/wx/fontmap.tex

diff --git a/docs/latex/wx/fontmap.tex b/docs/latex/wx/fontmap.tex
index 4a440bf7be..fe252bc35c 100644
--- a/docs/latex/wx/fontmap.tex
+++ b/docs/latex/wx/fontmap.tex
@@ -20,31 +20,26 @@ never TRUE, the config file is never created anyhow.
 
 In case everything else fails (i.e. there is no record in config file
 and "interactive" is FALSE or user denied to choose any replacement), 
-the class queries \helpref{wxEncodingConverter}{wxencodingconverter}
+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
 host system (see \helpref{IsEncodingAvailable}{wxfontmapperisencodingavailable}),
-you may use these two classes to a) find font in some similar encoding
+you may use these two classes to find font in some similar encoding
 (see \helpref{GetAltForEncoding}{wxfontmappergetaltforencoding})
-and
-b) convert the text to this encoding 
+and convert the text to this encoding 
 (\helpref{wxEncodingConverter::Convert}{wxencodingconverterconvert}).
 
 Following code snippet demonstrates it:
 
 \begin{verbatim}
-if (!wxTheFontMapper->IsEncodingAvailable(enc, facename))
+if (!wxFontMapper::Get()->IsEncodingAvailable(enc, facename))
 {
    wxFontEncoding alternative;
-   if (wxTheFontMapper->GetAltForEncoding(enc, &alternative,
-                                          facename, FALSE))
+   if (wxFontMapper::Get()->GetAltForEncoding(enc, &alternative,
+                                              facename, FALSE))
    {
        wxEncodingConverter encconv;
        if (!encconv.Init(enc, alternative))
@@ -72,7 +67,6 @@ No base class
 \helpref{wxEncodingConverter}{wxencodingconverter}, 
 \helpref{Writing non-English applications}{nonenglishoverview}
 
-
 \latexignore{\rtfignore{\wxheading{Members}}}
 
 \membersection{wxFontMapper::wxFontMapper}\label{wxfontmapperwxfontmapper}
@@ -81,6 +75,10 @@ No base class
 
 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}
 
@@ -88,6 +86,16 @@ Default ctor.
 
 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}
 
@@ -104,7 +112,6 @@ The first form is for wxWindows' internal use while the second one
 is better suitable for general use -- it returns wxFontEncoding which
 can consequently be passed to wxFont constructor.
 
-
 \membersection{wxFontMapper::IsEncodingAvailable}\label{wxfontmapperisencodingavailable}
 
 \func{bool}{IsEncodingAvailable}{\param{wxFontEncoding }{encoding}, \param{const wxString\& }{facename = wxEmptyString}}
@@ -112,7 +119,6 @@ can consequently be passed to wxFont constructor.
 Check whether given encoding is available in given face or not.
 If no facename is given, find {\it any} font in this encoding.
 
-
 \membersection{wxFontMapper::CharsetToEncoding}\label{wxfontmappercharsettoencoding}
 
 \func{wxFontEncoding}{CharsetToEncoding}{\param{const wxString\& }{charset}, \param{bool }{interactive = TRUE}}
@@ -120,35 +126,42 @@ If no facename is given, find {\it any} font in this encoding.
 Returns the encoding for the given charset (in the form of RFC 2046) or
 wxFONTENCODING\_SYSTEM if couldn't decode it.
 
-
 \membersection{wxFontMapper::GetEncodingName}\label{wxfontmappergetencodingname}
 
 \func{static wxString}{GetEncodingName}{\param{wxFontEncoding }{encoding}}
 
-Return internal string identifier for the encoding (see also
+Return internal string identifier for the encoding (see also 
 \helpref{GetEncodingDescription()}{wxfontmappergetencodingdescription})
 
-
 \membersection{wxFontMapper::GetEncodingDescription}\label{wxfontmappergetencodingdescription}
 
 \func{static wxString}{GetEncodingDescription}{\param{wxFontEncoding }{encoding}}
 
 Return user-readable string describing the given encoding.
 
-
 \membersection{wxFontMapper::SetDialogParent}\label{wxfontmappersetdialogparent}
 
 \func{void}{SetDialogParent}{\param{wxWindow* }{parent}}
 
 The parent window for modal dialogs.
 
-
 \membersection{wxFontMapper::SetDialogTitle}\label{wxfontmappersetdialogtitle}
 
 \func{void}{SetDialogTitle}{\param{const wxString\& }{title}}
 
 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}
 
