]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/winpars.cpp
todos, cleanups, detabified
[wxWidgets.git] / src / html / winpars.cpp
index df118d282321f06bc7e56f619f5f076f4a50876c..087c236a0713da22eab13d699854227d7ffbc0f7 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Vaclav Slavik
 // RCS-ID:      $Id$
 // Copyright:   (c) 1999 Vaclav Slavik
-// Licence:     wxWindows Licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 
@@ -154,6 +154,30 @@ void wxHtmlWinParser::SetFonts(wxString normal_face, wxString fixed_face,
                     }
 }
 
+void wxHtmlWinParser::SetStandardFonts(int size,
+                                       const wxString& normal_face,
+                                       const wxString& fixed_face)
+{
+    wxFont defaultFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
+    
+    int f_sizes[7];
+    if (size == -1)
+        size = defaultFont.GetPointSize();
+
+    f_sizes[0] = int(size * 0.6);
+    f_sizes[1] = int(size * 0.8);
+    f_sizes[2] = size;
+    f_sizes[3] = int(size * 1.2);
+    f_sizes[4] = int(size * 1.4);
+    f_sizes[5] = int(size * 1.6);
+    f_sizes[6] = int(size * 1.8);
+
+    wxString normal = normal_face.empty() ? 
+                      defaultFont.GetFaceName() : normal_face;
+    
+    SetFonts(normal, fixed_face, f_sizes);
+}
+
 void wxHtmlWinParser::InitParser(const wxString& source)
 {
     wxHtmlParser::InitParser(source);
@@ -450,7 +474,6 @@ void wxHtmlWinParser::SetInputEncoding(wxFontEncoding enc)
     wxFontEncoding altfix, altnorm;
     bool availfix, availnorm;
 
-#ifndef __WXMAC__
     // exact match?
     availnorm = wxFontMapper::Get()->IsEncodingAvailable(enc, m_FontFaceNormal);
     availfix = wxFontMapper::Get()->IsEncodingAvailable(enc, m_FontFaceFixed);
@@ -469,13 +492,15 @@ void wxHtmlWinParser::SetInputEncoding(wxFontEncoding enc)
     else if (wxFontMapper::Get()->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, FALSE))
         m_OutputEnc = altnorm;
 
-    // okay, let convert to ISO_8859-1, available always
     else
+    {
+#ifndef __WXMAC__
+        // okay, let convert to ISO_8859-1, available always
         m_OutputEnc = wxFONTENCODING_DEFAULT;
 #else
-    // we only have the current system encoding
-    m_OutputEnc = wxFONTENCODING_MACROMAN;
+        m_OutputEnc = wxLocale::GetSystemEncoding() ;
 #endif
+    }
 
     m_InputEnc = enc;
     if (m_OutputEnc == wxFONTENCODING_DEFAULT)