use wxFontMapper when setting the encoding (fix to restore the behaviour broken by the native font info change)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -37,10 +37,11 @@
|
|||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#endif // WX_PRECOMP
|
#endif // WX_PRECOMP
|
||||||
|
|
||||||
#include "wx/fontutil.h"
|
|
||||||
#include "wx/tokenzr.h"
|
|
||||||
|
|
||||||
#include "wx/msw/private.h"
|
#include "wx/msw/private.h"
|
||||||
|
|
||||||
|
#include "wx/fontutil.h"
|
||||||
|
#include "wx/fontmap.h"
|
||||||
|
|
||||||
#include "wx/tokenzr.h"
|
#include "wx/tokenzr.h"
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
|
||||||
@@ -462,10 +463,22 @@ void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding)
|
|||||||
{
|
{
|
||||||
wxNativeEncodingInfo info;
|
wxNativeEncodingInfo info;
|
||||||
if ( !wxGetNativeFontEncoding(encoding, &info) )
|
if ( !wxGetNativeFontEncoding(encoding, &info) )
|
||||||
|
{
|
||||||
|
#if wxUSE_FONTMAP
|
||||||
|
if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) )
|
||||||
|
#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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user