]> git.saurik.com Git - wxWidgets.git/commitdiff
applied patch adding SetFonts to wxHTML printing classes and allowing NULL sizes...
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 16 Mar 2003 20:30:26 +0000 (20:30 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 16 Mar 2003 20:30:26 +0000 (20:30 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19587 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

13 files changed:
docs/changes.txt
docs/latex/wx/htdcrend.tex
docs/latex/wx/hteasypr.tex
docs/latex/wx/htprint.tex
docs/latex/wx/htwindow.tex
docs/latex/wx/htwinprs.tex
include/wx/html/htmldefs.h
include/wx/html/htmlwin.h
include/wx/html/htmprint.h
include/wx/html/winpars.h
samples/html/printing/printing.cpp
src/html/htmprint.cpp
src/html/winpars.cpp

index 206be7fd5d004c699d34b9a3068359987d1676a5..9fb30d760dc0124e48a12ad5ac429ab4862080b2 100644 (file)
@@ -106,7 +106,11 @@ wxMotif:
 
 wxUniv:
 
 
 wxUniv:
 
-- Controls in toolbars now supported.
+- controls in toolbars now supported
+
+wxHTML:
+
+- added SetFonts to HTML printing classes (Adrian Philip Look)
 
 
 OLD CHANGES
 
 
 OLD CHANGES
index f36de1860d462014e549c8eb85946481eccef89c..21b93dc62afe443ec5b9b5e7e61290631624caa3 100644 (file)
@@ -44,6 +44,13 @@ in pixels (you should set it to page width minus margins).
 the screen width is always 800 pixels: it gives best results and ensures (almost) same printed outputs
 across platforms and differently configured desktops.}
 
 the screen width is always 800 pixels: it gives best results and ensures (almost) same printed outputs
 across platforms and differently configured desktops.}
 
+\membersection{wxHtmlDCRenderer::SetFonts}\label{wxhtmldcrenderersetfonts}
+
+\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes = NULL}}
+
+Sets fonts. See \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts} for
+detailed description.
+
 See also \helpref{SetSize}{wxhtmldcrenderersetsize}.
 
 \membersection{wxHtmlDCRenderer::SetSize}\label{wxhtmldcrenderersetsize}
 See also \helpref{SetSize}{wxhtmldcrenderersetsize}.
 
 \membersection{wxHtmlDCRenderer::SetSize}\label{wxhtmldcrenderersetsize}
index 9a27dc6a962f6735a48675a1cb029224c1cb96fb..3f7b7e594979fc2fc84e11b59456464e491af646 100644 (file)
@@ -106,6 +106,13 @@ Display printer setup dialog and allows the user to modify settings.
 
 Display page setup dialog and allows the user to modify settings. 
 
 
 Display page setup dialog and allows the user to modify settings. 
 
+\membersection{wxHtmlEasyPrinting::SetFonts}\label{wxhtmleasyprintingsetfonts}
+
+\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes = NULL}}
+
+Sets fonts. See \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts} for
+detailed description.
+
 \membersection{wxHtmlEasyPrinting::SetHeader}\label{wxhtmleasyprintingsetheader}
 
 \func{void}{SetHeader}{\param{const wxString\& }{header}, \param{int }{pg = wxPAGE\_ALL}}
 \membersection{wxHtmlEasyPrinting::SetHeader}\label{wxhtmleasyprintingsetheader}
 
 \func{void}{SetHeader}{\param{const wxString\& }{header}, \param{int }{pg = wxPAGE\_ALL}}
index 7375979b4ab7fc23a322391dd67c6c3550e46830..a996c185ad108614a2b5488a1f1af8dd9d8d2469 100644 (file)
@@ -27,6 +27,12 @@ This class serves as printout class for HTML documents.
 Constructor. 
 
 
 Constructor. 
 
 
+\membersection{wxHtmlPrintout::SetFonts}\label{wxhtmlprintoutsetfonts}
+
+\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes = NULL}}
+
+Sets fonts. See \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts} for
+detailed description.
 
 \membersection{wxHtmlPrintout::SetFooter}\label{wxhtmlprintoutsetfooter}
 
 
 \membersection{wxHtmlPrintout::SetFooter}\label{wxhtmlprintoutsetfooter}
 
index 0d367e91cf990754db48e41bbbb3372b9268ae0a..a463306e3f722d242749f04a272f1e132cc55e94 100644 (file)
@@ -297,7 +297,7 @@ This function sets the space between border of window and HTML contents. See ima
 
 \membersection{wxHtmlWindow::SetFonts}\label{wxhtmlwindowsetfonts}
 
 
 \membersection{wxHtmlWindow::SetFonts}\label{wxhtmlwindowsetfonts}
 
-\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes}}
+\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes = NULL}}
 
 This function sets font sizes and faces.
 
 
 This function sets font sizes and faces.
 
@@ -312,24 +312,14 @@ platform-specific face name. Examples are "helvetica" under Unix or
 
 \docparam{sizes}{This is an array of 7 items of {\it int} type.
 The values represent size of font with HTML size from -2 to +4
 
 \docparam{sizes}{This is an array of 7 items of {\it int} type.
 The values represent size of font with HTML size from -2 to +4
-( <FONT SIZE=-2> to <FONT SIZE=+4> )}
+( <FONT SIZE=-2> to <FONT SIZE=+4> ). Default sizes are used if {\it sizes}
+is NULL.}
 
 \wxheading{Defaults}
 
 
 \wxheading{Defaults}
 
-Under wxGTK:
-
-\begin{verbatim}
-    SetFonts("", "", {10, 12, 14, 16, 19, 24, 32});
-\end{verbatim}
-
-Under Windows:
-
-\begin{verbatim}
-    SetFonts("", "", {7, 8, 10, 12, 16, 22, 30});
-\end{verbatim}
-
-Although it seems different the fact is that the fonts are of approximately
-same size under both platforms (due to wxMSW / wxGTK inconsistency)
+Default font sizes are defined by constants wxHTML\_FONT\_SIZE\_1,
+wxHTML\_FONT\_SIZE\_2, ..., wxHTML\_FONT\_SIZE\_7. Note that they differ among
+platforms. Default face names are empty strings.
 
 \membersection{wxHtmlWindow::SetPage}\label{wxhtmlwindowsetpage}
 
 
 \membersection{wxHtmlWindow::SetPage}\label{wxhtmlwindowsetpage}
 
index 2b63d822ea4d8a907b50236f008b7838b0f59e36..977428a5aed7bad426130449f91ed17e990c0c29 100644 (file)
@@ -269,9 +269,10 @@ Sets underlined flag of actualfont. {\it x} is either true of false.
 
 \membersection{wxHtmlWinParser::SetFonts}\label{wxhtmlwinparsersetfonts}
 
 
 \membersection{wxHtmlWinParser::SetFonts}\label{wxhtmlwinparsersetfonts}
 
-\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes}}
+\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes = NULL}}
 
 
-Sets fonts. This method is identical to \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts}
+Sets fonts. See \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts} for
+detailed description.
 
 \membersection{wxHtmlWinParser::SetInputEncoding}\label{wxhtmlwinparsersetinputencoding}
 
 
 \membersection{wxHtmlWinParser::SetInputEncoding}\label{wxhtmlwinparsersetinputencoding}
 
index f0c758d4337dfefbb67446433d7ebae8dd63a28c..28e30779fa53e018fb9fca3abb7708a66ae29d90 100644 (file)
 
 #define wxHTML_COND_ISANCHOR              1
         // Finds the anchor of 'param' name (pointer to wxString).
 
 #define wxHTML_COND_ISANCHOR              1
         // Finds the anchor of 'param' name (pointer to wxString).
-       
+    
 #define wxHTML_COND_ISIMAGEMAP            2
         // Finds imagemap of 'param' name (pointer to wxString).
 #define wxHTML_COND_ISIMAGEMAP            2
         // Finds imagemap of 'param' name (pointer to wxString).
-       // (used exclusively by m_image.cpp)
-       
+    // (used exclusively by m_image.cpp)
+    
 #define wxHTML_COND_USER              10000
         // User-defined conditions should start from this number
 
 #define wxHTML_COND_USER              10000
         // User-defined conditions should start from this number
 
     /* maximum number of pages printable via html printing */
 
 
     /* maximum number of pages printable via html printing */
 
 
-
-
-
-
+    /* default font sizes */
+#ifdef __WXMSW__
+   #define wxHTML_FONT_SIZE_1              7
+   #define wxHTML_FONT_SIZE_2              8
+   #define wxHTML_FONT_SIZE_3             10
+   #define wxHTML_FONT_SIZE_4             12
+   #define wxHTML_FONT_SIZE_5             16
+   #define wxHTML_FONT_SIZE_6             22
+   #define wxHTML_FONT_SIZE_7             30
+#elif defined(__WXMAC__)
+   #define wxHTML_FONT_SIZE_1              9
+   #define wxHTML_FONT_SIZE_2             12
+   #define wxHTML_FONT_SIZE_3             14
+   #define wxHTML_FONT_SIZE_4             18
+   #define wxHTML_FONT_SIZE_5             24
+   #define wxHTML_FONT_SIZE_6             30
+   #define wxHTML_FONT_SIZE_7             36
+#else
+   #define wxHTML_FONT_SIZE_1             10
+   #define wxHTML_FONT_SIZE_2             12
+   #define wxHTML_FONT_SIZE_3             14
+   #define wxHTML_FONT_SIZE_4             16
+   #define wxHTML_FONT_SIZE_5             19
+   #define wxHTML_FONT_SIZE_6             24
+   #define wxHTML_FONT_SIZE_7             32
+#endif
 
 
 #if WXWIN_COMPATIBILITY_2
 
 
 #if WXWIN_COMPATIBILITY_2
index f26cb3c7238564eeb549fdc9469f889a44dfef4d..91b415f9acdc31e19e2a8e38ffe60e05eaa2b6b5 100644 (file)
@@ -121,7 +121,8 @@ public:
     void SetRelatedStatusBar(int bar);
 
     // Sets fonts to be used when displaying HTML page.
     void SetRelatedStatusBar(int bar);
 
     // Sets fonts to be used when displaying HTML page.
-    void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes);
+    void SetFonts(wxString normal_face, wxString fixed_face,
+                  const int *sizes = NULL);
 
     // Sets space between text and window borders.
     void SetBorders(int b) {m_Borders = b;}
 
     // Sets space between text and window borders.
     void SetBorders(int b) {m_Borders = b;}
index 79f3528bb917dfcc97164db45cff9ec4cd0dffaf..e05d01d90378c6f90344b8c6b924f9d7a3a80bc7 100644 (file)
@@ -53,6 +53,9 @@ public:
     // (see wxFileSystem for detailed explanation)
     void SetHtmlText(const wxString& html, const wxString& basepath = wxEmptyString, bool isdir = TRUE);
 
     // (see wxFileSystem for detailed explanation)
     void SetHtmlText(const wxString& html, const wxString& basepath = wxEmptyString, bool isdir = TRUE);
 
+    // Sets fonts to be used when displaying HTML page. (if size null then default sizes used).
+    void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = NULL);
+
     // [x,y] is position of upper-left corner of printing rectangle (see SetSize)
     // from is y-coordinate of the very first visible cell 
     // Returned value is y coordinate of first cell than didn't fit onto page.
     // [x,y] is position of upper-left corner of printing rectangle (see SetSize)
     // from is y-coordinate of the very first visible cell 
     // Returned value is y coordinate of first cell than didn't fit onto page.
@@ -125,6 +128,9 @@ public:
             // pg is one of wxPAGE_ODD, wxPAGE_EVEN and wx_PAGE_ALL constants.
             // You can set different header/footer for odd and even pages
 
             // pg is one of wxPAGE_ODD, wxPAGE_EVEN and wx_PAGE_ALL constants.
             // You can set different header/footer for odd and even pages
 
+    // Sets fonts to be used when displaying HTML page. (if size null then default sizes used).
+    void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = NULL);
+
     void SetMargins(float top = 25.2, float bottom = 25.2, float left = 25.2, float right = 25.2, 
                     float spaces = 5);
             // sets margins in milimeters. Defaults to 1 inch for margins and 0.5cm for space
     void SetMargins(float top = 25.2, float bottom = 25.2, float left = 25.2, float right = 25.2, 
                     float spaces = 5);
             // sets margins in milimeters. Defaults to 1 inch for margins and 0.5cm for space
@@ -207,6 +213,9 @@ public:
             // pg is one of wxPAGE_ODD, wxPAGE_EVEN and wx_PAGE_ALL constants.
             // You can set different header/footer for odd and even pages
 
             // pg is one of wxPAGE_ODD, wxPAGE_EVEN and wx_PAGE_ALL constants.
             // You can set different header/footer for odd and even pages
 
+    void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = 0);
+    // Sets fonts to be used when displaying HTML page. (if size null then default sizes used)
+
     wxPrintData *GetPrintData() {return m_PrintData;}
     wxPageSetupDialogData *GetPageSetupData() {return m_PageSetupData;}
             // return page setting data objects. 
     wxPrintData *GetPrintData() {return m_PrintData;}
     wxPageSetupDialogData *GetPageSetupData() {return m_PageSetupData;}
             // return page setting data objects. 
@@ -221,6 +230,9 @@ private:
     wxPrintData *m_PrintData;
     wxPageSetupDialogData *m_PageSetupData;
     wxString m_Name;
     wxPrintData *m_PrintData;
     wxPageSetupDialogData *m_PageSetupData;
     wxString m_Name;
+    int m_FontsSizesArr[7];
+    int *m_FontsSizes;
+    wxString m_FontFaceFixed, m_FontFaceNormal;
     wxString m_Headers[2], m_Footers[2];
     wxFrame *m_Frame;
 
     wxString m_Headers[2], m_Footers[2];
     wxFrame *m_Frame;
 
index d2dd34023017be9edae097669177ff217ddc0ac7..196ae84d019af4cd3b0ae6e17cd66bbf472bb30f 100644 (file)
@@ -68,8 +68,8 @@ public:
     // returns associated wxWindow
     wxHtmlWindow *GetWindow() {return m_Window;}
 
     // returns associated wxWindow
     wxHtmlWindow *GetWindow() {return m_Window;}
 
-    // sets fonts to be used when displaying HTML page.
-    void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes);
+    // Sets fonts to be used when displaying HTML page. (if size null then default sizes used).
+    void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = NULL);
 
     // Adds tags module. see wxHtmlTagsModule for details.
     static void AddModule(wxHtmlTagsModule *module);
 
     // Adds tags module. see wxHtmlTagsModule for details.
     static void AddModule(wxHtmlTagsModule *module);
index a76b0714b06828f234797443f1b1e9026dc10529..f414cb56b2ba6b676c4456504d8ac522f507d499 100644 (file)
@@ -59,6 +59,10 @@ class MyFrame : public wxFrame
         void OnPreview(wxCommandEvent& event);
         void OnOpen(wxCommandEvent& event);
         
         void OnPreview(wxCommandEvent& event);
         void OnOpen(wxCommandEvent& event);
         
+        void OnPrintSmall(wxCommandEvent& event);
+        void OnPrintNormal(wxCommandEvent& event);
+        void OnPrintHuge(wxCommandEvent& event);
+
 
     private:
         wxHtmlWindow *m_Html;
 
     private:
         wxHtmlWindow *m_Html;
@@ -81,7 +85,10 @@ enum
     Minimal_Preview,
     Minimal_PageSetup,
     Minimal_PrintSetup,
     Minimal_Preview,
     Minimal_PageSetup,
     Minimal_PrintSetup,
-    Minimal_Open
+    Minimal_Open,
+    Minimal_PrintSmall,
+    Minimal_PrintNormal,
+    Minimal_PrintHuge
 
 };
 
 
 };
 
@@ -100,6 +107,9 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_MENU(Minimal_PageSetup, MyFrame::OnPageSetup)
     EVT_MENU(Minimal_PrintSetup, MyFrame::OnPrintSetup)
     EVT_MENU(Minimal_Open, MyFrame::OnOpen)
     EVT_MENU(Minimal_PageSetup, MyFrame::OnPageSetup)
     EVT_MENU(Minimal_PrintSetup, MyFrame::OnPrintSetup)
     EVT_MENU(Minimal_Open, MyFrame::OnOpen)
+    EVT_MENU(Minimal_PrintSmall, MyFrame::OnPrintSmall)
+    EVT_MENU(Minimal_PrintNormal, MyFrame::OnPrintNormal)
+    EVT_MENU(Minimal_PrintHuge, MyFrame::OnPrintHuge)
 END_EVENT_TABLE()
 
 // Create a new application object: this macro will allow wxWindows to create
 END_EVENT_TABLE()
 
 // Create a new application object: this macro will allow wxWindows to create
@@ -166,9 +176,15 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
     menuFile->AppendSeparator();
     menuFile->Append(Minimal_Quit, _("&Exit"));
 
     menuFile->AppendSeparator();
     menuFile->Append(Minimal_Quit, _("&Exit"));
 
+    wxMenu *testFile = new wxMenu;
+    testFile->Append(Minimal_PrintSmall, _("Small Printer Fonts"));
+    testFile->Append(Minimal_PrintNormal, _("Normal Printer Fonts"));
+    testFile->Append(Minimal_PrintHuge, _("Huge Printer Fonts"));
+    
     // now append the freshly created menu to the menu bar...
     wxMenuBar *menuBar = new wxMenuBar;
     menuBar->Append(menuFile, _("&File"));
     // now append the freshly created menu to the menu bar...
     wxMenuBar *menuBar = new wxMenuBar;
     menuBar->Append(menuFile, _("&File"));
+    menuBar->Append(testFile, _("&Test"));
 
     // ... and attach this menu bar to the frame
     SetMenuBar(menuBar);
 
     // ... and attach this menu bar to the frame
     SetMenuBar(menuBar);
@@ -183,6 +199,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
     
     m_Prn = new wxHtmlEasyPrinting(_("Easy Printing Demo"), this);
     m_Prn -> SetHeader(m_Name + wxT("(@PAGENUM@/@PAGESCNT@)<hr>"), wxPAGE_ALL);
     
     m_Prn = new wxHtmlEasyPrinting(_("Easy Printing Demo"), this);
     m_Prn -> SetHeader(m_Name + wxT("(@PAGENUM@/@PAGESCNT@)<hr>"), wxPAGE_ALL);
+
 }
 
 // frame destructor
 }
 
 // frame destructor
@@ -245,3 +262,19 @@ void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
 }
 
 
 }
 
 
+void MyFrame::OnPrintSmall(wxCommandEvent& WXUNUSED(event))
+{
+    int fontsizes[] = { 4, 6, 8, 10, 12, 20, 24 }; 
+    m_Prn->SetFonts(wxEmptyString, wxEmptyString, fontsizes);
+}
+
+void MyFrame::OnPrintNormal(wxCommandEvent& WXUNUSED(event))
+{
+    m_Prn->SetFonts(wxEmptyString, wxEmptyString, 0);
+}
+
+void MyFrame::OnPrintHuge(wxCommandEvent& WXUNUSED(event))
+{
+    int fontsizes[] = { 20, 26, 28, 30, 32, 40, 44 }; 
+    m_Prn->SetFonts(wxEmptyString, wxEmptyString, fontsizes);
+}
index a2dfa82097ab880c1735d8500d2e628584a1c0da..62ff13af35a256346ec6098082708f8b9224259b 100644 (file)
@@ -79,7 +79,6 @@ void wxHtmlDCRenderer::SetSize(int width, int height)
 }
 
 
 }
 
 
-
 void wxHtmlDCRenderer::SetHtmlText(const wxString& html, const wxString& basepath, bool isdir)
 {
     if (m_DC == NULL) return;
 void wxHtmlDCRenderer::SetHtmlText(const wxString& html, const wxString& basepath, bool isdir)
 {
     if (m_DC == NULL) return;
@@ -93,6 +92,13 @@ void wxHtmlDCRenderer::SetHtmlText(const wxString& html, const wxString& basepat
 }
 
 
 }
 
 
+void wxHtmlDCRenderer::SetFonts(wxString normal_face, wxString fixed_face,
+                                const int *sizes)
+{
+    m_Parser->SetFonts(normal_face, fixed_face, sizes);
+    if (m_DC == NULL && m_Cells != NULL) m_Cells->Layout(m_Width);
+}
+
 
 int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render)
 {
 
 int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render)
 {
@@ -408,11 +414,18 @@ void wxHtmlPrintout::SetMargins(float top, float bottom, float left, float right
 
 
 
 
 
 
+void wxHtmlPrintout::SetFonts(wxString normal_face, wxString fixed_face,
+                              const int *sizes)
+{
+    m_Renderer->SetFonts(normal_face, fixed_face, sizes);
+    m_RendererHdr->SetFonts(normal_face, fixed_face, sizes);
+}
 
 
 
 
-//--------------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
 // wxHtmlEasyPrinting
 // wxHtmlEasyPrinting
-//--------------------------------------------------------------------------------
+//----------------------------------------------------------------------------
 
 
 wxHtmlEasyPrinting::wxHtmlEasyPrinting(const wxString& name, wxFrame *parent_frame)
 
 
 wxHtmlEasyPrinting::wxHtmlEasyPrinting(const wxString& name, wxFrame *parent_frame)
@@ -426,6 +439,8 @@ wxHtmlEasyPrinting::wxHtmlEasyPrinting(const wxString& name, wxFrame *parent_fra
     m_PageSetupData->EnableMargins(TRUE);
     m_PageSetupData->SetMarginTopLeft(wxPoint(25, 25));
     m_PageSetupData->SetMarginBottomRight(wxPoint(25, 25));
     m_PageSetupData->EnableMargins(TRUE);
     m_PageSetupData->SetMarginTopLeft(wxPoint(25, 25));
     m_PageSetupData->SetMarginBottomRight(wxPoint(25, 25));
+
+    SetFonts(wxEmptyString, wxEmptyString, NULL);
 }
 
 
 }
 
 
@@ -572,11 +587,28 @@ void wxHtmlEasyPrinting::SetFooter(const wxString& footer, int pg)
 }
 
 
 }
 
 
+void wxHtmlEasyPrinting::SetFonts(wxString normal_face, wxString fixed_face,
+                                  const int *sizes)
+{
+    m_FontFaceNormal = normal_face;
+    m_FontFaceFixed = fixed_face;
+
+    if (sizes)
+    {
+        m_FontsSizes = m_FontsSizesArr;
+        for (int i = 0; i < 7; i++) m_FontsSizes[i] = sizes[i];
+    }
+    else
+        m_FontsSizes = NULL;
+}
+
 
 wxHtmlPrintout *wxHtmlEasyPrinting::CreatePrintout()
 {
     wxHtmlPrintout *p = new wxHtmlPrintout(m_Name);
 
 
 wxHtmlPrintout *wxHtmlEasyPrinting::CreatePrintout()
 {
     wxHtmlPrintout *p = new wxHtmlPrintout(m_Name);
 
+    p->SetFonts(m_FontFaceNormal, m_FontFaceFixed, m_FontsSizes);
+
     p->SetHeader(m_Headers[0], wxPAGE_EVEN);
     p->SetHeader(m_Headers[1], wxPAGE_ODD);
     p->SetFooter(m_Footers[0], wxPAGE_EVEN);
     p->SetHeader(m_Headers[0], wxPAGE_EVEN);
     p->SetHeader(m_Headers[1], wxPAGE_ODD);
     p->SetFooter(m_Footers[0], wxPAGE_EVEN);
index 1d4af2c3fccb87a7fbb71bbc491fa51ad3b7c69e..4a5de2de4d6f7858ca8517dfd1b903b02c934e87 100644 (file)
@@ -69,14 +69,8 @@ wxHtmlWinParser::wxHtmlWinParser(wxHtmlWindow *wnd) : wxHtmlParser()
                             m_FontsEncTable[i][j][k][l][m] = wxFONTENCODING_DEFAULT;
 #endif
                         }
                             m_FontsEncTable[i][j][k][l][m] = wxFONTENCODING_DEFAULT;
 #endif
                         }
-#ifdef __WXMSW__
-        static int default_sizes[7] = {7, 8, 10, 12, 16, 22, 30};
-#elif defined(__WXMAC__)
-        static int default_sizes[7] = {9, 12, 14, 18, 24, 30, 36};
-#else
-        static int default_sizes[7] = {10, 12, 14, 16, 19, 24, 32};
-#endif
-        SetFonts(wxT(""), wxT(""), default_sizes);
+
+        SetFonts(wxEmptyString, wxEmptyString, NULL);
     }
 
     // fill in wxHtmlParser's tables:
     }
 
     // fill in wxHtmlParser's tables:
@@ -118,8 +112,22 @@ void wxHtmlWinParser::RemoveModule(wxHtmlTagsModule *module)
     m_Modules.DeleteObject(module);
 }
 
     m_Modules.DeleteObject(module);
 }
 
-void wxHtmlWinParser::SetFonts(wxString normal_face, wxString fixed_face, const int *sizes)
+void wxHtmlWinParser::SetFonts(wxString normal_face, wxString fixed_face,
+                               const int *sizes)
 {
 {
+    static int default_sizes[7] =
+        {
+            wxHTML_FONT_SIZE_1,
+                       wxHTML_FONT_SIZE_2,
+                       wxHTML_FONT_SIZE_3,
+                       wxHTML_FONT_SIZE_4,
+                       wxHTML_FONT_SIZE_5,
+                       wxHTML_FONT_SIZE_6,
+                       wxHTML_FONT_SIZE_7
+        };
+    
+    if (sizes == NULL) sizes = default_sizes;
+
     int i, j, k, l, m;
 
     for (i = 0; i < 7; i++) m_FontsSizes[i] = sizes[i];
     int i, j, k, l, m;
 
     for (i = 0; i < 7; i++) m_FontsSizes[i] = sizes[i];