Issue metadata
Sign in to add a comment
|
When letter-spacing != 0 common ligatures should not be applied. |
||||||||||||||||||||||
Issue descriptionAn old informative report and live example available at http://unifraktur.sourceforge.net/testcases/letter-spacing_ligatures/ . There is also a test case at https://chromium.googlesource.com/chromium/src/+/7c6aeb96da8745b949f1a246a19e41f6d6772f4b/third_party/WebKit/LayoutTests/fast/text/font-ligature-letter-spacing-expected.txt having two FAIL expectations . When letter-spacing != 0, optional ligatures should not be applied. There is even a comment in the code at https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/fonts/font_description.cc?l=271&rcl=a47c1f87c8f9616b839db391ce2d6de586824ec3 about this. However, this code does not appear to be correct, in that it doesn't disable ligatures in the feature settings when letter-spacing == 0. Even if it did, this feature setting is currently ignored when setting the ligatures in SetFontFeatures. Attached is a minimal diff to illustrate a possible change. It isn't complete in light of similar issues like issue 893330 it may be desirable to fix this a different way.
,
Oct 19
After creating a partial fix at https://chromium-review.googlesource.com/c/chromium/src/+/1292436 to fix the above test for letter-spacing (still issues with @font-face font-feature-settings), it was discovered that https://chromium.googlesource.com/chromium/src/+/7c6aeb96da8745b949f1a246a19e41f6d6772f4b/third_party/WebKit/LayoutTests/fast/text/font-ligature-letter-spacing-expected.txt and the associated test are simply incorrect. The letter-spacing != 0 should only disable common ligatures ('liga' and 'clig'), not discretionary ligatures like 'dlig'. That test needs to be fixed as part of this.
,
Oct 21
Thanks Ben. Is the desired behavior here specified anywhere? I.e. should letter-spacing-induced disabling of ligatures take precedence over explicit font-variant-ligatures or font-feature-settings declarations? I can't find anything more recent than a discussion from 2013. https://lists.w3.org/Archives/Public/www-style/2013Jul/0691.html
,
Oct 21
,
Oct 22
I'm mostly going on https://www.w3.org/TR/css-fonts-3/#feature-precedence , which while updated a bit with css4 is essentially the same in this regard. A summary of those rules is stated in the test, default < @font-face < font-variant < letter-spacing < font-feature-settings Note that only 'common ligatures' are supposed to be disabled by 'letter-spacing != 0', which are 'liga' and 'clig'. Apparently this is not supposed to apply to other ligatures like 'dlig' or 'hlig', since it explicitly calls out 'common ligatures' and defines that to mean 'liga' and'clig'.
,
Oct 22
Thanks Ben. I'll try to make the requires changes on the Blink side post-TPAC.
,
Oct 28
The NextAction date has arrived: 2018-10-28
,
Oct 29
Note that I have asked directly about letter-spacing and 'hlig' and 'dlig' at https://github.com/w3c/csswg-drafts/issues/2644 (in a addition to discovering an issue with the Khmer shaping spec and HarfBuzz). Hopefully this situation can be considered soon. If you know someone to around the css-fonts-3 or -4 spec to ask about this it might help to prod them a bit. Seems like this should be fairly straight forward to give an up or down on.
,
Oct 29
Note that we're not the only ones who think that maybe 'hlig' and 'dlig' should be affected by letter-spacing... https://github.com/w3c/csswg-drafts/issues/2644#issuecomment-386950844 .
,
Dec 1
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/78d30d938d765e7f8ac811166630f164dcc6df5b commit 78d30d938d765e7f8ac811166630f164dcc6df5b Author: Ben Wagner <bungeman@chromium.org> Date: Sat Dec 01 18:39:11 2018 Fix ligature interaction with letter-spacing and text-rendering. This is a minimal change to cover most cases. In particular this does not take @font-face font-feature-settings into account, but does make letter-spacing with a non-default value disable optional ligatures for all cases except when enabled directly by font-feature-settings. It also makes optimizeSpeed force the default setting for optional ligatures to off. This avoids using or changing TypesettingFeatures, leaving blink::kLigatures to only affect the use of the word shaper. The use of the word shaper can be modified independently and will involve rebaselines and consideration of the performance impact (since common fonts like Arial, Times New Roman, and DejaVu Sans use spaces in GPOS or GSUB). Bug: chromium:896033 Change-Id: I764b1a7eed6d9f06ff8df31c4225dee2ea860684 Reviewed-on: https://chromium-review.googlesource.com/c/1292436 Commit-Queue: Ben Wagner <bungeman@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#612933} [modify] https://crrev.com/78d30d938d765e7f8ac811166630f164dcc6df5b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc [modify] https://crrev.com/78d30d938d765e7f8ac811166630f164dcc6df5b/third_party/blink/web_tests/fast/css/text-rendering.html [delete] https://crrev.com/7238fc338593650f478451609bf5fcb599a1ab3d/third_party/blink/web_tests/fast/text/font-ligature-letter-spacing-expected.txt [modify] https://crrev.com/78d30d938d765e7f8ac811166630f164dcc6df5b/third_party/blink/web_tests/fast/text/font-ligature-letter-spacing.html [modify] https://crrev.com/78d30d938d765e7f8ac811166630f164dcc6df5b/third_party/blink/web_tests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-rendering-expected.png [modify] https://crrev.com/78d30d938d765e7f8ac811166630f164dcc6df5b/third_party/blink/web_tests/platform/linux/fast/css/text-rendering-expected.png [delete] https://crrev.com/7238fc338593650f478451609bf5fcb599a1ab3d/third_party/blink/web_tests/platform/linux/fast/text/font-ligature-letter-spacing-expected.txt [modify] https://crrev.com/78d30d938d765e7f8ac811166630f164dcc6df5b/third_party/blink/web_tests/platform/mac/fast/css/text-rendering-expected.png [modify] https://crrev.com/78d30d938d765e7f8ac811166630f164dcc6df5b/third_party/blink/web_tests/platform/win/fast/css/text-rendering-expected.png
,
Dec 3
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by bugdroid1@chromium.org
, Oct 19