diff --git a/buildglyphs.patel b/buildglyphs.patel index 996a48644..e2b832d34 100644 --- a/buildglyphs.patel +++ b/buildglyphs.patel @@ -218,17 +218,19 @@ define [buildFont para recursive] : begin { define upmscale : fallback para.upmscale 1 - set font.head.unitsPerEm 1000 - set font.hhea.ascent [CAP + ACCENT * 1.5] - set font.'OS/2'.usWinAscent [CAP + ACCENT * 1.5] - set font.'OS/2'.sTypoAscender [CAP + ACCENT * 1.5] - set font.hhea.descent [DESCENDER - ACCENT * 0.5] - set font.'OS/2'.usWinDescent [Math.abs [DESCENDER - ACCENT * 0.5]] - set font.'OS/2'.sTypoDescender [DESCENDER - ACCENT * 0.5] - set font.hhea.lineGap [CAP * 0.2] - set font.'OS/2'.sTypoLineGap [CAP * 0.2] - set font.'OS/2'.sxHeight XH - set font.post.italicAnvle [0 - para.italicangle] + let [asc : 1250 * CAP / [CAP - DESCENDER]] [desc : 1250 * DESCENDER / [CAP - DESCENDER]] : begin { + set font.head.unitsPerEm 1000 + set font.hhea.ascent asc + set font.'OS/2'.usWinAscent asc + set font.'OS/2'.sTypoAscender asc + set font.hhea.descent desc + set font.'OS/2'.usWinDescent [Math.abs desc] + set font.'OS/2'.sTypoDescender desc + set font.hhea.lineGap [CAP * 0.2] + set font.'OS/2'.sTypoLineGap [CAP * 0.2] + set font.'OS/2'.sxHeight XH + set font.post.italicAnvle [0 - para.italicangle] + } ### Necessary macros define-macro glyph-construction : syntax-rules { diff --git a/glyphs/symbol-ascii.patel b/glyphs/symbol-ascii.patel index e1c35b03b..8d612e8a4 100644 --- a/glyphs/symbol-ascii.patel +++ b/glyphs/symbol-ascii.patel @@ -101,12 +101,14 @@ create-glyph 'parenLeft' : glyph-construction { assign-unicode '(' local p 0.6 - - include : create-stroke - :.start-from [mix SB RIGHTSB parenInside] parenTop - :.set-width STROKE 0 - :.curve-to [mix SB RIGHTSB parenOutside] [mix parenMid parenTop p] [mix SB RIGHTSB parenOutside] parenMid - :.curve-to [mix SB RIGHTSB parenOutside] [mix parenMid parenBot p] [mix SB RIGHTSB parenInside] parenBot + include : spiro { + widths.lhs + g4 [mix SB RIGHTSB parenInside] parenTop + quadcontrols 1 [1 - p] + g4 [mix SB RIGHTSB parenOutside] parenMid + quadcontrols 0 p + g4 [mix SB RIGHTSB parenInside] parenBot + } } create-glyph 'parenRight' : glyph-construction { diff --git a/support/glyph.patel b/support/glyph.patel index 779eb173b..3de27a1be 100644 --- a/support/glyph.patel +++ b/support/glyph.patel @@ -180,7 +180,7 @@ define [Glyph.prototype.apply-transform transform alsoAnchors] : begin { } define [Glyph.prototype.create-stroke] : begin { local s : new Stroke - s.gizmo = [Object.create this.gizmo] + s.gizmo = (.x this.gizmo.x .y this.gizmo.y .xx this.gizmo.xx .xy this.gizmo.xy .yx this.gizmo.yx .yy this.gizmo.yy) return s } define [Glyph.prototype.set-anchor id type x y mbx mby] : begin { diff --git a/support/stroke.patel b/support/stroke.patel index 473e0aa8c..57fb6cba1 100644 --- a/support/stroke.patel +++ b/support/stroke.patel @@ -72,7 +72,9 @@ define [Stroke.prototype.heads-to x y] : begin { return this } define [Stroke.prototype.start-from x y] : begin { - this.points = ([tp this.gizmo (.x x .y y .onCurve true)]) + #local pt [tp this.gizmo (.x x .y y .onCurve true .subdivided false)] + #if [x === 250] : console.log x y this.gizmo pt + this.points = ([tp this.gizmo (.x x .y y .onCurve true .subdivided false)]) return this } Stroke.prototype.moveTo = Stroke.prototype.start-from diff --git a/support/transform.js b/support/transform.js index 88ec28994..fff732336 100644 --- a/support/transform.js +++ b/support/transform.js @@ -1,10 +1,10 @@ exports.transformPoint = function(tfm, pt){ return { + onCurve: pt.onCurve || false, + cubic: pt.cubic || false, + subdivided: pt.subdivided || false, x : pt.x * tfm.xx + pt.y * tfm.yx + tfm.x, - y : pt.x * tfm.xy + pt.y * tfm.yy + tfm.y, - onCurve: pt.onCurve, - cubic: pt.cubic, - subdivided: pt.subdivided + y : pt.x * tfm.xy + pt.y * tfm.yy + tfm.y } } exports.inverse = function(tfm){ @@ -23,10 +23,10 @@ exports.untransform = function(tfm, pt){ var yy = pt.y - tfm.y var denom = tfm.xx * tfm.yy - tfm.xy * tfm.yx return { + onCurve: pt.onCurve || false, + cubic: pt.cubic || false, + subdivided: pt.subdivided || false, x : (xx * tfm.yy - yy * tfm.yx) / denom, - y : (yy * tfm.xx - xx * tfm.xy) / denom, - onCurve: pt.onCurve, - cubic: pt.cubic, - subdivided: pt.subdivided + y : (yy * tfm.xx - xx * tfm.xy) / denom } } \ No newline at end of file