From e7e52b6d2fa1021a0fcf1a507ed8742c71b0da50 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 30 Dec 2001 22:29:44 +0000 Subject: [PATCH] compilation fixes for !wxUSE_FONTMAP git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/fontcmn.cpp | 7 +++++++ src/msw/font.cpp | 19 +++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index bdc45ec3bc..94b9bab49b 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -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() ) diff --git a/src/msw/font.cpp b/src/msw/font.cpp index 27c2d4b905..1b166505b1 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -521,19 +521,22 @@ void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding) if ( !wxGetNativeFontEncoding(encoding, &info) ) { #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 { // unsupported encoding, replace with the default 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; -- 2.47.2