]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/font.cpp
fixed wxXmlResource::Load's detection of filenames to be done as early as possible
[wxWidgets.git] / src / x11 / font.cpp
index b37530a1992994f7ece6498dc29c027097ccb08b..7e3ec5f6dcf4f1b2ac0ce5040210fbcd5eb3d9a5 100644 (file)
@@ -601,18 +601,18 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc)
     M_FONTDATA->m_faceName = tn.GetNextToken();  // family
 
     tmp = tn.GetNextToken().MakeUpper();         // weight
-    if (tmp == wxT("BOLD")) M_FONTDATA->m_weight = wxBOLD;
-    if (tmp == wxT("BLACK")) M_FONTDATA->m_weight = wxBOLD;
-    if (tmp == wxT("EXTRABOLD")) M_FONTDATA->m_weight = wxBOLD;
-    if (tmp == wxT("DEMIBOLD")) M_FONTDATA->m_weight = wxBOLD;
-    if (tmp == wxT("ULTRABOLD")) M_FONTDATA->m_weight = wxBOLD;
+    if (tmp == wxT("BOLD")) M_FONTDATA->m_weight = wxFONTWEIGHT_BOLD;
+    if (tmp == wxT("BLACK")) M_FONTDATA->m_weight = wxFONTWEIGHT_BOLD;
+    if (tmp == wxT("EXTRABOLD")) M_FONTDATA->m_weight = wxFONTWEIGHT_BOLD;
+    if (tmp == wxT("DEMIBOLD")) M_FONTDATA->m_weight = wxFONTWEIGHT_BOLD;
+    if (tmp == wxT("ULTRABOLD")) M_FONTDATA->m_weight = wxFONTWEIGHT_BOLD;
 
-    if (tmp == wxT("LIGHT")) M_FONTDATA->m_weight = wxLIGHT;
-    if (tmp == wxT("THIN")) M_FONTDATA->m_weight = wxLIGHT;
+    if (tmp == wxT("LIGHT")) M_FONTDATA->m_weight = wxFONTWEIGHT_LIGHT;
+    if (tmp == wxT("THIN")) M_FONTDATA->m_weight = wxFONTWEIGHT_LIGHT;
 
     tmp = tn.GetNextToken().MakeUpper();        // slant
-    if (tmp == wxT("I")) M_FONTDATA->m_style = wxITALIC;
-    if (tmp == wxT("O")) M_FONTDATA->m_style = wxITALIC;
+    if (tmp == wxT("I")) M_FONTDATA->m_style = wxFONTSTYLE_ITALIC;
+    if (tmp == wxT("O")) M_FONTDATA->m_style = wxFONTSTYLE_ITALIC;
 
     tn.GetNextToken();                           // set width
     tn.GetNextToken();                           // add. style
@@ -631,17 +631,17 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc)
     tmp = tn.GetNextToken().MakeUpper();         // spacing
 
     if (tmp == wxT("M"))
-        M_FONTDATA->m_family = wxMODERN;
+        M_FONTDATA->m_family = wxFONTFAMILY_MODERN;
     else if (M_FONTDATA->m_faceName == wxT("TIMES"))
-        M_FONTDATA->m_family = wxROMAN;
+        M_FONTDATA->m_family = wxFONTFAMILY_ROMAN;
     else if (M_FONTDATA->m_faceName == wxT("HELVETICA"))
-        M_FONTDATA->m_family = wxSWISS;
+        M_FONTDATA->m_family = wxFONTFAMILY_SWISS;
     else if (M_FONTDATA->m_faceName == wxT("LUCIDATYPEWRITER"))
-        M_FONTDATA->m_family = wxTELETYPE;
+        M_FONTDATA->m_family = wxFONTFAMILY_TELETYPE;
     else if (M_FONTDATA->m_faceName == wxT("LUCIDA"))
-        M_FONTDATA->m_family = wxDECORATIVE;
+        M_FONTDATA->m_family = wxFONTFAMILY_DECORATIVE;
     else if (M_FONTDATA->m_faceName == wxT("UTOPIA"))
-        M_FONTDATA->m_family = wxSCRIPT;
+        M_FONTDATA->m_family = wxFONTFAMILY_SCRIPT;
 
     tn.GetNextToken();                           // avg width
 
@@ -777,7 +777,7 @@ bool wxFont::GetNoAntiAliasing() const
 
 const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
 {
-    wxCHECK_MSG( Ok(), (wxNativeFontInfo *)NULL, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
 
 #if wxUSE_UNICODE
 #else
@@ -892,7 +892,7 @@ void wxFont::SetNoAntiAliasing( bool no )
 wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const
 {
     if ( !Ok() )
-        return (wxXFont *)NULL;
+        return NULL;
 
     long intScale = long(scale * 100.0 + 0.5); // key for wxXFont
     int pointSize = (M_FONTDATA->m_pointSize * 10 * intScale) / 100;
@@ -927,7 +927,7 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const
     {
         wxFAIL_MSG( wxT("Could not allocate even a default font -- something is wrong.") );
 
-        return (wxXFont*) NULL;
+        return NULL;
     }
 
     wxXFont* f = new wxXFont;