Skip to content
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

Font name acquisition #1

Open
JackSinner opened this issue Nov 15, 2022 · 3 comments
Open

Font name acquisition #1

JackSinner opened this issue Nov 15, 2022 · 3 comments

Comments

@JackSinner
Copy link

dirs, _ := fontconfig.DefaultFontDirs()
    for _, dir := range dirs {
        config := fontconfig.NewConfig()

        ff, err := config.ScanFontDirectories(dir)
        if err != nil {
            fmt.Println(err.Error())
            os.Exit(1)
        }
        for _, pattern := range ff {
            fmt.Println(pattern.GetAt(fontconfig.FULLNAME, 1))
        }
    }

Hello, I failed to get the second full name with the above code.

image

My local computer contains a second full name font. Is there any problem with my use?

@benoitkugler
Copy link
Owner

Your snippet seems OK. What is the result of pattern.GetAt(fontconfig.FULLNAME, 1) ?
Could you link the yumin.tff file for further inspection ?

@JackSinner
Copy link
Author

pattern.GetAt(fontconfig.FULLNAME, 1) The returned nil has no matching result.
I am going in the direction of setting the language, but it seems that this is not the direction.
yumin.ttf.zip

@benoitkugler
Copy link
Owner

Thank you. It seems indeed strange, I will look deeper into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants