compilation fixes for !wxUSE_FONTMAP

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-12-30 22:29:44 +00:00
parent a5d46b7362
commit e7e52b6d2f
2 changed files with 18 additions and 8 deletions

View File

@@ -450,11 +450,13 @@ wxString wxNativeFontInfo::ToUserString() const
desc << _T(' ') << size; desc << _T(' ') << size;
} }
#if wxUSE_FONTMAP
wxFontEncoding enc = GetEncoding(); wxFontEncoding enc = GetEncoding();
if ( enc != wxFONTENCODING_DEFAULT && enc != wxFONTENCODING_SYSTEM ) if ( enc != wxFONTENCODING_DEFAULT && enc != wxFONTENCODING_SYSTEM )
{ {
desc << _T(' ') << wxTheFontMapper->GetEncodingName(enc); desc << _T(' ') << wxTheFontMapper->GetEncodingName(enc);
} }
#endif // wxUSE_FONTMAP
return desc; return desc;
} }
@@ -471,7 +473,10 @@ bool wxNativeFontInfo::FromUserString(const wxString& s)
wxString face; wxString face;
unsigned long size; unsigned long size;
#if wxUSE_FONTMAP
wxFontEncoding encoding; wxFontEncoding encoding;
#endif // wxUSE_FONTMAP
while ( tokenizer.HasMoreTokens() ) while ( tokenizer.HasMoreTokens() )
{ {
@@ -501,11 +506,13 @@ bool wxNativeFontInfo::FromUserString(const wxString& s)
{ {
SetPointSize(size); SetPointSize(size);
} }
#if wxUSE_FONTMAP
else if ( (encoding = wxTheFontMapper->CharsetToEncoding(token, FALSE)) else if ( (encoding = wxTheFontMapper->CharsetToEncoding(token, FALSE))
!= wxFONTENCODING_DEFAULT ) != wxFONTENCODING_DEFAULT )
{ {
SetEncoding(encoding); SetEncoding(encoding);
} }
#endif // wxUSE_FONTMAP
else // assume it is the face name else // assume it is the face name
{ {
if ( !face.empty() ) if ( !face.empty() )

View File

@@ -521,19 +521,22 @@ void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding)
if ( !wxGetNativeFontEncoding(encoding, &info) ) if ( !wxGetNativeFontEncoding(encoding, &info) )
{ {
#if wxUSE_FONTMAP #if wxUSE_FONTMAP
if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) ) if ( wxTheFontMapper->GetAltForEncoding(encoding, &info) )
{
if ( !info.facename.empty() )
{
// if we have this encoding only in some particular facename, use
// the facename - it is better to show the correct characters in a
// wrong facename than unreadable text in a correct one
SetFaceName(info.facename);
}
}
else
#endif // wxUSE_FONTMAP #endif // wxUSE_FONTMAP
{ {
// unsupported encoding, replace with the default // unsupported encoding, replace with the default
info.charset = ANSI_CHARSET; info.charset = ANSI_CHARSET;
} }
else if ( !info.facename.empty() )
{
// if we have this encoding only in some particular facename, use
// the facename - it is better to show the correct characters in a
// wrong facename than unreadable text in a correct one
SetFaceName(info.facename);
}
} }
lf.lfCharSet = info.charset; lf.lfCharSet = info.charset;