From 6aa3f3de0cc3d0d3787739d354486d070cd778be Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 7 Apr 2010 22:07:02 +0000 Subject: [PATCH] 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 --- src/osx/carbon/utilscocoa.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/osx/carbon/utilscocoa.mm b/src/osx/carbon/utilscocoa.mm index c787a15a33..394b02b076 100644 --- a/src/osx/carbon/utilscocoa.mm +++ b/src/osx/carbon/utilscocoa.mm @@ -192,12 +192,16 @@ void wxNativeFontInfo::OSXValidateNSFontDescriptor() if (m_style == wxFONTSTYLE_ITALIC || m_style == wxFONTSTYLE_SLANT) traits |= NSFontItalicTrait; - + + NSDictionary* traitsdict = [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithUnsignedInt:traits], NSFontSymbolicTrait, + nil] ; + desc = [NSFontDescriptor fontDescriptorWithFontAttributes: [NSDictionary dictionaryWithObjectsAndKeys: wxCFStringRef(m_faceName).AsNSString(), NSFontFamilyAttribute, [NSNumber numberWithFloat:m_pointSize], NSFontSizeAttribute, - [NSNumber numberWithUnsignedInt:traits], NSFontSymbolicTrait, + traitsdict, NSFontTraitsAttribute, [NSNumber numberWithFloat:weight],NSFontWeightTrait, nil]];