golang/freetype

Parsing Chinese Font not showing its font name

MuzTank opened this issue · 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?

beta commented

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

@beta ok I'll try to test it later

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