[Webkit-unassigned] [Bug 219177] zero boundingRect pointer in Font::platformBoundsForGlyph() to CTFontGetBoundingRectsForGlyphs()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 15 13:02:20 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=219177

--- Comment #5 from Darin Adler <darin at apple.com> ---
Comment on attachment 417721
  --> https://bugs.webkit.org/attachment.cgi?id=417721
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417721&action=review

> Source/WebCore/platform/graphics/coretext/FontCoreText.cpp:703
> +    CGRect zeroRect = { };
> +    boundingBox = CTFontGetBoundingRectsForGlyphs(m_platformData.ctFont(), platformData().orientation() == FontOrientation::Vertical ? kCTFontOrientationVertical : kCTFontOrientationHorizontal, &glyph, &zeroRect, 1);

After more research I now realize this is an *out* argument from CTFontGetBoundingRectsForGlyphs. So it must not be named "emptyRect" or "zeroRect", since it will get a value and will not be empty or zero! Instead we should pass nullptr. The CTFontGetBoundingRectsForGlyphs documentation for this arguments says "Can be NULL, in which case only the overall bounding rect is calculated." I suggest we use nullptr.

> Source/WebCore/platform/graphics/coretext/FontCoreText.cpp:748
> +        CGRect zeroRect = { };
> +        if (!CGRectIsEmpty(CTFontGetBoundingRectsForGlyphs(platformFont, kCTFontOrientationDefault, &lowercaseAGlyph, &zeroRect, 1)))

Ditto.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210115/182c66b6/attachment-0001.htm>


More information about the webkit-unassigned mailing list