diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2016-10-25 02:25:08 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2016-10-25 23:37:48 +0200 |
commit | 48304cb5b4d8df71463837e2e48aa7c4d9594df9 (patch) | |
tree | b2c8c8c09e482ec799e08b07c26911727cf26a63 /vcl/quartz | |
parent | 50cbc6fbe8fd107d69d2897755021265af463386 (diff) |
Skip font formats not supported by CommonSalLayout
Don’t list fonts we can’t handle, bad things would happen…
Change-Id: Ic88486e34da69090deb3e8c394cb75a8e4e5cbd0
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index ac17abcc02b1..948bfb5141c6 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -341,6 +341,20 @@ FontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool* bFont // get font attributes CFDictionaryRef pAttrDict = static_cast<CFDictionaryRef>(CTFontDescriptorCopyAttribute( pFD, kCTFontTraitsAttribute )); + if (bFontEnabled && *bFontEnabled && SalLayout::UseCommonLayout()) + { + // Ignore font formats not supported by CommonSalLayout. + int nFormat; + CFNumberRef pFormat = static_cast<CFNumberRef>(CTFontDescriptorCopyAttribute(pFD, kCTFontFormatAttribute)); + CFNumberGetValue(pFormat, kCFNumberIntType, &nFormat); + if (nFormat == kCTFontFormatUnrecognized || nFormat == kCTFontFormatPostScript || nFormat == kCTFontFormatBitmap) + { + SAL_INFO("vcl.fonts", "Ignoring font with unsupported format: " << rDFA.GetFamilyName()); + *bFontEnabled = false; + } + CFRelease(pFormat); + } + // get symbolic trait // TODO: use other traits such as MonoSpace/Condensed/Expanded or Vertical too SInt64 nSymbolTrait = 0; |