The svgs will no longer contain NaNs.
This commit is contained in:
parent
fc799f50c9
commit
c2cfbb4061
16
generator.js
16
generator.js
|
@ -133,11 +133,25 @@ if(argv.ttf) (function(){
|
|||
|
||||
if(argv.svg) (function(){
|
||||
console.log(' Writing outline as SVG -> ' + argv.svg);
|
||||
function cov(x){ return Math.round(x * 10000) / 10000 };
|
||||
|
||||
var foundNaN = false;
|
||||
var glyfname = '';
|
||||
function cov(x) {
|
||||
if(!isFinite(x)){
|
||||
if(!foundNaN) {
|
||||
console.log("*** NaN value found in " + argv.svg + '(' + glyfname + ')' + " ***")
|
||||
foundNaN = true
|
||||
}
|
||||
return 0
|
||||
}
|
||||
return Math.round(x * 10000) / 10000
|
||||
};
|
||||
function mix(a, b, p){ return a + (b - a) * p };
|
||||
|
||||
function toSVGPath(glyph){
|
||||
var buf = '';
|
||||
foundNaN = false;
|
||||
glyfname = glyph.name;
|
||||
if(glyph.contours) for(var j = 0; j < glyph.contours.length; j++) {
|
||||
var contour = glyph.contours[j];
|
||||
var lx = 0;
|
||||
|
|
|
@ -441,6 +441,7 @@ define [determineMixR w v u sw] : begin
|
|||
local adjust : clamp 0.975 1 (1 - (iwidth / idepth - 2) * 0.0125)
|
||||
#console.log iwidth idepth (iwidth / idepth) adjust
|
||||
r = r * adjust
|
||||
if (r < 0.5) : set r 0.5
|
||||
return r
|
||||
|
||||
define nHookSegments 12
|
||||
|
|
Loading…
Reference in New Issue
Block a user