added wxFont::IsFixedWidth(), documented it and implemented for wxGTK/Motif

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-01-14 19:04:35 +00:00
parent f175912347
commit 53f6aab752
10 changed files with 133 additions and 12 deletions

View File

@@ -307,6 +307,11 @@ wxFont::~wxFont()
// accessors
// ----------------------------------------------------------------------------
bool wxFont::HasNativeFont() const
{
return !M_FONTDATA->m_nativeFontInfo.xFontName.empty();
}
int wxFont::GetPointSize() const
{
wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
@@ -367,6 +372,21 @@ wxNativeFontInfo *wxFont::GetNativeFontInfo() const
return new wxNativeFontInfo(M_FONTDATA->m_nativeFontInfo);
}
bool wxFont::IsFixedWidth() const
{
wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") );
if ( HasNativeFont() )
{
// the monospace fonts are supposed to have "M" in the spacing field
wxString spacing = M_FONTDATA->
m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING);
return spacing.Upper() == _T('M');
}
return wxFontBase::IsFixedWidth();
}
// ----------------------------------------------------------------------------
// change font attributes