Skip to content

Commit 90da4d6

Browse files
authored
Set GASP to symmetric grayscale
An unhinted font should have a GASP table set for symmetric grayscale with gridfit turned off (hinting disabled). This ensures consistent (if light) rendering on Windows rather than sharp, but uncontrolled rendering.
1 parent 22c6ccf commit 90da4d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/dehinter/font.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ def remove_glyf_instructions(tt):
160160
def update_gasp_table(tt):
161161
"""Modifies the following gasp table fields:
162162
1) rangeMaxPPEM changed to 65535
163-
2) rangeGaspBehavior changed to bit mask 0b1111 = 15"""
164-
if tt["gasp"].gaspRange != {65535: 15}:
165-
tt["gasp"].gaspRange = {65535: 15}
163+
2) rangeGaspBehavior changed to 0x000a (symmetric grayscale, no gridfit)
164+
if tt["gasp"].gaspRange != {65535: 0x000a}:
165+
tt["gasp"].gaspRange = {65535: 0x000a}
166166
return True
167167
else:
168168
return False

0 commit comments

Comments
 (0)