Title: [285009] trunk
Revision
285009
Author
mmaxfi...@apple.com
Date
2021-10-28 17:21:04 -0700 (Thu, 28 Oct 2021)

Log Message

The space glyph in the Filicudi font is not substituted by shaping in the complex text codepath, thereby breaking the visual effect of the font
https://bugs.webkit.org/show_bug.cgi?id=232293

Reviewed by Darin Adler.

.:

Big thanks to Ulrike Rausch and Frank Grießhammer for contributing the test font!!!

* metadata/contributors.json:

Source/WebCore:

Filicudi is a color font where the background of the glyphs is filled with a
repeating pattern of colored vertical stripes. Each glyph has multiple
alternates which change the phase of this repeating background pattern. The
font also has shaping rules to select the right alternate glyph based on the
previous glyph, so that the phases line up correctly and you get a nice
repeating pattern throughout the whole line of text.

You can see this in action here:
https://fonts.adobe.com/fonts/tipoteca-series#fonts-section

In the complex text codepath, though, after shaping, we were clobbering the
glyph used by the space character. We were overwriting it to be the glyph
that would have been used if there were no shaping. This means that the phase
of the repeating background for the space glyph was wrong, which broke the
visual effect of the repeating background on a full line of text.

The solution is to just stop clobbering the space glyph - but continue to
clobber the space width. If we stop clobbering the space glyph, then the
repeating background starts working again. We have to continue to clobber the
spaceWidth because different parts of webkit measure text in differently-sized
chunks. For example, computing the preferred widths measures word-by-word, but
painting - which requires measuring - measures the entire run. In order to have
these different strategies measure consistently, we have to clobber the widths
of all the space characters to set them consistently. These space width
adjustments are small - they're usually due to slight kerning of characters
like "T" around a space.

Clobbering one but not the other seems a bit scary, but I think in practice it
will actually be an improvement, because:
1) These glyphs we're dealing with here are almost always invisible, so
       clobbering / not clobbering won't have much effect
2) Because the width adjustments are usually small, the chance for a mismatch
       causing broken rendering is also small.

Long term, though, we'll stop clobbering space widths, too, because IFC will
help us be more deliberate about the chunks we measure text in. So, I think
this patch is both A) an improvement upon what we're shipping today, and
B) a step in the right future direction.

Test: fast/text/complex-space-glyph.html

* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):

LayoutTests:

Big thanks to Ulrike Rausch and Frank Grießhammer for contributing the test font!!!

* fast/text/complex-space-glyph-expected.html: Added.
* fast/text/complex-space-glyph.html: Added.
* fast/text/resources/Filicudi Dummy BSD2/FilicudiDummy-Barber.otf: Added.
* fast/text/resources/Filicudi Dummy BSD2/LICENSE.txt: Added.
* fast/text/resources/Filicudi Dummy BSD2/README.md: Added.
* fast/text/resources/Filicudi Dummy BSD2/color.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/ChangeLog (285008 => 285009)


--- trunk/ChangeLog	2021-10-29 00:04:43 UTC (rev 285008)
+++ trunk/ChangeLog	2021-10-29 00:21:04 UTC (rev 285009)
@@ -1,3 +1,14 @@
+2021-10-28  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        The space glyph in the Filicudi font is not substituted by shaping in the complex text codepath, thereby breaking the visual effect of the font
+        https://bugs.webkit.org/show_bug.cgi?id=232293
+
+        Reviewed by Darin Adler.
+
+        Big thanks to Ulrike Rausch and Frank Grießhammer for contributing the test font!!!
+
+        * metadata/contributors.json:
+
 2021-10-28  Aditya Keerthi  <akeer...@apple.com>
 
         Add Aditya Keerthi as a reviewer

Modified: trunk/LayoutTests/ChangeLog (285008 => 285009)


--- trunk/LayoutTests/ChangeLog	2021-10-29 00:04:43 UTC (rev 285008)
+++ trunk/LayoutTests/ChangeLog	2021-10-29 00:21:04 UTC (rev 285009)
@@ -1,3 +1,19 @@
+2021-10-28  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        The space glyph in the Filicudi font is not substituted by shaping in the complex text codepath, thereby breaking the visual effect of the font
+        https://bugs.webkit.org/show_bug.cgi?id=232293
+
+        Reviewed by Darin Adler.
+
+        Big thanks to Ulrike Rausch and Frank Grießhammer for contributing the test font!!!
+
+        * fast/text/complex-space-glyph-expected.html: Added.
+        * fast/text/complex-space-glyph.html: Added.
+        * fast/text/resources/Filicudi Dummy BSD2/FilicudiDummy-Barber.otf: Added.
+        * fast/text/resources/Filicudi Dummy BSD2/LICENSE.txt: Added.
+        * fast/text/resources/Filicudi Dummy BSD2/README.md: Added.
+        * fast/text/resources/Filicudi Dummy BSD2/color.html: Added.
+
 2021-10-28  Ayumi Kojima  <ayumi_koj...@apple.com>
 
         [ BigSur wk1 ] webgl/1.0.3/conformance/uniforms/uniform-default-values.html is flaky timing out.

Added: trunk/LayoutTests/fast/text/complex-space-glyph-expected.html (0 => 285009)


--- trunk/LayoutTests/fast/text/complex-space-glyph-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/complex-space-glyph-expected.html	2021-10-29 00:21:04 UTC (rev 285009)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: FilicudiDummy-Barber;
+    src:url("resources/Filicudi Dummy BSD2/FilicudiDummy-Barber.otf") format("opentype");
+}
+</style>
+</head>
+<body>
+This test makes sure that GSUB can affect the rendered space glyph. This is a font which has
+multiple alternates of the space glyph. The test passes if the correct alternate is used.
+You can see this visually if the vertical lines consistently alternate between red and blue.
+<div style="font: 4em 'FilicudiDummy-Barber';">H H</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/complex-space-glyph.html (0 => 285009)


--- trunk/LayoutTests/fast/text/complex-space-glyph.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/complex-space-glyph.html	2021-10-29 00:21:04 UTC (rev 285009)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: FilicudiDummy-Barber;
+    src:url("resources/Filicudi Dummy BSD2/FilicudiDummy-Barber.otf") format("opentype");
+}
+</style>
+</head>
+<body>
+This test makes sure that GSUB can affect the rendered space glyph. This is a font which has
+multiple alternates of the space glyph. The test passes if the correct alternate is used.
+You can see this visually if the vertical lines consistently alternate between red and blue.
+<div style="font: 4em 'FilicudiDummy-Barber'; font-feature-settings: 'ABCD';">H H</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/resources/Filicudi Dummy BSD2/FilicudiDummy-Barber.otf (0 => 285009)


--- trunk/LayoutTests/fast/text/resources/Filicudi Dummy BSD2/FilicudiDummy-Barber.otf	                        (rev 0)
+++ trunk/LayoutTests/fast/text/resources/Filicudi Dummy BSD2/FilicudiDummy-Barber.otf	2021-10-29 00:21:04 UTC (rev 285009)
@@ -0,0 +1,126 @@
+OTTO\x80@CFF {\xA3M\xC1LDSIG!\xE0GSUBW\xC3Wo\\xAEOS/2Q\xBET\x890`SVG \x809Q\xBC+\xA2cmap\xB1\x92h\xC2head`i\xB5\xCC6hhea\xFA&$hmtxq\xE0!\xB0.maxpP(nameq\xED\xA9\xDF\x90\xD5post\xFF\xB82, \x89:\xC1\xD2u_<\xF5Aݟ\xA1+ݟ\x84\xF2
+\xFF\xEE\xEE\xFF
+À€
+À€
+Po\xBC\xF3>\xF3#28ADBE \xA0\xEE\xFF\xB6\xFA ,.Zn	xs	*\xEB		>#	*\xEB	Xa	(\xB9	
+\xE1		\xEB	2	,7	Hc	\xAB	\xC7FilicudiRegular1.006;ADBE;FilicudiDummy-BarberVersion 1.006;hotconv 1.1.0;makeotfexe 2.6.0FilicudiDummy-BarberDummyCopyright \xA9 2019-2021 by Ulrike Rausch. All rights reserved.Filicudi Color BarberRegular1.006;ADBE;FilicudiDummy-BarberVersion 1.006;hotconv 1.1.0;makeotfexe 2.6.0FilicudiDummy-BarberAdobeUlrike Rauschhttp://www.adobe.com/typehttps://liebefonts.comhttp://w €wÀ€wÀ€.À€aÀ€dÀ€oÀ€bÀ€eÀ€.À€cÀ€oÀ€mÀ€/À€tÀ€yÀ€pÀ€eÀ€/À€lÀ€eÀ€gÀ€aÀ€lÀ€.À€hÀ€tÀ€mÀ€lÀ€FÀ€iÀ€lÀ€iÀ€cÀ€uÀ€dÀ€iÀ€ À€CÀ€oÀ€lÀ€oÀ€rÀ€BÀ€aÀ€rÀ€bÀ€eÀ€rÀ€À€À€À€À€À€À€À€À€À€À€"À€À€À€À€À€À€À€À€À€À€"À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€
 \xA0
+ Zz\xA0\xFF\xFF Aa\xA0\xFF\xFF\xFF\xE1\xFFa:\xFF\xB52FilicudiDummy-Barber/\xF8$\xF8%\xF8&\xA0 \x8F\x8B\x8B\xA0 \x8F\x8B\x8B\x95\xFB\x8E\xF8\x94\xF9\x82\xF7\x96\xA5\xF8\xE7\xF7\xA0"/<HT\dg\x99\xA1notdef.color1space.color1H.color1notdef.layer0notdef.layer1space.layer0space.layer1H.layer0H.layer11.0Copyright 2019 Ulrike Rausch. All rights reserved.Filicudi)\x87	+k\xBE\xCE\xD7\xFD+.
+0
+/
+.
+0
+/
+5
+\xD9,
+x\x9E\x9E?
+\xA0x`\xF8\x9C^\x9E\xF7ze\xF7.2
+\xFBz\xB1\xD9%
+\xFBzA\x9E\xFC\x9C\x8E6
+\xF7\xD4\x9Ee/=\xFB<
+\xF7.\xF7>e?{\xB1?\xFB
+i=
+Û‡>
+\xFB.\xFB\xDD3
+9
+ϱn\xA8ٱ٨n\xB1j\xF5\xF9\x822
+\xFBz\xB1\xF7\xF7z 
+\xFB\xFBk7
+\x90\xFB\xF7&\xFC\xA4:
+\x82nQ\xFB\x8D\xAC\xA8Q\xFB\xF7%8
+\xFB.\xFCQ3
+\x82\xF7#
++
+\x95\xB1Ù±)
+\xF7\xFE|'
++
+ϱ\xCF*
+\x94+
+\x95,
+ٱٱ\x95*
+\xF7.1
+\xFBz\xB1\xD9%
+\xFB|\xFE|4
+\xFB|#
+\x94\xF8\x9C\xF7z\xCF,
+Ù±\xF5\xF9\x821
+\xFC7\xB1\xF7\xF87 
+\xFB\xA2\xFD\x96$
+\xF7\xFCW4
+\xFB\xF0#
+\x84\x92\xF8\x9C\x92\xF7
+\xB1\xF7\xB1+\xF7B\xF8\x95\xA5 "*18?CHLRW&\xAD\xC9\xD8\xE1\xE8\xF1\xF8!%08BLV_e\xFBz\xB1\xC5\xF7z 
+\xC5#
+\xFB\x8E\xB1\xF7\x8Ee\xB1\xF8We\xFD\x96\xB1\xFA|e\xB1\xF7\x8Ee\xB1\xFA|ee\xFC7\xB1\x95*
+\xFB\x8E'
+-
+\xB1ٱٱ\xFB\x8E\xFA|5
+\x9F\xB1n\xA8\x9F\xB1\x9F\xB1\x9F\xB1\x9F\xA8n\xB1\x9F\xB1x\x9E\x92\x90?
+\xA0À€x`À€\xF8\x9CPÀ€\x9E\xF7zeHÀ€\xEB 
+BÀ€!
+AÀ€!
+@\x80!
+@ !
+@\x9F%
+\xFBz@\x9E\xFC\x9C\x826
+\x81À€\xB3?7
+\x84\x80\xD9\xF7)\x9Ee/\xFB9\xD1\xFC\x88@:
+\x80 nQ\xFB\x8D\x82@\xA8Q\xFB9\xF7><
+\x80\x80\xF7.\xF7>e?{\xB1?\x81À€?\xBA8
+\x82\x80\xA1^>
+\xFB
+\xD2=
+\x88À€+\xFC(&
+\x82À€"
+\x81À€"
+\x80\x80"
+\x80 "
+\x94;
+\x95\xB1\x9F\xB1\x9F\xB1\x9F\xB1\x9F\xB1\x9F\xB1\x9F\xB1\x9F\xB1\x9F\xB1\xAA\xA0)
+\x90À€\xEBePÀ€\xFBz\xB1HÀ€!
+DÀ€\xC5\xF7z(
+BÀ€\xC5\xF87(
+AÀ€\xC5\xF87(
+@\x80\xC5\xF87 
+@@!
+\x84 \x9F%
+\xFB\xB6\xFE|$
+\x82À€\xC5\xFCW$
+\x81À€\xC5\xFCW$
+\x80\x80\xC5\xFCW&
+\x90@"
+\xFB\xF0#
+\x88À€"
+-
+\x95\xB1\x9F\xB1\x9F\xB1\xD0)
+\xF0\xC5\xFE|'
+\xD0\xC5\xFE|'
+ 
+\xF7\xF7z(
+\xF7\xF87e 
+\xF7\xF7ze&
+\xF7#
+$
+\xF7\xFCW&
+9
+\x95\x9Ex\xB1x\xFBV\xF8mey\xB1A\x9D\xAF\xF7e\xFB\x9Dg\x89yg\xFB*\xB1\xF7* ;
+\xA8\xC4\xF7\x8F\xF7s\xC4-
+\xFBz\xF7z\xA3e\xD6\xFBAgFg\xB1\xF7\x89\x8F\xFB\xB1\xAD\x95\xFB\x8E\xB1\xF7\x8E
+4fDFLTlatn\xFF\xFF\xFF\xFFaaltaalt calt&calt,* 
+Jf\xB0#\xD3\x9E
+qf\xD7#\xFA\x9E<svg xmlns="http://www.w3.org/2000/svg" id="glyph0" viewBox="0 833 833 833"><g fill="#1408F7"><path d="M10.0 1083.0L48.0 1083.0L48.0 833.0L29.0 833.0L29.0 313.0L48.0 313.0L48.0 83.0L10.0 83.0ZM164.0 83.0L126.0 83.0L126.0 313.0L164.0 313.0ZM280.0 83.0L242.0 83.0L242.0 313.0L280.0 313.0ZM358.0 1083.0L396.0 1083.0L396.0 83.0L358.0 83.0L358.0 313.0L377.0 313.0L377.0 833.0L358.0 833.0ZM164.0 360.0L126.0 360.0L126.0 378.0L164.0 452.0ZM280.0 379.0L280.0 360.0L242.0 360.0L242.0 452.0ZM164.0 577.0L164.0 553.0L126.0 478.0L126.0 651.0ZM280.0 481.0L242.0 557.0L242.0 573.0L280.0 649.0ZM162.0 683.0L126.0 752.0L126.0 788.0L164.0 788.0L164.0 679.0ZM244.0 683.0L242.0 679.0L242.0 788.0L280.0 788.0L280.0 754.0ZM126.0 1083.0L164.0 1083.0L164.0 833.0L126.0 833.0ZM242.0 1083.0L280.0 1083.0L280.0 833.0L242.0 833.0Z"/></g><g fill="#FF0712"><path d="M106.0 83.
 0L68.0 83.0L68
 .0 313.0L106.0 313.0ZM222.0 83.0L184.0 83.0L184.0 313.0L222.0 313.0ZM338.0 83.0L300.0 83.0L300.0 313.0L338.0 313.0ZM204.0 528.0L222.0 492.0L222.0 360.0L184.0 360.0L184.0 492.0L202.0 528.0ZM77.0 382.0L77.0 747.0L106.0 690.0L106.0 439.0ZM329.0 382.0L300.0 440.0L300.0 689.0L329.0 747.0ZM204.0 602.0L202.0 602.0L184.0 638.0L184.0 788.0L222.0 788.0L222.0 638.0ZM68.0 1083.0L106.0 1083.0L106.0 833.0L68.0 833.0ZM184.0 1083.0L222.0 1083.0L222.0 833.0L184.0 833.0ZM300.0 1083.0L338.0 1083.0L338.0 833.0L300.0 833.0Z"/></g></svg><svg xmlns="http://www.w3.org/2000/svg" id="glyph1" viewBox="0 833 833 833"><g fill="#1408F7"><path d="M10.0 1083.0L48.0 1083.0L48.0 83.0L10.0 83.0ZM126.0 1083.0L164.0 1083.0L164.0 83.0L126.0 83.0Z"/></g><g fill="#FF0712"><path d="M68.0 1083.0L106.0 1083.0L106.0 83.0L68.0 83.0Z"/></g></svg><svg xmlns="http://www.w3.org/2000/svg&
 quot; id="glyph2" viewBox="0 833 833 833"><g fill="#1408F7"><path d="M10.0 1083.0L48.0 1083.0L48.0 83.0L10.0 83.0ZM164.0 83.0L126.0 83.0L126.0 313.0L164.0 313.0ZM280.0 83.0L242.0 83.0L242.0 502.0L280.0 502.0ZM396.0 83.0L358.0 83.0L358.0 313.0L396.0 313.0ZM474.0 1083.0L512.0 1083.0L512.0 83.0L474.0 83.0ZM242.0 1083.0L280.0 1083.0L280.0 632.0L242.0 632.0ZM358.0 1083.0L396.0 1083.0L396.0 833.0L358.0 833.0ZM126.0 1083.0L164.0 1083.0L164.0 833.0L126.0 833.0Z"/></g><g fill="#FF0712"><path d="M106.0 83.0L68.0 83.0L68.0 313.0L106.0 313.0ZM222.0 83.0L184.0 83.0L184.0 502.0L222.0 502.0ZM338.0 83.0L300.0 83.0L300.0 502.0L338.0 502.0ZM454.0 83.0L416.0 83.0L416.0 313.0L454.0 313.0ZM184.0 1083.0L222.0 1083.0L222.0 632.0L184.0 632.0ZM300.0 1083.0L338.0 1083.0L338.0 632.0L300.0 632.0ZM416.0 1083.0L454.0 1083.0L454.0 833.0L416.0 833.0ZM68.0 1083.0L106.0 1083.0L106.0 833.0L68.0 833.0Z"/></g></svg>
 <svg xmlns="http://www.w3.org/2000/svg" id="glyph3" viewBox="0 833 833 833"><g fill="#FF0712"><path d="M10.0 1083.0L48.0 1083.0L48.0 833.0L29.0 833.0L29.0 313.0L48.0 313.0L48.0 83.0L10.0 83.0ZM164.0 83.0L126.0 83.0L126.0 313.0L164.0 313.0ZM280.0 83.0L242.0 83.0L242.0 313.0L280.0 313.0ZM358.0 1083.0L396.0 1083.0L396.0 83.0L358.0 83.0L358.0 313.0L377.0 313.0L377.0 833.0L358.0 833.0ZM164.0 360.0L126.0 360.0L126.0 378.0L164.0 452.0ZM280.0 379.0L280.0 360.0L242.0 360.0L242.0 452.0ZM164.0 577.0L164.0 553.0L126.0 478.0L126.0 651.0ZM280.0 481.0L242.0 557.0L242.0 573.0L280.0 649.0ZM162.0 683.0L126.0 752.0L126.0 788.0L164.0 788.0L164.0 679.0ZM244.0 683.0L242.0 679.0L242.0 788.0L280.0 788.0L280.0 754.0ZM126.0 1083.0L164.0 1083.0L164.0 833.0L126.0 833.0ZM242.0 1083.0L280.0 1083.0L280.0 833.0L242.0 833.0Z"/></g><g fill="#1408F7"><path d="M106.0 83.0L68.0 83.0L68.0 313.0L106.0 313.0ZM222.0 83.0L184.0
  83.0L184.0 313.0L222.0 313.0ZM338.0 83.0L300.0 83.0L300.0 313.0L338.0 313.0ZM204.0 528.0L222.0 492.0L222.0 360.0L184.0 360.0L184.0 492.0L202.0 528.0ZM77.0 382.0L77.0 747.0L106.0 690.0L106.0 439.0ZM329.0 382.0L300.0 440.0L300.0 689.0L329.0 747.0ZM204.0 602.0L202.0 602.0L184.0 638.0L184.0 788.0L222.0 788.0L222.0 638.0ZM68.0 1083.0L106.0 1083.0L106.0 833.0L68.0 833.0ZM184.0 1083.0L222.0 1083.0L222.0 833.0L184.0 833.0ZM300.0 1083.0L338.0 1083.0L338.0 833.0L300.0 833.0Z"/></g></svg><svg xmlns="http://www.w3.org/2000/svg" id="glyph4" viewBox="0 833 833 833"><g fill="#FF0712"><path d="M10.0 1083.0L48.0 1083.0L48.0 83.0L10.0 83.0ZM126.0 1083.0L164.0 1083.0L164.0 83.0L126.0 83.0Z"/></g><g fill="#1408F7"><path d="M68.0 1083.0L106.0 1083.0L106.0 83.0L68.0 83.0Z"/></g></svg><svg xmlns="http://www.w3.org/2000/svg" id="glyph5" viewBox=&q
 uot;0 833 833 833"><g fill="#FF0712"><path d="M10.0 1083.0L48.0 1083.0L48.0 83.0L10.0 83.0ZM164.0 83.0L126.0 83.0L126.0 313.0L164.0 313.0ZM280.0 83.0L242.0 83.0L242.0 502.0L280.0 502.0ZM396.0 83.0L358.0 83.0L358.0 313.0L396.0 313.0ZM474.0 1083.0L512.0 1083.0L512.0 83.0L474.0 83.0ZM242.0 1083.0L280.0 1083.0L280.0 632.0L242.0 632.0ZM358.0 1083.0L396.0 1083.0L396.0 833.0L358.0 833.0ZM126.0 1083.0L164.0 1083.0L164.0 833.0L126.0 833.0Z"/></g><g fill="#1408F7"><path d="M106.0 83.0L68.0 83.0L68.0 313.0L106.0 313.0ZM222.0 83.0L184.0 83.0L184.0 502.0L222.0 502.0ZM338.0 83.0L300.0 83.0L300.0 502.0L338.0 502.0ZM454.0 83.0L416.0 83.0L416.0 313.0L454.0 313.0ZM184.0 1083.0L222.0 1083.0L222.0 632.0L184.0 632.0ZM300.0 1083.0L338.0 1083.0L338.0 632.0L300.0 632.0ZM416.0 1083.0L454.0 1083.0L454.0 833.0L416.0 833.0ZM68.0 1083.0L106.0 1083.0L106.0 833.0L68.0 833.0Z"/></g></svg>\x96
+À€\xAEÀ€
+
+À€
+\x96À€
+À€\xAEÀ€
+
+À€
+\x96À€
+\x96À€CÀ€\xAEÀ€
+À€\xAEÀ€C
+À€
+C
\ No newline at end of file

Added: trunk/LayoutTests/fast/text/resources/Filicudi Dummy BSD2/LICENSE.txt (0 => 285009)


--- trunk/LayoutTests/fast/text/resources/Filicudi Dummy BSD2/LICENSE.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/text/resources/Filicudi Dummy BSD2/LICENSE.txt	2021-10-29 00:21:04 UTC (rev 285009)
@@ -0,0 +1,9 @@
+Copyright 2021 Ulrike Rausch
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file

Added: trunk/LayoutTests/fast/text/resources/Filicudi Dummy BSD2/README.md (0 => 285009)


--- trunk/LayoutTests/fast/text/resources/Filicudi Dummy BSD2/README.md	                        (rev 0)
+++ trunk/LayoutTests/fast/text/resources/Filicudi Dummy BSD2/README.md	2021-10-29 00:21:04 UTC (rev 285009)
@@ -0,0 +1,14 @@
+# Filicudi Color Dummy
+
+This project is a subset of [Filicudi Color](https://fonts.adobe.com/fonts/tipoteca-series).
+
+The principle of Filicudi Color is applying an even color pattern across a line of text, no matter how wide the individual letters may be.
+To achieve this, contextual alternates are used. In the most simple case, two colors alternate with each other.
+
+This subset includes the glyphs .notdef, space, H (each in two color alternates), to illustrate a particular issue encountered in Safari:
+
+- contextual alternates work as expected when no CSS is invoked
+- contextual alternate assignment breaks with the space glyph when CSS is used via `font-feature-settings: "calt"`
+
+
+This project was prepared by Frank Grießhammer (fgrie...@adobe.com) and is provided under a BSD-2-Clause license.
\ No newline at end of file

Added: trunk/LayoutTests/fast/text/resources/Filicudi Dummy BSD2/color.html (0 => 285009)


--- trunk/LayoutTests/fast/text/resources/Filicudi Dummy BSD2/color.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/resources/Filicudi Dummy BSD2/color.html	2021-10-29 00:21:04 UTC (rev 285009)
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html contenteditable="True">
+<head>
+<style type="text/css">
+
+@font-face {
+    font-family: FilicudiDummy-Barber;
+    src:url('FilicudiDummy-Barber.otf') format('opentype');
+}
+
+body {
+    height: 100%;
+    font-size: 100%;
+    /*font-size: 6em;*/
+    padding: 1em;
+    margin: 0px;
+}
+
+.code {
+    font-size: 1em;
+    font-family: 'SourceCodePro-Regular', 'Courier';
+}
+
+.example {
+    font-size: 4em;
+    /*letter-spacing: 5px;   /* For FF*/
+    margin: 0;
+    font-family: 'FilicudiDummy-Barber', 'Courier New';
+}
+
+
+
+</style>
+
+</head>
+<body>
+
+<p class="code">font-variant-ligatures: contextual; -moz-font-feature-settings: "calt";  -webkit-font-feature-settings: "calt"; font-feature-settings: "calt";</p>
+<p class="example" style='font-variant-ligatures: contextual; -moz-font-feature-settings: "calt";  -webkit-font-feature-settings: "calt"; font-feature-settings: "calt";'; >test test test test test test</p>
+<hr>
+
+<p class="code";>-moz-font-feature-settings: "calt";  -webkit-font-feature-settings: "calt"; font-feature-settings: "calt";</p>
+<p class="example" style='-moz-font-feature-settings: "calt";  -webkit-font-feature-settings: "calt"; font-feature-settings: "calt"'; >test test test test test test</p>
+<hr>
+
+<p class="code">font-variant-ligatures: contextual;</p>
+<p class="example", style='font-variant-ligatures: contextual;'; >test test test test test test</p>
+<hr>
+
+<p class="code">font-variant: contextual-alt-values;</p>
+<p class="example", style='font-variant: contextual-alt-values'; >test test test test test test</p>
+<hr>
+
+<p class="code">everything off</p>
+<p class="example">test test test test test test</p>
+<hr>
+
+</body>
+</html>
+
+
+
+    

Modified: trunk/Source/WebCore/ChangeLog (285008 => 285009)


--- trunk/Source/WebCore/ChangeLog	2021-10-29 00:04:43 UTC (rev 285008)
+++ trunk/Source/WebCore/ChangeLog	2021-10-29 00:21:04 UTC (rev 285009)
@@ -1,3 +1,54 @@
+2021-10-28  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        The space glyph in the Filicudi font is not substituted by shaping in the complex text codepath, thereby breaking the visual effect of the font
+        https://bugs.webkit.org/show_bug.cgi?id=232293
+
+        Reviewed by Darin Adler.
+
+        Filicudi is a color font where the background of the glyphs is filled with a
+        repeating pattern of colored vertical stripes. Each glyph has multiple
+        alternates which change the phase of this repeating background pattern. The
+        font also has shaping rules to select the right alternate glyph based on the
+        previous glyph, so that the phases line up correctly and you get a nice
+        repeating pattern throughout the whole line of text.
+
+        You can see this in action here:
+        https://fonts.adobe.com/fonts/tipoteca-series#fonts-section
+
+        In the complex text codepath, though, after shaping, we were clobbering the
+        glyph used by the space character. We were overwriting it to be the glyph
+        that would have been used if there were no shaping. This means that the phase
+        of the repeating background for the space glyph was wrong, which broke the
+        visual effect of the repeating background on a full line of text.
+
+        The solution is to just stop clobbering the space glyph - but continue to
+        clobber the space width. If we stop clobbering the space glyph, then the
+        repeating background starts working again. We have to continue to clobber the
+        spaceWidth because different parts of webkit measure text in differently-sized
+        chunks. For example, computing the preferred widths measures word-by-word, but
+        painting - which requires measuring - measures the entire run. In order to have
+        these different strategies measure consistently, we have to clobber the widths
+        of all the space characters to set them consistently. These space width
+        adjustments are small - they're usually due to slight kerning of characters
+        like "T" around a space.
+
+        Clobbering one but not the other seems a bit scary, but I think in practice it
+        will actually be an improvement, because:
+        1) These glyphs we're dealing with here are almost always invisible, so
+               clobbering / not clobbering won't have much effect
+        2) Because the width adjustments are usually small, the chance for a mismatch
+               causing broken rendering is also small.
+
+        Long term, though, we'll stop clobbering space widths, too, because IFC will
+        help us be more deliberate about the chunks we measure text in. So, I think
+        this patch is both A) an improvement upon what we're shipping today, and
+        B) a step in the right future direction.
+
+        Test: fast/text/complex-space-glyph.html
+
+        * platform/graphics/ComplexTextController.cpp:
+        (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+
 2021-10-28  Sihui Liu  <sihui_...@apple.com>
 
         Release FileSystemStorageHandle when it is not in use

Modified: trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp (285008 => 285009)


--- trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp	2021-10-29 00:04:43 UTC (rev 285008)
+++ trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp	2021-10-29 00:21:04 UTC (rev 285009)
@@ -711,7 +711,7 @@
             UChar ch = *(cp + characterIndex);
 
             bool treatAsSpace = FontCascade::treatAsSpace(ch);
-            CGGlyph glyph = treatAsSpace ? font.spaceGlyph() : glyphs[i];
+            CGGlyph glyph = glyphs[i];
             FloatSize advance = treatAsSpace ? FloatSize(spaceWidth, advances[i].height()) : advances[i];
 
             if (ch == '\t' && m_run.allowTabs())

Modified: trunk/metadata/contributors.json (285008 => 285009)


--- trunk/metadata/contributors.json	2021-10-29 00:04:43 UTC (rev 285008)
+++ trunk/metadata/contributors.json	2021-10-29 00:21:04 UTC (rev 285009)
@@ -2439,6 +2439,12 @@
    },
    {
       "emails" : [
+         "fgrie...@adobe.com"
+      ],
+      "name" : "Frank Grie\u00dfhammer"
+   },
+   {
+      "emails" : [
          "fred.w...@free.fr",
          "fw...@igalia.com"
       ],
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to