foliojs / fontkit

An advanced font engine for Node and the browser
1.45k stars 213 forks source link

why bbox is undefined for MEIRYO font? #243

Open gjSCUT opened 3 years ago

gjSCUT commented 3 years ago
const jpFont = fontKit.create(fs.readFileSync(path.resolve('fonts', 'MEIRYO.TTC')))
console.log(jpFont.bbox)

The bbox is undefined

Here is the font file MEIRYO.TTC.zip

Pomax commented 3 years ago

A ttc file is not a font, though, it's a font collection containg lots of different fonts, and each of those fonts will have their own bbox.

@gjSCUT Also note that it's technically illegal to redistribute meiryo, it's a licensed font that you paid for (it's part of the price you pay for Windows) so please remember to not attach it (or any other licensed font) to a github issue for everyone to download.