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

fully process TTC collections: would probably require a LOT of extra work #2

Open
rcoreilly opened this issue Aug 17, 2018 · 0 comments

Comments

@rcoreilly
Copy link
Member

Currently it only gets the first font in a TTC collection:

truetype.go:548

// Parse returns a new Font for the given TTF or TTC data.
//
// For TrueType Collections, the first font in the collection is parsed.
func Parse(ttf []byte) (font *Font, err error) {
	return parse(ttf, 0)
}

The Menlo font in particular on Mac would be convenient to have full access to, as it has Italic which NotoSansMono does not. but it is shipped as a ttc file.

However, giving access to a ttc file would require significant additions to the golang font interface, to expose multiple fonts per Face, and select the appropriate one based on weight, style etc. This would add considerable complexity to get it all right. Currently using very simplistic code in GoGi to get by.

Per this thread, the best soln for now is to just break apart the ttc into separate ttf files:
https://stackoverflow.com/questions/39356906/do-font-files-e-g-ttc-ttf-otf-contain-different-weights

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

1 participant