Closed Bug 1738590 Opened 4 years ago Closed 1 year ago

Too wide glyphs are clipped on Windows

Categories

(Core :: Graphics: Text, defect)

Firefox 93
x86_64
Windows 10
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: khaled, Unassigned)

References

Details

Attachments

(3 files)

In the page https://www.amirifont.org/fatiha.html the glyph for U+FDFD is clipped from the left. On Firefox for macOS and Android, as well as Chrome. no clipping happens.

Attached image No clipping on macOS
Severity: -- → S3
Flags: needinfo?(lsalzman)
See Also: → 1738589

Jonathan, ideas?

Flags: needinfo?(lsalzman) → needinfo?(jfkthame)

I noticed something related to this on my tryserver run when testing the patch for bug 1738700 recently; see https://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml#logurl=https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/D_yEnhr9SI-I3krC5I9T9g/runs/0/artifacts/public/logs/live_backing.log&only_show_unexpected=1, where there's a visible "glitch" at the same position as the glyph in Khaled's comment 0 is truncated.

I assumed it's most likely some kind of DirectWrite issue, but I didn't try to dig any deeper yet. I guess the first thing to try would be to use that same font & glyph in other (DW-based) applications and see if anything odd shows up. (Note that Chrome may be using its FreeType renderer instead -- I don't know what criteria it uses to choose -- so we can't necessarily rely on that for a comparison.)

Some things I'd be curious to know (not on my Windows machine tonight, but maybe I can look tomorrow).... does it truncate at the same place regardless of the font size? Does it depend on the screen resolution/scale factor? Does the same issue occur without webrender (will require running an older version to test)?

Leaving ni? in place for now, pending further investigation....

Flags: needinfo?(jfkthame)

This seems to be specific to CFF-flavored fonts; if I use the TrueType-flavored version of Amiri Quran instead, the issue doesn't occur.

In Chrome, I notice that the very-wide Bismillah glyph is rendered with lower-grade antialiasing than the rest of the text (this is easier to see on a low-res display); it looks like it may be switching rendering modes, or rendering at a reduced size and then scaling up, or something like that.

This shows how Chrome is using a different (inferior) rendering mode or rasterizer for the extra-wide glyph. The left-hand sample shows "normal" glyphs from the following line, while the right-hand sample is an excerpt of the big U+FDFD glyph; note how its antialiasing is distinctly blockier/uglier, e.g. on the near-vertical strokes of the Alef and Lam components.

(Not sure what this tells us exactly, except for confirming that this extra-wide glyph is being rasterized differently somehow.)

In Chrome, I notice that the very-wide Bismillah glyph is rendered with lower-grade antialiasing than the rest of the text

Chrome GPU rasterization seems to have issues with big glyphs in general (I get the same effect with COLR fonts at bigger font sizes) and disabling GPU rasterization fixes the low res rendering, but I get the same clipping as Firefox so it seem like this is a DIrectWrite issue indeed.

Both Notepad and WordPad don’t render the basmala glyph in the CFF version of Amiri font at all, they show rectangles instead. I don’t know if they use DirectWrite or not. Windows font settings preview show the same truncation, so it is indeed a DirectWrite/Windows bug.

This seems to be a DirectWrite bug.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: