]> git.saurik.com Git - wxWidgets.git/commitdiff
Added encoding parameter to wxFontList::FindOrCreateFont
authorRobin Dunn <robin@alldunn.com>
Fri, 19 Nov 1999 23:32:07 +0000 (23:32 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 19 Nov 1999 23:32:07 +0000 (23:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4635 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/fontlist.tex
include/wx/gdicmn.h
src/common/gdicmn.cpp

index 2ee6f4bbe5911d911da3a78b3397083368516d05..dbe63b05808a695dec996644804e0fbcec9a33a2 100644 (file)
@@ -38,7 +38,7 @@ Used by wxWindows to add a font to the list, called in the font constructor.
 \membersection{wxFontList::FindOrCreateFont}\label{findorcreatefont}
 
 \func{wxFont *}{FindOrCreateFont}{\param{int}{ point\_size}, \param{int}{ family}, \param{int}{ style}, \param{int}{ weight}, \param{bool}{ underline = FALSE},
- \param{const wxString\& }{facename = NULL}}
+ \param{const wxString\& }{facename = NULL}, \param{wxFontEncoding }{encoding = wxFONTENCODING_DEFAULT}{}}
 
 Finds a font of the given specification, or creates one and adds it to the list. See the \helpref{wxFont constructor}{wxfontconstr} for
 details of the arguments.
index 0fcea7fdcc5ffb7ac5cab56ea4c235cb51491344..dd913a0c954798a972d980f3c38e8630c2d43c34 100644 (file)
@@ -26,6 +26,7 @@
 #include "wx/string.h"
 #include "wx/setup.h"
 #include "wx/colour.h"
+#include "wx/font.h"
 
 // ---------------------------------------------------------------------------
 // forward declarations
@@ -347,7 +348,8 @@ public:
     void RemoveFont(wxFont *font);
     wxFont *FindOrCreateFont(int pointSize, int family, int style, int weight,
                              bool underline = FALSE,
-                             const wxString& face = wxEmptyString);
+                             const wxString& face = wxEmptyString,
+                             wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
 };
 
 class WXDLLEXPORT wxColourDatabase : public wxList
index 244d71ae156df6de0f648dc8097c60c212366860..93f757164f3b7b271381f13c2700ff34280f60bf 100644 (file)
@@ -591,7 +591,7 @@ void wxFontList::RemoveFont (wxFont * font)
 }
 
 wxFont *wxFontList::
-        FindOrCreateFont (int PointSize, int FamilyOrFontId, int Style, int Weight, bool underline, const wxString& Face)
+        FindOrCreateFont (int PointSize, int FamilyOrFontId, int Style, int Weight, bool underline, const wxString& Face, wxFontEncoding encoding)
 {
   for (wxNode * node = First (); node; node = node->Next ())
     {
@@ -610,11 +610,12 @@ wxFont *wxFontList::
 #else
           each_font->GetFamily() == FamilyOrFontId &&
 #endif
-          ((each_font->GetFaceName() == wxT("")) || each_font->GetFaceName() == Face))
+          ((each_font->GetFaceName() == wxT("")) || each_font->GetFaceName() == Face) &&
+          (encoding == wxFONTENCODING_DEFAULT || each_font->GetEncoding() == encoding))
         //#endif
         return each_font;
     }
-  wxFont *font = new wxFont (PointSize, FamilyOrFontId, Style, Weight, underline, Face);
+  wxFont *font = new wxFont (PointSize, FamilyOrFontId, Style, Weight, underline, Face, encoding);
   font->SetVisible(TRUE);
   return font;
 }