Skip to content

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

Description

@rcoreilly

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions