Skip to content

Commit

Permalink
let instead of var
Browse files Browse the repository at this point in the history
  • Loading branch information
mattlag committed Oct 26, 2023
1 parent a54d31d commit 5a320e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/font.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions src/tables/sfnt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand Down

0 comments on commit 5a320e5

Please sign in to comment.