diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-04-03 23:28:13 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-04-03 23:38:14 +0300 |
commit | 0ea4a012400343b7105f108b47bb6e3df38d2558 (patch) | |
tree | 0edc4fb9625189fde51e3a1fa429639821bc7a7b /vcl | |
parent | e0d38b6656ee348690f5495e72067f4ac2ed49da (diff) |
It's the font *style* we are looking at here
So no point in checking font *family* names like "arial" or
"times". Actually, I doubt this whole block of heuristics is
necessary.
Change-Id: I6965c27a7c4bed53db0e7ddaa40b1d09ccc4ad43
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/coretext/salcoretextfontutils.cxx | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/vcl/coretext/salcoretextfontutils.cxx b/vcl/coretext/salcoretextfontutils.cxx index eef05c30059c..15db6fb4812c 100644 --- a/vcl/coretext/salcoretextfontutils.cxx +++ b/vcl/coretext/salcoretextfontutils.cxx @@ -166,44 +166,40 @@ static bool GetDevFontAttributes( CTFontDescriptorRef font_descriptor, ImplDevFo } CFStringRef string_ref = (CFStringRef)CTFontDescriptorCopyAttribute(font_descriptor, kCTFontStyleNameAttribute); - rtl::OUString font_name = GetOUString(string_ref); - rtl::OUString font_name_lc(font_name.toAsciiLowerCase()); + rtl::OUString style(GetOUString(string_ref).toAsciiLowerCase()); CFRelease(string_ref); // heuristics to adjust font slant - if( (font_name_lc.indexOf("oblique") != -1) || - (font_name_lc.indexOf("inclined") != -1) || - (font_name_lc.indexOf("slanted") != -1) ) + if( (style.indexOf("oblique") != -1) || + (style.indexOf("inclined") != -1) || + (style.indexOf("slanted") != -1) ) { rDFA.SetItalic( ITALIC_OBLIQUE ); } // heuristics to adjust font width - if (font_name_lc.indexOf("narrow") != -1) + if (style.indexOf("narrow") != -1) { rDFA.SetWidthType( WIDTH_SEMI_CONDENSED ); } // heuristics for font family type - if( (font_name_lc.indexOf("script") != -1) || - (font_name_lc.indexOf("chancery") != -1) || - (font_name_lc.indexOf("zapfino") != -1)) + if( (style.indexOf("script") != -1) || + (style.indexOf("chancery") != -1) ) { rDFA.SetFamilyType( FAMILY_SCRIPT ); } - else if( (font_name_lc.indexOf("comic") != -1) || - (font_name_lc.indexOf("outline") != -1) || - (font_name_lc.indexOf("pinpoint") != -1) ) + else if( (style.indexOf("comic") != -1) || + (style.indexOf("outline") != -1) || + (style.indexOf("pinpoint") != -1) ) { rDFA.SetFamilyType( FAMILY_DECORATIVE ); } - else if( (font_name_lc.indexOf("sans") != -1) || - (font_name_lc.indexOf("arial") != -1) ) + else if( (style.indexOf("sans") != -1) ) { rDFA.SetFamilyType( FAMILY_SWISS ); } - else if( (font_name_lc.indexOf("roman") != -1) || - (font_name_lc.indexOf("times") != -1) ) + else if( (style.indexOf("roman") != -1) ) { rDFA.SetFamilyType( FAMILY_ROMAN ); } |