Copy fonts more faithfully and efficiently in wxGTK
Use pango_font_description_copy() to copy fonts instead of
pango_font_description_to_string() and pango_font_description_from_string()
via wxNativeFontInfo::{To,From}String() respectively.
This is not only more efficient but also preserves the original family whereas
wxNativeFontInfo::FromString() helpfully replaces any fonts it doesn't know
about with the normal font name. That behaviour is probably wrong on its own,
but for now at least avoid silently changing fonts when copying them.
(cherry picked from commit 07380ba0b5
)
This commit is contained in:
committed by
Paul Cornett
parent
0f9f942a5b
commit
958515adc7
@@ -151,12 +151,9 @@ void wxFontRefData::InitFromNative()
|
||||
}
|
||||
|
||||
wxFontRefData::wxFontRefData( const wxFontRefData& data )
|
||||
: wxGDIRefData()
|
||||
: wxGDIRefData(),
|
||||
m_nativeFontInfo(data.m_nativeFontInfo)
|
||||
{
|
||||
// Forces a copy of the internal data. wxNativeFontInfo should probably
|
||||
// have a copy ctor and assignment operator to fix this properly but that
|
||||
// would break binary compatibility...
|
||||
m_nativeFontInfo.FromString(data.m_nativeFontInfo.ToString());
|
||||
}
|
||||
|
||||
wxFontRefData::wxFontRefData(int size, wxFontFamily family, wxFontStyle style,
|
||||
|
Reference in New Issue
Block a user