]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmprint.cpp
invalidate best size cache when GTK style changes
[wxWidgets.git] / src / html / htmprint.cpp
index ccf8ca40a9876ad021b3de3b72ca4b7e971d2be5..800ca10d6632b7014a5e681228c0641786335c4a 100644 (file)
@@ -5,7 +5,7 @@
 // Created:     25/09/99
 // RCS-ID:      $Id$
 // Copyright:   (c) Vaclav Slavik, 1999
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 
@@ -37,6 +37,7 @@
 #include "wx/wxhtml.h"
 #include "wx/wfstream.h"
 #include "wx/module.h"
+#include "wx/settings.h"
 
 
 //--------------------------------------------------------------------------------
@@ -101,6 +102,24 @@ void wxHtmlDCRenderer::SetFonts(wxString normal_face, wxString fixed_face,
 }
 
 
+void wxHtmlDCRenderer::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);
+}
+
+
 int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render, int to, int *known_pagebreaks, int number_of_pages)
 {
     int pbreak, hght;
@@ -447,6 +466,24 @@ void wxHtmlPrintout::SetFonts(wxString normal_face, wxString fixed_face,
 }
 
 
+void wxHtmlPrintout::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);
+}
+
+
 
 //----------------------------------------------------------------------------
 // wxHtmlEasyPrinting
@@ -634,6 +671,23 @@ void wxHtmlEasyPrinting::SetFonts(wxString normal_face, wxString fixed_face,
         m_FontsSizes = NULL;
 }
 
+void wxHtmlEasyPrinting::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);
+}
+
 
 wxHtmlPrintout *wxHtmlEasyPrinting::CreatePrintout()
 {