Bug 235437 - Word stretching is not applied to justified Tamil text when large gaps appear between words.
Summary: Word stretching is not applied to justified Tamil text when large gaps appear...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 15
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-21 07:02 PST by r12a
Modified: 2022-01-28 07:02 PST (History)
6 users (show)

See Also:


Attachments
ToT screenshot (724.36 KB, image/png)
2022-01-21 07:34 PST, zalan
no flags Details
ToT screenshot 2 (948.62 KB, image/png)
2022-01-21 07:37 PST, zalan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description r12a 2022-01-21 07:02:01 PST
Tamil words can be quite long, which can cause problems for justified text, especially in narrow columns, because large gaps can appear between words, or at the end of a line if only one word fits on that line. To mitigate this, especially in the absence of hyphenation, lines that are justified in Tamil should automatically stretch words to fit in the following cases.

When only one word fits on a line, that word should be stretched to fit the whole line.

Where a small number of words appears on a line, the words on that line may also be stretched, so as to reduce the inter-word spacing.

However, a distinctive feature of Tamil is that the adjustments applied should equally expand the space between all unconnected, spacing glyphs (including the space between various vowel-signs and their base), rather than solely putting space around syllables, grapheme clusters or even code points.

For examples and additional explanations see https://w3c.github.io/iip/gap-analysis/taml-gap#issue80_justification




interactive test, With CSS set to text-align:justify; text-justify:auto, when large gaps appear between justified words in Tamil the browser will automatically reduce the gaps by stretching words on the affected line.
https://github.com/w3c/line_paragraph_tests/issues/35
    Gecko: ❌ Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:94.0) Gecko/20100101 Firefox/94.0
    Blink: ❌ Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36
    Webkit: ❌ Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15

interactive test, With CSS set to text-align:justify; text-justify:auto, when a narrow column means that only one Tamil word fits on a line, the word will be stretched to fit the whole width of the column
https://github.com/w3c/line_paragraph_tests/issues/36
    Gecko: ❌ Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:94.0) Gecko/20100101 Firefox/94.0
    Blink: ❌ Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36
    Webkit: ❌ Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15

interactive test, When inter-character spacing is applied to Tamil, equal space is added between all unligated spacing glyphs, including between the glyphs forming vowel-signs and their base characters, but ligated glyphs and non-spacing combining characters are not separated from the base.
https://github.com/w3c/line_paragraph_tests/issues/36
    Gecko: ✅❌ Inter-character spacing is applied, but inter-glyph spacing is not. Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:96.0) Gecko/20100101 Firefox/96.0
    Blink: ❌ No inter-character spacing is applied. Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
    Webkit: ❌ No inter-character spacing is applied. Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Safari/605.1.15
Comment 1 zalan 2022-01-21 07:34:00 PST
Created attachment 449652 [details]
ToT screenshot

At least one of the tests passes on ToT (with IFC enabled for complex font codepath)
Comment 2 zalan 2022-01-21 07:37:30 PST
Created attachment 449654 [details]
ToT screenshot 2

This seems to be passing on ToT too.
Comment 3 zalan 2022-01-21 07:40:56 PST
These may all be fixed on trunk but it's hard to tell without actual test cases attached to the bug report (especially issues/35 where I am not sure if I managed to follow the "Adjust the box width to create a situation which would have wide spaces unless filled by inter-character stretching." instructions properly.)
Comment 4 r12a 2022-01-21 07:55:15 PST
@zalan, there is no word stretching going on in the snaps you provided, so the snaps show the problem, rather than showing that the text passes.  Notice the large empty gaps between words on both snaps, and notice how in the snap with a single word on the line that word isn't stretched to fill the line.
Comment 5 zalan 2022-01-21 08:58:15 PST
(In reply to r12a from comment #4)
> @zalan, there is no word stretching going on in the snaps you provided, so
> the snaps show the problem, rather than showing that the text passes. 
> Notice the large empty gaps between words on both snaps, and notice how in
> the snap with a single word on the line that word isn't stretched to fill
> the line.
Could you provide screenshots of the correct rendering, please?
Comment 6 r12a 2022-01-21 09:03:18 PST
@zalan, there are pictures of the expected behaviour if you follow the link i added above.  (The examples are from real life, and are not word for word identical with the text in the tests.)  Are you asking me to photoshop screen snaps of the tests to approximate the expected result?  Isn't it clear enough from the description?
Comment 7 r12a 2022-01-21 09:04:30 PST
See also this link: https://r12a.github.io/scripts/tamil/index.html#justification
Comment 8 Radar WebKit Bug Importer 2022-01-28 07:02:25 PST
<rdar://problem/88183952>