-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenSans font compatability #8
Comments
Just ran into the same issue. Any plans to fix this in the near future? |
For me it opens |
I'm having the same problem. |
Here's a great explanation on what's wrong with Open Sans kerning table; its parsing indeed fails on this check:
|
Same problem for me. Are there any plans to fix this? |
Any update? It seems to fail with Open Sans regular as well now. |
A quick fix is to apply the following patch: --- a/truetype/truetype.go
+++ b/truetype/truetype.go
@@ -345,7 +345,7 @@ func (f *Font) parseKern() error {
return UnsupportedError(fmt.Sprintf("kern coverage: 0x%04x", coverage))
}
f.nKern, offset = int(u16(f.kern, offset)), offset+2
- if 6*f.nKern != length-14 {
+ if uint16(6*f.nKern) != uint16(length-14) {
return FormatError("bad kern table length")
}
return nil This allows at least Calibri to be loaded successfully. I have no idea about other consequences, though. |
For some reason this problem is still not fixed in the main repo. This prevents lots of fonts from being used with this library. The original freetype repo, would load such fonts. IMHO a bit incorrectly, but better than nothing. Here is my version of a slightly more robust check: // For large kerning tables, the extracted length value may be incorrect.
// For such fonts, often only the lower 16 bits of the actual length are
// stored. Here we validate the lower 16 bits, and also make sure that
// the extracted number of kerning pairs does not exceed the total length
// of the kerning table.
if uint16(6*f.nKern) != uint16(length-14) || 6*f.nKern > len(f.kern)-18 {
return FormatError("bad kern table length")
} |
Hello! There is any updates on this? 🤔 |
This is still an issue, btw |
Also hitting this with the the https://fonts.google.com/specimen/Anton downloaded ttf file. |
Still an issue in 2021 |
+1 |
Still an issue in 2022 |
Still have issue with Clear Sans |
This appears to still be an issue as of 2024; we just got a report about this over on the Ikemen GO repository (see ikemen-engine/Ikemen-GO#1715); it affects this font. Is there any reason why the changes made in unidoc's fork or adnsv's fix above haven't been incorporated into the main branch? |
Original issue reported on code.google.com by
[email protected]
on 26 May 2013 at 4:47The text was updated successfully, but these errors were encountered: