freetype icon indicating copy to clipboard operation
freetype copied to clipboard

Parsing Chinese Font not showing its font name

Open MuzTank opened this issue 7 years ago • 4 comments

When I tried to get font's name with truetype.Parse I can't get the font's name / family name in english. It shows up as ????? instead of its english name.

Here is my go code: ttfParsed, err := truetype.Parse(filePath) if(err != nil) { continue } fmt.Println(">> "+ttfParsed.Name(1)+" | -->"+fontName)

I tried ttfParsed.Name with value 1, 2, 3, 16, and 17 all showed up as '?????' - please refers to the image below. image

Using fonts: Microsoft Jhenghei (https://www.fontsmarket.com/font-download/microsoft-jhenghei) Environment: go version go1.9.4 windows/amd64 on Windows 10

How do I get the english name of non-english font?

MuzTank avatar Oct 21 '18 17:10 MuzTank

@MuzTank I've met the same problem. I forked this repo at beta/freetype and tried to fix it with commit beta/freetype@44c97d09b7855b8ea3f3b02d687ffdca7eaab2f4. Could you please have a test to see if it solves your problem?

beta avatar May 09 '19 13:05 beta

@beta ok I'll try to test it later

MuzTank avatar May 10 '19 06:05 MuzTank

I met this problem too, it's been more than two years, when will it be solved?

xiebruce avatar Jan 28 '22 13:01 xiebruce

@beta Your fork is usefull, please push it and lets fixed it in 2024……

extrame avatar May 06 '24 02:05 extrame