Closed Bug 1811471 Opened 1 year ago Closed 1 year ago

Kerning is missing between Hiragana and Katakana characters

Categories

(Core :: Layout: Text and Fonts, defect)

Firefox 109
defect

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: harry.dalton, Assigned: jfkthame)

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Steps to reproduce:

I can reproduce by following these steps:

  1. Open "reproduce.html" from the attached files in the browser.

  2. A pair of characters (すペ) is shaped and rendered in Noto Sans, both with kerning enabled (red) and kerning disabled (green). Both elements are in the same absolute position to show overlap (black) and hence similarity.

Actual results:

Both elements overlap exactly, and only black is visible. This indicates that the text displays identically kerned and unkerned, and hence that the kerning is missing.

Expected results:

The elements should not overlap, and significant green or red should be visible. This would indicate that the text displays differently kerned and unkerned, and hence that the kerning is present and displayed correctly.

Further context:

Hiragana and Katakana characters belong to separate Unicode scripts[1], "Hira" and "Kana", but it is not uncommon for characters from both scripts to occur in the same run of text. In particular, the OpenType specification for font files classifies both Hiragana and Katakana under the same script[2], "kana", such that the same script-specific positioning and substitution features apply to both.

[1] https://unicode.org/standard/supported.html
[2] https://learn.microsoft.com/en-us/typography/opentype/spec/scripttags

All environments tested:

In Firefox, the kerning displays incorrectly in:

  • Firefox 109.0 on Windows 10 (Version 21H2)
  • Firefox 108.0.2 on macOS (Version 12.3.1)

In other browsers, the kerning displays correctly in:

  • Chrome (109.0.5414.75) and Edge (109.0.1518.55) on Windows 10 (Version 21H2)
  • Chrome (109.0.5414.87) on macOS (Version 12.3.1)
    The kerning displays incorrectly in:
  • Safari (15.4) on macOS (Version 12.3.1)
Attachment #9313240 - Attachment description: Contains a reproduction page for the issue, including a font that has affected kerning → ZIP containing a reproduction page for the issue, including a font that has affected kerning

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Text and Fonts' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout: Text and Fonts
Product: Firefox → Core

Thanks for the report and testcase. Looks like we should be able to fix this by simply merging Hiragana and Katakana for text-shaping purposes, so that they're treated as a single run.

Assignee: nobody → jfkthame
Severity: -- → S3
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3d2ed4c82060
Merge Hiragana and Katakana scripts for text-shaping purposes, to allow kerning across both alphabets. r=emilio
https://hg.mozilla.org/integration/autoland/rev/86c1f7e927cc
Add a WPT testcase to confirm that kerning works across a hiragana/katakana character pair. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/38089 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch

Terrific - thanks Jonathan for the fix, and everyone for the speedy (<9hours!) turnaround. The web platform tests PR is much appreciated too.

Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: