[webkit-changes] [WebKit/WebKit] 18ad72: text-spacing: text-autospace: integrate ideogram-a...

Vitor Roriz noreply at github.com
Tue Aug 27 15:12:45 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 18ad7252511a13c7560f140806684ae789e60c7f
      https://github.com/WebKit/WebKit/commit/18ad7252511a13c7560f140806684ae789e60c7f
  Author: Vitor Roriz <vitor.roriz at apple.com>
  Date:   2024-08-27 (Tue, 27 Aug 2024)

  Changed paths:
    M Source/WebCore/platform/graphics/FontCascade.cpp
    M Source/WebCore/platform/graphics/GlyphBuffer.h
    M Source/WebCore/platform/graphics/WidthIterator.cpp

  Log Message:
  -----------
  text-spacing: text-autospace: integrate ideogram-alpha for Simple path (WidthIterator)
https://bugs.webkit.org/show_bug.cgi?id=278541
rdar://133319627

Reviewed by Brent Fulgham.

We have two paths for producing GlyphBuffer's required for layout and painting.
WidthIterator is taken for CodePath::Simple. ComplexTextController is taken for
CodePath::Complex. Up to now, we would switch to the complex path in the presence
of "text-autospace", since its processing is currently only covered by ComplexTextController.

After this patch we no longer need to switch to the CodePath::Complex path in the presence of
text-autospace. This change is analogous to the changes to ComplexTextController from [1].

The text-autospace specification [2] requires certain classes of characters to have an extra
spacing added in between them. Our approach is to add a leading spacing to the current
glyph's advance (which affects layout). We also move the current glyph's origin by the same
spacing amount such that the spacing is always added as a leading spacing.

For example, if two characters "水" and "e" are adjacent and the spec requuires an
extra spacing between them, we adjust the correspondent glyph's advance and origin
while processing "e" in relation to the previous character "水".

[1] https://commits.webkit.org/282511@main
[2] https://www.w3.org/TR/css-text-4/#text-autospace-property

* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::codePath const):
* Source/WebCore/platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::expandAdvanceToLogicalRight):
* Source/WebCore/platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::hasExtraSpacing const):
(WebCore::WidthIterator::applyExtraSpacingAfterShaping):

Canonical link: https://commits.webkit.org/282821@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list