Comparing version 6.0.1 to 6.0.2
@@ -0,1 +1,7 @@ | ||
6.0.2 / 2021-07-01 | ||
------------------ | ||
- Glyphs that don't fit in int32 now throw an error instead of generating invalid font, #113. | ||
6.0.1 / 2021-06-17 | ||
@@ -2,0 +8,0 @@ ------------------ |
@@ -104,2 +104,3 @@ /* | ||
glyph.name = svgGlyph.name; | ||
glyph.codes = svgGlyph.ligatureCodes || svgGlyph.unicode; // needed for nice validator error output | ||
glyph.d = svgGlyph.d; | ||
@@ -106,0 +107,0 @@ glyph.height = !isNaN(svgGlyph.height) ? svgGlyph.height : font.height; |
@@ -267,2 +267,3 @@ 'use strict'; | ||
this.id = ''; | ||
this.codes = []; // needed for nice validator error output | ||
this.height = 0; | ||
@@ -285,2 +286,7 @@ this.name = ''; | ||
}); | ||
if (xMin < -32768) { | ||
throw new Error('xMin value for glyph ' + (this.name ? ('"' + this.name + '"') : JSON.stringify(this.codes)) + | ||
' is out of bounds (actual ' + xMin + ', expected -32768..32767, d="' + this.d + '")'); | ||
} | ||
return hasPoints ? xMin : 0; | ||
@@ -302,2 +308,7 @@ } | ||
}); | ||
if (xMax > 32767) { | ||
throw new Error('xMax value for glyph ' + (this.name ? ('"' + this.name + '"') : JSON.stringify(this.codes)) + | ||
' is out of bounds (actual ' + xMax + ', expected -32768..32767, d="' + this.d + '")'); | ||
} | ||
return hasPoints ? xMax : this.width; | ||
@@ -319,2 +330,7 @@ } | ||
}); | ||
if (yMin < -32768) { | ||
throw new Error('yMin value for glyph ' + (this.name ? ('"' + this.name + '"') : JSON.stringify(this.codes)) + | ||
' is out of bounds (actual ' + yMin + ', expected -32768..32767, d="' + this.d + '")'); | ||
} | ||
return hasPoints ? yMin : 0; | ||
@@ -336,2 +352,7 @@ } | ||
}); | ||
if (yMax > 32767) { | ||
throw new Error('yMax value for glyph ' + (this.name ? ('"' + this.name + '"') : JSON.stringify(this.codes)) + | ||
' is out of bounds (actual ' + yMax + ', expected -32768..32767, d="' + this.d + '")'); | ||
} | ||
return hasPoints ? yMax : 0; | ||
@@ -338,0 +359,0 @@ } |
{ | ||
"name": "svg2ttf", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"description": "Converts SVG font to TTF font", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
83452
2172