kekee000 / fonteditor-core

fonteditor core functions
MIT License
353 stars 67 forks source link

Any option to keep the original bounding box instead of re-calculating it? #21

Closed wsxyeah closed 4 years ago

wsxyeah commented 5 years ago

Now the bounding box will be re-calculated, which leads to vertical clipping issue in the situation of font fallback, since the absolute value of yMin and yMax becomes smaller than before, and the measured height of text may be smaller than the fallback font.

So any option to keep the original bounding box for the compatibility?

kekee000 commented 4 years ago

use support option to keep bounding box

// write font file
let buffer = font.write({
  type: 'woff', // support ttf, woff, woff2, eot, svg
  hinting: true, // save font hinting
  deflate: null, // deflate function for woff
  support: {head: {}, hhea: {}} // for user to overwrite head.xMin, head.xMax, head.yMin, head.yMax, hhea etc.
});