fixing NSFontDescriptor matching for font weights and styles, fixes #11910
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63908 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -192,12 +192,16 @@ void wxNativeFontInfo::OSXValidateNSFontDescriptor()
|
|||||||
|
|
||||||
if (m_style == wxFONTSTYLE_ITALIC || m_style == wxFONTSTYLE_SLANT)
|
if (m_style == wxFONTSTYLE_ITALIC || m_style == wxFONTSTYLE_SLANT)
|
||||||
traits |= NSFontItalicTrait;
|
traits |= NSFontItalicTrait;
|
||||||
|
|
||||||
|
NSDictionary* traitsdict = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
|
[NSNumber numberWithUnsignedInt:traits], NSFontSymbolicTrait,
|
||||||
|
nil] ;
|
||||||
|
|
||||||
desc = [NSFontDescriptor fontDescriptorWithFontAttributes:
|
desc = [NSFontDescriptor fontDescriptorWithFontAttributes:
|
||||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
wxCFStringRef(m_faceName).AsNSString(), NSFontFamilyAttribute,
|
wxCFStringRef(m_faceName).AsNSString(), NSFontFamilyAttribute,
|
||||||
[NSNumber numberWithFloat:m_pointSize], NSFontSizeAttribute,
|
[NSNumber numberWithFloat:m_pointSize], NSFontSizeAttribute,
|
||||||
[NSNumber numberWithUnsignedInt:traits], NSFontSymbolicTrait,
|
traitsdict, NSFontTraitsAttribute,
|
||||||
[NSNumber numberWithFloat:weight],NSFontWeightTrait,
|
[NSNumber numberWithFloat:weight],NSFontWeightTrait,
|
||||||
nil]];
|
nil]];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user