Closed Bug 1770163 Opened 2 years ago Closed 2 years ago

ScaledFontDWrite mishandles the 'gasp' table ranges

Categories

(Core :: Graphics: Text, defect)

Unspecified
Windows
defect

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

Details

Attachments

(1 file)

Noticed this while experimenting with bug 1770132: when Arial is rendered at 8ppem (i.e. 8px on a display with 100% scaling; correspondingly smaller px sizes on higher-res displays), it looks terrible because we render the glyphs without antialiasing, but their hinting doesn't actually kick in effectively until 9ppem.

This happens because we misinterpret the 'gasp' table ranges: a range should apply at ppem sizes up to and including its maxPPEM field.

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/88d31f6c458d
Make OpenType 'gasp' table ranges apply up to their maxPPEM size, inclusively. r=lsalzman
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
Flags: needinfo?(jfkthame)

The "Story Sans" font that site is using has a gasp table:

  <gasp>
    <gaspRange rangeMaxPPEM="8" rangeGaspBehavior="10"/>
    <gaspRange rangeMaxPPEM="16" rangeGaspBehavior="5"/>
    <gaspRange rangeMaxPPEM="65535" rangeGaspBehavior="15"/>
  </gasp>

At sizes above 8ppem and up to 16ppem (which is what the site is using if viewed on a low-res display with 100% scaling), it requests behavior 5, which according to the definitions at https://docs.microsoft.com/en-gb/typography/opentype/spec/gasp is a request for grid-fitting but no smoothing.

So it may not be pretty, but this is what the font asks for.

Flags: needinfo?(jfkthame)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: