Skip to content

Commit 8aef058

Browse files
ptoussailehni
authored andcommitted
Handle undefined cbox in Glyph metrics calculation
Fix issue with foliojs#306
1 parent 14e24f0 commit 8aef058

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/glyph/Glyph.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export default class Glyph {
6868
if (this._font.vmtx) {
6969
var {advance:advanceHeight, bearing:topBearing} = this._getTableMetrics(this._font.vmtx);
7070
} else {
71+
if (typeof cbox === 'undefined' || cbox === null) { ({ cbox } = this); }
7172
var advanceHeight = Math.abs(this._font.ascent - this._font.descent);
7273
var topBearing = this._font.ascent - cbox.maxY;
7374
}

0 commit comments

Comments
 (0)