capsize icon indicating copy to clipboard operation
capsize copied to clipboard

Pass optional `postscriptName` parameter to fontkit

Open tsung-ju opened this issue 1 year ago • 4 comments

Currently passing .ttc files to fromFile, fromBlob or fromUrl causes an error, because fontkit returns a Collection instead of a Font. I added an optional postscriptName parameter which tells fontkit to return a specific font from the collection.

Here's an example usage:

const metrics = await fromFile('NotoSans.ttc', 'NotoSans');

tsung-ju avatar Dec 22 '23 03:12 tsung-ju