#endif
// used as title for several dialog boxes
-static const wxChar SAMPLE_TITLE[] = _T("wxWidgets Font Sample");
+static const wxChar SAMPLE_TITLE[] = wxT("wxWidgets Font Sample");
// ----------------------------------------------------------------------------
// private classes
{
m_fontSize = wxNORMAL_FONT->GetPointSize();
- SetIcon(wxIcon(sample_xpm));
+ SetIcon(wxICON(sample));
// create a menu bar
wxMenu *menuFile = new wxMenu;
// set background
dc.SetBackground(wxBrush(wxT("white"), wxSOLID));
dc.Clear();
+ dc.SetFont(m_font);
// one text line height
wxCoord hLine = dc.GetCharHeight();
dc.DrawText(fontInfo, x, y);
y += hLine;
- fontInfo.Printf(wxT("Size: %d points, encoding: %s"),
+ fontInfo.Printf(wxT("Size: %d points or %d pixels; %d*%d average char size"),
m_font.GetPointSize(),
- wxFontMapper::
- GetEncodingDescription(m_font.GetEncoding()).c_str());
+ m_font.GetPixelSize().y,
+ dc.GetCharWidth(), dc.GetCharHeight());
dc.DrawText(fontInfo, x, y);
y += hLine;
- fontInfo.Printf(wxT("Style: %s, weight: %s, fixed width: %s"),
+ fontInfo.Printf(wxT("Style: %s, weight: %s, fixed width: %s, encoding: %s"),
m_font.GetStyleString().c_str(),
m_font.GetWeightString().c_str(),
- m_font.IsFixedWidth() ? _T("yes") : _T("no"));
+ m_font.IsFixedWidth() ? wxT("yes") : wxT("no"),
+ wxFontMapper::GetEncodingDescription(m_font.GetEncoding()));
dc.DrawText(fontInfo, x, y);
y += hLine;
y += hLine;
// prepare to draw the font
- dc.SetFont(m_font);
dc.SetTextForeground(m_colour);
// the size of one cell (Normally biggest char + small margin)
}
// draw the lines between them
- dc.SetPen(wxPen(wxColour(_T("blue")), 1, wxSOLID));
+ dc.SetPen(wxPen(wxColour(wxT("blue")), 1, wxSOLID));
int l;
// horizontal