Added NormalizeFontSizes which will set the html font sizes based on

the size of a system font.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28649 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-08-05 23:59:44 +00:00
parent ebee3cd033
commit 7acd36259b
7 changed files with 120 additions and 1 deletions

View File

@@ -36,12 +36,12 @@
#include "wx/dataobj.h"
#include "wx/timer.h"
#include "wx/dcmemory.h"
#include "wx/settings.h"
#include "wx/arrimpl.cpp"
#include "wx/listimpl.cpp"
#if wxUSE_CLIPBOARD
// ----------------------------------------------------------------------------
// wxHtmlWinAutoScrollTimer: the timer used to generate a stream of scroll
@@ -249,6 +249,22 @@ void wxHtmlWindow::SetFonts(wxString normal_face, wxString fixed_face, const int
if (!op.IsEmpty()) LoadPage(op);
}
void wxHtmlWindow::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);
}
bool wxHtmlWindow::SetPage(const wxString& source)