Changed wxHTML default font size for printing to be 12pt regardless
of the platform; this font shouldn't depend on toolkit's default GUI font (introduced in 2.8, now reverting to pre-2.8 correct behaviour). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53980 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -266,17 +266,15 @@ void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
void MyFrame::OnPrintSmall(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnPrintSmall(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
int fontsizes[] = { 4, 6, 8, 10, 12, 20, 24 };
|
m_Prn->SetStandardFonts(8);
|
||||||
m_Prn->SetFonts(wxEmptyString, wxEmptyString, fontsizes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnPrintNormal(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnPrintNormal(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
m_Prn->SetFonts(wxEmptyString, wxEmptyString, 0);
|
m_Prn->SetStandardFonts(12);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnPrintHuge(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnPrintHuge(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
int fontsizes[] = { 20, 26, 28, 30, 32, 40, 44 };
|
m_Prn->SetStandardFonts(28);
|
||||||
m_Prn->SetFonts(wxEmptyString, wxEmptyString, fontsizes);
|
|
||||||
}
|
}
|
||||||
|
@@ -33,6 +33,10 @@
|
|||||||
#include "wx/wfstream.h"
|
#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
|
// wxHtmlDCRenderer
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
@@ -46,6 +50,7 @@ wxHtmlDCRenderer::wxHtmlDCRenderer() : wxObject()
|
|||||||
m_Parser = new wxHtmlWinParser();
|
m_Parser = new wxHtmlWinParser();
|
||||||
m_FS = new wxFileSystem();
|
m_FS = new wxFileSystem();
|
||||||
m_Parser->SetFS(m_FS);
|
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_Footers[0] = m_Footers[1] = wxEmptyString;
|
||||||
m_HeaderHeight = m_FooterHeight = 0;
|
m_HeaderHeight = m_FooterHeight = 0;
|
||||||
SetMargins(); // to default values
|
SetMargins(); // to default values
|
||||||
|
SetStandardFonts(DEFAULT_PRINT_FONT_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -500,7 +506,7 @@ wxHtmlEasyPrinting::wxHtmlEasyPrinting(const wxString& name, wxWindow *parentWin
|
|||||||
m_PageSetupData->SetMarginTopLeft(wxPoint(25, 25));
|
m_PageSetupData->SetMarginTopLeft(wxPoint(25, 25));
|
||||||
m_PageSetupData->SetMarginBottomRight(wxPoint(25, 25));
|
m_PageSetupData->SetMarginBottomRight(wxPoint(25, 25));
|
||||||
|
|
||||||
SetFonts(wxEmptyString, wxEmptyString, NULL);
|
SetStandardFonts(DEFAULT_PRINT_FONT_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user