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:
@@ -450,11 +450,13 @@ wxString wxNativeFontInfo::ToUserString() const
|
||||
desc << _T(' ') << size;
|
||||
}
|
||||
|
||||
#if wxUSE_FONTMAP
|
||||
wxFontEncoding enc = GetEncoding();
|
||||
if ( enc != wxFONTENCODING_DEFAULT && enc != wxFONTENCODING_SYSTEM )
|
||||
{
|
||||
desc << _T(' ') << wxTheFontMapper->GetEncodingName(enc);
|
||||
}
|
||||
#endif // wxUSE_FONTMAP
|
||||
|
||||
return desc;
|
||||
}
|
||||
@@ -471,7 +473,10 @@ bool wxNativeFontInfo::FromUserString(const wxString& s)
|
||||
|
||||
wxString face;
|
||||
unsigned long size;
|
||||
|
||||
#if wxUSE_FONTMAP
|
||||
wxFontEncoding encoding;
|
||||
#endif // wxUSE_FONTMAP
|
||||
|
||||
while ( tokenizer.HasMoreTokens() )
|
||||
{
|
||||
@@ -501,11 +506,13 @@ bool wxNativeFontInfo::FromUserString(const wxString& s)
|
||||
{
|
||||
SetPointSize(size);
|
||||
}
|
||||
#if wxUSE_FONTMAP
|
||||
else if ( (encoding = wxTheFontMapper->CharsetToEncoding(token, FALSE))
|
||||
!= wxFONTENCODING_DEFAULT )
|
||||
{
|
||||
SetEncoding(encoding);
|
||||
}
|
||||
#endif // wxUSE_FONTMAP
|
||||
else // assume it is the face name
|
||||
{
|
||||
if ( !face.empty() )
|
||||
|
@@ -521,13 +521,9 @@ void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding)
|
||||
if ( !wxGetNativeFontEncoding(encoding, &info) )
|
||||
{
|
||||
#if wxUSE_FONTMAP
|
||||
if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) )
|
||||
#endif // wxUSE_FONTMAP
|
||||
if ( wxTheFontMapper->GetAltForEncoding(encoding, &info) )
|
||||
{
|
||||
// unsupported encoding, replace with the default
|
||||
info.charset = ANSI_CHARSET;
|
||||
}
|
||||
else if ( !info.facename.empty() )
|
||||
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
|
||||
@@ -535,6 +531,13 @@ void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding)
|
||||
SetFaceName(info.facename);
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif // wxUSE_FONTMAP
|
||||
{
|
||||
// unsupported encoding, replace with the default
|
||||
info.charset = ANSI_CHARSET;
|
||||
}
|
||||
}
|
||||
|
||||
lf.lfCharSet = info.charset;
|
||||
}
|
||||
|
Reference in New Issue
Block a user