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
x/image/font/sfnt: cannot parse some Chinese font file #52153
Comments
cc @nigeltao |
@cherrymui Hello, may I ask: is there anyone working on this issue and about how long will it take to solve this issue? I'm developing a software and I need to get the font info. |
Could you upload the font file in this issue? |
I think this is work as intended. According to the TrueType manual(https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6.html)
Unfortunately Aa漫语手写体.ttf.zip is corrupted at
|
@mengzhuo I believe what you said is correct, but the point is, both macOS and Windows accept this font, that means the author don't know his font has a little problem(maybe this problem is from the font designing software, not the font designer) and many people are using it, actually there are many other fonts acts like Aa漫语手写体.ttf.zip, that means these kind of fonts are widely accepted, when people using my software, I can't told him/her: your font has a problem, because they will reply: why? I can use it on my Mac/ my Windows laptop/ etc. How can I explain? the developing language that I use has a bug? |
As p.s. for b, first, prevTag := buf, true, uint32(0); len(b) > 0; b = b[16:] {
tag := u32(b)
if first {
first = false
} else if tag <= prevTag {
return nil, 0, false, errInvalidTableTagOrder
}
prevTag = tag became for b := buf; len(b) > 0; b = b[16:] {
tag := u32(b) |
820行这个地方的4字节对齐校验, 有些中文字体也通不过: // We ignore the checksums, but "all tables must begin on four byte
// boundries [sic]".
if o&3 != 0 {
return nil, 0, false, errInvalidTableOffset
} |
OK, thank you. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, the latest release that I can upgrade through
brew upgrade go
on my Mac isgo1.18 darwin/amd64
(2022.04.05 07:11, UTC+08).What operating system and processor architecture are you using (
go env
)?I'm using
macOS 11.5.1 (20G80)
, Intel amd64go env
OutputWhat did you do?
Parse this Chinese font file: Aa漫语手写体.ttf.zip, returns an error, but parse another Chinese font: 华康金刚黑.zip, succeed.
What did you expect to see?
Parse this font Aa漫语手写体.ttf.zip, just as parsing this font: 华康金刚黑.zip, so I can get font info, for example, font family name....
What did you see instead?
It prints an error:
Evidence to prove Aa漫语手写体.ttf.zip is a normal font
I can install it, and find it in FontBook(macOS)
I can use it in TextEdit(macOS)
So I think this font file:Aa漫语手写体.ttf.zip should be able to be parsed correctly.
The text was updated successfully, but these errors were encountered: