Closed Bug 1381775 Opened 9 years ago Closed 9 years ago

Kerning issues with CSS-imported TTF and WOFF fonts

Categories

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

54 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: khorrth, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0 Build ID: 20170630112252 Steps to reproduce: I have developed a font with metrics based on pixel grid to be pixel-perfect. I have saved it in 3 different formats - TTF, OTF, WOFF. Then I have imported it using @font-face. Actual results: OTF and WOFF fonts rendered with no kerning, TTF was rendered a bit blurry. I have a testcase: http://khorrth.me/axb.html Expected results: OTF and WOFF fonts should be rendered with kerning at least. It is desirable TTF fonts to have such a good antialiasing like OTF ones.
Component: Untriaged → Layout: Text
Product: Firefox → Core
(In reply to khorrth from comment #0) > OTF and WOFF fonts rendered with no kerning, See https://www.microsoft.com/typography/otspec/kern.htm: "OpenType™ fonts containing CFF outlines are not supported by the 'kern' table and must use the 'GPOS' OpenType Layout table." So you need to convert your old-style 'kern' table to a GPOS 'kern' feature in order for it to work with the CFF font.
(In reply to Jonathan Kew (:jfkthame) from comment #1) > (In reply to khorrth from comment #0) > > OTF and WOFF fonts rendered with no kerning, > > See https://www.microsoft.com/typography/otspec/kern.htm: > > "OpenType™ fonts containing CFF outlines are not supported by the 'kern' > table and must use the 'GPOS' OpenType Layout table." > > So you need to convert your old-style 'kern' table to a GPOS 'kern' feature > in order for it to work with the CFF font. The same font works fine if it is not imported by CSS, but available system-wide. I have a bit more detailed overview here: http://khorrth.me/ax.html Is this normal behavior?
(In reply to khorrth from comment #2) > (In reply to Jonathan Kew (:jfkthame) from comment #1) > > (In reply to khorrth from comment #0) > > > OTF and WOFF fonts rendered with no kerning, > > > > See https://www.microsoft.com/typography/otspec/kern.htm: > > > > "OpenType™ fonts containing CFF outlines are not supported by the 'kern' > > table and must use the 'GPOS' OpenType Layout table." > > > > So you need to convert your old-style 'kern' table to a GPOS 'kern' feature > > in order for it to work with the CFF font. > > The same font works fine if it is not imported by CSS, but available > system-wide. I have a bit more detailed overview here: > http://khorrth.me/ax.html > > Is this normal behavior? And yeah, the GPOS is used.
I downloaded the .otf and .ttf fonts linked from your testcase at http://khorrth.me/axb.html, and neither of them includes a 'GPOS' table; they only have the legacy 'kern' table: $ ttx -l Wireshock-Regular-K.otf Listing table info for "Wireshock-Regular-K.otf": tag checksum length offset ---- ---------- ------- ------- CFF 0x34A84DA2 4587 1496 FFTM 0x7FFB7A1E 28 6084 OS/2 0x49955AE5 96 288 cmap 0x9C1DC2EC 466 996 head 0x0A317B03 54 188 hhea 0x0022008E 36 244 hmtx 0x04C10000 534 6112 kern 0xE544FC68 104576 6648 maxp 0x00865000 6 280 name 0x165DD4E3 612 384 post 0xFFFE0002 32 1464 $ ttx -l Wireshock-Regular-K.ttf Listing table info for "Wireshock-Regular-K.ttf": tag checksum length offset ---- ---------- ------- ------- FFTM 0x7FFB7A1E 28 112288 OS/2 0x49955AC5 96 344 cmap 0xBE57E827 466 984 gasp 0xFFFF0003 8 112280 glyf 0xFEBCD7F8 5332 1728 head 0x0A317B03 54 220 hhea 0x00220090 36 276 hmtx 0x04C80000 542 440 kern 0x6D658488 104576 7060 loca 0x55A7506E 274 1452 maxp 0x00CD0017 32 312 name 0x165DD4E3 612 111636 post 0xFFFE0002 32 112248
(In reply to Jonathan Kew (:jfkthame) from comment #4) > I downloaded the .otf and .ttf fonts linked from your testcase at > http://khorrth.me/axb.html, and neither of them includes a 'GPOS' table; > they only have the legacy 'kern' table: > > $ ttx -l Wireshock-Regular-K.otf > Listing table info for "Wireshock-Regular-K.otf": > tag checksum length offset > ---- ---------- ------- ------- > CFF 0x34A84DA2 4587 1496 > FFTM 0x7FFB7A1E 28 6084 > OS/2 0x49955AE5 96 288 > cmap 0x9C1DC2EC 466 996 > head 0x0A317B03 54 188 > hhea 0x0022008E 36 244 > hmtx 0x04C10000 534 6112 > kern 0xE544FC68 104576 6648 > maxp 0x00865000 6 280 > name 0x165DD4E3 612 384 > post 0xFFFE0002 32 1464 > > $ ttx -l Wireshock-Regular-K.ttf > Listing table info for "Wireshock-Regular-K.ttf": > tag checksum length offset > ---- ---------- ------- ------- > FFTM 0x7FFB7A1E 28 112288 > OS/2 0x49955AC5 96 344 > cmap 0xBE57E827 466 984 > gasp 0xFFFF0003 8 112280 > glyf 0xFEBCD7F8 5332 1728 > head 0x0A317B03 54 220 > hhea 0x00220090 36 276 > hmtx 0x04C80000 542 440 > kern 0x6D658488 104576 7060 > loca 0x55A7506E 274 1452 > maxp 0x00CD0017 32 312 > name 0x165DD4E3 612 111636 > post 0xFFFE0002 32 112248 https://fontforge.github.io/TrueOpenTables.html "kern kerning Provides kerning information for Apple's truetype fonts (and for older MS truetype fonts). In OpenType fonts this information is contained in the GPOS table." So, the "kern" table is a subtable of GPOS. When I save with "old-style kern for Windows" option, it doesn't change anything.
Oh, I am sorry. I was wrong about it, found the solution. Thank You.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.