Kaydet (Commit) 04a77bfa authored tarafından Khaled Hosny's avatar Khaled Hosny

Don’t return false for blank glyphs

CTFontCreatePathForGlyph() will return NULL for blank glyphs causing
CoreTextStyle::GetGlyphOutline() to return false which propagated as
error all the way to OutputDevice::GetTextOutlines() causing it to
needlessly enter into fallback code. Other implementations just return
true and an empty polygon here.

Change-Id: Ib20ebff00f7cb3aae22f1c6b4c3a0e9d7a429987
Reviewed-on: https://gerrit.libreoffice.org/31902Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKhaled Hosny <khaledhosny@eglug.org>
üst 385f6240
......@@ -231,6 +231,19 @@ bool CoreTextStyle::GetGlyphOutline(const GlyphItem& rGlyph, basegfx::B2DPolyPol
CGGlyph nCGGlyph = rGlyph.maGlyphId;
CTFontRef pCTFont = static_cast<CTFontRef>(CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName ));
SAL_WNODEPRECATED_DECLARATIONS_PUSH
const CTFontOrientation aFontOrientation = kCTFontDefaultOrientation;
SAL_WNODEPRECATED_DECLARATIONS_POP
CGRect aCGRect = CTFontGetBoundingRectsForGlyphs(pCTFont, aFontOrientation, &nCGGlyph, nullptr, 1);
if (!CGRectIsNull(aCGRect) && CGRectIsEmpty(aCGRect))
{
// CTFontCreatePathForGlyph returns NULL for blank glyphs, but we want
// to return true for them.
return true;
}
CGPathRef xPath = CTFontCreatePathForGlyph( pCTFont, nCGGlyph, nullptr );
if (!xPath)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment