Fix wxNativeFontInfo::InitFromFont() when using Pango
Use pango_font_description_copy() to make a lossless copy of the original font instead of doing it using wxWidgets API which is less direct and, in addition, currently is completely broken as SetXXX() methods don't create the Pango font description if it doesn't exist as they ought to. Closes https://github.com/wxWidgets/wxWidgets/pull/312
This commit is contained in:
committed by
Vadim Zeitlin
parent
b078e348b7
commit
dbe2a1c2fd
@@ -230,6 +230,9 @@ public:
|
||||
// init with the parameters of the given font
|
||||
void InitFromFont(const wxFont& font)
|
||||
{
|
||||
#if wxUSE_PANGO
|
||||
Init(*font.GetNativeFontInfo());
|
||||
#else
|
||||
// translate all font parameters
|
||||
SetStyle((wxFontStyle)font.GetStyle());
|
||||
SetWeight((wxFontWeight)font.GetWeight());
|
||||
@@ -255,6 +258,7 @@ public:
|
||||
// deal with encoding now (it may override the font family and facename
|
||||
// so do it after setting them)
|
||||
SetEncoding(font.GetEncoding());
|
||||
#endif // !wxUSE_PANGO
|
||||
}
|
||||
|
||||
// accessors and modifiers for the font elements
|
||||
|
Reference in New Issue
Block a user