X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/806f9e8330691d64966af62d35e6b3d88f30471e..3201a1046ba71ba8e5ef2ed694fde34d12f743f3:/src/html/htmprint.cpp?ds=inline diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp index cc804e27d3..e4dbbcfda7 100644 --- a/src/html/htmprint.cpp +++ b/src/html/htmprint.cpp @@ -33,6 +33,10 @@ #include "wx/wfstream.h" +// default font size of normal text (HTML font size 0) for printing, in points: +#define DEFAULT_PRINT_FONT_SIZE 12 + + //-------------------------------------------------------------------------------- // wxHtmlDCRenderer //-------------------------------------------------------------------------------- @@ -46,6 +50,7 @@ wxHtmlDCRenderer::wxHtmlDCRenderer() : wxObject() m_Parser = new wxHtmlWinParser(); m_FS = new wxFileSystem(); m_Parser->SetFS(m_FS); + SetStandardFonts(DEFAULT_PRINT_FONT_SIZE); } @@ -161,6 +166,7 @@ wxHtmlPrintout::wxHtmlPrintout(const wxString& title) : wxPrintout(title) m_Footers[0] = m_Footers[1] = wxEmptyString; m_HeaderHeight = m_FooterHeight = 0; SetMargins(); // to default values + SetStandardFonts(DEFAULT_PRINT_FONT_SIZE); } @@ -251,7 +257,7 @@ bool wxHtmlPrintout::OnBeginDocument(int startPage, int endPage) bool wxHtmlPrintout::OnPrintPage(int page) { wxDC *dc = GetDC(); - if (dc && dc->Ok()) + if (dc && dc->IsOk()) { if (HasPage(page)) RenderPage(dc, page); @@ -410,7 +416,7 @@ void wxHtmlPrintout::RenderPage(wxDC *dc, int page) m_Renderer->SetDC(dc, (double)ppiPrinterY / (double)ppiScreenY); - dc->SetBackgroundMode(wxTRANSPARENT); + dc->SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); m_Renderer->Render((int) (ppmm_h * m_MarginLeft), (int) (ppmm_v * (m_MarginTop + (m_HeaderHeight == 0 ? 0 : m_MarginSpace)) + m_HeaderHeight), m_PageBreaks, @@ -500,7 +506,7 @@ wxHtmlEasyPrinting::wxHtmlEasyPrinting(const wxString& name, wxWindow *parentWin m_PageSetupData->SetMarginTopLeft(wxPoint(25, 25)); m_PageSetupData->SetMarginBottomRight(wxPoint(25, 25)); - SetFonts(wxEmptyString, wxEmptyString, NULL); + SetStandardFonts(DEFAULT_PRINT_FONT_SIZE); }