X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eb6a4098a0f2e9ae55e72ad960b3dfc134d177c9..ff6871ef3d4453660dfa9f178b8d7d2a5cd8ee0e:/src/html/winpars.cpp diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index 2e6fb654e7..77769c411f 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -4,7 +4,7 @@ // Author: Vaclav Slavik // RCS-ID: $Id$ // Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows Licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -31,12 +31,14 @@ #include "wx/html/htmlwin.h" #include "wx/fontmap.h" #include "wx/log.h" +#include "wx/settings.h" //----------------------------------------------------------------------------- // wxHtmlWinParser //----------------------------------------------------------------------------- +IMPLEMENT_ABSTRACT_CLASS(wxHtmlWinParser, wxHtmlParser) wxList wxHtmlWinParser::m_Modules; @@ -152,6 +154,23 @@ void wxHtmlWinParser::SetFonts(wxString normal_face, wxString fixed_face, } } +void wxHtmlWinParser::NormalizeFontSizes(int size) +{ + int f_sizes[7]; + if (size == -1) + size = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).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); + + SetFonts(wxEmptyString, wxEmptyString, f_sizes); +} + void wxHtmlWinParser::InitParser(const wxString& source) { wxHtmlParser::InitParser(source); @@ -187,8 +206,11 @@ void wxHtmlWinParser::InitParser(const wxString& source) #endif m_Container->InsertCell(new wxHtmlColourCell(m_ActualColor)); + wxColour windowColour = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW) ; m_Container->InsertCell( - new wxHtmlColourCell(GetWindow()->GetBackgroundColour(), + new wxHtmlColourCell(GetWindow() ? + GetWindow()->GetBackgroundColour() : + windowColour, wxHTML_CLR_BACKGROUND)); m_Container->InsertCell(new wxHtmlFontCell(CreateCurrentFont())); } @@ -463,9 +485,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 + m_OutputEnc = wxLocale::GetSystemEncoding() ; +#endif + } m_InputEnc = enc; if (m_OutputEnc == wxFONTENCODING_DEFAULT)