material-design-icons icon indicating copy to clipboard operation
material-design-icons copied to clipboard

GASP table of MaterialIcons-Regular.ttf does not contain values for GASP version 1

Open drott opened this issue 6 years ago • 1 comments

(Spun off from Chromium issue 737569)

https://docs.microsoft.com/en-us/typography/opentype/spec/gasp is the reference for the GASP table which configures rendering settings for Windows.

Dumping MaterialIcons-Regular.ttf & .woff this is the GASP table for this font:

<?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="3.18">

  <gasp>
    <gaspRange rangeMaxPPEM="65535" rangeGaspBehavior="2"/>
  </gasp>

</ttFont>

The rangeGaspBehavior value is two, which corresponds to GASP_DOGRAY which means that in a GDI / pre-ClearType rendering environment, this font should be rendered with font smoothing.

In a ClearType enabled rendering environment such as Windows 8 and above, this font does not specify how it should be rendered. In order to improve contrast with older fonts, Chrome does not automatically enable ClearType symmetric font smoothing when the font has a GASP table and does not specify its desired rendering mode.

The GASP value of the Material Design icon fonts should be upgraded to at least value 0x2 (GASP_DOGRAY) + 0x8 (GASP_SYMMETRIC_SMOOTHIN)G = 0xA. For best results, value 0x0004 GASP_SYMMETRIC_GRIDFIT might be best to add, so that the final value would be 0xC + 0x2 = 0xE.

@behdad

Image from bug report illustrating the blockiness on the Chrome side:

material_design_iconfont_glitch

drott avatar Sep 18 '18 12:09 drott

Agree that this should be addressed. Good argument made that a better 'gasp' setting would be 14 (0xe in hex). Should check 'gasp' settings in Material Symbols as well.

tphinney avatar May 05 '22 00:05 tphinney

Given that crispness at small sizes is considered highly desirable, turning on the first gasp bit for grid-fitting is also a thing. So these days we use a gasp setting of 15 (oxf in hex).

tphinney avatar Jan 29 '24 21:01 tphinney