opentypejs / opentype.js

Read and write OpenType fonts using JavaScript.
https://opentype.js.org/
MIT License
4.36k stars 466 forks source link

TrueType Collection file. Error: Unsupported OpenType signature ttcf #379

Open punksta opened 5 years ago

punksta commented 5 years ago

I am trying to open font file with multiple styles inside.

Expected Behavior

font collection file is handled, opentype.js finds multiple fonts.

Current Behavior

image

Possible Solution

I have know idea to be honest :)

Steps to Reproduce (for bugs)

compile multiple ttf fonts into one file using this guide https://graphicdesign.stackexchange.com/a/104892/137343

Context

I want to get supported styles from font file

Your Environment

punksta commented 5 years ago

https://mega.nz/#!OINDmA7I!KiPqAMqfXSp-QBLzUWjcsbasr4vjS8pObOnE9oqjdZw the file I was using

punksta commented 5 years ago

https://www.npmjs.com/package/fontkit#font-collection-objects found this.

Jolg42 commented 5 years ago

@punksta Indeed this is not yet supported and if anybody wants to contribute my guess is that this could be helpful:

The current workaround would be to find a .ttf, .otf or woff version of your font, or to unpackage the font collection to get all the .ttf

punksta commented 5 years ago

I ended up using fontkit. It does not support getting ttf files from font collection, but it can return list of font with names and other data. This is exactly that I needed.