diff --git a/src/font.js b/src/font.js index 0115b574..f955c69d 100644 --- a/src/font.js +++ b/src/font.js @@ -86,11 +86,11 @@ function Font(options) { this.unitsPerEm = options.unitsPerEm || 1000; this.ascender = options.ascender; this.descender = options.descender; + this.createdTimestamp = options.createdTimestamp; this.slope = options.slope; this.italicAngle = options.italicAngle; - this.createdTimestamp = options.createdTimestamp; - var selection = 0; + let selection = 0; if (this.italicAngle < 0) { selection |= this.fsSelectionValues.ITALIC; } else if (this.italicAngle > 0) { diff --git a/src/tables/sfnt.js b/src/tables/sfnt.js index 9e7aac4c..1c2ccd6e 100644 --- a/src/tables/sfnt.js +++ b/src/tables/sfnt.js @@ -207,13 +207,14 @@ function fontToSfntTable(font) { globals.ascender = font.ascender; globals.descender = font.descender; - var macStyle = 0; + let macStyle = 0; if (font.italicAngle < 0) { macStyle |= 2; } if (font.weightClass >= 600) { macStyle |= 1; } + const headTable = head.make({ flags: 3, // 00000011 (baseline for font at y=0; left sidebearing point at x=0) unitsPerEm: font.unitsPerEm, @@ -234,7 +235,7 @@ function fontToSfntTable(font) { minRightSideBearing: globals.minRightSideBearing, xMaxExtent: globals.maxLeftSideBearing + (globals.xMax - globals.xMin), numberOfHMetrics: font.glyphs.length, - slope: font.slope, + slope: font.slope }); const maxpTable = maxp.make(font.glyphs.length);