golang/freetype

GPOS Support

Lachee opened this issue · 1 comments

This package doesn't support GPOS. Fonts from Google's Font library do not work as they use the GPOS table instead of the kern table.

Using https://fontdrop.info/, you can see that the font NOTABLE does not have a kern table. However, FontDrop states in the "OT" tab that the font has a GPOS table. It appears that this package is ignoring that table and is ONLY using the kern table.

This is fine like old fonts such as Luxirr, but many fonts now available just use the GPOS table exclusively. It seems like every font I get from Google Font seems to exclude the kern table.

        kernA := rune('A')
	kernB := rune('V')
	fontKern := fontSrc.Kern(fixed.I(1), fontSrc.Index(kernA), fontSrc.Index(kernB))
	faceKern := fontFace.Kern(kernA, kernB)
	log.Println("Kern between", string(kernA), string(kernB), ". Face:", faceKern, ", Font:", fontKern)

Notable (from Google Font):
Kern between A V . Face: 0:00 , Font: 0:00
Lexirr (from GitHub Example):
Kern between A V . Face: -11:43 , Font: -0:07

As you can see, the Kern function does nothing for fonts using GPOS instead of Kern.

The irony that Google's own language doesn't support fonts provided by Google.

this package is not being supported (PR's not even being merged).. I'm trying to keep an updated version with all PR's integrated in my fork at: https://github.com/goki/freetype so if you submit a PR to fix this I will merge it there..