From 4ba6733f37f1d481f6b526f99830eef9d8d74ab0 Mon Sep 17 00:00:00 2001 From: Belleve Invis Date: Sun, 19 Jul 2015 20:30:20 +0800 Subject: [PATCH] Support global transformation and italics --- font.js | 652 ++++++++++++++++++++++------------------ font.patel | 219 ++++++++++---- support/glyph.js | 46 ++- support/glyph.patel | 35 ++- support/intersection.js | 2 +- support/stroke.js | 574 ++++++++++++++++++++--------------- support/stroke.patel | 128 +++++--- support/transform.js | 19 ++ 8 files changed, 1043 insertions(+), 632 deletions(-) create mode 100644 support/transform.js diff --git a/font.js b/font.js index 550a380..10f3d23 100644 --- a/font.js +++ b/font.js @@ -1,5 +1,5 @@ { - var r0_font, r0_glyphList, r0_glyphs, r0_Glyph, r0_Stroke, r0_para, r0_variantSelector, r0_DESCENDER, r0_WIDTH, r0_CAP, r0_XH, r0_O, r0_SB, r0_HOOK, r0_SMOOTH, r0_SMALLSMOOTH, r0_STROKE, r0_DOTSIZE, r0_XO, r0_CAPO, r0_HALFSTROKE, r0_RIGHTSB, r0_MIDDLE, r0_CAPMIDDLE, r0_CAP_SMOOTH, r0_DOTRADIUS, r0_KAPPA, r0_COKAPPA, r0_COBKAPPA, r0_BKAPPA, r0_KAPPA_HOOK, r0_Ring, r0_ORing, r0_xn$createglyph$7Hrq, _r0_t0, _r0_t1, _r0_t2, _r0_t3, _r0_t4, _r0_t5, _r0_t6, _r0_t7, _r0_t8, _r0_t9, _r0_t10, _r0_t11, _r0_t12, _r0_t13, _r0_t14, _r0_t15, _r0_t16, _r0_t17, _r0_t18, _r0_t19, _r0_t20, _r0_t21, _r0_t22, _r0_t23, _r0_t24, _r0_t25, _r0_t26, _r0_t27, _r0_t28, _r0_t29, _r0_t30, _r0_t31, _r0_t32, _r0_t33, _r0_t34, _r0_t35; + var r0_font, r0_glyphList, r0_glyphs, r0_Glyph, r0_Stroke, r0_para, r0_variantSelector, r0_globalTransform, r0_UPWARD, r0_DOWNWARD, r0_RIGHTWARD, r0_LEFTWARD, r0_DESCENDER, r0_WIDTH, r0_CAP, r0_XH, r0_O, r0_SB, r0_HOOK, r0_SMOOTH, r0_SMALLSMOOTH, r0_STROKE, r0_DOTSIZE, r0_XO, r0_CAPO, r0_HALFSTROKE, r0_RIGHTSB, r0_MIDDLE, r0_CAPMIDDLE, r0_CAP_SMOOTH, r0_DOTRADIUS, r0_KAPPA, r0_COKAPPA, r0_COBKAPPA, r0_BKAPPA, r0_KAPPA_HOOK, r0_Ring, r0_ORing, r0_xn$createglyph$7Hrq, _r0_t0, _r0_t1, _r0_t2, _r0_t3, _r0_t4, _r0_t5, _r0_t6, _r0_t7, _r0_t8, _r0_t9, _r0_t10, _r0_t11, _r0_t12, _r0_t13, _r0_t14, _r0_t15, _r0_t16, _r0_t17, _r0_t18, _r0_t19, _r0_t20, _r0_t21, _r0_t22, _r0_t23, _r0_t24, _r0_t25, _r0_t26, _r0_t27, _r0_t28, _r0_t29, _r0_t30, _r0_t31, _r0_t32, _r0_t33, _r0_t34, _r0_t35; r0_font = require('./empty.json'); r0_glyphList = r0_font['glyf']; r0_glyphs = { '.notdef': r0_glyphList[0] }; @@ -17,9 +17,34 @@ 'smallsmooth': 242, 'o': -8, 'descender': -178, - 'kappa': 0.51 + 'kappa': 0.51, + 'italicangle': 10 }; r0_variantSelector = { 'zero': 'slashed' }; + r0_globalTransform = { + 'xx': 1, + 'yx': Math['tan'](r0_para['italicangle'] / 180 * Math['PI']), + 'xy': 0, + 'yy': 1, + 'x': 0, + 'y': 0 + }; + r0_UPWARD = { + 'x': -1, + 'y': 0 + }; + r0_DOWNWARD = { + 'x': 1, + 'y': 0 + }; + r0_RIGHTWARD = { + 'x': r0_globalTransform['yx'], + 'y': 1 + }; + r0_LEFTWARD = { + 'x': -r0_globalTransform['yx'], + 'y': -1 + }; r0_DESCENDER = r0_para['descender']; r0_WIDTH = r0_para['width']; r0_CAP = r0_para['cap']; @@ -49,7 +74,7 @@ var r1_u, r1_d, r1_l, r1_r, r1_my, r1_mx, r1_s; r1_my = (r1_u + r1_d) / 2; r1_mx = (r1_l + r1_r) / 2; - r1_s = new r0_Stroke()['start-from'](r1_mx, r1_d)['cubic-to'](r1_mx + (r1_l - r1_mx) * r0_BKAPPA, r1_d, r1_l, r1_my + (r1_d - r1_my) * r0_BKAPPA, r1_l, r1_my)['cubic-to'](r1_l, r1_my + (r1_u - r1_my) * r0_BKAPPA, r1_mx + (r1_l - r1_mx) * r0_BKAPPA, r1_u, r1_mx, r1_u)['cubic-to'](r1_mx + (r1_r - r1_mx) * r0_BKAPPA, r1_u, r1_r, r1_my + (r1_u - r1_my) * r0_BKAPPA, r1_r, r1_my)['cubic-to'](r1_r, r1_my + (r1_d - r1_my) * r0_BKAPPA, r1_mx + (r1_r - r1_mx) * r0_BKAPPA, r1_d, r1_mx, r1_d); + r1_s = new r0_Stroke()['set-transform'](r0_globalTransform)['start-from'](r1_mx, r1_d)['cubic-to'](r1_mx + (r1_l - r1_mx) * r0_BKAPPA, r1_d, r1_l, r1_my + (r1_d - r1_my) * r0_BKAPPA, r1_l, r1_my)['cubic-to'](r1_l, r1_my + (r1_u - r1_my) * r0_BKAPPA, r1_mx + (r1_l - r1_mx) * r0_BKAPPA, r1_u, r1_mx, r1_u)['cubic-to'](r1_mx + (r1_r - r1_mx) * r0_BKAPPA, r1_u, r1_r, r1_my + (r1_u - r1_my) * r0_BKAPPA, r1_r, r1_my)['cubic-to'](r1_r, r1_my + (r1_d - r1_my) * r0_BKAPPA, r1_mx + (r1_r - r1_mx) * r0_BKAPPA, r1_d, r1_mx, r1_d); return r1_s['points']; }; r0_ORing = function _r0_t1(r2_u, r2_d, r2_l, r2_r, r2_smooth) { @@ -57,7 +82,7 @@ r2_myu = r2_u - r2_smooth; r2_myd = r2_d + r2_smooth; r2_mx = (r2_l + r2_r) / 2; - r2_s = new r0_Stroke()['start-from'](r2_mx, r2_d)['cubic-to'](r2_mx + (r2_l - r2_mx) * r0_BKAPPA, r2_d, r2_l, r2_myd + (r2_d - r2_myd) * r0_BKAPPA, r2_l, r2_myd)['line-to'](r2_l, r2_myu)['cubic-to'](r2_l, r2_myu + (r2_u - r2_myu) * r0_BKAPPA, r2_mx + (r2_l - r2_mx) * r0_BKAPPA, r2_u, r2_mx, r2_u)['cubic-to'](r2_mx + (r2_r - r2_mx) * r0_BKAPPA, r2_u, r2_r, r2_myu + (r2_u - r2_myu) * r0_BKAPPA, r2_r, r2_myu)['line-to'](r2_r, r2_myd)['cubic-to'](r2_r, r2_myd + (r2_d - r2_myd) * r0_BKAPPA, r2_mx + (r2_r - r2_mx) * r0_BKAPPA, r2_d, r2_mx, r2_d); + r2_s = new r0_Stroke()['set-transform'](r0_globalTransform)['start-from'](r2_mx, r2_d)['cubic-to'](r2_mx + (r2_l - r2_mx) * r0_BKAPPA, r2_d, r2_l, r2_myd + (r2_d - r2_myd) * r0_BKAPPA, r2_l, r2_myd)['line-to'](r2_l, r2_myu)['cubic-to'](r2_l, r2_myu + (r2_u - r2_myu) * r0_BKAPPA, r2_mx + (r2_l - r2_mx) * r0_BKAPPA, r2_u, r2_mx, r2_u)['cubic-to'](r2_mx + (r2_r - r2_mx) * r0_BKAPPA, r2_u, r2_r, r2_myu + (r2_u - r2_myu) * r0_BKAPPA, r2_r, r2_myu)['line-to'](r2_r, r2_myd)['cubic-to'](r2_r, r2_myd + (r2_d - r2_myd) * r0_BKAPPA, r2_mx + (r2_r - r2_mx) * r0_BKAPPA, r2_d, r2_mx, r2_d); return r2_s['points']; }; r0_xn$createglyph$7Hrq = function _r0_t2(r7_name, r7_actions) { @@ -69,7 +94,7 @@ return r7_glyphObject; }; r0_xn$createglyph$7Hrq('space', function _r0_t3() { - var r9_xn$setwidth$9Jrj, r9_xn$assignunicode$7Hrq, r9_xn$startfrom$1aao, r9_xn$lineto$5sIl, r9_xn$curveto$1aao, r9_xn$cubicto$1aao, r9_xn$putshapes$9Jrj, r9_xn$reverselast$3qIs, r9_xn$includeglyph$3qIs, _r9_t0; + var r9_xn$setwidth$9Jrj, r9_xn$assignunicode$7Hrq, r9_xn$startfrom$1aao, r9_xn$lineto$5sIl, r9_xn$curveto$1aao, r9_xn$cubicto$1aao, r9_xn$putshapes$9Jrj, r9_xn$reverselast$3qIs, r9_xn$includeglyph$3qIs, r9_xn$createstroke$7Hrq, _r9_t0; _r9_t0 = this; r9_xn$setwidth$9Jrj = _r9_t0['set-width']['bind'](_r9_t0); r9_xn$assignunicode$7Hrq = _r9_t0['assign-unicode']['bind'](_r9_t0); @@ -80,12 +105,14 @@ r9_xn$putshapes$9Jrj = _r9_t0['put-shapes']['bind'](_r9_t0); r9_xn$reverselast$3qIs = _r9_t0['reverse-last']['bind'](_r9_t0); r9_xn$includeglyph$3qIs = _r9_t0['include-glyph']['bind'](_r9_t0); + r9_xn$createstroke$7Hrq = _r9_t0['create-stroke']['bind'](_r9_t0); + _r9_t0['gizmo'] = r0_globalTransform; r9_xn$setwidth$9Jrj(r0_WIDTH); r9_xn$assignunicode$7Hrq(' '); return void 0; }); r0_xn$createglyph$7Hrq('bar', function _r0_t4() { - var r11_xn$setwidth$9Jrj, r11_xn$assignunicode$7Hrq, r11_xn$startfrom$1aao, r11_xn$lineto$5sIl, r11_xn$curveto$1aao, r11_xn$cubicto$1aao, r11_xn$putshapes$9Jrj, r11_xn$reverselast$3qIs, r11_xn$includeglyph$3qIs, _r11_t0; + var r11_xn$setwidth$9Jrj, r11_xn$assignunicode$7Hrq, r11_xn$startfrom$1aao, r11_xn$lineto$5sIl, r11_xn$curveto$1aao, r11_xn$cubicto$1aao, r11_xn$putshapes$9Jrj, r11_xn$reverselast$3qIs, r11_xn$includeglyph$3qIs, r11_xn$createstroke$7Hrq, _r11_t0; _r11_t0 = this; r11_xn$setwidth$9Jrj = _r11_t0['set-width']['bind'](_r11_t0); r11_xn$assignunicode$7Hrq = _r11_t0['assign-unicode']['bind'](_r11_t0); @@ -96,13 +123,15 @@ r11_xn$putshapes$9Jrj = _r11_t0['put-shapes']['bind'](_r11_t0); r11_xn$reverselast$3qIs = _r11_t0['reverse-last']['bind'](_r11_t0); r11_xn$includeglyph$3qIs = _r11_t0['include-glyph']['bind'](_r11_t0); + r11_xn$createstroke$7Hrq = _r11_t0['create-stroke']['bind'](_r11_t0); + _r11_t0['gizmo'] = r0_globalTransform; r11_xn$setwidth$9Jrj(r0_WIDTH); r11_xn$assignunicode$7Hrq('|'); - r11_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_MIDDLE, r0_DESCENDER / 2)['set-width'](r0_STROKE / 2, r0_STROKE / 2)['line-to'](r0_MIDDLE, r0_CAP - r0_DESCENDER / 2)['form-stroke']()); + r11_xn$putshapes$9Jrj(r11_xn$createstroke$7Hrq()['start-from'](r0_MIDDLE, r0_DESCENDER / 2)['set-width'](r0_STROKE / 2, r0_STROKE / 2)['line-to'](r0_MIDDLE, r0_CAP - r0_DESCENDER / 2)['form-stroke']()); return void 0; }); r0_xn$createglyph$7Hrq('A', function _r0_t5() { - var r13_xn$setwidth$9Jrj, r13_xn$assignunicode$7Hrq, r13_xn$startfrom$1aao, r13_xn$lineto$5sIl, r13_xn$curveto$1aao, r13_xn$cubicto$1aao, r13_xn$putshapes$9Jrj, r13_xn$reverselast$3qIs, r13_xn$includeglyph$3qIs, r13_TURN, r13_leftbar, r13_rightbar, r13_hbar, _r13_t0; + var r13_xn$setwidth$9Jrj, r13_xn$assignunicode$7Hrq, r13_xn$startfrom$1aao, r13_xn$lineto$5sIl, r13_xn$curveto$1aao, r13_xn$cubicto$1aao, r13_xn$putshapes$9Jrj, r13_xn$reverselast$3qIs, r13_xn$includeglyph$3qIs, r13_xn$createstroke$7Hrq, r13_TURN, r13_leftbar, r13_rightbar, r13_hbar, _r13_t0; _r13_t0 = this; r13_xn$setwidth$9Jrj = _r13_t0['set-width']['bind'](_r13_t0); r13_xn$assignunicode$7Hrq = _r13_t0['assign-unicode']['bind'](_r13_t0); @@ -113,14 +142,16 @@ r13_xn$putshapes$9Jrj = _r13_t0['put-shapes']['bind'](_r13_t0); r13_xn$reverselast$3qIs = _r13_t0['reverse-last']['bind'](_r13_t0); r13_xn$includeglyph$3qIs = _r13_t0['include-glyph']['bind'](_r13_t0); + r13_xn$createstroke$7Hrq = _r13_t0['create-stroke']['bind'](_r13_t0); + _r13_t0['gizmo'] = r0_globalTransform; r13_xn$setwidth$9Jrj(r0_WIDTH); r13_xn$assignunicode$7Hrq('A'); r13_TURN = r0_XH * 0.1; - r13_leftbar = new r0_Stroke(); - r13_leftbar['start-from'](r0_SB, 0)['set-width'](0, r0_STROKE)['line-to'](r0_SB, r13_TURN)['curve-to'](r0_SB, r13_TURN + 0.27 * (r0_CAP - r13_TURN), r0_MIDDLE - r0_STROKE / 2, r0_CAP)['set-width'](0, r0_STROKE * 0.8); - r13_rightbar = new r0_Stroke(); - r13_rightbar['start-from'](r0_RIGHTSB, 0)['set-width'](r0_STROKE, 0)['line-to'](r0_RIGHTSB, r13_TURN)['curve-to'](r0_RIGHTSB, r13_TURN + 0.27 * (r0_CAP - r13_TURN), r0_MIDDLE + r0_STROKE / 2, r0_CAP)['set-width'](r0_STROKE * 0.8, 0); - r13_hbar = new r0_Stroke()['start-from'](r0_SB + r0_STROKE, r0_XH / 2)['set-width'](0, r0_STROKE)['line-to'](r0_RIGHTSB - r0_STROKE, r0_XH / 2); + r13_leftbar = r13_xn$createstroke$7Hrq(); + r13_leftbar['start-from'](r0_SB, 0)['pen-direction'](r0_UPWARD)['set-width'](0, r0_STROKE)['line-to'](r0_SB, r13_TURN)['pen-direction'](r0_UPWARD)['curve-to'](r0_SB, r13_TURN + 0.27 * (r0_CAP - r13_TURN), r0_MIDDLE - r0_STROKE / 2, r0_CAP)['set-width'](0, r0_STROKE * 0.8); + r13_rightbar = r13_xn$createstroke$7Hrq(); + r13_rightbar['start-from'](r0_RIGHTSB, 0)['pen-direction'](r0_UPWARD)['set-width'](r0_STROKE, 0)['line-to'](r0_RIGHTSB, r13_TURN)['pen-direction'](r0_UPWARD)['curve-to'](r0_RIGHTSB, r13_TURN + 0.27 * (r0_CAP - r13_TURN), r0_MIDDLE + r0_STROKE / 2, r0_CAP)['set-width'](r0_STROKE * 0.8, 0); + r13_hbar = r13_xn$createstroke$7Hrq()['start-from'](r0_SB + r0_STROKE, r0_XH / 2)['pen-direction'](r0_RIGHTWARD)['set-width'](0, r0_STROKE)['line-to'](r0_RIGHTSB - r0_STROKE, r0_XH / 2)['pen-direction'](r0_RIGHTWARD); r13_xn$putshapes$9Jrj(r13_leftbar['form-stroke']()); r13_xn$putshapes$9Jrj(r13_hbar['form-stroke']()); r13_xn$putshapes$9Jrj(r13_rightbar['form-stroke']()); @@ -130,7 +161,7 @@ return void 0; }); r0_xn$createglyph$7Hrq('X', function _r0_t6() { - var r15_xn$setwidth$9Jrj, r15_xn$assignunicode$7Hrq, r15_xn$startfrom$1aao, r15_xn$lineto$5sIl, r15_xn$curveto$1aao, r15_xn$cubicto$1aao, r15_xn$putshapes$9Jrj, r15_xn$reverselast$3qIs, r15_xn$includeglyph$3qIs, r15_TURN, r15_straight, r15_strench, r15_barone, r15_bartwo, _r15_t0, _r15_t1; + var r15_xn$setwidth$9Jrj, r15_xn$assignunicode$7Hrq, r15_xn$startfrom$1aao, r15_xn$lineto$5sIl, r15_xn$curveto$1aao, r15_xn$cubicto$1aao, r15_xn$putshapes$9Jrj, r15_xn$reverselast$3qIs, r15_xn$includeglyph$3qIs, r15_xn$createstroke$7Hrq, r15_TURN, r15_straight, r15_strench, r15_barone, r15_bartwo, _r15_t0; _r15_t0 = this; r15_xn$setwidth$9Jrj = _r15_t0['set-width']['bind'](_r15_t0); r15_xn$assignunicode$7Hrq = _r15_t0['assign-unicode']['bind'](_r15_t0); @@ -141,60 +172,79 @@ r15_xn$putshapes$9Jrj = _r15_t0['put-shapes']['bind'](_r15_t0); r15_xn$reverselast$3qIs = _r15_t0['reverse-last']['bind'](_r15_t0); r15_xn$includeglyph$3qIs = _r15_t0['include-glyph']['bind'](_r15_t0); + r15_xn$createstroke$7Hrq = _r15_t0['create-stroke']['bind'](_r15_t0); + _r15_t0['gizmo'] = r0_globalTransform; r15_xn$setwidth$9Jrj(r0_WIDTH); r15_xn$assignunicode$7Hrq('X'); r15_TURN = r0_XH * 0.05; r15_straight = 0.6; r15_strench = 0.125; - r15_barone = new r0_Stroke()['start-from'](r0_SB + r0_HALFSTROKE, 0)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['line-to'](r0_SB + r0_HALFSTROKE, r15_TURN)['curve-to'](r0_SB + r0_HALFSTROKE, r15_TURN + r15_strench * (r0_CAP - r15_TURN), r0_MIDDLE + r15_straight * (r0_SB + r0_HALFSTROKE - r0_MIDDLE), r0_CAPMIDDLE + r15_straight * (r15_TURN + r15_strench * (r0_CAP - r15_TURN) - r0_CAPMIDDLE))['line-to'](r0_MIDDLE + r15_straight * (r0_RIGHTSB - r0_HALFSTROKE - r0_MIDDLE), r0_CAPMIDDLE + r15_straight * (r0_CAP - r15_TURN - r15_strench * (r0_CAP - r15_TURN) - r0_CAPMIDDLE))['curve-to'](r0_RIGHTSB - r0_HALFSTROKE, r0_CAP - r15_TURN - r15_strench * (r0_CAP - r15_TURN), r0_RIGHTSB - r0_HALFSTROKE, r0_CAP - r15_TURN)['line-to'](r0_RIGHTSB - r0_HALFSTROKE, r0_CAP)['form-stroke'](); - r15_bartwo = [r15_barone[0]['map'](function _r15_t1(r16_pt) { - var r16_pt; - return { - 'x': r0_WIDTH - r16_pt['x'], - 'y': r16_pt['y'], - 'onCurve': r16_pt['onCurve'], - 'cubic': r16_pt['cubic'] - }; - })['reverse']()]; - r15_xn$putshapes$9Jrj(r15_barone); - r15_xn$putshapes$9Jrj(r15_bartwo); + r15_barone = r15_xn$createstroke$7Hrq()['start-from'](r0_SB + r0_HALFSTROKE, 0)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['pen-direction'](r0_UPWARD)['line-to'](r0_SB + r0_HALFSTROKE, r15_TURN)['curve-to'](r0_SB + r0_HALFSTROKE, r15_TURN + r15_strench * (r0_CAP - r15_TURN), r0_MIDDLE + r15_straight * (r0_SB + r0_HALFSTROKE - r0_MIDDLE), r0_CAPMIDDLE + r15_straight * (r15_TURN + r15_strench * (r0_CAP - r15_TURN) - r0_CAPMIDDLE))['line-to'](r0_MIDDLE + r15_straight * (r0_RIGHTSB - r0_HALFSTROKE - r0_MIDDLE), r0_CAPMIDDLE + r15_straight * (r0_CAP - r15_TURN - r15_strench * (r0_CAP - r15_TURN) - r0_CAPMIDDLE))['curve-to'](r0_RIGHTSB - r0_HALFSTROKE, r0_CAP - r15_TURN - r15_strench * (r0_CAP - r15_TURN), r0_RIGHTSB - r0_HALFSTROKE, r0_CAP - r15_TURN)['line-to'](r0_RIGHTSB - r0_HALFSTROKE, r0_CAP)['pen-direction'](r0_UPWARD); + r15_bartwo = r15_xn$createstroke$7Hrq()['start-from'](r0_RIGHTSB - r0_HALFSTROKE, 0)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['pen-direction'](r0_UPWARD)['line-to'](r0_RIGHTSB - r0_HALFSTROKE, r15_TURN)['curve-to'](r0_RIGHTSB - r0_HALFSTROKE, r15_TURN + r15_strench * (r0_CAP - r15_TURN), r0_MIDDLE + r15_straight * (r0_RIGHTSB - r0_HALFSTROKE - r0_MIDDLE), r0_CAPMIDDLE + r15_straight * (r15_TURN + r15_strench * (r0_CAP - r15_TURN) - r0_CAPMIDDLE))['line-to'](r0_MIDDLE + r15_straight * (r0_SB + r0_HALFSTROKE - r0_MIDDLE), r0_CAPMIDDLE + r15_straight * (r0_CAP - r15_TURN - r15_strench * (r0_CAP - r15_TURN) - r0_CAPMIDDLE))['curve-to'](r0_SB + r0_HALFSTROKE, r0_CAP - r15_TURN - r15_strench * (r0_CAP - r15_TURN), r0_SB + r0_HALFSTROKE, r0_CAP - r15_TURN)['line-to'](r0_SB + r0_HALFSTROKE, r0_CAP)['pen-direction'](r0_UPWARD); + r15_xn$putshapes$9Jrj(r15_barone['form-stroke']()); + r15_xn$putshapes$9Jrj(r15_bartwo['form-stroke']()); return void 0; }); r0_xn$createglyph$7Hrq('Y', function _r0_t7() { - var r18_xn$setwidth$9Jrj, r18_xn$assignunicode$7Hrq, r18_xn$startfrom$1aao, r18_xn$lineto$5sIl, r18_xn$curveto$1aao, r18_xn$cubicto$1aao, r18_xn$putshapes$9Jrj, r18_xn$reverselast$3qIs, r18_xn$includeglyph$3qIs, r18_TURN, r18_straight, r18_strench, r18_cross, r18_barone, r18_bartwo, _r18_t0, _r18_t1; - _r18_t0 = this; - r18_xn$setwidth$9Jrj = _r18_t0['set-width']['bind'](_r18_t0); - r18_xn$assignunicode$7Hrq = _r18_t0['assign-unicode']['bind'](_r18_t0); - r18_xn$startfrom$1aao = _r18_t0['start-from']['bind'](_r18_t0); - r18_xn$lineto$5sIl = _r18_t0['line-to']['bind'](_r18_t0); - r18_xn$curveto$1aao = _r18_t0['curve-to']['bind'](_r18_t0); - r18_xn$cubicto$1aao = _r18_t0['cubic-to']['bind'](_r18_t0); - r18_xn$putshapes$9Jrj = _r18_t0['put-shapes']['bind'](_r18_t0); - r18_xn$reverselast$3qIs = _r18_t0['reverse-last']['bind'](_r18_t0); - r18_xn$includeglyph$3qIs = _r18_t0['include-glyph']['bind'](_r18_t0); - r18_xn$setwidth$9Jrj(r0_WIDTH); - r18_xn$assignunicode$7Hrq('Y'); - r18_TURN = r0_XH * 0.05; - r18_straight = 0.6; - r18_strench = 0.15; - r18_cross = r0_CAP * 0.4; - r18_barone = new r0_Stroke()['start-from'](r0_MIDDLE, r18_cross)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['line-to'](r0_MIDDLE + r18_straight * (r0_RIGHTSB - r0_HALFSTROKE - r0_MIDDLE), r18_cross + r18_straight * (r0_CAP - r18_TURN - r18_strench * (r0_CAP - r18_TURN) - r18_cross))['curve-to'](r0_RIGHTSB - r0_HALFSTROKE, r0_CAP - r18_TURN - r18_strench * (r0_CAP - r18_TURN), r0_RIGHTSB - r0_HALFSTROKE, r0_CAP - r18_TURN)['line-to'](r0_RIGHTSB - r0_HALFSTROKE, r0_CAP)['form-stroke'](); - r18_bartwo = [r18_barone[0]['map'](function _r18_t1(r19_pt) { - var r19_pt; - return { - 'x': r0_WIDTH - r19_pt['x'], - 'y': r19_pt['y'], - 'onCurve': r19_pt['onCurve'], - 'cubic': r19_pt['cubic'] - }; - })['reverse']()]; - r18_xn$putshapes$9Jrj(r18_barone); - r18_xn$putshapes$9Jrj(r18_bartwo); - r18_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_MIDDLE, 0)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['line-to'](r0_MIDDLE, r18_cross + r0_HALFSTROKE)['form-stroke']()); + var r17_xn$setwidth$9Jrj, r17_xn$assignunicode$7Hrq, r17_xn$startfrom$1aao, r17_xn$lineto$5sIl, r17_xn$curveto$1aao, r17_xn$cubicto$1aao, r17_xn$putshapes$9Jrj, r17_xn$reverselast$3qIs, r17_xn$includeglyph$3qIs, r17_xn$createstroke$7Hrq, r17_TURN, r17_straight, r17_strench, r17_cross, r17_barone, r17_bartwo, _r17_t0; + _r17_t0 = this; + r17_xn$setwidth$9Jrj = _r17_t0['set-width']['bind'](_r17_t0); + r17_xn$assignunicode$7Hrq = _r17_t0['assign-unicode']['bind'](_r17_t0); + r17_xn$startfrom$1aao = _r17_t0['start-from']['bind'](_r17_t0); + r17_xn$lineto$5sIl = _r17_t0['line-to']['bind'](_r17_t0); + r17_xn$curveto$1aao = _r17_t0['curve-to']['bind'](_r17_t0); + r17_xn$cubicto$1aao = _r17_t0['cubic-to']['bind'](_r17_t0); + r17_xn$putshapes$9Jrj = _r17_t0['put-shapes']['bind'](_r17_t0); + r17_xn$reverselast$3qIs = _r17_t0['reverse-last']['bind'](_r17_t0); + r17_xn$includeglyph$3qIs = _r17_t0['include-glyph']['bind'](_r17_t0); + r17_xn$createstroke$7Hrq = _r17_t0['create-stroke']['bind'](_r17_t0); + _r17_t0['gizmo'] = r0_globalTransform; + r17_xn$setwidth$9Jrj(r0_WIDTH); + r17_xn$assignunicode$7Hrq('Y'); + r17_TURN = r0_XH * 0.05; + r17_straight = 0.6; + r17_strench = 0.15; + r17_cross = r0_CAP * 0.4; + r17_barone = r17_xn$createstroke$7Hrq()['start-from'](r0_MIDDLE, r17_cross)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['line-to'](r0_MIDDLE + r17_straight * (r0_RIGHTSB - r0_HALFSTROKE - r0_MIDDLE), r17_cross + r17_straight * (r0_CAP - r17_TURN - r17_strench * (r0_CAP - r17_TURN) - r17_cross))['curve-to'](r0_RIGHTSB - r0_HALFSTROKE, r0_CAP - r17_TURN - r17_strench * (r0_CAP - r17_TURN), r0_RIGHTSB - r0_HALFSTROKE, r0_CAP - r17_TURN)['line-to'](r0_RIGHTSB - r0_HALFSTROKE, r0_CAP)['pen-direction'](r0_UPWARD); + r17_bartwo = r17_xn$createstroke$7Hrq()['start-from'](r0_MIDDLE, r17_cross)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['line-to'](r0_MIDDLE + r17_straight * (r0_SB + r0_HALFSTROKE - r0_MIDDLE), r17_cross + r17_straight * (r0_CAP - r17_TURN - r17_strench * (r0_CAP - r17_TURN) - r17_cross))['curve-to'](r0_SB + r0_HALFSTROKE, r0_CAP - r17_TURN - r17_strench * (r0_CAP - r17_TURN), r0_SB + r0_HALFSTROKE, r0_CAP - r17_TURN)['line-to'](r0_SB + r0_HALFSTROKE, r0_CAP)['pen-direction'](r0_UPWARD); + r17_xn$putshapes$9Jrj(r17_barone['form-stroke']()); + r17_xn$putshapes$9Jrj(r17_bartwo['form-stroke']()); + r17_xn$putshapes$9Jrj(r17_xn$createstroke$7Hrq()['start-from'](r0_MIDDLE, 0)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['pen-direction'](r0_UPWARD)['line-to'](r0_MIDDLE, r17_cross + r0_HALFSTROKE)['pen-direction'](r0_UPWARD)['form-stroke']()); return void 0; }); r0_xn$createglyph$7Hrq('B', function _r0_t8() { - var r21_xn$setwidth$9Jrj, r21_xn$assignunicode$7Hrq, r21_xn$startfrom$1aao, r21_xn$lineto$5sIl, r21_xn$curveto$1aao, r21_xn$cubicto$1aao, r21_xn$putshapes$9Jrj, r21_xn$reverselast$3qIs, r21_xn$includeglyph$3qIs, r21_bowl, r21_tkappa, r21_bkappa, r21_turntop, r21_turnbottom, r21_topbowl, r21_bottombowl, r21_leftbar, _r21_t0; + var r19_xn$setwidth$9Jrj, r19_xn$assignunicode$7Hrq, r19_xn$startfrom$1aao, r19_xn$lineto$5sIl, r19_xn$curveto$1aao, r19_xn$cubicto$1aao, r19_xn$putshapes$9Jrj, r19_xn$reverselast$3qIs, r19_xn$includeglyph$3qIs, r19_xn$createstroke$7Hrq, r19_bowl, r19_tkappa, r19_bkappa, r19_turntop, r19_turnbottom, r19_topbowl, r19_bottombowl, r19_leftbar, _r19_t0; + _r19_t0 = this; + r19_xn$setwidth$9Jrj = _r19_t0['set-width']['bind'](_r19_t0); + r19_xn$assignunicode$7Hrq = _r19_t0['assign-unicode']['bind'](_r19_t0); + r19_xn$startfrom$1aao = _r19_t0['start-from']['bind'](_r19_t0); + r19_xn$lineto$5sIl = _r19_t0['line-to']['bind'](_r19_t0); + r19_xn$curveto$1aao = _r19_t0['curve-to']['bind'](_r19_t0); + r19_xn$cubicto$1aao = _r19_t0['cubic-to']['bind'](_r19_t0); + r19_xn$putshapes$9Jrj = _r19_t0['put-shapes']['bind'](_r19_t0); + r19_xn$reverselast$3qIs = _r19_t0['reverse-last']['bind'](_r19_t0); + r19_xn$includeglyph$3qIs = _r19_t0['include-glyph']['bind'](_r19_t0); + r19_xn$createstroke$7Hrq = _r19_t0['create-stroke']['bind'](_r19_t0); + _r19_t0['gizmo'] = r0_globalTransform; + r19_xn$setwidth$9Jrj(r0_WIDTH); + r19_xn$assignunicode$7Hrq('B'); + r19_bowl = 451; + r19_tkappa = r0_COKAPPA - 0.22; + r19_bkappa = r0_COKAPPA - 0.2; + r19_turntop = (r0_CAP + (r19_bowl - r0_STROKE)) / 2; + r19_turnbottom = r19_bowl / 2; + r19_topbowl = r19_xn$createstroke$7Hrq(); + r19_topbowl['start-from'](r0_SB, r0_CAP)['pen-direction'](r0_RIGHTWARD)['line-to'](r0_RIGHTSB - r0_SB * 0.5 - r19_turnbottom, r0_CAP)['cubic-to'](r0_RIGHTSB - r0_SB * 0.5 - r19_tkappa * r19_turnbottom, r0_CAP, r0_RIGHTSB - r0_SB * 0.5, r19_turntop + (r0_CAP - r19_turntop) * r0_KAPPA, r0_RIGHTSB - r0_SB * 0.5, r19_turntop)['cubic-to'](r0_RIGHTSB - r0_SB * 0.5, r19_turntop + r0_KAPPA * (r19_bowl - r0_STROKE - r19_turntop), r0_RIGHTSB - r0_SB * 0.5 - r19_tkappa * r19_turnbottom, r19_bowl - r0_STROKE, r0_RIGHTSB - r0_SB * 0.5 - r19_turnbottom, r19_bowl - r0_STROKE)['line-to'](r0_SB, r19_bowl - r0_STROKE)['pen-direction'](r0_LEFTWARD); + r19_bottombowl = r19_xn$createstroke$7Hrq(); + r19_bottombowl['start-from'](r0_SB, 0)['pen-direction'](r0_RIGHTWARD)['line-to'](r0_RIGHTSB - r19_turnbottom, 0)['cubic-to'](r0_RIGHTSB - r19_bkappa * r19_turnbottom, 0, r0_RIGHTSB, r19_turnbottom * r0_KAPPA, r0_RIGHTSB, r19_turnbottom)['cubic-to'](r0_RIGHTSB, r19_turnbottom + r0_KAPPA * (r19_bowl - r19_turnbottom), r0_RIGHTSB - r19_bkappa * r19_turnbottom, r19_bowl, r0_RIGHTSB - r19_turnbottom, r19_bowl)['line-to'](r0_SB, r19_bowl)['pen-direction'](r0_LEFTWARD); + r19_leftbar = r19_xn$createstroke$7Hrq()['start-from'](r0_SB, 0)['pen-direction'](r0_UPWARD)['line-to'](r0_SB, r0_CAP)['pen-direction'](r0_UPWARD); + r19_xn$putshapes$9Jrj(r19_topbowl['form-stroke'](0, r0_STROKE)); + r19_xn$putshapes$9Jrj(r19_bottombowl['form-stroke'](r0_STROKE, 0)); + r19_xn$putshapes$9Jrj(r19_leftbar['form-stroke'](0, r0_STROKE)); + return void 0; + }); + r0_xn$createglyph$7Hrq('D', function _r0_t9() { + var r21_xn$setwidth$9Jrj, r21_xn$assignunicode$7Hrq, r21_xn$startfrom$1aao, r21_xn$lineto$5sIl, r21_xn$curveto$1aao, r21_xn$cubicto$1aao, r21_xn$putshapes$9Jrj, r21_xn$reverselast$3qIs, r21_xn$includeglyph$3qIs, r21_xn$createstroke$7Hrq, r21_dsmooth, r21_bsmooth, r21_bkappa, r21_leftbar, r21_bowl, _r21_t0; _r21_t0 = this; r21_xn$setwidth$9Jrj = _r21_t0['set-width']['bind'](_r21_t0); r21_xn$assignunicode$7Hrq = _r21_t0['assign-unicode']['bind'](_r21_t0); @@ -205,25 +255,22 @@ r21_xn$putshapes$9Jrj = _r21_t0['put-shapes']['bind'](_r21_t0); r21_xn$reverselast$3qIs = _r21_t0['reverse-last']['bind'](_r21_t0); r21_xn$includeglyph$3qIs = _r21_t0['include-glyph']['bind'](_r21_t0); + r21_xn$createstroke$7Hrq = _r21_t0['create-stroke']['bind'](_r21_t0); + _r21_t0['gizmo'] = r0_globalTransform; r21_xn$setwidth$9Jrj(r0_WIDTH); - r21_xn$assignunicode$7Hrq('B'); - r21_bowl = 451; - r21_tkappa = r0_COKAPPA - 0.22; + r21_xn$assignunicode$7Hrq('D'); + r21_dsmooth = r0_SMOOTH * 1.55; + r21_bsmooth = r0_SMOOTH * 1.3; r21_bkappa = r0_COKAPPA - 0.2; - r21_turntop = (r0_CAP + (r21_bowl - r0_STROKE)) / 2; - r21_turnbottom = r21_bowl / 2; - r21_topbowl = new r0_Stroke(); - r21_topbowl['start-from'](r0_SB, r0_CAP)['line-to'](r0_RIGHTSB - r0_SB * 0.5 - r21_turnbottom, r0_CAP)['cubic-to'](r0_RIGHTSB - r0_SB * 0.5 - r21_tkappa * r21_turnbottom, r0_CAP, r0_RIGHTSB - r0_SB * 0.5, r21_turntop + (r0_CAP - r21_turntop) * r0_KAPPA, r0_RIGHTSB - r0_SB * 0.5, r21_turntop)['cubic-to'](r0_RIGHTSB - r0_SB * 0.5, r21_turntop + r0_KAPPA * (r21_bowl - r0_STROKE - r21_turntop), r0_RIGHTSB - r0_SB * 0.5 - r21_tkappa * r21_turnbottom, r21_bowl - r0_STROKE, r0_RIGHTSB - r0_SB * 0.5 - r21_turnbottom, r21_bowl - r0_STROKE)['line-to'](r0_SB, r21_bowl - r0_STROKE); - r21_bottombowl = new r0_Stroke(); - r21_bottombowl['start-from'](r0_SB, 0)['line-to'](r0_RIGHTSB - r21_turnbottom, 0)['cubic-to'](r0_RIGHTSB - r21_bkappa * r21_turnbottom, 0, r0_RIGHTSB, r21_turnbottom * r0_KAPPA, r0_RIGHTSB, r21_turnbottom)['cubic-to'](r0_RIGHTSB, r21_turnbottom + r0_KAPPA * (r21_bowl - r21_turnbottom), r0_RIGHTSB - r21_bkappa * r21_turnbottom, r21_bowl, r0_RIGHTSB - r21_turnbottom, r21_bowl)['line-to'](r0_SB, r21_bowl); - r21_leftbar = new r0_Stroke()['start-from'](r0_SB, 0)['line-to'](r0_SB, r0_CAP); - r21_xn$putshapes$9Jrj(r21_topbowl['form-stroke'](0, r0_STROKE)); - r21_xn$putshapes$9Jrj(r21_bottombowl['form-stroke'](r0_STROKE, 0)); + r21_leftbar = r21_xn$createstroke$7Hrq()['start-from'](r0_SB, 0)['pen-direction'](r0_UPWARD)['line-to'](r0_SB, r0_CAP)['pen-direction'](r0_UPWARD); + r21_bowl = r21_xn$createstroke$7Hrq(); + r21_bowl['start-from'](r0_SB, 0)['pen-direction'](r0_RIGHTWARD)['line-to'](r0_RIGHTSB - r21_bsmooth, 0)['cubic-to'](r0_RIGHTSB - r21_bkappa * r21_bsmooth, 0, r0_RIGHTSB, r0_COBKAPPA * r21_dsmooth, r0_RIGHTSB, r21_dsmooth)['line-to'](r0_RIGHTSB, r0_CAP - r21_dsmooth)['cubic-to'](r0_RIGHTSB, r0_CAP - r0_COBKAPPA * r21_dsmooth, r0_RIGHTSB - r21_bkappa * r21_bsmooth, r0_CAP, r0_RIGHTSB - r21_bsmooth, r0_CAP)['line-to'](r0_SB, r0_CAP)['pen-direction'](r0_LEFTWARD); + r21_xn$putshapes$9Jrj(r21_bowl['form-stroke'](r0_STROKE, 0)); r21_xn$putshapes$9Jrj(r21_leftbar['form-stroke'](0, r0_STROKE)); return void 0; }); - r0_xn$createglyph$7Hrq('D', function _r0_t9() { - var r23_xn$setwidth$9Jrj, r23_xn$assignunicode$7Hrq, r23_xn$startfrom$1aao, r23_xn$lineto$5sIl, r23_xn$curveto$1aao, r23_xn$cubicto$1aao, r23_xn$putshapes$9Jrj, r23_xn$reverselast$3qIs, r23_xn$includeglyph$3qIs, r23_dsmooth, r23_bsmooth, r23_bkappa, r23_leftbar, r23_bowl, _r23_t0; + r0_xn$createglyph$7Hrq('P', function _r0_t10() { + var r23_xn$setwidth$9Jrj, r23_xn$assignunicode$7Hrq, r23_xn$startfrom$1aao, r23_xn$lineto$5sIl, r23_xn$curveto$1aao, r23_xn$cubicto$1aao, r23_xn$putshapes$9Jrj, r23_xn$reverselast$3qIs, r23_xn$includeglyph$3qIs, r23_xn$createstroke$7Hrq, r23_bowl, r23_bkappa, r23_turntop, r23_turnbottom, r23_topbowl, r23_leftbar, _r23_t0; _r23_t0 = this; r23_xn$setwidth$9Jrj = _r23_t0['set-width']['bind'](_r23_t0); r23_xn$assignunicode$7Hrq = _r23_t0['assign-unicode']['bind'](_r23_t0); @@ -234,20 +281,23 @@ r23_xn$putshapes$9Jrj = _r23_t0['put-shapes']['bind'](_r23_t0); r23_xn$reverselast$3qIs = _r23_t0['reverse-last']['bind'](_r23_t0); r23_xn$includeglyph$3qIs = _r23_t0['include-glyph']['bind'](_r23_t0); + r23_xn$createstroke$7Hrq = _r23_t0['create-stroke']['bind'](_r23_t0); + _r23_t0['gizmo'] = r0_globalTransform; r23_xn$setwidth$9Jrj(r0_WIDTH); - r23_xn$assignunicode$7Hrq('D'); - r23_dsmooth = r0_SMOOTH * 1.55; - r23_bsmooth = r0_SMOOTH * 1.3; + r23_xn$assignunicode$7Hrq('P'); + r23_bowl = r0_CAPMIDDLE; r23_bkappa = r0_COKAPPA - 0.2; - r23_leftbar = new r0_Stroke()['start-from'](r0_SB, 0)['line-to'](r0_SB, r0_CAP); - r23_bowl = new r0_Stroke(); - r23_bowl['start-from'](r0_SB, 0)['line-to'](r0_RIGHTSB - r23_bsmooth, 0)['cubic-to'](r0_RIGHTSB - r23_bkappa * r23_bsmooth, 0, r0_RIGHTSB, r0_COBKAPPA * r23_dsmooth, r0_RIGHTSB, r23_dsmooth)['line-to'](r0_RIGHTSB, r0_CAP - r23_dsmooth)['cubic-to'](r0_RIGHTSB, r0_CAP - r0_COBKAPPA * r23_dsmooth, r0_RIGHTSB - r23_bkappa * r23_bsmooth, r0_CAP, r0_RIGHTSB - r23_bsmooth, r0_CAP)['line-to'](r0_SB, r0_CAP); - r23_xn$putshapes$9Jrj(r23_bowl['form-stroke'](r0_STROKE, 0)); + r23_turntop = (r0_CAP + (r23_bowl - r0_HALFSTROKE)) / 2; + r23_turnbottom = r23_bowl / 2; + r23_topbowl = r23_xn$createstroke$7Hrq(); + r23_topbowl['start-from'](r0_SB, r0_CAP)['line-to'](r0_RIGHTSB - r23_turnbottom, r0_CAP)['cubic-to'](r0_RIGHTSB - r23_bkappa * r23_turnbottom, r0_CAP, r0_RIGHTSB, r23_turntop + (r0_CAP - r23_turntop) * r0_KAPPA, r0_RIGHTSB, r23_turntop)['cubic-to'](r0_RIGHTSB, r23_turntop + r0_KAPPA * (r23_bowl - r0_HALFSTROKE - r23_turntop), r0_RIGHTSB - r23_bkappa * r23_turnbottom, r23_bowl - r0_HALFSTROKE, r0_RIGHTSB - r23_turnbottom, r23_bowl - r0_HALFSTROKE)['line-to'](r0_SB, r23_bowl - r0_HALFSTROKE); + r23_leftbar = r23_xn$createstroke$7Hrq()['start-from'](r0_SB, 0)['line-to'](r0_SB, r0_CAP); + r23_xn$putshapes$9Jrj(r23_topbowl['form-stroke'](0, r0_STROKE)); r23_xn$putshapes$9Jrj(r23_leftbar['form-stroke'](0, r0_STROKE)); return void 0; }); - r0_xn$createglyph$7Hrq('P', function _r0_t10() { - var r25_xn$setwidth$9Jrj, r25_xn$assignunicode$7Hrq, r25_xn$startfrom$1aao, r25_xn$lineto$5sIl, r25_xn$curveto$1aao, r25_xn$cubicto$1aao, r25_xn$putshapes$9Jrj, r25_xn$reverselast$3qIs, r25_xn$includeglyph$3qIs, r25_bowl, r25_bkappa, r25_turntop, r25_turnbottom, r25_topbowl, r25_leftbar, _r25_t0; + r0_xn$createglyph$7Hrq('R', function _r0_t11() { + var r25_xn$setwidth$9Jrj, r25_xn$assignunicode$7Hrq, r25_xn$startfrom$1aao, r25_xn$lineto$5sIl, r25_xn$curveto$1aao, r25_xn$cubicto$1aao, r25_xn$putshapes$9Jrj, r25_xn$reverselast$3qIs, r25_xn$includeglyph$3qIs, r25_xn$createstroke$7Hrq, r25_TURN, r25_right, _r25_t0; _r25_t0 = this; r25_xn$setwidth$9Jrj = _r25_t0['set-width']['bind'](_r25_t0); r25_xn$assignunicode$7Hrq = _r25_t0['assign-unicode']['bind'](_r25_t0); @@ -258,21 +308,18 @@ r25_xn$putshapes$9Jrj = _r25_t0['put-shapes']['bind'](_r25_t0); r25_xn$reverselast$3qIs = _r25_t0['reverse-last']['bind'](_r25_t0); r25_xn$includeglyph$3qIs = _r25_t0['include-glyph']['bind'](_r25_t0); + r25_xn$createstroke$7Hrq = _r25_t0['create-stroke']['bind'](_r25_t0); + _r25_t0['gizmo'] = r0_globalTransform; r25_xn$setwidth$9Jrj(r0_WIDTH); - r25_xn$assignunicode$7Hrq('P'); - r25_bowl = r0_CAPMIDDLE; - r25_bkappa = r0_COKAPPA - 0.2; - r25_turntop = (r0_CAP + (r25_bowl - r0_HALFSTROKE)) / 2; - r25_turnbottom = r25_bowl / 2; - r25_topbowl = new r0_Stroke(); - r25_topbowl['start-from'](r0_SB, r0_CAP)['line-to'](r0_RIGHTSB - r25_turnbottom, r0_CAP)['cubic-to'](r0_RIGHTSB - r25_bkappa * r25_turnbottom, r0_CAP, r0_RIGHTSB, r25_turntop + (r0_CAP - r25_turntop) * r0_KAPPA, r0_RIGHTSB, r25_turntop)['cubic-to'](r0_RIGHTSB, r25_turntop + r0_KAPPA * (r25_bowl - r0_HALFSTROKE - r25_turntop), r0_RIGHTSB - r25_bkappa * r25_turnbottom, r25_bowl - r0_HALFSTROKE, r0_RIGHTSB - r25_turnbottom, r25_bowl - r0_HALFSTROKE)['line-to'](r0_SB, r25_bowl - r0_HALFSTROKE); - r25_leftbar = new r0_Stroke()['start-from'](r0_SB, 0)['line-to'](r0_SB, r0_CAP); - r25_xn$putshapes$9Jrj(r25_topbowl['form-stroke'](0, r0_STROKE)); - r25_xn$putshapes$9Jrj(r25_leftbar['form-stroke'](0, r0_STROKE)); + r25_xn$assignunicode$7Hrq('R'); + r25_xn$includeglyph$3qIs(r0_glyphs['P']); + r25_TURN = r0_XH * 0.1; + r25_right = r0_RIGHTSB + r0_O; + r25_xn$putshapes$9Jrj(r25_xn$createstroke$7Hrq()['start-from'](r25_right - r0_HALFSTROKE, 0)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['curve-to'](r25_right - r0_HALFSTROKE, r25_TURN + 0.1 * (r0_XH - r25_TURN), r0_MIDDLE, r0_CAPMIDDLE)['form-stroke']()); return void 0; }); - r0_xn$createglyph$7Hrq('R', function _r0_t11() { - var r27_xn$setwidth$9Jrj, r27_xn$assignunicode$7Hrq, r27_xn$startfrom$1aao, r27_xn$lineto$5sIl, r27_xn$curveto$1aao, r27_xn$cubicto$1aao, r27_xn$putshapes$9Jrj, r27_xn$reverselast$3qIs, r27_xn$includeglyph$3qIs, r27_TURN, r27_right, _r27_t0; + r0_xn$createglyph$7Hrq('C', function _r0_t12() { + var r27_xn$setwidth$9Jrj, r27_xn$assignunicode$7Hrq, r27_xn$startfrom$1aao, r27_xn$lineto$5sIl, r27_xn$curveto$1aao, r27_xn$cubicto$1aao, r27_xn$putshapes$9Jrj, r27_xn$reverselast$3qIs, r27_xn$includeglyph$3qIs, r27_xn$createstroke$7Hrq, r27_outline, _r27_t0; _r27_t0 = this; r27_xn$setwidth$9Jrj = _r27_t0['set-width']['bind'](_r27_t0); r27_xn$assignunicode$7Hrq = _r27_t0['assign-unicode']['bind'](_r27_t0); @@ -283,16 +330,17 @@ r27_xn$putshapes$9Jrj = _r27_t0['put-shapes']['bind'](_r27_t0); r27_xn$reverselast$3qIs = _r27_t0['reverse-last']['bind'](_r27_t0); r27_xn$includeglyph$3qIs = _r27_t0['include-glyph']['bind'](_r27_t0); + r27_xn$createstroke$7Hrq = _r27_t0['create-stroke']['bind'](_r27_t0); + _r27_t0['gizmo'] = r0_globalTransform; r27_xn$setwidth$9Jrj(r0_WIDTH); - r27_xn$assignunicode$7Hrq('R'); - r27_xn$includeglyph$3qIs(r0_glyphs['P']); - r27_TURN = r0_XH * 0.1; - r27_right = r0_RIGHTSB + r0_O; - r27_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r27_right - r0_HALFSTROKE, 0)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['curve-to'](r27_right - r0_HALFSTROKE, r27_TURN + 0.1 * (r0_XH - r27_TURN), r0_MIDDLE, r0_CAPMIDDLE)['form-stroke']()); + r27_xn$assignunicode$7Hrq('C'); + r27_outline = r27_xn$createstroke$7Hrq(); + r27_outline['start-from'](r0_RIGHTSB - r0_SB * 0.1, r0_CAP - r0_HOOK)['curve-to'](r0_MIDDLE + r0_KAPPA_HOOK * (r0_MIDDLE - r0_para['sb']), r0_CAPO, r0_MIDDLE, r0_CAPO)['cubic-to'](r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_CAPO, r0_SB, r0_CAP - r0_COBKAPPA * r0_SMOOTH, r0_SB, r0_CAP_SMOOTH)['line-to'](r0_SB, r0_SMOOTH)['cubic-to'](r0_SB, r0_COBKAPPA * r0_SMOOTH, r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_O, r0_WIDTH / 2, r0_O)['curve-to'](r0_MIDDLE + r0_KAPPA_HOOK * (r0_MIDDLE - r0_SB), r0_O, r0_RIGHTSB - r0_SB * 0.1, r0_HOOK); + r27_xn$putshapes$9Jrj(r27_outline['form-stroke'](r0_STROKE, 0)); return void 0; }); - r0_xn$createglyph$7Hrq('C', function _r0_t12() { - var r29_xn$setwidth$9Jrj, r29_xn$assignunicode$7Hrq, r29_xn$startfrom$1aao, r29_xn$lineto$5sIl, r29_xn$curveto$1aao, r29_xn$cubicto$1aao, r29_xn$putshapes$9Jrj, r29_xn$reverselast$3qIs, r29_xn$includeglyph$3qIs, r29_outline, _r29_t0; + r0_xn$createglyph$7Hrq('G', function _r0_t13() { + var r29_xn$setwidth$9Jrj, r29_xn$assignunicode$7Hrq, r29_xn$startfrom$1aao, r29_xn$lineto$5sIl, r29_xn$curveto$1aao, r29_xn$cubicto$1aao, r29_xn$putshapes$9Jrj, r29_xn$reverselast$3qIs, r29_xn$includeglyph$3qIs, r29_xn$createstroke$7Hrq, r29_outline, r29_bar, _r29_t0; _r29_t0 = this; r29_xn$setwidth$9Jrj = _r29_t0['set-width']['bind'](_r29_t0); r29_xn$assignunicode$7Hrq = _r29_t0['assign-unicode']['bind'](_r29_t0); @@ -303,15 +351,19 @@ r29_xn$putshapes$9Jrj = _r29_t0['put-shapes']['bind'](_r29_t0); r29_xn$reverselast$3qIs = _r29_t0['reverse-last']['bind'](_r29_t0); r29_xn$includeglyph$3qIs = _r29_t0['include-glyph']['bind'](_r29_t0); + r29_xn$createstroke$7Hrq = _r29_t0['create-stroke']['bind'](_r29_t0); + _r29_t0['gizmo'] = r0_globalTransform; r29_xn$setwidth$9Jrj(r0_WIDTH); - r29_xn$assignunicode$7Hrq('C'); - r29_outline = new r0_Stroke(); - r29_outline['start-from'](r0_RIGHTSB - r0_SB * 0.1, r0_CAP - r0_HOOK)['curve-to'](r0_MIDDLE + r0_KAPPA_HOOK * (r0_MIDDLE - r0_para['sb']), r0_CAPO, r0_MIDDLE, r0_CAPO)['cubic-to'](r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_CAPO, r0_SB, r0_CAP - r0_COBKAPPA * r0_SMOOTH, r0_SB, r0_CAP_SMOOTH)['line-to'](r0_SB, r0_SMOOTH)['cubic-to'](r0_SB, r0_COBKAPPA * r0_SMOOTH, r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_O, r0_WIDTH / 2, r0_O)['curve-to'](r0_MIDDLE + r0_KAPPA_HOOK * (r0_MIDDLE - r0_SB), r0_O, r0_RIGHTSB - r0_SB * 0.1, r0_HOOK); + r29_xn$assignunicode$7Hrq('G'); + r29_outline = r29_xn$createstroke$7Hrq(); + r29_outline['start-from'](r0_RIGHTSB - r0_SB * 0.1, r0_CAP - r0_HOOK)['curve-to'](r0_MIDDLE + r0_KAPPA_HOOK * (r0_MIDDLE - r0_para['sb']), r0_CAPO, r0_MIDDLE, r0_CAPO)['cubic-to'](r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_CAPO, r0_SB, r0_CAP - r0_COBKAPPA * r0_SMOOTH, r0_SB, r0_CAP_SMOOTH)['line-to'](r0_SB, r0_SMOOTH)['cubic-to'](r0_SB, r0_COBKAPPA * r0_SMOOTH, r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_O, r0_WIDTH / 2, r0_O)['cubic-to'](r0_MIDDLE + r0_BKAPPA * (r0_RIGHTSB - r0_MIDDLE), r0_O, r0_RIGHTSB, r0_COBKAPPA * r0_SMOOTH, r0_RIGHTSB, r0_SMOOTH)['line-to'](r0_RIGHTSB, r0_CAP / 2 + r0_STROKE / 2)['pen-direction'](r0_UPWARD); r29_xn$putshapes$9Jrj(r29_outline['form-stroke'](r0_STROKE, 0)); + r29_bar = r29_xn$createstroke$7Hrq()['start-from'](r0_MIDDLE, r0_CAP / 2 + r0_STROKE / 2)['line-to'](r0_RIGHTSB, r0_CAP / 2 + r0_STROKE / 2)['pen-direction'](r0_RIGHTWARD); + r29_xn$putshapes$9Jrj(r29_bar['form-stroke'](0, r0_STROKE)); return void 0; }); - r0_xn$createglyph$7Hrq('G', function _r0_t13() { - var r31_xn$setwidth$9Jrj, r31_xn$assignunicode$7Hrq, r31_xn$startfrom$1aao, r31_xn$lineto$5sIl, r31_xn$curveto$1aao, r31_xn$cubicto$1aao, r31_xn$putshapes$9Jrj, r31_xn$reverselast$3qIs, r31_xn$includeglyph$3qIs, r31_outline, r31_bar, _r31_t0; + r0_xn$createglyph$7Hrq('O', function _r0_t14() { + var r31_xn$setwidth$9Jrj, r31_xn$assignunicode$7Hrq, r31_xn$startfrom$1aao, r31_xn$lineto$5sIl, r31_xn$curveto$1aao, r31_xn$cubicto$1aao, r31_xn$putshapes$9Jrj, r31_xn$reverselast$3qIs, r31_xn$includeglyph$3qIs, r31_xn$createstroke$7Hrq, r31_outline, _r31_t0; _r31_t0 = this; r31_xn$setwidth$9Jrj = _r31_t0['set-width']['bind'](_r31_t0); r31_xn$assignunicode$7Hrq = _r31_t0['assign-unicode']['bind'](_r31_t0); @@ -322,17 +374,17 @@ r31_xn$putshapes$9Jrj = _r31_t0['put-shapes']['bind'](_r31_t0); r31_xn$reverselast$3qIs = _r31_t0['reverse-last']['bind'](_r31_t0); r31_xn$includeglyph$3qIs = _r31_t0['include-glyph']['bind'](_r31_t0); + r31_xn$createstroke$7Hrq = _r31_t0['create-stroke']['bind'](_r31_t0); + _r31_t0['gizmo'] = r0_globalTransform; r31_xn$setwidth$9Jrj(r0_WIDTH); - r31_xn$assignunicode$7Hrq('G'); - r31_outline = new r0_Stroke(); - r31_outline['start-from'](r0_RIGHTSB - r0_SB * 0.1, r0_CAP - r0_HOOK)['curve-to'](r0_MIDDLE + r0_KAPPA_HOOK * (r0_MIDDLE - r0_para['sb']), r0_CAPO, r0_MIDDLE, r0_CAPO)['cubic-to'](r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_CAPO, r0_SB, r0_CAP - r0_COBKAPPA * r0_SMOOTH, r0_SB, r0_CAP_SMOOTH)['line-to'](r0_SB, r0_SMOOTH)['cubic-to'](r0_SB, r0_COBKAPPA * r0_SMOOTH, r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_O, r0_WIDTH / 2, r0_O)['cubic-to'](r0_MIDDLE + r0_BKAPPA * (r0_RIGHTSB - r0_MIDDLE), r0_O, r0_RIGHTSB, r0_COBKAPPA * r0_SMOOTH, r0_RIGHTSB, r0_SMOOTH)['line-to'](r0_RIGHTSB, r0_CAP / 2 + r0_STROKE / 2); + r31_xn$assignunicode$7Hrq('O'); + r31_outline = r31_xn$createstroke$7Hrq(); + r31_outline['start-from'](r0_MIDDLE, r0_CAPO)['cubic-to'](r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_CAPO, r0_SB, r0_CAP - r0_COBKAPPA * r0_SMOOTH, r0_SB, r0_CAP - r0_SMOOTH)['line-to'](r0_SB, r0_SMOOTH)['cubic-to'](r0_SB, r0_COBKAPPA * r0_SMOOTH, r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_O, r0_WIDTH / 2, r0_O)['cubic-to'](r0_MIDDLE + r0_BKAPPA * (r0_RIGHTSB - r0_MIDDLE), r0_O, r0_RIGHTSB, r0_COBKAPPA * r0_SMOOTH, r0_RIGHTSB, r0_SMOOTH)['line-to'](r0_RIGHTSB, r0_CAP - r0_SMOOTH)['cubic-to'](r0_RIGHTSB, r0_CAP - r0_COBKAPPA * r0_SMOOTH, r0_MIDDLE + r0_BKAPPA * (r0_RIGHTSB - r0_MIDDLE), r0_CAPO, r0_MIDDLE, r0_CAPO); r31_xn$putshapes$9Jrj(r31_outline['form-stroke'](r0_STROKE, 0)); - r31_bar = new r0_Stroke()['start-from'](r0_MIDDLE, r0_CAP / 2 + r0_STROKE / 2)['line-to'](r0_RIGHTSB, r0_CAP / 2 + r0_STROKE / 2); - r31_xn$putshapes$9Jrj(r31_bar['form-stroke'](0, r0_STROKE)); return void 0; }); - r0_xn$createglyph$7Hrq('O', function _r0_t14() { - var r33_xn$setwidth$9Jrj, r33_xn$assignunicode$7Hrq, r33_xn$startfrom$1aao, r33_xn$lineto$5sIl, r33_xn$curveto$1aao, r33_xn$cubicto$1aao, r33_xn$putshapes$9Jrj, r33_xn$reverselast$3qIs, r33_xn$includeglyph$3qIs, r33_outline, _r33_t0; + r0_xn$createglyph$7Hrq('zero.slashed', function _r0_t15() { + var r33_xn$setwidth$9Jrj, r33_xn$assignunicode$7Hrq, r33_xn$startfrom$1aao, r33_xn$lineto$5sIl, r33_xn$curveto$1aao, r33_xn$cubicto$1aao, r33_xn$putshapes$9Jrj, r33_xn$reverselast$3qIs, r33_xn$includeglyph$3qIs, r33_xn$createstroke$7Hrq, r33_bar, _r33_t0; _r33_t0 = this; r33_xn$setwidth$9Jrj = _r33_t0['set-width']['bind'](_r33_t0); r33_xn$assignunicode$7Hrq = _r33_t0['assign-unicode']['bind'](_r33_t0); @@ -343,15 +395,16 @@ r33_xn$putshapes$9Jrj = _r33_t0['put-shapes']['bind'](_r33_t0); r33_xn$reverselast$3qIs = _r33_t0['reverse-last']['bind'](_r33_t0); r33_xn$includeglyph$3qIs = _r33_t0['include-glyph']['bind'](_r33_t0); + r33_xn$createstroke$7Hrq = _r33_t0['create-stroke']['bind'](_r33_t0); + _r33_t0['gizmo'] = r0_globalTransform; r33_xn$setwidth$9Jrj(r0_WIDTH); - r33_xn$assignunicode$7Hrq('O'); - r33_outline = new r0_Stroke(); - r33_outline['start-from'](r0_MIDDLE, r0_CAPO)['cubic-to'](r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_CAPO, r0_SB, r0_CAP - r0_COBKAPPA * r0_SMOOTH, r0_SB, r0_CAP - r0_SMOOTH)['line-to'](r0_SB, r0_SMOOTH)['cubic-to'](r0_SB, r0_COBKAPPA * r0_SMOOTH, r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_O, r0_WIDTH / 2, r0_O)['cubic-to'](r0_MIDDLE + r0_BKAPPA * (r0_RIGHTSB - r0_MIDDLE), r0_O, r0_RIGHTSB, r0_COBKAPPA * r0_SMOOTH, r0_RIGHTSB, r0_SMOOTH)['line-to'](r0_RIGHTSB, r0_CAP - r0_SMOOTH)['cubic-to'](r0_RIGHTSB, r0_CAP - r0_COBKAPPA * r0_SMOOTH, r0_MIDDLE + r0_BKAPPA * (r0_RIGHTSB - r0_MIDDLE), r0_CAPO, r0_MIDDLE, r0_CAPO); - r33_xn$putshapes$9Jrj(r33_outline['form-stroke'](r0_STROKE, 0)); + r33_xn$putshapes$9Jrj(r0_glyphs['O']['contours']); + r33_bar = r33_xn$createstroke$7Hrq()['start-from'](r0_SB + r0_STROKE / 2, r0_CAP * (1 - 0.65))['line-to'](r0_RIGHTSB - r0_STROKE / 2, r0_CAP * 0.65); + r33_xn$putshapes$9Jrj(r33_bar['form-stroke'](r0_STROKE / 2, r0_STROKE / 2)); return void 0; }); - r0_xn$createglyph$7Hrq('zero.slashed', function _r0_t15() { - var r35_xn$setwidth$9Jrj, r35_xn$assignunicode$7Hrq, r35_xn$startfrom$1aao, r35_xn$lineto$5sIl, r35_xn$curveto$1aao, r35_xn$cubicto$1aao, r35_xn$putshapes$9Jrj, r35_xn$reverselast$3qIs, r35_xn$includeglyph$3qIs, r35_bar, _r35_t0; + r0_xn$createglyph$7Hrq('zero.unslashed', function _r0_t16() { + var r35_xn$setwidth$9Jrj, r35_xn$assignunicode$7Hrq, r35_xn$startfrom$1aao, r35_xn$lineto$5sIl, r35_xn$curveto$1aao, r35_xn$cubicto$1aao, r35_xn$putshapes$9Jrj, r35_xn$reverselast$3qIs, r35_xn$includeglyph$3qIs, r35_xn$createstroke$7Hrq, _r35_t0; _r35_t0 = this; r35_xn$setwidth$9Jrj = _r35_t0['set-width']['bind'](_r35_t0); r35_xn$assignunicode$7Hrq = _r35_t0['assign-unicode']['bind'](_r35_t0); @@ -362,14 +415,13 @@ r35_xn$putshapes$9Jrj = _r35_t0['put-shapes']['bind'](_r35_t0); r35_xn$reverselast$3qIs = _r35_t0['reverse-last']['bind'](_r35_t0); r35_xn$includeglyph$3qIs = _r35_t0['include-glyph']['bind'](_r35_t0); - r35_xn$setwidth$9Jrj(r0_WIDTH); - r35_xn$putshapes$9Jrj(r0_glyphs['O']['contours']); - r35_bar = new r0_Stroke()['start-from'](r0_SB + r0_STROKE / 2, r0_CAP * (1 - 0.65))['line-to'](r0_RIGHTSB - r0_STROKE / 2, r0_CAP * 0.65); - r35_xn$putshapes$9Jrj(r35_bar['form-stroke'](r0_STROKE / 2, r0_STROKE / 2)); + r35_xn$createstroke$7Hrq = _r35_t0['create-stroke']['bind'](_r35_t0); + _r35_t0['gizmo'] = r0_globalTransform; + r35_xn$includeglyph$3qIs(r0_glyphs['O']); return void 0; }); - r0_xn$createglyph$7Hrq('zero.unslashed', function _r0_t16() { - var r37_xn$setwidth$9Jrj, r37_xn$assignunicode$7Hrq, r37_xn$startfrom$1aao, r37_xn$lineto$5sIl, r37_xn$curveto$1aao, r37_xn$cubicto$1aao, r37_xn$putshapes$9Jrj, r37_xn$reverselast$3qIs, r37_xn$includeglyph$3qIs, _r37_t0; + r0_xn$createglyph$7Hrq('zero.dotted', function _r0_t17() { + var r37_xn$setwidth$9Jrj, r37_xn$assignunicode$7Hrq, r37_xn$startfrom$1aao, r37_xn$lineto$5sIl, r37_xn$curveto$1aao, r37_xn$cubicto$1aao, r37_xn$putshapes$9Jrj, r37_xn$reverselast$3qIs, r37_xn$includeglyph$3qIs, r37_xn$createstroke$7Hrq, _r37_t0; _r37_t0 = this; r37_xn$setwidth$9Jrj = _r37_t0['set-width']['bind'](_r37_t0); r37_xn$assignunicode$7Hrq = _r37_t0['assign-unicode']['bind'](_r37_t0); @@ -380,64 +432,78 @@ r37_xn$putshapes$9Jrj = _r37_t0['put-shapes']['bind'](_r37_t0); r37_xn$reverselast$3qIs = _r37_t0['reverse-last']['bind'](_r37_t0); r37_xn$includeglyph$3qIs = _r37_t0['include-glyph']['bind'](_r37_t0); + r37_xn$createstroke$7Hrq = _r37_t0['create-stroke']['bind'](_r37_t0); + _r37_t0['gizmo'] = r0_globalTransform; r37_xn$includeglyph$3qIs(r0_glyphs['O']); - return void 0; - }); - r0_xn$createglyph$7Hrq('zero.dotted', function _r0_t17() { - var r39_xn$setwidth$9Jrj, r39_xn$assignunicode$7Hrq, r39_xn$startfrom$1aao, r39_xn$lineto$5sIl, r39_xn$curveto$1aao, r39_xn$cubicto$1aao, r39_xn$putshapes$9Jrj, r39_xn$reverselast$3qIs, r39_xn$includeglyph$3qIs, _r39_t0; - _r39_t0 = this; - r39_xn$setwidth$9Jrj = _r39_t0['set-width']['bind'](_r39_t0); - r39_xn$assignunicode$7Hrq = _r39_t0['assign-unicode']['bind'](_r39_t0); - r39_xn$startfrom$1aao = _r39_t0['start-from']['bind'](_r39_t0); - r39_xn$lineto$5sIl = _r39_t0['line-to']['bind'](_r39_t0); - r39_xn$curveto$1aao = _r39_t0['curve-to']['bind'](_r39_t0); - r39_xn$cubicto$1aao = _r39_t0['cubic-to']['bind'](_r39_t0); - r39_xn$putshapes$9Jrj = _r39_t0['put-shapes']['bind'](_r39_t0); - r39_xn$reverselast$3qIs = _r39_t0['reverse-last']['bind'](_r39_t0); - r39_xn$includeglyph$3qIs = _r39_t0['include-glyph']['bind'](_r39_t0); - r39_xn$includeglyph$3qIs(r0_glyphs['O']); - r39_xn$putshapes$9Jrj([r0_Ring(r0_CAPMIDDLE + r0_DOTRADIUS, r0_CAPMIDDLE - r0_DOTRADIUS, r0_MIDDLE + r0_DOTRADIUS, r0_MIDDLE - r0_DOTRADIUS)]); + r37_xn$putshapes$9Jrj([r0_Ring(r0_CAPMIDDLE + r0_DOTRADIUS, r0_CAPMIDDLE - r0_DOTRADIUS, r0_MIDDLE + r0_DOTRADIUS, r0_MIDDLE - r0_DOTRADIUS)]); return void 0; }); r0_xn$createglyph$7Hrq('zero', function _r0_t18() { - var r41_xn$setwidth$9Jrj, r41_xn$assignunicode$7Hrq, r41_xn$startfrom$1aao, r41_xn$lineto$5sIl, r41_xn$curveto$1aao, r41_xn$cubicto$1aao, r41_xn$putshapes$9Jrj, r41_xn$reverselast$3qIs, r41_xn$includeglyph$3qIs, r41_otherwise, _r41_t0, _r41_t1, _r41_t2, _r41_t3, _r41_t4, _r41_t5, _r41_t6, _r41_t7; - _r41_t1 = this; - r41_xn$setwidth$9Jrj = _r41_t1['set-width']['bind'](_r41_t1); - r41_xn$assignunicode$7Hrq = _r41_t1['assign-unicode']['bind'](_r41_t1); - r41_xn$startfrom$1aao = _r41_t1['start-from']['bind'](_r41_t1); - r41_xn$lineto$5sIl = _r41_t1['line-to']['bind'](_r41_t1); - r41_xn$curveto$1aao = _r41_t1['curve-to']['bind'](_r41_t1); - r41_xn$cubicto$1aao = _r41_t1['cubic-to']['bind'](_r41_t1); - r41_xn$putshapes$9Jrj = _r41_t1['put-shapes']['bind'](_r41_t1); - r41_xn$reverselast$3qIs = _r41_t1['reverse-last']['bind'](_r41_t1); - r41_xn$includeglyph$3qIs = _r41_t1['include-glyph']['bind'](_r41_t1); - r41_xn$setwidth$9Jrj(r0_WIDTH); - r41_xn$assignunicode$7Hrq('0'); - _r41_t2 = r41_xn$includeglyph$3qIs; - _r41_t3 = r0_glyphs; - _r41_t0 = r0_variantSelector['zero']; - if ('slashed' === _r41_t0) { - _r41_t4 = 'zero.slashed'; + var r39_xn$setwidth$9Jrj, r39_xn$assignunicode$7Hrq, r39_xn$startfrom$1aao, r39_xn$lineto$5sIl, r39_xn$curveto$1aao, r39_xn$cubicto$1aao, r39_xn$putshapes$9Jrj, r39_xn$reverselast$3qIs, r39_xn$includeglyph$3qIs, r39_xn$createstroke$7Hrq, r39_otherwise, _r39_t0, _r39_t1, _r39_t2, _r39_t3, _r39_t4, _r39_t5, _r39_t6, _r39_t7; + _r39_t1 = this; + r39_xn$setwidth$9Jrj = _r39_t1['set-width']['bind'](_r39_t1); + r39_xn$assignunicode$7Hrq = _r39_t1['assign-unicode']['bind'](_r39_t1); + r39_xn$startfrom$1aao = _r39_t1['start-from']['bind'](_r39_t1); + r39_xn$lineto$5sIl = _r39_t1['line-to']['bind'](_r39_t1); + r39_xn$curveto$1aao = _r39_t1['curve-to']['bind'](_r39_t1); + r39_xn$cubicto$1aao = _r39_t1['cubic-to']['bind'](_r39_t1); + r39_xn$putshapes$9Jrj = _r39_t1['put-shapes']['bind'](_r39_t1); + r39_xn$reverselast$3qIs = _r39_t1['reverse-last']['bind'](_r39_t1); + r39_xn$includeglyph$3qIs = _r39_t1['include-glyph']['bind'](_r39_t1); + r39_xn$createstroke$7Hrq = _r39_t1['create-stroke']['bind'](_r39_t1); + _r39_t1['gizmo'] = r0_globalTransform; + r39_xn$setwidth$9Jrj(r0_WIDTH); + r39_xn$assignunicode$7Hrq('0'); + _r39_t2 = r39_xn$includeglyph$3qIs; + _r39_t3 = r0_glyphs; + _r39_t0 = r0_variantSelector['zero']; + if ('slashed' === _r39_t0) { + _r39_t4 = 'zero.slashed'; } else { - if ('dotted' === _r41_t0) { - _r41_t5 = 'zero.dotted'; + if ('dotted' === _r39_t0) { + _r39_t5 = 'zero.dotted'; } else { - if ('unslahsed' === _r41_t0) { - _r41_t6 = 'zero.unslashed'; + if ('unslahsed' === _r39_t0) { + _r39_t6 = 'zero.unslashed'; } else { - r41_otherwise = _r41_t0; - _r41_t6 = 'zero.slashed'; + r39_otherwise = _r39_t0; + _r39_t6 = 'zero.slashed'; } - _r41_t5 = _r41_t6; + _r39_t5 = _r39_t6; } - _r41_t4 = _r41_t5; + _r39_t4 = _r39_t5; } - _r41_t7 = _r41_t3[_r41_t4]; - _r41_t2(_r41_t7); + _r39_t7 = _r39_t3[_r39_t4]; + _r39_t2(_r39_t7); return void 0; }); r0_xn$createglyph$7Hrq('Q', function _r0_t19() { - var r43_xn$setwidth$9Jrj, r43_xn$assignunicode$7Hrq, r43_xn$startfrom$1aao, r43_xn$lineto$5sIl, r43_xn$curveto$1aao, r43_xn$cubicto$1aao, r43_xn$putshapes$9Jrj, r43_xn$reverselast$3qIs, r43_xn$includeglyph$3qIs, _r43_t0; + var r41_xn$setwidth$9Jrj, r41_xn$assignunicode$7Hrq, r41_xn$startfrom$1aao, r41_xn$lineto$5sIl, r41_xn$curveto$1aao, r41_xn$cubicto$1aao, r41_xn$putshapes$9Jrj, r41_xn$reverselast$3qIs, r41_xn$includeglyph$3qIs, r41_xn$createstroke$7Hrq, _r41_t0; + _r41_t0 = this; + r41_xn$setwidth$9Jrj = _r41_t0['set-width']['bind'](_r41_t0); + r41_xn$assignunicode$7Hrq = _r41_t0['assign-unicode']['bind'](_r41_t0); + r41_xn$startfrom$1aao = _r41_t0['start-from']['bind'](_r41_t0); + r41_xn$lineto$5sIl = _r41_t0['line-to']['bind'](_r41_t0); + r41_xn$curveto$1aao = _r41_t0['curve-to']['bind'](_r41_t0); + r41_xn$cubicto$1aao = _r41_t0['cubic-to']['bind'](_r41_t0); + r41_xn$putshapes$9Jrj = _r41_t0['put-shapes']['bind'](_r41_t0); + r41_xn$reverselast$3qIs = _r41_t0['reverse-last']['bind'](_r41_t0); + r41_xn$includeglyph$3qIs = _r41_t0['include-glyph']['bind'](_r41_t0); + r41_xn$createstroke$7Hrq = _r41_t0['create-stroke']['bind'](_r41_t0); + _r41_t0['gizmo'] = r0_globalTransform; + r41_xn$setwidth$9Jrj(r0_WIDTH); + r41_xn$assignunicode$7Hrq('Q'); + r41_xn$putshapes$9Jrj(r0_glyphs['O']['contours']); + r41_xn$startfrom$1aao(r0_MIDDLE, 0); + r41_xn$lineto$5sIl(r0_MIDDLE + r0_STROKE / 2, -r0_CAP * 0.2); + r41_xn$lineto$5sIl(r0_MIDDLE + r0_STROKE / 2 + r0_STROKE, -r0_CAP * 0.2); + r41_xn$lineto$5sIl(r0_MIDDLE + r0_STROKE, 0); + r41_xn$lineto$5sIl(r0_MIDDLE + r0_STROKE * (1 - 0.5 / 3), r0_STROKE * 0.5); + r41_xn$reverselast$3qIs(); + return void 0; + }); + r0_xn$createglyph$7Hrq('H', function _r0_t20() { + var r43_xn$setwidth$9Jrj, r43_xn$assignunicode$7Hrq, r43_xn$startfrom$1aao, r43_xn$lineto$5sIl, r43_xn$curveto$1aao, r43_xn$cubicto$1aao, r43_xn$putshapes$9Jrj, r43_xn$reverselast$3qIs, r43_xn$includeglyph$3qIs, r43_xn$createstroke$7Hrq, _r43_t0; _r43_t0 = this; r43_xn$setwidth$9Jrj = _r43_t0['set-width']['bind'](_r43_t0); r43_xn$assignunicode$7Hrq = _r43_t0['assign-unicode']['bind'](_r43_t0); @@ -448,19 +514,17 @@ r43_xn$putshapes$9Jrj = _r43_t0['put-shapes']['bind'](_r43_t0); r43_xn$reverselast$3qIs = _r43_t0['reverse-last']['bind'](_r43_t0); r43_xn$includeglyph$3qIs = _r43_t0['include-glyph']['bind'](_r43_t0); + r43_xn$createstroke$7Hrq = _r43_t0['create-stroke']['bind'](_r43_t0); + _r43_t0['gizmo'] = r0_globalTransform; r43_xn$setwidth$9Jrj(r0_WIDTH); - r43_xn$assignunicode$7Hrq('Q'); - r43_xn$putshapes$9Jrj(r0_glyphs['O']['contours']); - r43_xn$startfrom$1aao(r0_MIDDLE, 0); - r43_xn$lineto$5sIl(r0_MIDDLE + r0_STROKE / 2, -r0_CAP * 0.2); - r43_xn$lineto$5sIl(r0_MIDDLE + r0_STROKE / 2 + r0_STROKE, -r0_CAP * 0.2); - r43_xn$lineto$5sIl(r0_MIDDLE + r0_STROKE, 0); - r43_xn$lineto$5sIl(r0_MIDDLE + r0_STROKE * (1 - 0.5 / 3), r0_STROKE * 0.5); - r43_xn$reverselast$3qIs(); + r43_xn$assignunicode$7Hrq('H'); + r43_xn$putshapes$9Jrj(r43_xn$createstroke$7Hrq()['start-from'](r0_SB, 0)['pen-direction'](r0_UPWARD)['set-width'](0, r0_STROKE)['line-to'](r0_SB, r0_CAP)['pen-direction'](r0_UPWARD)['form-stroke']()); + r43_xn$putshapes$9Jrj(r43_xn$createstroke$7Hrq()['start-from'](r0_RIGHTSB, 0)['pen-direction'](r0_UPWARD)['set-width'](r0_STROKE, 0)['line-to'](r0_RIGHTSB, r0_CAP)['pen-direction'](r0_UPWARD)['form-stroke']()); + r43_xn$putshapes$9Jrj(r43_xn$createstroke$7Hrq()['start-from'](r0_SB, r0_CAP / 2)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['pen-direction'](r0_RIGHTWARD)['line-to'](r0_RIGHTSB, r0_CAP / 2)['pen-direction'](r0_RIGHTWARD)['form-stroke']()); return void 0; }); - r0_xn$createglyph$7Hrq('H', function _r0_t20() { - var r45_xn$setwidth$9Jrj, r45_xn$assignunicode$7Hrq, r45_xn$startfrom$1aao, r45_xn$lineto$5sIl, r45_xn$curveto$1aao, r45_xn$cubicto$1aao, r45_xn$putshapes$9Jrj, r45_xn$reverselast$3qIs, r45_xn$includeglyph$3qIs, _r45_t0; + r0_xn$createglyph$7Hrq('L', function _r0_t21() { + var r45_xn$setwidth$9Jrj, r45_xn$assignunicode$7Hrq, r45_xn$startfrom$1aao, r45_xn$lineto$5sIl, r45_xn$curveto$1aao, r45_xn$cubicto$1aao, r45_xn$putshapes$9Jrj, r45_xn$reverselast$3qIs, r45_xn$includeglyph$3qIs, r45_xn$createstroke$7Hrq, _r45_t0; _r45_t0 = this; r45_xn$setwidth$9Jrj = _r45_t0['set-width']['bind'](_r45_t0); r45_xn$assignunicode$7Hrq = _r45_t0['assign-unicode']['bind'](_r45_t0); @@ -471,15 +535,16 @@ r45_xn$putshapes$9Jrj = _r45_t0['put-shapes']['bind'](_r45_t0); r45_xn$reverselast$3qIs = _r45_t0['reverse-last']['bind'](_r45_t0); r45_xn$includeglyph$3qIs = _r45_t0['include-glyph']['bind'](_r45_t0); + r45_xn$createstroke$7Hrq = _r45_t0['create-stroke']['bind'](_r45_t0); + _r45_t0['gizmo'] = r0_globalTransform; r45_xn$setwidth$9Jrj(r0_WIDTH); - r45_xn$assignunicode$7Hrq('H'); - r45_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_SB, 0)['set-width'](0, r0_STROKE)['line-to'](r0_SB, r0_CAP)['form-stroke']()); - r45_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_RIGHTSB, 0)['set-width'](r0_STROKE, 0)['line-to'](r0_RIGHTSB, r0_CAP)['form-stroke']()); - r45_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_SB, r0_CAP / 2)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['line-to'](r0_RIGHTSB, r0_CAP / 2)['form-stroke']()); + r45_xn$assignunicode$7Hrq('L'); + r45_xn$putshapes$9Jrj(r45_xn$createstroke$7Hrq()['start-from'](r0_SB * 1.5, r0_CAP)['set-width'](r0_STROKE, 0)['pen-direction'](r0_DOWNWARD)['line-to'](r0_SB * 1.5, 0)['pen-direction'](r0_DOWNWARD)['form-stroke']()); + r45_xn$putshapes$9Jrj(r45_xn$createstroke$7Hrq()['start-from'](r0_SB * 1.5, 0)['set-width'](r0_STROKE, 0)['pen-direction'](r0_RIGHTWARD)['line-to'](r0_RIGHTSB, 0)['pen-direction'](r0_RIGHTWARD)['form-stroke']()); return void 0; }); - r0_xn$createglyph$7Hrq('L', function _r0_t21() { - var r47_xn$setwidth$9Jrj, r47_xn$assignunicode$7Hrq, r47_xn$startfrom$1aao, r47_xn$lineto$5sIl, r47_xn$curveto$1aao, r47_xn$cubicto$1aao, r47_xn$putshapes$9Jrj, r47_xn$reverselast$3qIs, r47_xn$includeglyph$3qIs, _r47_t0; + r0_xn$createglyph$7Hrq('dotlessI.straight', function _r0_t22() { + var r47_xn$setwidth$9Jrj, r47_xn$assignunicode$7Hrq, r47_xn$startfrom$1aao, r47_xn$lineto$5sIl, r47_xn$curveto$1aao, r47_xn$cubicto$1aao, r47_xn$putshapes$9Jrj, r47_xn$reverselast$3qIs, r47_xn$includeglyph$3qIs, r47_xn$createstroke$7Hrq, _r47_t0; _r47_t0 = this; r47_xn$setwidth$9Jrj = _r47_t0['set-width']['bind'](_r47_t0); r47_xn$assignunicode$7Hrq = _r47_t0['assign-unicode']['bind'](_r47_t0); @@ -490,13 +555,13 @@ r47_xn$putshapes$9Jrj = _r47_t0['put-shapes']['bind'](_r47_t0); r47_xn$reverselast$3qIs = _r47_t0['reverse-last']['bind'](_r47_t0); r47_xn$includeglyph$3qIs = _r47_t0['include-glyph']['bind'](_r47_t0); - r47_xn$setwidth$9Jrj(r0_WIDTH); - r47_xn$assignunicode$7Hrq('L'); - r47_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_SB * 1.5, r0_CAP)['line-to'](r0_SB * 1.5, 0)['line-to'](r0_RIGHTSB, 0)['form-stroke'](r0_STROKE, 0)); + r47_xn$createstroke$7Hrq = _r47_t0['create-stroke']['bind'](_r47_t0); + _r47_t0['gizmo'] = r0_globalTransform; + r47_xn$putshapes$9Jrj(r47_xn$createstroke$7Hrq()['start-from'](r0_MIDDLE, 0)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['line-to'](r0_MIDDLE, r0_CAP)['form-stroke']()); return void 0; }); - r0_xn$createglyph$7Hrq('dotlessI.straight', function _r0_t22() { - var r49_xn$setwidth$9Jrj, r49_xn$assignunicode$7Hrq, r49_xn$startfrom$1aao, r49_xn$lineto$5sIl, r49_xn$curveto$1aao, r49_xn$cubicto$1aao, r49_xn$putshapes$9Jrj, r49_xn$reverselast$3qIs, r49_xn$includeglyph$3qIs, _r49_t0; + r0_xn$createglyph$7Hrq('dotlessI.symmetric', function _r0_t23() { + var r49_xn$setwidth$9Jrj, r49_xn$assignunicode$7Hrq, r49_xn$startfrom$1aao, r49_xn$lineto$5sIl, r49_xn$curveto$1aao, r49_xn$cubicto$1aao, r49_xn$putshapes$9Jrj, r49_xn$reverselast$3qIs, r49_xn$includeglyph$3qIs, r49_xn$createstroke$7Hrq, _r49_t0; _r49_t0 = this; r49_xn$setwidth$9Jrj = _r49_t0['set-width']['bind'](_r49_t0); r49_xn$assignunicode$7Hrq = _r49_t0['assign-unicode']['bind'](_r49_t0); @@ -507,11 +572,15 @@ r49_xn$putshapes$9Jrj = _r49_t0['put-shapes']['bind'](_r49_t0); r49_xn$reverselast$3qIs = _r49_t0['reverse-last']['bind'](_r49_t0); r49_xn$includeglyph$3qIs = _r49_t0['include-glyph']['bind'](_r49_t0); - r49_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_MIDDLE, 0)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['line-to'](r0_MIDDLE, r0_CAP)['form-stroke']()); + r49_xn$createstroke$7Hrq = _r49_t0['create-stroke']['bind'](_r49_t0); + _r49_t0['gizmo'] = r0_globalTransform; + r49_xn$includeglyph$3qIs(r0_glyphs['dotlessI.straight']); + r49_xn$putshapes$9Jrj(r49_xn$createstroke$7Hrq()['start-from'](r0_MIDDLE - r0_WIDTH * 0.26, r0_CAP)['set-width'](0, r0_STROKE)['line-to'](r0_MIDDLE + r0_WIDTH * 0.26, r0_CAP)['form-stroke']()); + r49_xn$putshapes$9Jrj(r49_xn$createstroke$7Hrq()['start-from'](r0_MIDDLE - r0_WIDTH * 0.26, 0)['set-width'](r0_STROKE, 0)['line-to'](r0_MIDDLE + r0_WIDTH * 0.26, 0)['form-stroke']()); return void 0; }); - r0_xn$createglyph$7Hrq('dotlessI.symmetric', function _r0_t23() { - var r51_xn$setwidth$9Jrj, r51_xn$assignunicode$7Hrq, r51_xn$startfrom$1aao, r51_xn$lineto$5sIl, r51_xn$curveto$1aao, r51_xn$cubicto$1aao, r51_xn$putshapes$9Jrj, r51_xn$reverselast$3qIs, r51_xn$includeglyph$3qIs, _r51_t0; + r0_xn$createglyph$7Hrq('I', function _r0_t24() { + var r51_xn$setwidth$9Jrj, r51_xn$assignunicode$7Hrq, r51_xn$startfrom$1aao, r51_xn$lineto$5sIl, r51_xn$curveto$1aao, r51_xn$cubicto$1aao, r51_xn$putshapes$9Jrj, r51_xn$reverselast$3qIs, r51_xn$includeglyph$3qIs, r51_xn$createstroke$7Hrq, _r51_t0; _r51_t0 = this; r51_xn$setwidth$9Jrj = _r51_t0['set-width']['bind'](_r51_t0); r51_xn$assignunicode$7Hrq = _r51_t0['assign-unicode']['bind'](_r51_t0); @@ -522,13 +591,15 @@ r51_xn$putshapes$9Jrj = _r51_t0['put-shapes']['bind'](_r51_t0); r51_xn$reverselast$3qIs = _r51_t0['reverse-last']['bind'](_r51_t0); r51_xn$includeglyph$3qIs = _r51_t0['include-glyph']['bind'](_r51_t0); - r51_xn$includeglyph$3qIs(r0_glyphs['dotlessI.straight']); - r51_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_MIDDLE - r0_WIDTH * 0.26, r0_CAP)['set-width'](0, r0_STROKE)['line-to'](r0_MIDDLE + r0_WIDTH * 0.26, r0_CAP)['form-stroke']()); - r51_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_MIDDLE - r0_WIDTH * 0.26, 0)['set-width'](r0_STROKE, 0)['line-to'](r0_MIDDLE + r0_WIDTH * 0.26, 0)['form-stroke']()); + r51_xn$createstroke$7Hrq = _r51_t0['create-stroke']['bind'](_r51_t0); + _r51_t0['gizmo'] = r0_globalTransform; + r51_xn$setwidth$9Jrj(r0_WIDTH); + r51_xn$assignunicode$7Hrq('I'); + r51_xn$includeglyph$3qIs(r0_glyphs['dotlessI.symmetric']); return void 0; }); - r0_xn$createglyph$7Hrq('I', function _r0_t24() { - var r53_xn$setwidth$9Jrj, r53_xn$assignunicode$7Hrq, r53_xn$startfrom$1aao, r53_xn$lineto$5sIl, r53_xn$curveto$1aao, r53_xn$cubicto$1aao, r53_xn$putshapes$9Jrj, r53_xn$reverselast$3qIs, r53_xn$includeglyph$3qIs, _r53_t0; + r0_xn$createglyph$7Hrq('S', function _r0_t25() { + var r53_xn$setwidth$9Jrj, r53_xn$assignunicode$7Hrq, r53_xn$startfrom$1aao, r53_xn$lineto$5sIl, r53_xn$curveto$1aao, r53_xn$cubicto$1aao, r53_xn$putshapes$9Jrj, r53_xn$reverselast$3qIs, r53_xn$includeglyph$3qIs, r53_xn$createstroke$7Hrq, r53_slope, r53_bowltop, r53_strokemiddle, r53_bowlbottom, _r53_t0; _r53_t0 = this; r53_xn$setwidth$9Jrj = _r53_t0['set-width']['bind'](_r53_t0); r53_xn$assignunicode$7Hrq = _r53_t0['assign-unicode']['bind'](_r53_t0); @@ -539,13 +610,24 @@ r53_xn$putshapes$9Jrj = _r53_t0['put-shapes']['bind'](_r53_t0); r53_xn$reverselast$3qIs = _r53_t0['reverse-last']['bind'](_r53_t0); r53_xn$includeglyph$3qIs = _r53_t0['include-glyph']['bind'](_r53_t0); + r53_xn$createstroke$7Hrq = _r53_t0['create-stroke']['bind'](_r53_t0); + _r53_t0['gizmo'] = r0_globalTransform; r53_xn$setwidth$9Jrj(r0_WIDTH); - r53_xn$assignunicode$7Hrq('I'); - r53_xn$includeglyph$3qIs(r0_glyphs['dotlessI.symmetric']); + r53_xn$assignunicode$7Hrq('S'); + r53_slope = 0.11; + r53_bowltop = r53_xn$createstroke$7Hrq(); + r53_bowltop['start-from'](r0_RIGHTSB - r0_SB * 0.1, r0_CAP - r0_HOOK)['set-width'](r0_STROKE, 0)['curve-to'](r0_MIDDLE + r0_KAPPA_HOOK * (r0_MIDDLE - r0_para['sb']), r0_CAPO, r0_MIDDLE, r0_CAPO)['cubic-to'](r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_CAPO, r0_SB, r0_CAP - r0_COBKAPPA * r0_SMOOTH, r0_SB, r0_CAP_SMOOTH); + r53_strokemiddle = r53_xn$createstroke$7Hrq(); + r53_strokemiddle['start-from'](r0_SB + r0_STROKE / 2, r0_CAP_SMOOTH)['set-width'](r0_STROKE / 2, r0_STROKE / 2)['curve-to'](r0_SB + r0_STROKE / 2, (0.5 + r53_slope) * r0_CAP + 2 * r53_slope * r0_CAP / (0.4 * r0_WIDTH) * (0.3 * r0_WIDTH - r0_SB - r0_STROKE / 2), 0.3 * r0_WIDTH, (0.5 + r53_slope) * r0_CAP)['line-to'](0.7 * r0_WIDTH, (0.5 - r53_slope) * r0_CAP)['curve-to'](r0_RIGHTSB - r0_STROKE / 2, (0.5 - r53_slope) * r0_CAP - 2 * r53_slope * r0_CAP / (0.4 * r0_WIDTH) * (0.3 * r0_WIDTH - r0_SB - r0_STROKE / 2), r0_RIGHTSB - r0_STROKE / 2, r0_SMOOTH); + r53_bowlbottom = r53_xn$createstroke$7Hrq(); + r53_bowlbottom['start-from'](r0_RIGHTSB, r0_SMOOTH)['set-width'](0, r0_STROKE)['cubic-to'](r0_RIGHTSB, r0_COBKAPPA * r0_SMOOTH, r0_MIDDLE + r0_BKAPPA * (r0_RIGHTSB - r0_MIDDLE), r0_O, r0_MIDDLE, r0_O)['curve-to'](r0_MIDDLE - r0_KAPPA_HOOK * (r0_MIDDLE - r0_para['sb']), r0_O, r0_SB * 1.1, r0_HOOK); + r53_xn$putshapes$9Jrj(r53_bowltop['form-stroke']()); + r53_xn$putshapes$9Jrj(r53_strokemiddle['form-stroke']()); + r53_xn$putshapes$9Jrj(r53_bowlbottom['form-stroke']()); return void 0; }); - r0_xn$createglyph$7Hrq('S', function _r0_t25() { - var r55_xn$setwidth$9Jrj, r55_xn$assignunicode$7Hrq, r55_xn$startfrom$1aao, r55_xn$lineto$5sIl, r55_xn$curveto$1aao, r55_xn$cubicto$1aao, r55_xn$putshapes$9Jrj, r55_xn$reverselast$3qIs, r55_xn$includeglyph$3qIs, r55_slope, r55_bowltop, r55_strokemiddle, r55_bowlbottom, _r55_t0; + r0_xn$createglyph$7Hrq('dollar', function _r0_t26() { + var r55_xn$setwidth$9Jrj, r55_xn$assignunicode$7Hrq, r55_xn$startfrom$1aao, r55_xn$lineto$5sIl, r55_xn$curveto$1aao, r55_xn$cubicto$1aao, r55_xn$putshapes$9Jrj, r55_xn$reverselast$3qIs, r55_xn$includeglyph$3qIs, r55_xn$createstroke$7Hrq, _r55_t0; _r55_t0 = this; r55_xn$setwidth$9Jrj = _r55_t0['set-width']['bind'](_r55_t0); r55_xn$assignunicode$7Hrq = _r55_t0['assign-unicode']['bind'](_r55_t0); @@ -556,22 +638,17 @@ r55_xn$putshapes$9Jrj = _r55_t0['put-shapes']['bind'](_r55_t0); r55_xn$reverselast$3qIs = _r55_t0['reverse-last']['bind'](_r55_t0); r55_xn$includeglyph$3qIs = _r55_t0['include-glyph']['bind'](_r55_t0); + r55_xn$createstroke$7Hrq = _r55_t0['create-stroke']['bind'](_r55_t0); + _r55_t0['gizmo'] = r0_globalTransform; r55_xn$setwidth$9Jrj(r0_WIDTH); - r55_xn$assignunicode$7Hrq('S'); - r55_slope = 0.11; - r55_bowltop = new r0_Stroke(); - r55_bowltop['start-from'](r0_RIGHTSB - r0_SB * 0.1, r0_CAP - r0_HOOK)['set-width'](r0_STROKE, 0)['curve-to'](r0_MIDDLE + r0_KAPPA_HOOK * (r0_MIDDLE - r0_para['sb']), r0_CAPO, r0_MIDDLE, r0_CAPO)['cubic-to'](r0_SB + (1 - r0_BKAPPA) * (r0_WIDTH / 2 - r0_SB), r0_CAPO, r0_SB, r0_CAP - r0_COBKAPPA * r0_SMOOTH, r0_SB, r0_CAP_SMOOTH); - r55_strokemiddle = new r0_Stroke(); - r55_strokemiddle['start-from'](r0_SB + r0_STROKE / 2, r0_CAP_SMOOTH)['set-width'](r0_STROKE / 2, r0_STROKE / 2)['curve-to'](r0_SB + r0_STROKE / 2, (0.5 + r55_slope) * r0_CAP + 2 * r55_slope * r0_CAP / (0.4 * r0_WIDTH) * (0.3 * r0_WIDTH - r0_SB - r0_STROKE / 2), 0.3 * r0_WIDTH, (0.5 + r55_slope) * r0_CAP)['line-to'](0.7 * r0_WIDTH, (0.5 - r55_slope) * r0_CAP)['curve-to'](r0_RIGHTSB - r0_STROKE / 2, (0.5 - r55_slope) * r0_CAP - 2 * r55_slope * r0_CAP / (0.4 * r0_WIDTH) * (0.3 * r0_WIDTH - r0_SB - r0_STROKE / 2), r0_RIGHTSB - r0_STROKE / 2, r0_SMOOTH); - r55_bowlbottom = new r0_Stroke(); - r55_bowlbottom['start-from'](r0_RIGHTSB, r0_SMOOTH)['set-width'](0, r0_STROKE)['cubic-to'](r0_RIGHTSB, r0_COBKAPPA * r0_SMOOTH, r0_MIDDLE + r0_BKAPPA * (r0_RIGHTSB - r0_MIDDLE), r0_O, r0_MIDDLE, r0_O)['curve-to'](r0_MIDDLE - r0_KAPPA_HOOK * (r0_MIDDLE - r0_para['sb']), r0_O, r0_SB * 1.1, r0_HOOK); - r55_xn$putshapes$9Jrj(r55_bowltop['form-stroke']()); - r55_xn$putshapes$9Jrj(r55_strokemiddle['form-stroke']()); - r55_xn$putshapes$9Jrj(r55_bowlbottom['form-stroke']()); + r55_xn$assignunicode$7Hrq('$'); + r55_xn$putshapes$9Jrj(r0_glyphs['S']['contours']); + r55_xn$putshapes$9Jrj(r55_xn$createstroke$7Hrq()['start-from'](r0_MIDDLE, r0_CAP)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['line-to'](r0_MIDDLE, r0_CAP - r0_DESCENDER / 2)['form-stroke']()); + r55_xn$putshapes$9Jrj(r55_xn$createstroke$7Hrq()['start-from'](r0_MIDDLE, r0_DESCENDER / 2)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['line-to'](r0_MIDDLE, 0)['form-stroke']()); return void 0; }); - r0_xn$createglyph$7Hrq('dollar', function _r0_t26() { - var r57_xn$setwidth$9Jrj, r57_xn$assignunicode$7Hrq, r57_xn$startfrom$1aao, r57_xn$lineto$5sIl, r57_xn$curveto$1aao, r57_xn$cubicto$1aao, r57_xn$putshapes$9Jrj, r57_xn$reverselast$3qIs, r57_xn$includeglyph$3qIs, _r57_t0; + r0_xn$createglyph$7Hrq('o', function _r0_t27() { + var r57_xn$setwidth$9Jrj, r57_xn$assignunicode$7Hrq, r57_xn$startfrom$1aao, r57_xn$lineto$5sIl, r57_xn$curveto$1aao, r57_xn$cubicto$1aao, r57_xn$putshapes$9Jrj, r57_xn$reverselast$3qIs, r57_xn$includeglyph$3qIs, r57_xn$createstroke$7Hrq, _r57_t0; _r57_t0 = this; r57_xn$setwidth$9Jrj = _r57_t0['set-width']['bind'](_r57_t0); r57_xn$assignunicode$7Hrq = _r57_t0['assign-unicode']['bind'](_r57_t0); @@ -582,15 +659,19 @@ r57_xn$putshapes$9Jrj = _r57_t0['put-shapes']['bind'](_r57_t0); r57_xn$reverselast$3qIs = _r57_t0['reverse-last']['bind'](_r57_t0); r57_xn$includeglyph$3qIs = _r57_t0['include-glyph']['bind'](_r57_t0); + r57_xn$createstroke$7Hrq = _r57_t0['create-stroke']['bind'](_r57_t0); + _r57_t0['gizmo'] = r0_globalTransform; r57_xn$setwidth$9Jrj(r0_WIDTH); - r57_xn$assignunicode$7Hrq('$'); - r57_xn$putshapes$9Jrj(r0_glyphs['S']['contours']); - r57_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_MIDDLE, r0_CAP)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['line-to'](r0_MIDDLE, r0_CAP - r0_DESCENDER / 2)['form-stroke']()); - r57_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_MIDDLE, r0_DESCENDER / 2)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['line-to'](r0_MIDDLE, 0)['form-stroke']()); + r57_xn$assignunicode$7Hrq('o'); + r57_xn$putshapes$9Jrj([ + r0_ORing(r0_XO, r0_O, r0_SB, r0_RIGHTSB, r0_SMALLSMOOTH), + r0_ORing(r0_XO - r0_STROKE, r0_O + r0_STROKE, r0_SB + r0_STROKE, r0_RIGHTSB - r0_STROKE, r0_SMALLSMOOTH - r0_STROKE) + ]); + r57_xn$reverselast$3qIs(); return void 0; }); - r0_xn$createglyph$7Hrq('o', function _r0_t27() { - var r59_xn$setwidth$9Jrj, r59_xn$assignunicode$7Hrq, r59_xn$startfrom$1aao, r59_xn$lineto$5sIl, r59_xn$curveto$1aao, r59_xn$cubicto$1aao, r59_xn$putshapes$9Jrj, r59_xn$reverselast$3qIs, r59_xn$includeglyph$3qIs, _r59_t0; + r0_xn$createglyph$7Hrq('o.left', function _r0_t28() { + var r59_xn$setwidth$9Jrj, r59_xn$assignunicode$7Hrq, r59_xn$startfrom$1aao, r59_xn$lineto$5sIl, r59_xn$curveto$1aao, r59_xn$cubicto$1aao, r59_xn$putshapes$9Jrj, r59_xn$reverselast$3qIs, r59_xn$includeglyph$3qIs, r59_xn$createstroke$7Hrq, _r59_t0; _r59_t0 = this; r59_xn$setwidth$9Jrj = _r59_t0['set-width']['bind'](_r59_t0); r59_xn$assignunicode$7Hrq = _r59_t0['assign-unicode']['bind'](_r59_t0); @@ -601,17 +682,18 @@ r59_xn$putshapes$9Jrj = _r59_t0['put-shapes']['bind'](_r59_t0); r59_xn$reverselast$3qIs = _r59_t0['reverse-last']['bind'](_r59_t0); r59_xn$includeglyph$3qIs = _r59_t0['include-glyph']['bind'](_r59_t0); + r59_xn$createstroke$7Hrq = _r59_t0['create-stroke']['bind'](_r59_t0); + _r59_t0['gizmo'] = r0_globalTransform; r59_xn$setwidth$9Jrj(r0_WIDTH); - r59_xn$assignunicode$7Hrq('o'); r59_xn$putshapes$9Jrj([ - r0_ORing(r0_XO, r0_O, r0_SB, r0_RIGHTSB, r0_SMALLSMOOTH), + r0_ORing(r0_XO, r0_O, r0_SB + r0_STROKE / 2, r0_RIGHTSB, r0_SMALLSMOOTH), r0_ORing(r0_XO - r0_STROKE, r0_O + r0_STROKE, r0_SB + r0_STROKE, r0_RIGHTSB - r0_STROKE, r0_SMALLSMOOTH - r0_STROKE) ]); r59_xn$reverselast$3qIs(); return void 0; }); - r0_xn$createglyph$7Hrq('o.left', function _r0_t28() { - var r61_xn$setwidth$9Jrj, r61_xn$assignunicode$7Hrq, r61_xn$startfrom$1aao, r61_xn$lineto$5sIl, r61_xn$curveto$1aao, r61_xn$cubicto$1aao, r61_xn$putshapes$9Jrj, r61_xn$reverselast$3qIs, r61_xn$includeglyph$3qIs, _r61_t0; + r0_xn$createglyph$7Hrq('o.right', function _r0_t29() { + var r61_xn$setwidth$9Jrj, r61_xn$assignunicode$7Hrq, r61_xn$startfrom$1aao, r61_xn$lineto$5sIl, r61_xn$curveto$1aao, r61_xn$cubicto$1aao, r61_xn$putshapes$9Jrj, r61_xn$reverselast$3qIs, r61_xn$includeglyph$3qIs, r61_xn$createstroke$7Hrq, _r61_t0; _r61_t0 = this; r61_xn$setwidth$9Jrj = _r61_t0['set-width']['bind'](_r61_t0); r61_xn$assignunicode$7Hrq = _r61_t0['assign-unicode']['bind'](_r61_t0); @@ -622,16 +704,18 @@ r61_xn$putshapes$9Jrj = _r61_t0['put-shapes']['bind'](_r61_t0); r61_xn$reverselast$3qIs = _r61_t0['reverse-last']['bind'](_r61_t0); r61_xn$includeglyph$3qIs = _r61_t0['include-glyph']['bind'](_r61_t0); + r61_xn$createstroke$7Hrq = _r61_t0['create-stroke']['bind'](_r61_t0); + _r61_t0['gizmo'] = r0_globalTransform; r61_xn$setwidth$9Jrj(r0_WIDTH); r61_xn$putshapes$9Jrj([ - r0_ORing(r0_XO, r0_O, r0_SB + r0_STROKE / 2, r0_RIGHTSB, r0_SMALLSMOOTH), + r0_ORing(r0_XO, r0_O, r0_SB, r0_RIGHTSB - r0_STROKE / 2, r0_SMALLSMOOTH), r0_ORing(r0_XO - r0_STROKE, r0_O + r0_STROKE, r0_SB + r0_STROKE, r0_RIGHTSB - r0_STROKE, r0_SMALLSMOOTH - r0_STROKE) ]); r61_xn$reverselast$3qIs(); return void 0; }); - r0_xn$createglyph$7Hrq('o.right', function _r0_t29() { - var r63_xn$setwidth$9Jrj, r63_xn$assignunicode$7Hrq, r63_xn$startfrom$1aao, r63_xn$lineto$5sIl, r63_xn$curveto$1aao, r63_xn$cubicto$1aao, r63_xn$putshapes$9Jrj, r63_xn$reverselast$3qIs, r63_xn$includeglyph$3qIs, _r63_t0; + r0_xn$createglyph$7Hrq('p', function _r0_t30() { + var r63_xn$setwidth$9Jrj, r63_xn$assignunicode$7Hrq, r63_xn$startfrom$1aao, r63_xn$lineto$5sIl, r63_xn$curveto$1aao, r63_xn$cubicto$1aao, r63_xn$putshapes$9Jrj, r63_xn$reverselast$3qIs, r63_xn$includeglyph$3qIs, r63_xn$createstroke$7Hrq, _r63_t0; _r63_t0 = this; r63_xn$setwidth$9Jrj = _r63_t0['set-width']['bind'](_r63_t0); r63_xn$assignunicode$7Hrq = _r63_t0['assign-unicode']['bind'](_r63_t0); @@ -642,16 +726,16 @@ r63_xn$putshapes$9Jrj = _r63_t0['put-shapes']['bind'](_r63_t0); r63_xn$reverselast$3qIs = _r63_t0['reverse-last']['bind'](_r63_t0); r63_xn$includeglyph$3qIs = _r63_t0['include-glyph']['bind'](_r63_t0); + r63_xn$createstroke$7Hrq = _r63_t0['create-stroke']['bind'](_r63_t0); + _r63_t0['gizmo'] = r0_globalTransform; r63_xn$setwidth$9Jrj(r0_WIDTH); - r63_xn$putshapes$9Jrj([ - r0_ORing(r0_XO, r0_O, r0_SB, r0_RIGHTSB - r0_STROKE / 2, r0_SMALLSMOOTH), - r0_ORing(r0_XO - r0_STROKE, r0_O + r0_STROKE, r0_SB + r0_STROKE, r0_RIGHTSB - r0_STROKE, r0_SMALLSMOOTH - r0_STROKE) - ]); - r63_xn$reverselast$3qIs(); + r63_xn$assignunicode$7Hrq('p'); + r63_xn$putshapes$9Jrj(r0_glyphs['o.left']['contours']); + r63_xn$putshapes$9Jrj(r63_xn$createstroke$7Hrq()['start-from'](r0_SB, r0_XH)['pen-direction'](r0_DOWNWARD)['set-width'](r0_STROKE, 0)['line-to'](r0_SB, r0_DESCENDER)['pen-direction'](r0_DOWNWARD)['form-stroke']()); return void 0; }); - r0_xn$createglyph$7Hrq('p', function _r0_t30() { - var r65_xn$setwidth$9Jrj, r65_xn$assignunicode$7Hrq, r65_xn$startfrom$1aao, r65_xn$lineto$5sIl, r65_xn$curveto$1aao, r65_xn$cubicto$1aao, r65_xn$putshapes$9Jrj, r65_xn$reverselast$3qIs, r65_xn$includeglyph$3qIs, _r65_t0; + r0_xn$createglyph$7Hrq('b', function _r0_t31() { + var r65_xn$setwidth$9Jrj, r65_xn$assignunicode$7Hrq, r65_xn$startfrom$1aao, r65_xn$lineto$5sIl, r65_xn$curveto$1aao, r65_xn$cubicto$1aao, r65_xn$putshapes$9Jrj, r65_xn$reverselast$3qIs, r65_xn$includeglyph$3qIs, r65_xn$createstroke$7Hrq, _r65_t0; _r65_t0 = this; r65_xn$setwidth$9Jrj = _r65_t0['set-width']['bind'](_r65_t0); r65_xn$assignunicode$7Hrq = _r65_t0['assign-unicode']['bind'](_r65_t0); @@ -662,14 +746,16 @@ r65_xn$putshapes$9Jrj = _r65_t0['put-shapes']['bind'](_r65_t0); r65_xn$reverselast$3qIs = _r65_t0['reverse-last']['bind'](_r65_t0); r65_xn$includeglyph$3qIs = _r65_t0['include-glyph']['bind'](_r65_t0); + r65_xn$createstroke$7Hrq = _r65_t0['create-stroke']['bind'](_r65_t0); + _r65_t0['gizmo'] = r0_globalTransform; r65_xn$setwidth$9Jrj(r0_WIDTH); - r65_xn$assignunicode$7Hrq('p'); + r65_xn$assignunicode$7Hrq('b'); r65_xn$putshapes$9Jrj(r0_glyphs['o.left']['contours']); - r65_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_SB, r0_XH)['set-width'](r0_STROKE, 0)['line-to'](r0_SB, r0_DESCENDER)['form-stroke']()); + r65_xn$putshapes$9Jrj(r65_xn$createstroke$7Hrq()['start-from'](r0_SB, 0)['pen-direction'](r0_UPWARD)['set-width'](0, r0_STROKE)['line-to'](r0_SB, r0_CAP)['pen-direction'](r0_UPWARD)['form-stroke']()); return void 0; }); - r0_xn$createglyph$7Hrq('b', function _r0_t31() { - var r67_xn$setwidth$9Jrj, r67_xn$assignunicode$7Hrq, r67_xn$startfrom$1aao, r67_xn$lineto$5sIl, r67_xn$curveto$1aao, r67_xn$cubicto$1aao, r67_xn$putshapes$9Jrj, r67_xn$reverselast$3qIs, r67_xn$includeglyph$3qIs, _r67_t0; + r0_xn$createglyph$7Hrq('q', function _r0_t32() { + var r67_xn$setwidth$9Jrj, r67_xn$assignunicode$7Hrq, r67_xn$startfrom$1aao, r67_xn$lineto$5sIl, r67_xn$curveto$1aao, r67_xn$cubicto$1aao, r67_xn$putshapes$9Jrj, r67_xn$reverselast$3qIs, r67_xn$includeglyph$3qIs, r67_xn$createstroke$7Hrq, _r67_t0; _r67_t0 = this; r67_xn$setwidth$9Jrj = _r67_t0['set-width']['bind'](_r67_t0); r67_xn$assignunicode$7Hrq = _r67_t0['assign-unicode']['bind'](_r67_t0); @@ -680,14 +766,16 @@ r67_xn$putshapes$9Jrj = _r67_t0['put-shapes']['bind'](_r67_t0); r67_xn$reverselast$3qIs = _r67_t0['reverse-last']['bind'](_r67_t0); r67_xn$includeglyph$3qIs = _r67_t0['include-glyph']['bind'](_r67_t0); + r67_xn$createstroke$7Hrq = _r67_t0['create-stroke']['bind'](_r67_t0); + _r67_t0['gizmo'] = r0_globalTransform; r67_xn$setwidth$9Jrj(r0_WIDTH); - r67_xn$assignunicode$7Hrq('b'); - r67_xn$putshapes$9Jrj(r0_glyphs['o.left']['contours']); - r67_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_SB, 0)['set-width'](0, r0_STROKE)['line-to'](r0_SB, r0_CAP)['form-stroke']()); + r67_xn$assignunicode$7Hrq('q'); + r67_xn$putshapes$9Jrj(r0_glyphs['o.right']['contours']); + r67_xn$putshapes$9Jrj(r67_xn$createstroke$7Hrq()['start-from'](r0_RIGHTSB, r0_XH)['pen-direction'](r0_DOWNWARD)['set-width'](0, r0_STROKE)['line-to'](r0_RIGHTSB, r0_DESCENDER)['pen-direction'](r0_DOWNWARD)['form-stroke']()); return void 0; }); - r0_xn$createglyph$7Hrq('q', function _r0_t32() { - var r69_xn$setwidth$9Jrj, r69_xn$assignunicode$7Hrq, r69_xn$startfrom$1aao, r69_xn$lineto$5sIl, r69_xn$curveto$1aao, r69_xn$cubicto$1aao, r69_xn$putshapes$9Jrj, r69_xn$reverselast$3qIs, r69_xn$includeglyph$3qIs, _r69_t0; + r0_xn$createglyph$7Hrq('d', function _r0_t33() { + var r69_xn$setwidth$9Jrj, r69_xn$assignunicode$7Hrq, r69_xn$startfrom$1aao, r69_xn$lineto$5sIl, r69_xn$curveto$1aao, r69_xn$cubicto$1aao, r69_xn$putshapes$9Jrj, r69_xn$reverselast$3qIs, r69_xn$includeglyph$3qIs, r69_xn$createstroke$7Hrq, _r69_t0; _r69_t0 = this; r69_xn$setwidth$9Jrj = _r69_t0['set-width']['bind'](_r69_t0); r69_xn$assignunicode$7Hrq = _r69_t0['assign-unicode']['bind'](_r69_t0); @@ -698,14 +786,16 @@ r69_xn$putshapes$9Jrj = _r69_t0['put-shapes']['bind'](_r69_t0); r69_xn$reverselast$3qIs = _r69_t0['reverse-last']['bind'](_r69_t0); r69_xn$includeglyph$3qIs = _r69_t0['include-glyph']['bind'](_r69_t0); + r69_xn$createstroke$7Hrq = _r69_t0['create-stroke']['bind'](_r69_t0); + _r69_t0['gizmo'] = r0_globalTransform; r69_xn$setwidth$9Jrj(r0_WIDTH); - r69_xn$assignunicode$7Hrq('q'); + r69_xn$assignunicode$7Hrq('d'); r69_xn$putshapes$9Jrj(r0_glyphs['o.right']['contours']); - r69_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_RIGHTSB, r0_XH)['set-width'](0, r0_STROKE)['line-to'](r0_RIGHTSB, r0_DESCENDER)['form-stroke']()); + r69_xn$putshapes$9Jrj(r69_xn$createstroke$7Hrq()['start-from'](r0_RIGHTSB, 0)['pen-direction'](r0_UPWARD)['set-width'](r0_STROKE, 0)['line-to'](r0_RIGHTSB, r0_CAP)['pen-direction'](r0_UPWARD)['form-stroke']()); return void 0; }); - r0_xn$createglyph$7Hrq('d', function _r0_t33() { - var r71_xn$setwidth$9Jrj, r71_xn$assignunicode$7Hrq, r71_xn$startfrom$1aao, r71_xn$lineto$5sIl, r71_xn$curveto$1aao, r71_xn$cubicto$1aao, r71_xn$putshapes$9Jrj, r71_xn$reverselast$3qIs, r71_xn$includeglyph$3qIs, _r71_t0; + r0_xn$createglyph$7Hrq('g', function _r0_t34() { + var r71_xn$setwidth$9Jrj, r71_xn$assignunicode$7Hrq, r71_xn$startfrom$1aao, r71_xn$lineto$5sIl, r71_xn$curveto$1aao, r71_xn$cubicto$1aao, r71_xn$putshapes$9Jrj, r71_xn$reverselast$3qIs, r71_xn$includeglyph$3qIs, r71_xn$createstroke$7Hrq, _r71_t0; _r71_t0 = this; r71_xn$setwidth$9Jrj = _r71_t0['set-width']['bind'](_r71_t0); r71_xn$assignunicode$7Hrq = _r71_t0['assign-unicode']['bind'](_r71_t0); @@ -716,14 +806,24 @@ r71_xn$putshapes$9Jrj = _r71_t0['put-shapes']['bind'](_r71_t0); r71_xn$reverselast$3qIs = _r71_t0['reverse-last']['bind'](_r71_t0); r71_xn$includeglyph$3qIs = _r71_t0['include-glyph']['bind'](_r71_t0); + r71_xn$createstroke$7Hrq = _r71_t0['create-stroke']['bind'](_r71_t0); + _r71_t0['gizmo'] = r0_globalTransform; r71_xn$setwidth$9Jrj(r0_WIDTH); - r71_xn$assignunicode$7Hrq('d'); - r71_xn$putshapes$9Jrj(r0_glyphs['o.right']['contours']); - r71_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_RIGHTSB, 0)['set-width'](r0_STROKE, 0)['line-to'](r0_RIGHTSB, r0_CAP)['form-stroke']()); + r71_xn$assignunicode$7Hrq('g'); + r71_xn$putshapes$9Jrj([ + r0_Ring(r0_XO, r0_XH * 0.4, r0_SB * 1.5, r0_RIGHTSB - 0.5 * r0_SB, r0_SMALLSMOOTH), + r0_Ring(r0_XO - r0_STROKE, r0_XH * 0.4 + r0_STROKE, r0_SB * 1.5 + r0_STROKE, r0_RIGHTSB - 0.5 * r0_SB - r0_STROKE, r0_SMALLSMOOTH - r0_STROKE) + ]); + r71_xn$reverselast$3qIs(); + r71_xn$putshapes$9Jrj(r71_xn$createstroke$7Hrq()['start-from'](r0_MIDDLE, r0_XH * 0.4)['set-width'](0, r0_STROKE * 0.75)['arc-hv-to'](r0_SB * 1.5 + r0_STROKE, (r0_O - r0_DESCENDER * 0.85 + r0_XH * 0.4) * 0.47)['set-width'](0, r0_STROKE)['arc-vh-to'](r0_MIDDLE + r0_DESCENDER * 0.15, r0_O - r0_DESCENDER * 0.85)['line-to'](r0_MIDDLE - r0_DESCENDER * 0.15, r0_O - r0_DESCENDER * 0.85)['arc-hv-to'](r0_RIGHTSB - r0_O * 2, -r0_STROKE * r0_globalTransform['yx'] * 2)['arc-vh-to'](r0_MIDDLE, r0_DESCENDER + r0_O)['arc-hv-to'](r0_SB, r0_DESCENDER * 0.1)['arc-vh-to'](r0_MIDDLE + r0_DESCENDER * 0.15, r0_O - r0_DESCENDER * 0.85)['form-stroke']()); + r71_xn$startfrom$1aao(r0_RIGHTSB, r0_XH); + r71_xn$lineto$5sIl(r0_RIGHTSB, r0_XH - r0_STROKE); + r71_xn$lineto$5sIl(r0_MIDDLE, r0_XH - r0_STROKE - r0_O); + r71_xn$lineto$5sIl(r0_MIDDLE, r0_XH); return void 0; }); - r0_xn$createglyph$7Hrq('g', function _r0_t34() { - var r73_xn$setwidth$9Jrj, r73_xn$assignunicode$7Hrq, r73_xn$startfrom$1aao, r73_xn$lineto$5sIl, r73_xn$curveto$1aao, r73_xn$cubicto$1aao, r73_xn$putshapes$9Jrj, r73_xn$reverselast$3qIs, r73_xn$includeglyph$3qIs, r73_MODDLE, _r73_t0; + r0_xn$createglyph$7Hrq('x', function _r0_t35() { + var r73_xn$setwidth$9Jrj, r73_xn$assignunicode$7Hrq, r73_xn$startfrom$1aao, r73_xn$lineto$5sIl, r73_xn$curveto$1aao, r73_xn$cubicto$1aao, r73_xn$putshapes$9Jrj, r73_xn$reverselast$3qIs, r73_xn$includeglyph$3qIs, r73_xn$createstroke$7Hrq, r73_TURN, r73_barone, r73_bartwo, _r73_t0; _r73_t0 = this; r73_xn$setwidth$9Jrj = _r73_t0['set-width']['bind'](_r73_t0); r73_xn$assignunicode$7Hrq = _r73_t0['assign-unicode']['bind'](_r73_t0); @@ -734,47 +834,15 @@ r73_xn$putshapes$9Jrj = _r73_t0['put-shapes']['bind'](_r73_t0); r73_xn$reverselast$3qIs = _r73_t0['reverse-last']['bind'](_r73_t0); r73_xn$includeglyph$3qIs = _r73_t0['include-glyph']['bind'](_r73_t0); + r73_xn$createstroke$7Hrq = _r73_t0['create-stroke']['bind'](_r73_t0); + _r73_t0['gizmo'] = r0_globalTransform; r73_xn$setwidth$9Jrj(r0_WIDTH); - r73_xn$assignunicode$7Hrq('g'); - r73_xn$putshapes$9Jrj([ - r0_Ring(r0_XO, r0_XH * 0.4, r0_SB * 1.5, r0_RIGHTSB - 0.5 * r0_SB, r0_SMALLSMOOTH), - r0_Ring(r0_XO - r0_STROKE, r0_XH * 0.4 + r0_STROKE, r0_SB * 1.5 + r0_STROKE, r0_RIGHTSB - 0.5 * r0_SB - r0_STROKE, r0_SMALLSMOOTH - r0_STROKE) - ]); - r73_xn$reverselast$3qIs(); - r73_xn$putshapes$9Jrj(new r0_Stroke()['start-from'](r0_MIDDLE, r0_XH * 0.4)['set-width'](0, r0_STROKE * 0.75)['arc-hv-to'](r0_SB * 1.5 + r0_STROKE, (r0_O - r0_DESCENDER * 0.85 + r0_XH * 0.4) / 2)['set-width'](0, r0_STROKE)['arc-vh-to'](r0_MIDDLE + r0_DESCENDER * 0.15, r0_O - r0_DESCENDER * 0.85)['line-to'](r0_MIDDLE - r0_DESCENDER * 0.15, r0_O - r0_DESCENDER * 0.85)['arc-hv-to'](r0_RIGHTSB - r0_O * 2, 0)['arc-vh-to'](r0_MIDDLE, r0_DESCENDER + r0_O)['arc-hv-to'](r0_SB, r0_DESCENDER * 0.1)['arc-vh-to'](r0_MIDDLE + r0_DESCENDER * 0.15, r0_O - r0_DESCENDER * 0.85)['form-stroke']()); - r73_xn$startfrom$1aao(r0_RIGHTSB, r0_XH); - r73_xn$lineto$5sIl(r0_RIGHTSB, r0_XH - r0_STROKE); - r73_xn$lineto$5sIl(r0_MIDDLE, r0_XH - r0_STROKE - r0_O); - r73_xn$lineto$5sIl(r73_MODDLE, r0_XH); - return void 0; - }); - r0_xn$createglyph$7Hrq('x', function _r0_t35() { - var r75_xn$setwidth$9Jrj, r75_xn$assignunicode$7Hrq, r75_xn$startfrom$1aao, r75_xn$lineto$5sIl, r75_xn$curveto$1aao, r75_xn$cubicto$1aao, r75_xn$putshapes$9Jrj, r75_xn$reverselast$3qIs, r75_xn$includeglyph$3qIs, r75_TURN, r75_barone, r75_bartwo, _r75_t0, _r75_t1; - _r75_t0 = this; - r75_xn$setwidth$9Jrj = _r75_t0['set-width']['bind'](_r75_t0); - r75_xn$assignunicode$7Hrq = _r75_t0['assign-unicode']['bind'](_r75_t0); - r75_xn$startfrom$1aao = _r75_t0['start-from']['bind'](_r75_t0); - r75_xn$lineto$5sIl = _r75_t0['line-to']['bind'](_r75_t0); - r75_xn$curveto$1aao = _r75_t0['curve-to']['bind'](_r75_t0); - r75_xn$cubicto$1aao = _r75_t0['cubic-to']['bind'](_r75_t0); - r75_xn$putshapes$9Jrj = _r75_t0['put-shapes']['bind'](_r75_t0); - r75_xn$reverselast$3qIs = _r75_t0['reverse-last']['bind'](_r75_t0); - r75_xn$includeglyph$3qIs = _r75_t0['include-glyph']['bind'](_r75_t0); - r75_xn$setwidth$9Jrj(r0_WIDTH); - r75_xn$assignunicode$7Hrq('x'); - r75_TURN = r0_XH * 0.1; - r75_barone = new r0_Stroke()['start-from'](r0_SB + r0_HALFSTROKE, 0)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['cubic-to'](r0_SB + r0_HALFSTROKE, r75_TURN + 0.17 * (r0_XH - r75_TURN), r0_RIGHTSB - r0_HALFSTROKE, r0_XH - r75_TURN - 0.17 * (r0_XH - r75_TURN), r0_RIGHTSB - r0_HALFSTROKE, r0_XH)['form-stroke'](); - r75_bartwo = [r75_barone[0]['map'](function _r75_t1(r76_pt) { - var r76_pt; - return { - 'x': r0_WIDTH - r76_pt['x'], - 'y': r76_pt['y'], - 'onCurve': r76_pt['onCurve'], - 'cubic': r76_pt['cubic'] - }; - })['reverse']()]; - r75_xn$putshapes$9Jrj(r75_barone); - r75_xn$putshapes$9Jrj(r75_bartwo); + r73_xn$assignunicode$7Hrq('x'); + r73_TURN = r0_XH * 0.1; + r73_barone = r73_xn$createstroke$7Hrq()['start-from'](r0_SB + r0_HALFSTROKE, 0)['pen-direction'](r0_UPWARD)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['cubic-to'](r0_SB + r0_HALFSTROKE, r73_TURN + 0.17 * (r0_XH - r73_TURN), r0_RIGHTSB - r0_HALFSTROKE, r0_XH - r73_TURN - 0.17 * (r0_XH - r73_TURN), r0_RIGHTSB - r0_HALFSTROKE, r0_XH)['pen-direction'](r0_UPWARD); + r73_bartwo = r73_xn$createstroke$7Hrq()['start-from'](r0_RIGHTSB - r0_HALFSTROKE, 0)['pen-direction'](r0_UPWARD)['set-width'](r0_HALFSTROKE, r0_HALFSTROKE)['cubic-to'](r0_RIGHTSB - r0_HALFSTROKE, r73_TURN + 0.17 * (r0_XH - r73_TURN), r0_SB + r0_HALFSTROKE, r0_XH - r73_TURN - 0.17 * (r0_XH - r73_TURN), r0_SB + r0_HALFSTROKE, r0_XH)['pen-direction'](r0_UPWARD); + r73_xn$putshapes$9Jrj(r73_barone['form-stroke']()); + r73_xn$putshapes$9Jrj(r73_bartwo['form-stroke']()); return void 0; }); exports['font'] = r0_font; diff --git a/font.patel b/font.patel index e26d1ae..f990185 100644 --- a/font.patel +++ b/font.patel @@ -19,12 +19,27 @@ define para ( .o [-8] .descender [-178] .kappa 0.51 + .italicangle 10 ) define variantSelector ( .zero 'slashed' ) +define globalTransform ( + .xx 1 + .yx [Math.tan [para.italicangle / 180 * Math.PI]] + .xy 0 + .yy 1 + .x 0 + .y 0 +) + +define UPWARD (.x [-1] .y 0) +define DOWNWARD (.x 1 .y 0) +define RIGHTWARD (.x globalTransform.yx .y 1) +define LEFTWARD (.x [- globalTransform.yx] .y [-1]) + # metrics define DESCENDER para.descender define WIDTH para.width @@ -63,6 +78,7 @@ define [Ring u d l r] : begin { local my [[u + d] / 2] local mx [[l + r] / 2] local s : new Stroke + :.set-transform globalTransform :.start-from mx d :.cubic-to [mx + [l - mx] * BKAPPA] d l [my + [d - my] * BKAPPA] l my :.cubic-to l [my + [u - my] * BKAPPA] [mx + [l - mx] * BKAPPA] u mx u @@ -75,6 +91,7 @@ define [ORing u d l r smooth] : begin { local myd [d + smooth] local mx [[l + r] / 2] local s : new Stroke + :.set-transform globalTransform :.start-from mx d :.cubic-to [mx + [l - mx] * BKAPPA] d l [myd + [d - myd] * BKAPPA] l myd :.line-to l myu @@ -96,6 +113,8 @@ define-macro glyph-construction : syntax-rules { local put-shapes : this.put-shapes.bind this local reverse-last : this.reverse-last.bind this local include-glyph : this.include-glyph.bind this + local create-stroke : this.create-stroke.bind this + this.gizmo = globalTransform begin @::[steps.map formOf] return nothing }]] env) @@ -109,7 +128,6 @@ define [create-glyph name actions] : begin { return glyphObject } - ### GLYPHS create-glyph 'space' : glyph-construction { set-width WIDTH @@ -118,7 +136,7 @@ create-glyph 'space' : glyph-construction { create-glyph 'bar' : glyph-construction { set-width WIDTH assign-unicode '|' - put-shapes : new Stroke :.start-from MIDDLE [DESCENDER / 2] + put-shapes : create-stroke :.start-from MIDDLE [DESCENDER / 2] :.set-width [STROKE / 2] [STROKE / 2] :.line-to MIDDLE [CAP - DESCENDER / 2] :.form-stroke @@ -131,24 +149,30 @@ create-glyph 'A' : glyph-construction { local TURN [XH * 0.1] - local leftbar : new Stroke + local leftbar : create-stroke leftbar.start-from SB 0 + :.pen-direction UPWARD :.set-width 0 STROKE :.line-to SB TURN + :.pen-direction UPWARD :.curve-to SB [TURN + 0.27 * [CAP - TURN]] [MIDDLE - STROKE / 2] CAP :.set-width 0 [STROKE * 0.8] - local rightbar : new Stroke + local rightbar : create-stroke rightbar.start-from RIGHTSB 0 + :.pen-direction UPWARD :.set-width STROKE 0 :.line-to RIGHTSB TURN + :.pen-direction UPWARD :.curve-to RIGHTSB [TURN + 0.27 * [CAP - TURN]] [MIDDLE + STROKE / 2] CAP :.set-width [STROKE * 0.8] 0 - local hbar : new Stroke + local hbar : create-stroke :.start-from [SB + STROKE] [XH / 2] + :.pen-direction RIGHTWARD :.set-width 0 STROKE :.line-to [RIGHTSB - STROKE] [XH / 2] + :.pen-direction RIGHTWARD put-shapes : leftbar.form-stroke put-shapes : hbar.form-stroke @@ -167,20 +191,30 @@ create-glyph 'X' : glyph-construction { local straight 0.6 local strench 0.125 - local barone : new Stroke + local barone : create-stroke :.start-from [SB + HALFSTROKE] 0 :.set-width HALFSTROKE HALFSTROKE + :.pen-direction UPWARD :.line-to [SB + HALFSTROKE] TURN :.curve-to [SB + HALFSTROKE] [TURN + strench * [CAP - TURN]] [MIDDLE + straight * [SB + HALFSTROKE - MIDDLE]] [CAPMIDDLE + straight * [TURN + strench * [CAP - TURN] - CAPMIDDLE]] :.line-to [MIDDLE + straight * [RIGHTSB - HALFSTROKE - MIDDLE]] [CAPMIDDLE + straight * [CAP - TURN - strench * [CAP - TURN] - CAPMIDDLE]] :.curve-to [RIGHTSB - HALFSTROKE] [CAP - TURN - strench * [CAP - TURN]] [RIGHTSB - HALFSTROKE] [CAP - TURN] :.line-to [RIGHTSB - HALFSTROKE] CAP - :.form-stroke + :.pen-direction UPWARD - local bartwo : list : barone.0.map [[pt] -> (.x [WIDTH - pt.x] .y pt.y .onCurve pt.onCurve .cubic pt.cubic)] :.reverse + local bartwo : create-stroke + :.start-from [RIGHTSB - HALFSTROKE] 0 + :.set-width HALFSTROKE HALFSTROKE + :.pen-direction UPWARD + :.line-to [RIGHTSB - HALFSTROKE] TURN + :.curve-to [RIGHTSB - HALFSTROKE] [TURN + strench * [CAP - TURN]] [MIDDLE + straight * [RIGHTSB - HALFSTROKE - MIDDLE]] [CAPMIDDLE + straight * [TURN + strench * [CAP - TURN] - CAPMIDDLE]] + :.line-to [MIDDLE + straight * [SB + HALFSTROKE - MIDDLE]] [CAPMIDDLE + straight * [CAP - TURN - strench * [CAP - TURN] - CAPMIDDLE]] + :.curve-to [SB + HALFSTROKE] [CAP - TURN - strench * [CAP - TURN]] [SB + HALFSTROKE] [CAP - TURN] + :.line-to [SB + HALFSTROKE] CAP + :.pen-direction UPWARD - put-shapes barone - put-shapes bartwo + put-shapes : barone.form-stroke + put-shapes : bartwo.form-stroke } create-glyph 'Y' : glyph-construction { set-width WIDTH @@ -191,19 +225,31 @@ create-glyph 'Y' : glyph-construction { local strench 0.15 local cross [CAP * 0.4] - local barone : new Stroke + local barone : create-stroke :.start-from MIDDLE cross :.set-width HALFSTROKE HALFSTROKE :.line-to [MIDDLE + straight * [RIGHTSB - HALFSTROKE - MIDDLE]] [cross + straight * [CAP - TURN - strench * [CAP - TURN] - cross]] :.curve-to [RIGHTSB - HALFSTROKE] [CAP - TURN - strench * [CAP - TURN]] [RIGHTSB - HALFSTROKE] [CAP - TURN] :.line-to [RIGHTSB - HALFSTROKE] CAP - :.form-stroke + :.pen-direction UPWARD - local bartwo : list : barone.0.map [[pt] -> (.x [WIDTH - pt.x] .y pt.y .onCurve pt.onCurve .cubic pt.cubic)] :.reverse + local bartwo : create-stroke + :.start-from MIDDLE cross + :.set-width HALFSTROKE HALFSTROKE + :.line-to [MIDDLE + straight * [SB + HALFSTROKE - MIDDLE]] [cross + straight * [CAP - TURN - strench * [CAP - TURN] - cross]] + :.curve-to [SB + HALFSTROKE] [CAP - TURN - strench * [CAP - TURN]] [SB + HALFSTROKE] [CAP - TURN] + :.line-to [SB + HALFSTROKE] CAP + :.pen-direction UPWARD - put-shapes barone - put-shapes bartwo - put-shapes : new Stroke :.start-from MIDDLE 0 :.set-width HALFSTROKE HALFSTROKE :.line-to MIDDLE [cross + HALFSTROKE] :.form-stroke + put-shapes : barone.form-stroke + put-shapes : bartwo.form-stroke + put-shapes : create-stroke + :.start-from MIDDLE 0 + :.set-width HALFSTROKE HALFSTROKE + :.pen-direction UPWARD + :.line-to MIDDLE [cross + HALFSTROKE] + :.pen-direction UPWARD + :.form-stroke } ### B D P R @@ -218,21 +264,29 @@ create-glyph 'B' : glyph-construction { local turntop : [CAP + [bowl - STROKE]] / 2 local turnbottom : bowl / 2 - local topbowl : new Stroke + local topbowl : create-stroke topbowl.start-from SB CAP + :.pen-direction RIGHTWARD :.line-to [RIGHTSB - SB * 0.5 - turnbottom] CAP :.cubic-to [RIGHTSB - SB * 0.5 - tkappa * turnbottom] CAP [RIGHTSB - SB * 0.5] [turntop + [CAP - turntop] * KAPPA] [RIGHTSB - SB * 0.5] turntop :.cubic-to [RIGHTSB - SB * 0.5] [turntop + KAPPA * [bowl - STROKE - turntop]] [RIGHTSB - SB * 0.5 - tkappa * turnbottom] [bowl - STROKE] [RIGHTSB - SB * 0.5 - turnbottom] [bowl - STROKE] :.line-to SB [bowl - STROKE] + :.pen-direction LEFTWARD - local bottombowl : new Stroke + local bottombowl : create-stroke bottombowl.start-from SB 0 + :.pen-direction RIGHTWARD :.line-to [RIGHTSB - turnbottom] 0 :.cubic-to [RIGHTSB - bkappa * turnbottom] 0 RIGHTSB [turnbottom * KAPPA] RIGHTSB turnbottom :.cubic-to RIGHTSB [turnbottom + KAPPA * [bowl - turnbottom]] [RIGHTSB - bkappa * turnbottom] bowl [RIGHTSB - turnbottom] bowl :.line-to SB bowl + :.pen-direction LEFTWARD - local leftbar : new Stroke :.start-from SB 0 :.line-to SB CAP + local leftbar : create-stroke + :.start-from SB 0 + :.pen-direction UPWARD + :.line-to SB CAP + :.pen-direction UPWARD put-shapes : topbowl.form-stroke 0 STROKE put-shapes : bottombowl.form-stroke STROKE 0 @@ -247,15 +301,22 @@ create-glyph 'D' : glyph-construction { local bsmooth [SMOOTH * 1.3] local bkappa [COKAPPA - 0.2] - local leftbar : new Stroke :.start-from SB 0 :.line-to SB CAP + local leftbar : create-stroke + :.start-from SB 0 + :.pen-direction UPWARD + :.line-to SB CAP + :.pen-direction UPWARD - local bowl : new Stroke + local bowl : create-stroke bowl.start-from SB 0 + :.pen-direction RIGHTWARD :.line-to [RIGHTSB - bsmooth] 0 :.cubic-to [RIGHTSB - bkappa * bsmooth] 0 RIGHTSB [COBKAPPA * dsmooth] RIGHTSB dsmooth :.line-to RIGHTSB [CAP - dsmooth] :.cubic-to RIGHTSB [CAP - COBKAPPA * dsmooth] [RIGHTSB - bkappa * bsmooth] CAP [RIGHTSB - bsmooth] CAP :.line-to SB CAP + :.pen-direction LEFTWARD + put-shapes : bowl.form-stroke STROKE 0 put-shapes : leftbar.form-stroke 0 STROKE @@ -270,14 +331,14 @@ create-glyph 'P' : glyph-construction { local turntop : [CAP + [bowl - HALFSTROKE]] / 2 local turnbottom : bowl / 2 - local topbowl : new Stroke + local topbowl : create-stroke topbowl.start-from SB CAP :.line-to [RIGHTSB - turnbottom] CAP :.cubic-to [RIGHTSB - bkappa * turnbottom] CAP RIGHTSB [turntop + [CAP - turntop] * KAPPA] RIGHTSB turntop :.cubic-to RIGHTSB [turntop + KAPPA * [bowl - HALFSTROKE - turntop]] [RIGHTSB - bkappa * turnbottom] [bowl - HALFSTROKE] [RIGHTSB - turnbottom] [bowl - HALFSTROKE] :.line-to SB [bowl - HALFSTROKE] - local leftbar : new Stroke :.start-from SB 0 :.line-to SB CAP + local leftbar : create-stroke :.start-from SB 0 :.line-to SB CAP put-shapes : topbowl.form-stroke 0 STROKE put-shapes : leftbar.form-stroke 0 STROKE @@ -289,7 +350,7 @@ create-glyph 'R' : glyph-construction { local TURN [XH * 0.1] local right [RIGHTSB + O] - put-shapes : new Stroke + put-shapes : create-stroke :.start-from [right - HALFSTROKE] 0 :.set-width HALFSTROKE HALFSTROKE :.curve-to [right - HALFSTROKE] [TURN + 0.1 * [XH - TURN]] MIDDLE CAPMIDDLE @@ -301,7 +362,7 @@ create-glyph 'R' : glyph-construction { create-glyph 'C' : glyph-construction { set-width WIDTH assign-unicode 'C' - local outline : new Stroke + local outline : create-stroke outline.start-from [RIGHTSB - SB * 0.1] [CAP - HOOK] :.curve-to [MIDDLE + KAPPA_HOOK * [MIDDLE - para.sb]] CAPO MIDDLE CAPO :.cubic-to [SB + [1 - BKAPPA] * [WIDTH / 2 - SB]] CAPO SB [CAP - COBKAPPA * SMOOTH] SB CAP_SMOOTH @@ -314,7 +375,7 @@ create-glyph 'C' : glyph-construction { create-glyph 'G' : glyph-construction { set-width WIDTH assign-unicode 'G' - local outline : new Stroke + local outline : create-stroke outline.start-from [RIGHTSB - SB * 0.1] [CAP - HOOK] :.curve-to [MIDDLE + KAPPA_HOOK * [MIDDLE - para.sb]] CAPO MIDDLE CAPO :.cubic-to [SB + [1 - BKAPPA] * [WIDTH / 2 - SB]] CAPO SB [CAP - COBKAPPA * SMOOTH] SB CAP_SMOOTH @@ -322,16 +383,20 @@ create-glyph 'G' : glyph-construction { :.cubic-to SB [COBKAPPA * SMOOTH] [SB + [1 - BKAPPA] * [WIDTH / 2 - SB]] O [WIDTH / 2] O :.cubic-to [MIDDLE + BKAPPA * [RIGHTSB - MIDDLE]] O RIGHTSB [COBKAPPA * SMOOTH] RIGHTSB SMOOTH :.line-to RIGHTSB [CAP / 2 + STROKE / 2] + :.pen-direction UPWARD put-shapes : outline.form-stroke STROKE 0 - local bar : new Stroke :.start-from MIDDLE [CAP / 2 + STROKE / 2] :.line-to RIGHTSB [CAP / 2 + STROKE / 2] + local bar : create-stroke + :.start-from MIDDLE [CAP / 2 + STROKE / 2] + :.line-to RIGHTSB [CAP / 2 + STROKE / 2] + :.pen-direction RIGHTWARD put-shapes : bar.form-stroke 0 STROKE } create-glyph 'O' : glyph-construction { set-width WIDTH assign-unicode 'O' - local outline : new Stroke + local outline : create-stroke outline.start-from MIDDLE CAPO :.cubic-to [SB + [1 - BKAPPA] * [WIDTH / 2 - SB]] CAPO SB [CAP - COBKAPPA * SMOOTH] SB [CAP - SMOOTH] :.line-to SB SMOOTH @@ -347,7 +412,7 @@ create-glyph 'zero.slashed' : glyph-construction { put-shapes glyphs.O.contours - local bar : new Stroke :.start-from [SB + STROKE / 2] [CAP * [1 - 0.65]] :.line-to [RIGHTSB - STROKE / 2] [CAP * 0.65] + local bar : create-stroke :.start-from [SB + STROKE / 2] [CAP * [1 - 0.65]] :.line-to [RIGHTSB - STROKE / 2] [CAP * 0.65] put-shapes : bar.form-stroke [STROKE / 2] [STROKE / 2] } create-glyph 'zero.unslashed' : glyph-construction { @@ -389,20 +454,36 @@ create-glyph 'H' : glyph-construction { set-width WIDTH assign-unicode 'H' - put-shapes : new Stroke :.start-from SB 0 :.set-width 0 STROKE :.line-to SB CAP :.form-stroke - put-shapes : new Stroke :.start-from RIGHTSB 0 :.set-width STROKE 0 :.line-to RIGHTSB CAP :.form-stroke - put-shapes : new Stroke :.start-from SB [CAP / 2] :.set-width HALFSTROKE HALFSTROKE :.line-to RIGHTSB [CAP / 2] :.form-stroke + put-shapes : create-stroke :.start-from SB 0 :.pen-direction UPWARD :.set-width 0 STROKE + :.line-to SB CAP :.pen-direction UPWARD :.form-stroke + put-shapes : create-stroke :.start-from RIGHTSB 0 :.pen-direction UPWARD :.set-width STROKE 0 + :.line-to RIGHTSB CAP :.pen-direction UPWARD :.form-stroke + put-shapes : create-stroke :.start-from SB [CAP / 2] :.set-width HALFSTROKE HALFSTROKE :.pen-direction RIGHTWARD + :.line-to RIGHTSB [CAP / 2] :.pen-direction RIGHTWARD :.form-stroke } create-glyph 'L' : glyph-construction { set-width WIDTH assign-unicode 'L' - put-shapes : new Stroke :.start-from [SB * 1.5] CAP :.line-to [SB * 1.5] 0 :.line-to RIGHTSB 0 :.form-stroke STROKE 0 + put-shapes : create-stroke + :.start-from [SB * 1.5] CAP + :.set-width STROKE 0 + :.pen-direction DOWNWARD + :.line-to [SB * 1.5] 0 + :.pen-direction DOWNWARD + :.form-stroke + put-shapes : create-stroke + :.start-from [SB * 1.5] 0 + :.set-width STROKE 0 + :.pen-direction RIGHTWARD + :.line-to RIGHTSB 0 + :.pen-direction RIGHTWARD + :.form-stroke } create-glyph 'dotlessI.straight' : glyph-construction { - put-shapes : new Stroke :.start-from MIDDLE 0 + put-shapes : create-stroke :.start-from MIDDLE 0 :.set-width HALFSTROKE HALFSTROKE :.line-to MIDDLE CAP :.form-stroke @@ -410,13 +491,13 @@ create-glyph 'dotlessI.straight' : glyph-construction { create-glyph 'dotlessI.symmetric' : glyph-construction { include-glyph glyphs.'dotlessI.straight' # Top serif - put-shapes : new Stroke + put-shapes : create-stroke :.start-from [MIDDLE - WIDTH * 0.26] CAP :.set-width 0 STROKE :.line-to [MIDDLE + WIDTH * 0.26] CAP :.form-stroke # Bottom serif - put-shapes : new Stroke + put-shapes : create-stroke :.start-from [MIDDLE - WIDTH * 0.26] 0 :.set-width STROKE 0 :.line-to [MIDDLE + WIDTH * 0.26] 0 @@ -436,20 +517,20 @@ create-glyph 'S' : glyph-construction { local slope 0.11 - local bowltop : new Stroke + local bowltop : create-stroke bowltop.start-from [RIGHTSB - SB * 0.1] [CAP - HOOK] :.set-width STROKE 0 :.curve-to [MIDDLE + KAPPA_HOOK * [MIDDLE - para.sb]] CAPO MIDDLE CAPO :.cubic-to [SB + [1 - BKAPPA] * [WIDTH / 2 - SB]] CAPO SB [CAP - COBKAPPA * SMOOTH] SB CAP_SMOOTH - local strokemiddle : new Stroke + local strokemiddle : create-stroke strokemiddle.start-from [SB + STROKE / 2] CAP_SMOOTH :.set-width [STROKE / 2] [STROKE / 2] :.curve-to [SB + STROKE / 2] [[0.5 + slope] * CAP + [2 * slope * CAP] / [0.4 * WIDTH] * [0.3 * WIDTH - SB - STROKE / 2]] [0.3 * WIDTH] [[0.5 + slope] * CAP] :.line-to [0.7 * WIDTH] [[0.5 - slope] * CAP] :.curve-to [RIGHTSB - STROKE / 2] [[0.5 - slope] * CAP - [2 * slope * CAP] / [0.4 * WIDTH] * [0.3 * WIDTH - SB - STROKE / 2]] [RIGHTSB - STROKE / 2] SMOOTH - local bowlbottom : new Stroke + local bowlbottom : create-stroke bowlbottom.start-from RIGHTSB SMOOTH :.set-width 0 STROKE :.cubic-to RIGHTSB [COBKAPPA * SMOOTH] [MIDDLE + BKAPPA * [RIGHTSB - MIDDLE]] O MIDDLE O :.curve-to [MIDDLE - KAPPA_HOOK * [MIDDLE - para.sb]] O [SB * 1.1] HOOK @@ -461,8 +542,8 @@ create-glyph 'S' : glyph-construction { create-glyph 'dollar' : glyph-construction { set-width WIDTH; assign-unicode '$' put-shapes glyphs.S.contours - put-shapes : new Stroke :.start-from MIDDLE CAP :.set-width HALFSTROKE HALFSTROKE :.line-to MIDDLE [CAP - DESCENDER / 2] :.form-stroke - put-shapes : new Stroke :.start-from MIDDLE [DESCENDER / 2] :.set-width HALFSTROKE HALFSTROKE :.line-to MIDDLE 0 :.form-stroke + put-shapes : create-stroke :.start-from MIDDLE CAP :.set-width HALFSTROKE HALFSTROKE :.line-to MIDDLE [CAP - DESCENDER / 2] :.form-stroke + put-shapes : create-stroke :.start-from MIDDLE [DESCENDER / 2] :.set-width HALFSTROKE HALFSTROKE :.line-to MIDDLE 0 :.form-stroke } @@ -498,25 +579,49 @@ create-glyph 'p' : glyph-construction { set-width WIDTH assign-unicode 'p' put-shapes glyphs.'o.left'.contours - put-shapes : new Stroke :.start-from SB XH :.set-width STROKE 0 :.line-to SB DESCENDER :.form-stroke + put-shapes : create-stroke + :.start-from SB XH + :.pen-direction DOWNWARD + :.set-width STROKE 0 + :.line-to SB DESCENDER + :.pen-direction DOWNWARD + :.form-stroke } create-glyph 'b' : glyph-construction { set-width WIDTH assign-unicode 'b' put-shapes glyphs.'o.left'.contours - put-shapes : new Stroke :.start-from SB 0 :.set-width 0 STROKE :.line-to SB CAP :.form-stroke + put-shapes : create-stroke + :.start-from SB 0 + :.pen-direction UPWARD + :.set-width 0 STROKE + :.line-to SB CAP + :.pen-direction UPWARD + :.form-stroke } create-glyph 'q' : glyph-construction { set-width WIDTH assign-unicode 'q' put-shapes glyphs.'o.right'.contours - put-shapes : new Stroke :.start-from RIGHTSB XH :.set-width 0 STROKE :.line-to RIGHTSB DESCENDER :.form-stroke + put-shapes : create-stroke + :.start-from RIGHTSB XH + :.pen-direction DOWNWARD + :.set-width 0 STROKE + :.line-to RIGHTSB DESCENDER + :.pen-direction DOWNWARD + :.form-stroke } create-glyph 'd' : glyph-construction { set-width WIDTH assign-unicode 'd' put-shapes glyphs.'o.right'.contours - put-shapes : new Stroke :.start-from RIGHTSB 0 :.set-width STROKE 0 :.line-to RIGHTSB CAP :.form-stroke + put-shapes : create-stroke + :.start-from RIGHTSB 0 + :.pen-direction UPWARD + :.set-width STROKE 0 + :.line-to RIGHTSB CAP + :.pen-direction UPWARD + :.form-stroke } create-glyph 'g' : glyph-construction { set-width WIDTH @@ -528,14 +633,14 @@ create-glyph 'g' : glyph-construction { } reverse-last - put-shapes : new Stroke + put-shapes : create-stroke :.start-from MIDDLE [XH * 0.4] :.set-width 0 [STROKE * 0.75] - :.arc-hv-to [SB * 1.5 + STROKE] [[O - DESCENDER * 0.85 + XH * 0.4] / 2] + :.arc-hv-to [SB * 1.5 + STROKE] [[O - DESCENDER * 0.85 + XH * 0.4] * 0.47] :.set-width 0 STROKE :.arc-vh-to [MIDDLE + DESCENDER * 0.15] [O - DESCENDER * 0.85] :.line-to [MIDDLE - DESCENDER * 0.15] [O - DESCENDER * 0.85] - :.arc-hv-to [RIGHTSB - O * 2] 0 + :.arc-hv-to [RIGHTSB - O * 2] [[-STROKE] * globalTransform.yx * 2] :.arc-vh-to MIDDLE [DESCENDER + O] :.arc-hv-to SB [DESCENDER * 0.1] :.arc-vh-to [MIDDLE + DESCENDER * 0.15] [O - DESCENDER * 0.85] @@ -544,7 +649,7 @@ create-glyph 'g' : glyph-construction { start-from RIGHTSB XH line-to RIGHTSB [XH - STROKE] line-to MIDDLE [XH - STROKE - O] - line-to MODDLE XH + line-to MIDDLE XH } @@ -554,16 +659,22 @@ create-glyph 'x' : glyph-construction { local TURN [XH * 0.1] - local barone : new Stroke + local barone : create-stroke :.start-from [SB + HALFSTROKE] 0 + :.pen-direction UPWARD :.set-width HALFSTROKE HALFSTROKE :.cubic-to [SB + HALFSTROKE] [TURN + 0.17 * [XH - TURN]] [RIGHTSB - HALFSTROKE] [XH - TURN - 0.17 * [XH - TURN]] [RIGHTSB - HALFSTROKE] XH - :.form-stroke + :.pen-direction UPWARD - local bartwo : list : barone.0.map [[pt] -> (.x [WIDTH - pt.x] .y pt.y .onCurve pt.onCurve .cubic pt.cubic)] :.reverse + local bartwo : create-stroke + :.start-from [RIGHTSB - HALFSTROKE] 0 + :.pen-direction UPWARD + :.set-width HALFSTROKE HALFSTROKE + :.cubic-to [RIGHTSB - HALFSTROKE] [TURN + 0.17 * [XH - TURN]] [SB + HALFSTROKE] [XH - TURN - 0.17 * [XH - TURN]] [SB + HALFSTROKE] XH + :.pen-direction UPWARD - put-shapes barone - put-shapes bartwo + put-shapes : barone.form-stroke + put-shapes : bartwo.form-stroke } diff --git a/support/glyph.js b/support/glyph.js index 2b2346e..ee5640d 100644 --- a/support/glyph.js +++ b/support/glyph.js @@ -1,6 +1,16 @@ { - var r0_bezierCubic2Q2, r0_Glyph, _r0_t0, _r0_t1, _r0_t2, _r0_t3, _r0_t4, _r0_t5, _r0_t6, _r0_t7, _r0_t8, _r0_t9; + var r0_bezierCubic2Q2, r0_tp, r0_Stroke, r0_id, r0_Glyph, _r0_t0, _r0_t1, _r0_t2, _r0_t3, _r0_t4, _r0_t5, _r0_t6, _r0_t7, _r0_t8, _r0_t9, _r0_t10; r0_bezierCubic2Q2 = require('node-sfnt/lib/math/bezierCubic2Q2'); + r0_tp = require('./transform')['transformPoint']; + r0_Stroke = require('./stroke')['Stroke']; + r0_id = { + 'xx': 1, + 'yx': 0, + 'xy': 0, + 'yy': 1, + 'x': 0, + 'y': 0 + }; r0_Glyph = function _r0_t0(r1_name) { var r1_name, _r1_t0; _r1_t0 = this; @@ -8,6 +18,14 @@ _r1_t0['unicode'] = []; _r1_t0['contours'] = []; _r1_t0['advanceWidth'] = 500; + _r1_t0['gizmo'] = { + 'xx': 1, + 'yx': 0, + 'xy': 0, + 'yy': 1, + 'x': 0, + 'y': 0 + }; return void 0; }; r0_Glyph['prototype']['set-width'] = function _r0_t1(r2_w) { @@ -25,35 +43,35 @@ r0_Glyph['prototype']['start-from'] = function _r0_t3(r4_x, r4_y) { var r4_x, r4_y, _r4_t0; _r4_t0 = this; - _r4_t0['contours']['push']([{ + _r4_t0['contours']['push']([r0_tp(_r4_t0['gizmo'], { 'x': r4_x, 'y': r4_y, 'onCurve': true - }]); + })]); return _r4_t0; }; r0_Glyph['prototype']['line-to'] = function _r0_t4(r5_x, r5_y) { var r5_x, r5_y, _r5_t0; _r5_t0 = this; - _r5_t0['contours'][_r5_t0['contours']['length'] - 1]['push']({ + _r5_t0['contours'][_r5_t0['contours']['length'] - 1]['push'](r0_tp(_r5_t0['gizmo'], { 'x': r5_x, 'y': r5_y, 'onCurve': true - }); + })); return _r5_t0; }; r0_Glyph['prototype']['curve-to'] = function _r0_t5(r6_xc, r6_yc, r6_x, r6_y) { var r6_xc, r6_yc, r6_x, r6_y, _r6_t0; _r6_t0 = this; - _r6_t0['contours'][_r6_t0['contours']['length'] - 1]['push']({ + _r6_t0['contours'][_r6_t0['contours']['length'] - 1]['push'](r0_tp(_r6_t0['gizmo'], { 'x': r6_xc, 'y': r6_yc, 'onCurve': false - }, { + }), r0_tp(_r6_t0['gizmo'], { 'x': r6_x, 'y': r6_y, 'onCurve': true - }); + })); return _r6_t0; }; r0_Glyph['prototype']['cubic-to'] = function _r0_t6(r7_x1, r7_y1, r7_x2, r7_y2, r7_x, r7_y) { @@ -93,8 +111,10 @@ return _r9_t0['contours'][_r9_t0['contours']['length'] - 1] = _r9_t0['contours'][_r9_t0['contours']['length'] - 1]['reverse'](); }; r0_Glyph['prototype']['put-shapes'] = function _r0_t8(r10_contours) { - var r10_contours, r10_contour, r10_j, r10_point, r10_p2, r10_p3, _r10_t0, _r10_t1, _r10_t2, _r10_t3; + var r10_contours, r10_t, r10_contour, r10_j, r10_point, r10_p2, r10_p3, _r10_t0, _r10_t1, _r10_t2, _r10_t3; _r10_t3 = this; + r10_t = _r10_t3['gizmo']; + _r10_t3['gizmo'] = r0_id; _r10_t0 = r10_contours; _r10_t1 = _r10_t0['length']; _r10_t2 = 0; @@ -118,6 +138,7 @@ } } } + _r10_t3['gizmo'] = r10_t; return _r10_t3; }; r0_Glyph['prototype']['include-glyph'] = function _r0_t9(r12_glyph) { @@ -125,5 +146,12 @@ _r12_t0 = this; return _r12_t0['put-shapes'](r12_glyph['contours']); }; + r0_Glyph['prototype']['create-stroke'] = function _r0_t10() { + var r13_s, _r13_t0; + _r13_t0 = this; + r13_s = new r0_Stroke(); + r13_s['gizmo'] = Object['create'](_r13_t0['gizmo']); + return r13_s; + }; exports['Glyph'] = r0_Glyph; } diff --git a/support/glyph.patel b/support/glyph.patel index b50cfe4..72bfc05 100644 --- a/support/glyph.patel +++ b/support/glyph.patel @@ -1,9 +1,29 @@ define bezierCubic2Q2 [require 'node-sfnt/lib/math/bezierCubic2Q2'] +define tp [require './transform'].transformPoint +define Stroke [require './stroke'].Stroke + +define id ( + .xx 1 + .yx 0 + .xy 0 + .yy 1 + .x 0 + .y 0 +) + define [Glyph name] : begin { set this.name name set this.unicode () set this.contours () set this.advanceWidth 500 + set this.gizmo ( + .xx 1 + .yx 0 + .xy 0 + .yy 1 + .x 0 + .y 0 + ) return nothing } define [Glyph.prototype.set-width w] : begin { @@ -16,15 +36,15 @@ define [Glyph.prototype.assign-unicode u] : begin { } define [Glyph.prototype.start-from x y] : begin { - this.contours.push ((.x x .y y .onCurve true)) + this.contours.push ([tp this.gizmo (.x x .y y .onCurve true)]) return this } define [Glyph.prototype.line-to x y] : begin { - this.contours`[this.contours.length - 1].push (.x x .y y .onCurve true) + this.contours`[this.contours.length - 1].push [tp this.gizmo (.x x .y y .onCurve true)] return this } define [Glyph.prototype.curve-to xc yc x y] : begin { - this.contours`[this.contours.length - 1].push (.x xc .y yc .onCurve false) (.x x .y y .onCurve true) + this.contours`[this.contours.length - 1].push [tp this.gizmo (.x xc .y yc .onCurve false)] [tp this.gizmo (.x x .y y .onCurve true)] return this } define [Glyph.prototype.cubic-to x1 y1 x2 y2 x y] : begin { @@ -38,6 +58,9 @@ define [Glyph.prototype.reverse-last] : begin { this.contours.[this.contours.length - 1] = [this.contours.[this.contours.length - 1].reverse] } define [Glyph.prototype.put-shapes contours] : begin { + # do not double-transform + local t this.gizmo + set this.gizmo id foreach contour [items-of contours] : begin { this.start-from contour.0.x contour.0.y for [local j 1] [j < contour.length] [inc j] : begin { @@ -54,8 +77,14 @@ define [Glyph.prototype.put-shapes contours] : begin { }]] } } + set this.gizmo t return this } define [Glyph.prototype.include-glyph glyph] : this.put-shapes glyph.contours +define [Glyph.prototype.create-stroke] : begin { + local s : new Stroke + s.gizmo = [Object.create this.gizmo] + return s +} exports.Glyph = Glyph \ No newline at end of file diff --git a/support/intersection.js b/support/intersection.js index 9e407ab..c5efeb6 100644 --- a/support/intersection.js +++ b/support/intersection.js @@ -7,7 +7,7 @@ exports.intersection = function (line1StartX, line1StartY, line1EndX, line1EndY, onLine2: false }; denominator = ((line2EndY - line2StartY) * (line1EndX - line1StartX)) - ((line2EndX - line2StartX) * (line1EndY - line1StartY)); - if (Math.abs(denominator) < 0.000000000001) { + if (Math.abs(denominator) < 0.00000000001) { return result; } a = line1StartY - line2StartY; diff --git a/support/stroke.js b/support/stroke.js index f824877..96deb7e 100644 --- a/support/stroke.js +++ b/support/stroke.js @@ -1,8 +1,10 @@ { - var r0_smooth, r0_intersection, r0_Bezier, r0_xn$rangearray$1aao, r0_SAMPLES, r0_TINY, r0_LITTLE, r0_KAPPA, r0_COKAPPA, r0_BKAPPA, r0_COBKAPPA, r0_Stroke, r0_dforward, r0_dbackward, r0_nonlinear, _r0_t0, _r0_t1, _r0_t2, _r0_t3, _r0_t4, _r0_t5, _r0_t6, _r0_t7, _r0_t8, _r0_t9, _r0_t10, _r0_t11, _r0_t12, _r0_t13; + var r0_smooth, r0_intersection, r0_Bezier, r0_tp, r0_utp, r0_xn$rangearray$1aao, r0_SAMPLES, r0_TINY, r0_LITTLE, r0_KAPPA, r0_COKAPPA, r0_BKAPPA, r0_COBKAPPA, r0_Stroke, r0_dforward, r0_dbackward, r0_nonlinear, r0_computeOffsetPoint, _r0_t0, _r0_t1, _r0_t2, _r0_t3, _r0_t4, _r0_t5, _r0_t6, _r0_t7, _r0_t8, _r0_t9, _r0_t10, _r0_t11, _r0_t12, _r0_t13, _r0_t14, _r0_t15, _r0_t16; r0_smooth = require('./monotonic-interpolate')['createInterpolant']; r0_intersection = require('./intersection')['intersection']; r0_Bezier = require('bezier-js'); + r0_tp = require('./transform')['transformPoint']; + r0_utp = require('./transform')['untransform']; r0_xn$rangearray$1aao = function _r0_t0(r1_low, r1_high) { var r1_low, r1_high, r1_a, r1_j; r1_a = []; @@ -23,313 +25,407 @@ var _r2_t0; _r2_t0 = this; _r2_t0['points'] = []; + _r2_t0['gizmo'] = { + 'xx': 1, + 'yx': 0, + 'xy': 0, + 'yy': 1, + 'x': 0, + 'y': 0 + }; return _r2_t0; }; - r0_Stroke['bindParameters'] = function _r0_t2(r3_para) { - var r3_para; - r0_KAPPA = r3_para['kappa']; + r0_Stroke['prototype']['set-transform'] = function _r0_t2(r3_t) { + var r3_t, _r3_t0; + _r3_t0 = this; + _r3_t0['gizmo'] = r3_t; + return _r3_t0; + }; + r0_Stroke['bindParameters'] = function _r0_t3(r4_para) { + var r4_para; + r0_KAPPA = r4_para['kappa']; r0_COKAPPA = 1 - r0_KAPPA; r0_COBKAPPA = r0_COKAPPA - 0.1; return r0_BKAPPA = r0_KAPPA + 0.1; }; - r0_Stroke['prototype']['set-width'] = function _r0_t3(r4_d1, r4_d2) { - var r4_d1, r4_d2, r4_point, _r4_t0; - _r4_t0 = this; - r4_point = _r4_t0['points'][_r4_t0['points']['length'] - 1]; - r4_point['d1'] = r4_d1; - r4_point['d2'] = r4_d2; - return _r4_t0; - }; - r0_Stroke['prototype']['start-from'] = function _r0_t4(r5_x, r5_y) { - var r5_x, r5_y, _r5_t0; + r0_Stroke['prototype']['set-width'] = function _r0_t4(r5_d1, r5_d2) { + var r5_d1, r5_d2, r5_point, _r5_t0; _r5_t0 = this; - _r5_t0['points'] = [{ - 'x': r5_x, - 'y': r5_y, - 'onCurve': true - }]; + r5_point = _r5_t0['points'][_r5_t0['points']['length'] - 1]; + r5_point['d1'] = r5_d1; + r5_point['d2'] = r5_d2; return _r5_t0; }; - r0_Stroke['prototype']['line-to'] = function _r0_t5(r6_x, r6_y) { - var r6_x, r6_y, _r6_t0; - _r6_t0 = this; - _r6_t0['points']['push']({ - 'x': r6_x, - 'y': r6_y, - 'onCurve': true - }); - return _r6_t0; + r0_Stroke['prototype']['pen-direction'] = function _r0_t5(r6_x, r6_y) { + var r6_x, r6_y, r6_point, _r6_t0, _r6_t1; + _r6_t1 = this; + if (r6_x['x'] !== void 0 || r6_x['y'] !== void 0) { + r6_y = r6_x['y']; + _r6_t0 = r6_x = r6_x['x']; + } else + _r6_t0 = void 0; + r6_point = _r6_t1['points'][_r6_t1['points']['length'] - 1]; + r6_point['pdx'] = r6_x; + r6_point['pdy'] = r6_y; + return _r6_t1; }; - r0_Stroke['prototype']['curve-to'] = function _r0_t6(r7_xc, r7_yc, r7_x, r7_y) { - var r7_xc, r7_yc, r7_x, r7_y, _r7_t0; + r0_Stroke['prototype']['start-from'] = function _r0_t6(r7_x, r7_y) { + var r7_x, r7_y, _r7_t0; _r7_t0 = this; - _r7_t0['points']['push']({ - 'x': r7_xc, - 'y': r7_yc, - 'onCurve': false - }, { - 'x': r7_x, - 'y': r7_y, - 'onCurve': true - }); + _r7_t0['points'] = [r0_tp(_r7_t0['gizmo'], { + 'x': r7_x, + 'y': r7_y, + 'onCurve': true + })]; return _r7_t0; }; - r0_Stroke['prototype']['cubic-to'] = function _r0_t7(r8_x1, r8_y1, r8_x2, r8_y2, r8_x, r8_y) { - var r8_x1, r8_y1, r8_x2, r8_y2, r8_x, r8_y, _r8_t0; + r0_Stroke['prototype']['line-to'] = function _r0_t7(r8_x, r8_y) { + var r8_x, r8_y, _r8_t0; _r8_t0 = this; - _r8_t0['points']['push']({ - 'x': r8_x1, - 'y': r8_y1, - 'onCurve': false, - 'cubic': true - }, { - 'x': r8_x2, - 'y': r8_y2, - 'onCurve': false, - 'cubic': true - }, { + _r8_t0['points']['push'](r0_tp(_r8_t0['gizmo'], { 'x': r8_x, 'y': r8_y, 'onCurve': true - }); + })); return _r8_t0; }; - r0_Stroke['prototype']['arc-vh-to'] = function _r0_t8(r9_x, r9_y) { - var r9_x, r9_y, r9_last, _r9_t0; + r0_Stroke['prototype']['curve-to'] = function _r0_t8(r9_xc, r9_yc, r9_x, r9_y) { + var r9_xc, r9_yc, r9_x, r9_y, _r9_t0; _r9_t0 = this; - r9_last = _r9_t0['points'][_r9_t0['points']['length'] - 1]; - _r9_t0['cubic-to'](r9_last['x'], r9_last['y'] + r0_BKAPPA * (r9_y - r9_last['y']), r9_x + r0_BKAPPA * (r9_last['x'] - r9_x), r9_y, r9_x, r9_y); + _r9_t0['points']['push'](r0_tp(_r9_t0['gizmo'], { + 'x': r9_xc, + 'y': r9_yc, + 'onCurve': false + }), r0_tp(_r9_t0['gizmo'], { + 'x': r9_x, + 'y': r9_y, + 'onCurve': true + })); return _r9_t0; }; - r0_Stroke['prototype']['arc-hv-to'] = function _r0_t9(r10_x, r10_y) { - var r10_x, r10_y, r10_last, _r10_t0; + r0_Stroke['prototype']['cubic-to'] = function _r0_t9(r10_x1, r10_y1, r10_x2, r10_y2, r10_x, r10_y) { + var r10_x1, r10_y1, r10_x2, r10_y2, r10_x, r10_y, _r10_t0; _r10_t0 = this; - r10_last = _r10_t0['points'][_r10_t0['points']['length'] - 1]; - _r10_t0['cubic-to'](r10_last['x'] + r0_BKAPPA * (r10_x - r10_last['x']), r10_last['y'], r10_x, r10_y + r0_BKAPPA * (r10_last['y'] - r10_y), r10_x, r10_y); + _r10_t0['points']['push'](r0_tp(_r10_t0['gizmo'], { + 'x': r10_x1, + 'y': r10_y1, + 'onCurve': false, + 'cubic': true + }), r0_tp(_r10_t0['gizmo'], { + 'x': r10_x2, + 'y': r10_y2, + 'onCurve': false, + 'cubic': true + }), r0_tp(_r10_t0['gizmo'], { + 'x': r10_x, + 'y': r10_y, + 'onCurve': true + })); return _r10_t0; }; - r0_dforward = function _r0_t10(r11_p0, r11_p1, r11_p2, r11_p3) { - var r11_p0, r11_p1, r11_p2, r11_p3; + r0_Stroke['prototype']['arc-vh-to'] = function _r0_t10(r11_x, r11_y) { + var r11_x, r11_y, r11_last, _r11_t0; + _r11_t0 = this; + r11_last = r0_utp(_r11_t0['gizmo'], _r11_t0['points'][_r11_t0['points']['length'] - 1]); + _r11_t0['cubic-to'](r11_last['x'], r11_last['y'] + r0_BKAPPA * (r11_y - r11_last['y']), r11_x + r0_BKAPPA * (r11_last['x'] - r11_x), r11_y, r11_x, r11_y); + return _r11_t0; + }; + r0_Stroke['prototype']['arc-hv-to'] = function _r0_t11(r12_x, r12_y) { + var r12_x, r12_y, r12_last, _r12_t0; + _r12_t0 = this; + r12_last = r0_utp(_r12_t0['gizmo'], _r12_t0['points'][_r12_t0['points']['length'] - 1]); + _r12_t0['cubic-to'](r12_last['x'] + r0_BKAPPA * (r12_x - r12_last['x']), r12_last['y'], r12_x, r12_y + r0_BKAPPA * (r12_last['y'] - r12_y), r12_x, r12_y); + return _r12_t0; + }; + r0_dforward = function _r0_t12(r13_p0, r13_p1, r13_p2, r13_p3) { + var r13_p0, r13_p1, r13_p2, r13_p3; return { - 'x': r11_p0['x'] + (-11 / 6 * r11_p0['x'] + 3 * r11_p1['x'] - 3 / 2 * r11_p2['x'] + r11_p3['x'] / 3) / r0_TINY * r0_LITTLE, - 'y': r11_p0['y'] + (-11 / 6 * r11_p0['y'] + 3 * r11_p1['y'] - 3 / 2 * r11_p2['y'] + r11_p3['y'] / 3) / r0_TINY * r0_LITTLE + 'x': r13_p0['x'] + (-11 / 6 * r13_p0['x'] + 3 * r13_p1['x'] - 3 / 2 * r13_p2['x'] + r13_p3['x'] / 3) / r0_TINY * r0_LITTLE, + 'y': r13_p0['y'] + (-11 / 6 * r13_p0['y'] + 3 * r13_p1['y'] - 3 / 2 * r13_p2['y'] + r13_p3['y'] / 3) / r0_TINY * r0_LITTLE }; }; - r0_dbackward = function _r0_t11(r12_p0, r12_p1, r12_p2, r12_p3) { - var r12_p0, r12_p1, r12_p2, r12_p3; + r0_dbackward = function _r0_t13(r14_p0, r14_p1, r14_p2, r14_p3) { + var r14_p0, r14_p1, r14_p2, r14_p3; return { - 'x': r12_p0['x'] + (11 / 6 * r12_p0['x'] - 3 * r12_p1['x'] + 3 / 2 * r12_p2['x'] - r12_p3['x'] / 3) / r0_TINY * r0_LITTLE, - 'y': r12_p0['y'] + (11 / 6 * r12_p0['y'] - 3 * r12_p1['y'] + 3 / 2 * r12_p2['y'] - r12_p3['y'] / 3) / r0_TINY * r0_LITTLE + 'x': r14_p0['x'] + (11 / 6 * r14_p0['x'] - 3 * r14_p1['x'] + 3 / 2 * r14_p2['x'] - r14_p3['x'] / 3) / r0_TINY * r0_LITTLE, + 'y': r14_p0['y'] + (11 / 6 * r14_p0['y'] - 3 * r14_p1['y'] + 3 / 2 * r14_p2['y'] - r14_p3['y'] / 3) / r0_TINY * r0_LITTLE }; }; - r0_nonlinear = function _r0_t12(r13_a, r13_b, r13_c) { - var r13_a, r13_b, r13_c; - return Math['abs']((r13_c['y'] - r13_a['y']) * (r13_b['x'] - r13_a['x']) - (r13_c['x'] - r13_a['x']) * (r13_b['y'] - r13_a['y'])) > r0_TINY; + r0_nonlinear = function _r0_t14(r15_a, r15_b, r15_c) { + var r15_a, r15_b, r15_c; + return Math['abs']((r15_c['y'] - r15_a['y']) * (r15_b['x'] - r15_a['x']) - (r15_c['x'] - r15_a['x']) * (r15_b['y'] - r15_a['y'])) > r0_TINY; }; - r0_Stroke['prototype']['form-stroke'] = function _r0_t13(r14_d1, r14_d2) { - var r14_d1, r14_d2, r14_d1s, r14_d2s, r14_subSegments, r14_p0, r14_j, r14_p1, r14_p2, r14_p3, r14_f1, r14_f2, r14_left, r14_right, r14_seg, r14_curve, r14_sample, r14_t, r14_tn, r14_lthis, r14_rthis, r14_lnext, r14_rnext, r14_lnthis1, r14_rnthis1, r14_lnnext1, r14_rnnext1, r14_lnthis2, r14_rnthis2, r14_lnnext2, r14_rnnext2, r14_lnthis3, r14_rnthis3, r14_lnnext3, r14_rnnext3, r14_dlthis, r14_drthis, r14_dlnext, r14_drnext, r14_il, r14_ir, r14_last, r14_shape, _r14_t0, _r14_t1, _r14_t2, _r14_t3, _r14_t4, _r14_t5, _r14_t6, _r14_t7, _r14_t8, _r14_t9, _r14_t10, _r14_t11, _r14_t12, _r14_t13, _r14_t14, _r14_t15, _r14_t16, _r14_t17, _r14_t18, _r14_t19, _r14_t20, _r14_t21, _r14_t22, _r14_t23, _r14_t24, _r14_t25, _r14_t26, _r14_t27, _r14_t28, _r14_t29, _r14_t30, _r14_t31, _r14_t32, _r14_t33, _r14_t34, _r14_t35, _r14_t36, _r14_t37, _r14_t38; - _r14_t2 = this; - if (_r14_t2['points'][0]['d1'] >= 0) - _r14_t3 = _r14_t2['points'][0]['d1']; + r0_computeOffsetPoint = function _r0_t15(r16_curve, r16_t, r16_j, r16_foffset, r16_fpdx, r16_fpdy) { + var r16_curve, r16_t, r16_j, r16_foffset, r16_fpdx, r16_fpdy, r16_onpoint, r16_normal; + r16_onpoint = r16_curve['compute'](r16_t - r16_j); + r16_normal = r16_curve['normal'](r16_t - r16_j); + return { + 'x': r16_onpoint['x'] + r16_foffset(r16_t) * (r16_normal['x'] + r16_fpdx(r16_t)), + 'y': r16_onpoint['y'] + r16_foffset(r16_t) * (r16_normal['y'] + r16_fpdy(r16_t)) + }; + }; + r0_Stroke['prototype']['form-stroke'] = function _r0_t16(r17_d1, r17_d2) { + var r17_d1, r17_d2, r17_d1s, r17_d2s, r17_pdxs, r17_pdys, r17_subSegments, r17_p0, r17_j, r17_p1, r17_p2, r17_seg, r17_normalpt, r17_p3, r17_f1, r17_f2, r17_fpdx, r17_fpdy, r17_left, r17_right, r17_curve, r17_sample, r17_t, r17_tn, r17_lthis, r17_rthis, r17_lnext, r17_rnext, r17_lnthis1, r17_rnthis1, r17_lnnext1, r17_rnnext1, r17_lnthis2, r17_rnthis2, r17_lnnext2, r17_rnnext2, r17_lnthis3, r17_rnthis3, r17_lnnext3, r17_rnnext3, r17_dlthis, r17_drthis, r17_dlnext, r17_drnext, r17_il, r17_ir, r17_last, r17_shape, r17_k, r17_still, _r17_t0, _r17_t1, _r17_t2, _r17_t3, _r17_t4, _r17_t5, _r17_t6, _r17_t7, _r17_t8, _r17_t9, _r17_t10, _r17_t11, _r17_t12, _r17_t13, _r17_t14, _r17_t15, _r17_t16, _r17_t17, _r17_t18, _r17_t19, _r17_t20, _r17_t21, _r17_t22, _r17_t23, _r17_t24, _r17_t25, _r17_t26, _r17_t27, _r17_t28, _r17_t29, _r17_t30, _r17_t31, _r17_t32, _r17_t33, _r17_t34, _r17_t35, _r17_t36, _r17_t37, _r17_t38, _r17_t39, _r17_t40, _r17_t41, _r17_t42, _r17_t43, _r17_t44, _r17_t45, _r17_t46, _r17_t47, _r17_t48, _r17_t49, _r17_t50, _r17_t51, _r17_t52, _r17_t53, _r17_t54, _r17_t55, _r17_t56, _r17_t57, _r17_t58, _r17_t59; + _r17_t2 = this; + if (_r17_t2['points'][0]['d1'] >= 0) + _r17_t3 = _r17_t2['points'][0]['d1']; else - _r14_t3 = r14_d1; - _r14_t4 = r14_d1 = _r14_t3; - r14_d1s = [_r14_t4]; - if (_r14_t2['points'][0]['d2'] >= 0) - _r14_t5 = _r14_t2['points'][0]['d2']; + _r17_t3 = r17_d1; + _r17_t4 = r17_d1 = _r17_t3; + r17_d1s = [_r17_t4]; + if (_r17_t2['points'][0]['d2'] >= 0) + _r17_t5 = _r17_t2['points'][0]['d2']; else - _r14_t5 = r14_d2; - _r14_t6 = r14_d2 = _r14_t5; - r14_d2s = [_r14_t6]; - r14_subSegments = []; - r14_p0 = _r14_t2['points'][0]; - r14_j = 1; - for (; r14_j < this['points']['length']; r14_j = r14_j + 1) { - r14_p1 = _r14_t2['points'][r14_j]; - if (r14_p1['onCurve']) { - r14_subSegments['push']([ - r14_p0, - { - 'x': (r14_p0['x'] + r14_p1['x']) / 2, - 'y': (r14_p0['y'] + r14_p1['y']) / 2 - }, - r14_p1 - ]); - _r14_t7 = r14_d1s; - _r14_t8 = _r14_t7['push']; - if (r14_p1['d1'] >= 0) - _r14_t9 = r14_p1['d1']; + _r17_t5 = r17_d2; + _r17_t6 = r17_d2 = _r17_t5; + r17_d2s = [_r17_t6]; + r17_pdxs = [0]; + r17_pdys = [0]; + r17_subSegments = []; + r17_p0 = _r17_t2['points'][0]; + r17_j = 1; + for (; r17_j < this['points']['length']; r17_j = r17_j + 1) { + r17_p1 = _r17_t2['points'][r17_j]; + if (r17_p1['onCurve']) { + r17_subSegments['push'](r17_seg = new r0_Bezier(r17_p0['x'], r17_p0['y'], (r17_p0['x'] + r17_p1['x']) / 2, (r17_p0['y'] + r17_p1['y']) / 2, r17_p1['x'], r17_p1['y'])); + _r17_t7 = r17_d1s; + _r17_t8 = _r17_t7['push']; + if (r17_p1['d1'] >= 0) + _r17_t9 = r17_p1['d1']; else - _r14_t9 = r14_d1; - _r14_t10 = r14_d1 = _r14_t9; - _r14_t8['call'](_r14_t7, _r14_t10); - _r14_t11 = r14_d2s; - _r14_t12 = _r14_t11['push']; - if (r14_p1['d2'] >= 0) - _r14_t13 = r14_p1['d2']; + _r17_t9 = r17_d1; + _r17_t10 = r17_d1 = _r17_t9; + _r17_t8['call'](_r17_t7, _r17_t10); + _r17_t11 = r17_d2s; + _r17_t12 = _r17_t11['push']; + if (r17_p1['d2'] >= 0) + _r17_t13 = r17_p1['d2']; else - _r14_t13 = r14_d2; - _r14_t14 = r14_d2 = _r14_t13; - _r14_t12['call'](_r14_t11, _r14_t14); - r14_p0 = r14_p1; - } else if (r14_p1['cubic']) { - r14_p2 = _r14_t2['points'][r14_j + 1]; - r14_p3 = _r14_t2['points'][r14_j + 2]; - _r14_t15 = r14_d1s; - _r14_t16 = _r14_t15['push']; - if (r14_p3['d1'] >= 0) - _r14_t17 = r14_p3['d1']; + _r17_t13 = r17_d2; + _r17_t14 = r17_d2 = _r17_t13; + _r17_t12['call'](_r17_t11, _r17_t14); + r17_normalpt = r17_seg['normal'](0); + _r17_t15 = r17_pdxs; + _r17_t16 = _r17_t15['push']; + if (r17_p1['pdx'] !== void 0) + _r17_t17 = r17_p1['pdx'] - r17_normalpt['x']; else - _r14_t17 = r14_d1; - _r14_t18 = r14_d1 = _r14_t17; - _r14_t16['call'](_r14_t15, _r14_t18); - _r14_t19 = r14_d2s; - _r14_t20 = _r14_t19['push']; - if (r14_p3['d2'] >= 0) - _r14_t21 = r14_p3['d2']; + _r17_t17 = 0; + _r17_t16['call'](_r17_t15, _r17_t17); + _r17_t18 = r17_pdys; + _r17_t19 = _r17_t18['push']; + if (r17_p1['pdy'] !== void 0) + _r17_t20 = r17_p1['pdy'] - r17_normalpt['y']; else - _r14_t21 = r14_d2; - _r14_t22 = r14_d2 = _r14_t21; - _r14_t20['call'](_r14_t19, _r14_t22); - r14_subSegments['push']([ - r14_p0, - r14_p1, - r14_p2, - r14_p3 - ]); - r14_p0 = r14_p3; - r14_j = r14_j + 2; + _r17_t20 = 0; + _r17_t19['call'](_r17_t18, _r17_t20); + r17_p0 = r17_p1; + } else if (r17_p1['cubic']) { + r17_p2 = _r17_t2['points'][r17_j + 1]; + r17_p3 = _r17_t2['points'][r17_j + 2]; + r17_subSegments['push'](r17_seg = new r0_Bezier(r17_p0['x'], r17_p0['y'], r17_p1['x'], r17_p1['y'], r17_p2['x'], r17_p2['y'], r17_p3['x'], r17_p3['y'])); + _r17_t21 = r17_d1s; + _r17_t22 = _r17_t21['push']; + if (r17_p3['d1'] >= 0) + _r17_t23 = r17_p3['d1']; + else + _r17_t23 = r17_d1; + _r17_t24 = r17_d1 = _r17_t23; + _r17_t22['call'](_r17_t21, _r17_t24); + _r17_t25 = r17_d2s; + _r17_t26 = _r17_t25['push']; + if (r17_p3['d2'] >= 0) + _r17_t27 = r17_p3['d2']; + else + _r17_t27 = r17_d2; + _r17_t28 = r17_d2 = _r17_t27; + _r17_t26['call'](_r17_t25, _r17_t28); + r17_normalpt = r17_seg['normal'](0); + _r17_t29 = r17_pdxs; + _r17_t30 = _r17_t29['push']; + if (r17_p3['pdx'] !== void 0) + _r17_t31 = r17_p3['pdx'] - r17_normalpt['x']; + else + _r17_t31 = 0; + _r17_t30['call'](_r17_t29, _r17_t31); + _r17_t32 = r17_pdys; + _r17_t33 = _r17_t32['push']; + if (r17_p3['pdy'] !== void 0) + _r17_t34 = r17_p3['pdy'] - r17_normalpt['y']; + else + _r17_t34 = 0; + _r17_t33['call'](_r17_t32, _r17_t34); + r17_p0 = r17_p3; + r17_j = r17_j + 2; } else if (true) { - r14_p2 = _r14_t2['points'][r14_j + 1]; - _r14_t23 = r14_d1s; - _r14_t24 = _r14_t23['push']; - if (r14_p2['d1'] >= 0) - _r14_t25 = r14_p2['d1']; + r17_p2 = _r17_t2['points'][r17_j + 1]; + r17_subSegments['push'](r17_seg = new r0_Bezier(r17_p0['x'], r17_p0['y'], r17_p1['x'], r17_p1['y'], r17_p2['x'], r17_p2['y'])); + _r17_t35 = r17_d1s; + _r17_t36 = _r17_t35['push']; + if (r17_p2['d1'] >= 0) + _r17_t37 = r17_p2['d1']; else - _r14_t25 = r14_d1; - _r14_t26 = r14_d1 = _r14_t25; - _r14_t24['call'](_r14_t23, _r14_t26); - _r14_t27 = r14_d2s; - _r14_t28 = _r14_t27['push']; - if (r14_p2['d2'] >= 0) - _r14_t29 = r14_p2['d2']; + _r17_t37 = r17_d1; + _r17_t38 = r17_d1 = _r17_t37; + _r17_t36['call'](_r17_t35, _r17_t38); + _r17_t39 = r17_d2s; + _r17_t40 = _r17_t39['push']; + if (r17_p2['d2'] >= 0) + _r17_t41 = r17_p2['d2']; else - _r14_t29 = r14_d2; - _r14_t30 = r14_d2 = _r14_t29; - _r14_t28['call'](_r14_t27, _r14_t30); - r14_subSegments['push']([ - r14_p0, - r14_p1, - r14_p2 - ]); - r14_p0 = r14_p2; - r14_j = r14_j + 1; + _r17_t41 = r17_d2; + _r17_t42 = r17_d2 = _r17_t41; + _r17_t40['call'](_r17_t39, _r17_t42); + r17_normalpt = r17_seg['normal'](0); + _r17_t43 = r17_pdxs; + _r17_t44 = _r17_t43['push']; + if (r17_p2['pdx'] !== void 0) + _r17_t45 = r17_p2['pdx'] - r17_normalpt['x']; + else + _r17_t45 = 0; + _r17_t44['call'](_r17_t43, _r17_t45); + _r17_t46 = r17_pdys; + _r17_t47 = _r17_t46['push']; + if (r17_p2['pdy'] !== void 0) + _r17_t48 = r17_p2['pdy'] - r17_normalpt['y']; + else + _r17_t48 = 0; + _r17_t47['call'](_r17_t46, _r17_t48); + r17_p0 = r17_p2; + r17_j = r17_j + 1; } else void 0; } - r14_f1 = r0_smooth(r0_xn$rangearray$1aao(0, r14_d1s['length']), r14_d1s); - r14_f2 = r0_smooth(r0_xn$rangearray$1aao(0, r14_d2s['length']), r14_d2s); - r14_left = []; - r14_right = []; - r14_j = 0; - for (; r14_j < r14_subSegments['length']; r14_j = r14_j + 1) { - r14_seg = r14_subSegments[r14_j]; - if (r14_seg['length'] > 3) - _r14_t31 = new r0_Bezier(r14_seg[0]['x'], r14_seg[0]['y'], r14_seg[1]['x'], r14_seg[1]['y'], r14_seg[2]['x'], r14_seg[2]['y'], r14_seg[3]['x'], r14_seg[3]['y']); - else - _r14_t31 = new r0_Bezier(r14_seg[0]['x'], r14_seg[0]['y'], r14_seg[1]['x'], r14_seg[1]['y'], r14_seg[2]['x'], r14_seg[2]['y']); - r14_curve = _r14_t31; - _r14_t0 = 0; - _r14_t1 = r0_SAMPLES; - r14_sample = _r14_t0; - for (; r14_sample < _r14_t1; r14_sample = r14_sample + 1) { - r14_t = r14_j + r14_sample / r0_SAMPLES; - r14_tn = r14_j + (r14_sample + 1) / r0_SAMPLES; - r14_lthis = r14_curve['offset'](r14_sample / r0_SAMPLES, r14_f1(r14_t)); - r14_rthis = r14_curve['offset'](r14_sample / r0_SAMPLES, -r14_f2(r14_t)); - r14_lnext = r14_curve['offset']((r14_sample + 1) / r0_SAMPLES, r14_f1(r14_tn)); - r14_rnext = r14_curve['offset']((r14_sample + 1) / r0_SAMPLES, -r14_f2(r14_tn)); - r14_lnthis1 = r14_curve['offset'](r14_sample / r0_SAMPLES + r0_TINY, r14_f1(r14_t + r0_TINY)); - r14_rnthis1 = r14_curve['offset'](r14_sample / r0_SAMPLES + r0_TINY, -r14_f2(r14_t + r0_TINY)); - r14_lnnext1 = r14_curve['offset']((r14_sample + 1) / r0_SAMPLES - r0_TINY, r14_f1(r14_tn - r0_TINY)); - r14_rnnext1 = r14_curve['offset']((r14_sample + 1) / r0_SAMPLES - r0_TINY, -r14_f2(r14_tn - r0_TINY)); - r14_lnthis2 = r14_curve['offset'](r14_sample / r0_SAMPLES + r0_TINY * 2, r14_f1(r14_t + r0_TINY * 2)); - r14_rnthis2 = r14_curve['offset'](r14_sample / r0_SAMPLES + r0_TINY * 2, -r14_f2(r14_t + r0_TINY * 2)); - r14_lnnext2 = r14_curve['offset']((r14_sample + 1) / r0_SAMPLES - r0_TINY * 2, r14_f1(r14_tn - r0_TINY * 2)); - r14_rnnext2 = r14_curve['offset']((r14_sample + 1) / r0_SAMPLES - r0_TINY * 2, -r14_f2(r14_tn - r0_TINY * 2)); - r14_lnthis3 = r14_curve['offset'](r14_sample / r0_SAMPLES + r0_TINY * 3, r14_f1(r14_t + r0_TINY * 3)); - r14_rnthis3 = r14_curve['offset'](r14_sample / r0_SAMPLES + r0_TINY * 3, -r14_f2(r14_t + r0_TINY * 3)); - r14_lnnext3 = r14_curve['offset']((r14_sample + 1) / r0_SAMPLES - r0_TINY * 3, r14_f1(r14_tn - r0_TINY * 3)); - r14_rnnext3 = r14_curve['offset']((r14_sample + 1) / r0_SAMPLES - r0_TINY * 3, -r14_f2(r14_tn - r0_TINY * 3)); - r14_dlthis = r0_dforward(r14_lthis, r14_lnthis1, r14_lnthis2, r14_lnthis3); - r14_drthis = r0_dforward(r14_rthis, r14_rnthis1, r14_rnthis2, r14_rnthis3); - r14_dlnext = r0_dbackward(r14_lnext, r14_lnnext1, r14_lnnext2, r14_lnnext3); - r14_drnext = r0_dbackward(r14_rnext, r14_rnnext2, r14_rnnext2, r14_rnnext3); - r14_il = r0_intersection(r14_lthis['x'], r14_lthis['y'], r14_dlthis['x'], r14_dlthis['y'], r14_lnext['x'], r14_lnext['y'], r14_dlnext['x'], r14_dlnext['y']); - r14_ir = r0_intersection(r14_rthis['x'], r14_rthis['y'], r14_drthis['x'], r14_drthis['y'], r14_rnext['x'], r14_rnext['y'], r14_drnext['x'], r14_drnext['y']); - if (r14_il['x'] !== null && r14_il['y'] !== null && r0_nonlinear(r14_lthis, r14_il, r14_lnext)) { - r14_left['push']({ - 'x': r14_lthis['x'], - 'y': r14_lthis['y'], + if (_r17_t2['points'][0]['pdx'] !== void 0) + _r17_t49 = r17_pdxs[0] = _r17_t2['points'][0]['pdx'] - r17_subSegments[0]['normal'](0)['x']; + else + _r17_t49 = void 0; + if (_r17_t2['points'][0]['pdy'] !== void 0) + _r17_t50 = r17_pdys[0] = _r17_t2['points'][0]['pdy'] - r17_subSegments[0]['normal'](0)['y']; + else + _r17_t50 = void 0; + r17_f1 = r0_smooth(r0_xn$rangearray$1aao(0, r17_d1s['length']), r17_d1s); + r17_f2 = r0_smooth(r0_xn$rangearray$1aao(0, r17_d2s['length']), r17_d2s['map'](function _r17_t51(r18_x) { + var r18_x; + return -r18_x; + })); + r17_fpdx = r0_smooth(r0_xn$rangearray$1aao(0, r17_d1s['length']), r17_pdxs); + r17_fpdy = r0_smooth(r0_xn$rangearray$1aao(0, r17_d2s['length']), r17_pdys); + r17_left = []; + r17_right = []; + r17_j = 0; + for (; r17_j < r17_subSegments['length']; r17_j = r17_j + 1) { + r17_curve = r17_subSegments[r17_j]; + _r17_t0 = 0; + _r17_t1 = r0_SAMPLES; + r17_sample = _r17_t0; + for (; r17_sample < _r17_t1; r17_sample = r17_sample + 1) { + r17_t = r17_j + r17_sample / r0_SAMPLES; + r17_tn = r17_j + (r17_sample + 1) / r0_SAMPLES; + r17_lthis = r0_computeOffsetPoint(r17_curve, r17_t, r17_j, r17_f1, r17_fpdx, r17_fpdy); + r17_rthis = r0_computeOffsetPoint(r17_curve, r17_t, r17_j, r17_f2, r17_fpdx, r17_fpdy); + r17_lnext = r0_computeOffsetPoint(r17_curve, r17_tn, r17_j, r17_f1, r17_fpdx, r17_fpdy); + r17_rnext = r0_computeOffsetPoint(r17_curve, r17_tn, r17_j, r17_f2, r17_fpdx, r17_fpdy); + r17_lnthis1 = r0_computeOffsetPoint(r17_curve, r17_t + r0_TINY, r17_j, r17_f1, r17_fpdx, r17_fpdy); + r17_rnthis1 = r0_computeOffsetPoint(r17_curve, r17_t + r0_TINY, r17_j, r17_f2, r17_fpdx, r17_fpdy); + r17_lnnext1 = r0_computeOffsetPoint(r17_curve, r17_tn - r0_TINY, r17_j, r17_f1, r17_fpdx, r17_fpdy); + r17_rnnext1 = r0_computeOffsetPoint(r17_curve, r17_tn - r0_TINY, r17_j, r17_f2, r17_fpdx, r17_fpdy); + r17_lnthis2 = r0_computeOffsetPoint(r17_curve, r17_t + 2 * r0_TINY, r17_j, r17_f1, r17_fpdx, r17_fpdy); + r17_rnthis2 = r0_computeOffsetPoint(r17_curve, r17_t + 2 * r0_TINY, r17_j, r17_f2, r17_fpdx, r17_fpdy); + r17_lnnext2 = r0_computeOffsetPoint(r17_curve, r17_tn - 2 * r0_TINY, r17_j, r17_f1, r17_fpdx, r17_fpdy); + r17_rnnext2 = r0_computeOffsetPoint(r17_curve, r17_tn - 2 * r0_TINY, r17_j, r17_f2, r17_fpdx, r17_fpdy); + r17_lnthis3 = r0_computeOffsetPoint(r17_curve, r17_t + 3 * r0_TINY, r17_j, r17_f1, r17_fpdx, r17_fpdy); + r17_rnthis3 = r0_computeOffsetPoint(r17_curve, r17_t + 3 * r0_TINY, r17_j, r17_f2, r17_fpdx, r17_fpdy); + r17_lnnext3 = r0_computeOffsetPoint(r17_curve, r17_tn - 3 * r0_TINY, r17_j, r17_f1, r17_fpdx, r17_fpdy); + r17_rnnext3 = r0_computeOffsetPoint(r17_curve, r17_tn - 3 * r0_TINY, r17_j, r17_f2, r17_fpdx, r17_fpdy); + r17_dlthis = r0_dforward(r17_lthis, r17_lnthis1, r17_lnthis2, r17_lnthis3); + r17_drthis = r0_dforward(r17_rthis, r17_rnthis1, r17_rnthis2, r17_rnthis3); + r17_dlnext = r0_dbackward(r17_lnext, r17_lnnext1, r17_lnnext2, r17_lnnext3); + r17_drnext = r0_dbackward(r17_rnext, r17_rnnext2, r17_rnnext2, r17_rnnext3); + r17_il = r0_intersection(r17_lthis['x'], r17_lthis['y'], r17_dlthis['x'], r17_dlthis['y'], r17_lnext['x'], r17_lnext['y'], r17_dlnext['x'], r17_dlnext['y']); + r17_ir = r0_intersection(r17_rthis['x'], r17_rthis['y'], r17_drthis['x'], r17_drthis['y'], r17_rnext['x'], r17_rnext['y'], r17_drnext['x'], r17_drnext['y']); + if (r17_il['x'] !== null && r17_il['y'] !== null && r0_nonlinear(r17_lthis, r17_il, r17_lnext)) { + r17_left['push']({ + 'x': r17_lthis['x'], + 'y': r17_lthis['y'], 'onCurve': true }, { - 'x': r14_il['x'], - 'y': r14_il['y'], + 'x': r17_il['x'], + 'y': r17_il['y'], 'onCurve': false }); } else { - r14_left['push']({ - 'x': r14_lthis['x'], - 'y': r14_lthis['y'], + r17_left['push']({ + 'x': r17_lthis['x'], + 'y': r17_lthis['y'], 'onCurve': true }); } - if (r14_ir['x'] !== null && r14_ir['y'] !== null && r0_nonlinear(r14_rthis, r14_ir, r14_rnext)) { - r14_right['push']({ - 'x': r14_rthis['x'], - 'y': r14_rthis['y'], + if (r17_ir['x'] !== null && r17_ir['y'] !== null && r0_nonlinear(r17_rthis, r17_ir, r17_rnext)) { + r17_right['push']({ + 'x': r17_rthis['x'], + 'y': r17_rthis['y'], 'onCurve': true }, { - 'x': r14_ir['x'], - 'y': r14_ir['y'], + 'x': r17_ir['x'], + 'y': r17_ir['y'], 'onCurve': false }); } else { - r14_right['push']({ - 'x': r14_rthis['x'], - 'y': r14_rthis['y'], + r17_right['push']({ + 'x': r17_rthis['x'], + 'y': r17_rthis['y'], 'onCurve': true }); } } - _r14_t32 = r14_left; - _r14_t33 = _r14_t32['push']; - r14_last = r14_curve['offset'](1, r14_f1(r14_j + 1)); - _r14_t34 = { - 'x': r14_last['x'], - 'y': r14_last['y'], + _r17_t52 = r17_left; + _r17_t53 = _r17_t52['push']; + r17_last = r0_computeOffsetPoint(r17_curve, r17_j + 1, r17_j, r17_f1, r17_fpdx, r17_fpdy); + _r17_t54 = { + 'x': r17_last['x'], + 'y': r17_last['y'], 'onCurve': true }; - _r14_t33['call'](_r14_t32, _r14_t34); - _r14_t35 = r14_right; - _r14_t36 = _r14_t35['push']; - r14_last = r14_curve['offset'](1, -r14_f2(r14_j + 1)); - _r14_t37 = { - 'x': r14_last['x'], - 'y': r14_last['y'], + _r17_t53['call'](_r17_t52, _r17_t54); + _r17_t55 = r17_right; + _r17_t56 = _r17_t55['push']; + r17_last = r0_computeOffsetPoint(r17_curve, r17_j + 1, r17_j, r17_f2, r17_fpdx, r17_fpdy); + _r17_t57 = { + 'x': r17_last['x'], + 'y': r17_last['y'], 'onCurve': true }; - _r14_t36['call'](_r14_t35, _r14_t37); + _r17_t56['call'](_r17_t55, _r17_t57); } - r14_shape = r14_left['concat'](r14_right['reverse']())['map'](function _r14_t38(r16_p) { - var r16_p; + r17_shape = r17_left['concat'](r17_right['reverse']())['map'](function _r17_t58(r20_p) { + var r20_p; return { - 'x': r16_p['x'], - 'y': r16_p['y'], - 'onCurve': r16_p['onCurve'] + 'x': r20_p['x'], + 'y': r20_p['y'], + 'onCurve': r20_p['onCurve'] }; }); - return [r14_shape]; + r17_j = 0; + for (; r17_j < r17_shape['length'] - 1; r17_j = r17_j + 1) { + r17_p0 = r17_shape[r17_j]; + r17_still = true; + r17_k = r17_j + 1; + for (; r17_still && r17_k < r17_shape['length'] - 1; r17_k = r17_k + 1) { + r17_p1 = r17_shape[r17_k]; + r17_p2 = r17_shape[r17_k + 1]; + if (r17_p0['onCurve'] && r17_p1['onCurve'] && r17_p2['onCurve'] && !r0_nonlinear(r17_p0, r17_p1, r17_p2)) { + r17_p1['removable'] = true; + } else { + r17_still = false; + } + } + r17_j = r17_k - 1; + } + return [r17_shape['filter'](function _r17_t59(r21_x) { + var r21_x; + return r21_x && !r21_x['removable']; + })]; }; exports['Stroke'] = r0_Stroke; } diff --git a/support/stroke.patel b/support/stroke.patel index 1234a25..cf3be46 100644 --- a/support/stroke.patel +++ b/support/stroke.patel @@ -1,6 +1,8 @@ define smooth [require './monotonic-interpolate'].createInterpolant define intersection [require './intersection'].intersection define Bezier [require 'bezier-js'] +define tp [require './transform'].transformPoint +define utp [require './transform'].untransform define [range-array low high] : begin { local a () @@ -18,6 +20,18 @@ define COBKAPPA : COKAPPA - 0.1 define [Stroke] : begin { this.points = () + set this.gizmo ( + .xx 1 + .yx 0 + .xy 0 + .yy 1 + .x 0 + .y 0 + ) + return this +} +define [Stroke.prototype.set-transform t] : begin { + this.gizmo = t return this } define [Stroke.bindParameters para] : begin { @@ -32,29 +46,39 @@ define [Stroke.prototype.set-width d1 d2] : begin { point.d2 = d2 return this } +define [Stroke.prototype.pen-direction x y] : begin { + if [x.x !== nothing || x.y !== nothing] : begin { + set y x.y + set x x.x + } + local point this.points`[this.points.length - 1] + point.pdx = x + point.pdy = y + return this +} define [Stroke.prototype.start-from x y] : begin { - this.points = ((.x x .y y .onCurve true)) + this.points = ([tp this.gizmo (.x x .y y .onCurve true)]) return this } define [Stroke.prototype.line-to x y] : begin { - this.points.push (.x x .y y .onCurve true) + this.points.push [tp this.gizmo (.x x .y y .onCurve true)] return this } define [Stroke.prototype.curve-to xc yc x y] : begin { - this.points.push (.x xc .y yc .onCurve false) (.x x .y y .onCurve true) + this.points.push [tp this.gizmo (.x xc .y yc .onCurve false)] [tp this.gizmo (.x x .y y .onCurve true)] return this } define [Stroke.prototype.cubic-to x1 y1 x2 y2 x y] : begin { - this.points.push (.x x1 .y y1 .onCurve false .cubic true) (.x x2 .y y2 .onCurve false .cubic true) (.x x .y y .onCurve true) + this.points.push [tp this.gizmo (.x x1 .y y1 .onCurve false .cubic true)] [tp this.gizmo (.x x2 .y y2 .onCurve false .cubic true)] [tp this.gizmo (.x x .y y .onCurve true)] return this } define [Stroke.prototype.arc-vh-to x y] : begin { - local last this.points`[this.points.length - 1] + local last :utp this.gizmo this.points`[this.points.length - 1] this.cubic-to last.x [last.y + BKAPPA * [y - last.y]] [x + BKAPPA * [last.x - x]] y x y return this } define [Stroke.prototype.arc-hv-to x y] : begin { - local last this.points`[this.points.length - 1] + local last :utp this.gizmo this.points`[this.points.length - 1] this.cubic-to [last.x + BKAPPA * [x - last.x]] last.y x [y + BKAPPA * [last.y - y]] x y return this } @@ -70,69 +94,90 @@ define [dbackward p0 p1 p2 p3] ( ) define [nonlinear a b c] : [Math.abs [[c.y - a.y] * [b.x - a.x] - [c.x - a.x] * [b.y - a.y]]] > TINY +define [computeOffsetPoint curve t j foffset fpdx fpdy] : begin { + local onpoint : curve.compute [t - j] + local normal : curve.normal [t - j] + return (.x onpoint.x + [foffset t] * [normal.x + [fpdx t]] .y onpoint.y + [foffset t] * [normal.y + [fpdy t]]) +} + define [Stroke.prototype.form-stroke d1 d2] : begin { local d1s ([set d1 [if [this.points.0.d1 >= 0] this.points.0.d1 d1]]) local d2s ([set d2 [if [this.points.0.d2 >= 0] this.points.0.d2 d2]]) + local pdxs (0) + local pdys (0) + local subSegments () + local p0 this.points.0 for [local j 1] [j < this.points.length] [inc j] : begin { local p1 this.points`j piecewise { p1.onCurve : begin { - subSegments.push (p0 (.x [[p0.x + p1.x] / 2] .y [[p0.y + p1.y] / 2]) p1) + subSegments.push : local seg : new Bezier p0.x p0.y [[p0.x + p1.x] / 2] [[p0.y + p1.y] / 2] p1.x p1.y d1s.push : set d1 [if [p1.d1 >= 0] p1.d1 d1] d2s.push : set d2 [if [p1.d2 >= 0] p1.d2 d2] + local normalpt : seg.normal 0 + pdxs.push : if [p1.pdx !== nothing] [p1.pdx - normalpt.x] 0 + pdys.push : if [p1.pdy !== nothing] [p1.pdy - normalpt.y] 0 p0 = p1 } p1.cubic : begin { local p2 this.points`[j + 1] local p3 this.points`[j + 2] + subSegments.push : local seg : new Bezier p0.x p0.y p1.x p1.y p2.x p2.y p3.x p3.y d1s.push : set d1 [if [p3.d1 >= 0] p3.d1 d1] d2s.push : set d2 [if [p3.d2 >= 0] p3.d2 d2] - subSegments.push (p0 p1 p2 p3) + local normalpt : seg.normal 0 + pdxs.push : if [p3.pdx !== nothing] [p3.pdx - normalpt.x] 0 + pdys.push : if [p3.pdy !== nothing] [p3.pdy - normalpt.y] 0 p0 = p3 j = j + 2 } true : begin { local p2 this.points`[j + 1] + subSegments.push : local seg : new Bezier p0.x p0.y p1.x p1.y p2.x p2.y d1s.push : set d1 [if [p2.d1 >= 0] p2.d1 d1] d2s.push : set d2 [if [p2.d2 >= 0] p2.d2 d2] - subSegments.push (p0 p1 p2) + local normalpt : seg.normal 0 + pdxs.push : if [p2.pdx !== nothing] [p2.pdx - normalpt.x] 0 + pdys.push : if [p2.pdy !== nothing] [p2.pdy - normalpt.y] 0 p0 = p2 j = j + 1 } } } + if [this.points.0.pdx !== nothing] : set pdxs.0 [this.points.0.pdx - [subSegments.0.normal 0].x] + if [this.points.0.pdy !== nothing] : set pdys.0 [this.points.0.pdy - [subSegments.0.normal 0].y] + local f1 : smooth [range-array 0 d1s.length] d1s - local f2 : smooth [range-array 0 d2s.length] d2s + local f2 : smooth [range-array 0 d2s.length] [d2s.map [[x] -> [-x]]] + local fpdx : smooth [range-array 0 d1s.length] pdxs + local fpdy : smooth [range-array 0 d2s.length] pdys local left () local right () for [local j 0] [j < subSegments.length] [inc j] : begin { - local seg subSegments`j - local curve : if [seg.length > 3] [new Bezier seg.0.x seg.0.y seg.1.x seg.1.y seg.2.x seg.2.y seg.3.x seg.3.y] [new Bezier seg.0.x seg.0.y seg.1.x seg.1.y seg.2.x seg.2.y] + local curve subSegments`j foreach sample [range 0 SAMPLES] : begin { local t : j + sample / SAMPLES local tn : j + [sample + 1] / SAMPLES - local lthis : curve.offset [sample / SAMPLES] [f1 t] - local rthis : curve.offset [sample / SAMPLES] [-[f2 t]] - - local lnext : curve.offset [[sample + 1] / SAMPLES] [f1 tn] - local rnext : curve.offset [[sample + 1] / SAMPLES] [-[f2 tn]] - - local lnthis1 : curve.offset [sample / SAMPLES + TINY] [f1 [t + TINY]] - local rnthis1 : curve.offset [sample / SAMPLES + TINY] [-[f2 [t + TINY]]] - local lnnext1 : curve.offset [[sample + 1] / SAMPLES - TINY] [f1 [tn - TINY]] - local rnnext1 : curve.offset [[sample + 1] / SAMPLES - TINY] [-[f2 [tn - TINY]]] - local lnthis2 : curve.offset [sample / SAMPLES + [TINY * 2]] [f1 [t + [TINY * 2]]] - local rnthis2 : curve.offset [sample / SAMPLES + [TINY * 2]] [-[f2 [t + [TINY * 2]]]] - local lnnext2 : curve.offset [[sample + 1] / SAMPLES - [TINY * 2]] [f1 [tn - [TINY * 2]]] - local rnnext2 : curve.offset [[sample + 1] / SAMPLES - [TINY * 2]] [-[f2 [tn - [TINY * 2]]]] - local lnthis3 : curve.offset [sample / SAMPLES + [TINY * 3]] [f1 [t + [TINY * 3]]] - local rnthis3 : curve.offset [sample / SAMPLES + [TINY * 3]] [-[f2 [t + [TINY * 3]]]] - local lnnext3 : curve.offset [[sample + 1] / SAMPLES - [TINY * 3]] [f1 [tn - [TINY * 3]]] - local rnnext3 : curve.offset [[sample + 1] / SAMPLES - [TINY * 3]] [-[f2 [tn - [TINY * 3]]]] - + local lthis : computeOffsetPoint curve t j f1 fpdx fpdy + local rthis : computeOffsetPoint curve t j f2 fpdx fpdy + local lnext : computeOffsetPoint curve tn j f1 fpdx fpdy + local rnext : computeOffsetPoint curve tn j f2 fpdx fpdy + local lnthis1 : computeOffsetPoint curve [t + TINY] j f1 fpdx fpdy + local rnthis1 : computeOffsetPoint curve [t + TINY] j f2 fpdx fpdy + local lnnext1 : computeOffsetPoint curve [tn - TINY] j f1 fpdx fpdy + local rnnext1 : computeOffsetPoint curve [tn - TINY] j f2 fpdx fpdy + local lnthis2 : computeOffsetPoint curve [t + 2 * TINY] j f1 fpdx fpdy + local rnthis2 : computeOffsetPoint curve [t + 2 * TINY] j f2 fpdx fpdy + local lnnext2 : computeOffsetPoint curve [tn - 2 * TINY] j f1 fpdx fpdy + local rnnext2 : computeOffsetPoint curve [tn - 2 * TINY] j f2 fpdx fpdy + local lnthis3 : computeOffsetPoint curve [t + 3 * TINY] j f1 fpdx fpdy + local rnthis3 : computeOffsetPoint curve [t + 3 * TINY] j f2 fpdx fpdy + local lnnext3 : computeOffsetPoint curve [tn - 3 * TINY] j f1 fpdx fpdy + local rnnext3 : computeOffsetPoint curve [tn - 3 * TINY] j f2 fpdx fpdy + local dlthis [dforward lthis lnthis1 lnthis2 lnthis3] local drthis [dforward rthis rnthis1 rnthis2 rnthis3] local dlnext [dbackward lnext lnnext1 lnnext2 lnnext3] @@ -153,12 +198,27 @@ define [Stroke.prototype.form-stroke d1 d2] : begin { right.push (.x rthis.x .y rthis.y .onCurve true) }] } - left.push [begin [local last [curve.offset 1 [f1 [j + 1]]]] (.x last.x .y last.y .onCurve true)] - right.push [begin [local last [curve.offset 1 [-[f2 [j + 1]]]]] (.x last.x .y last.y .onCurve true)] + left.push [begin [local last [computeOffsetPoint curve [j + 1] j f1 fpdx fpdy]] (.x last.x .y last.y .onCurve true)] + right.push [begin [local last [computeOffsetPoint curve [j + 1] j f2 fpdx fpdy]] (.x last.x .y last.y .onCurve true)] } local shape : left.concat [right.reverse] :.map [[p] -> (.x p.x .y p.y .onCurve p.onCurve)] - return (shape) + # reduce linear oncurve points + for [local j 0] [j < shape.length - 1] [inc j] : begin { + local p0 shape`j + set still true + for [local k [j + 1]] [still && k < shape.length - 1] [inc k] : begin { + local p1 shape`k + local p2 shape`[k + 1] + if [p0.onCurve && p1.onCurve && p2.onCurve && [not [nonlinear p0 p1 p2]]] [then { + set p1.removable true + }] [else { + set still false + }] + } + set j [k - 1] + } + return ([shape.filter [[x] -> [x && [not x.removable]]]]) } exports.Stroke = Stroke \ No newline at end of file diff --git a/support/transform.js b/support/transform.js new file mode 100644 index 0000000..7befee9 --- /dev/null +++ b/support/transform.js @@ -0,0 +1,19 @@ +exports.transformPoint = function(tfm, pt){ + return { + 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 + } +} +exports.untransform = function(tfm, pt){ + var xx = pt.x - tfm.x + var yy = pt.y - tfm.y + var denom = tfm.xx * tfm.yy - tfm.xy * tfm.yx + return { + x : (xx * tfm.yy - yy * tfm.yx) / denom, + y : (yy * tfm.xx - xx * tfm.xy) / denom, + onCurve: pt.onCurve, + cubic: pt.cubic + } +} \ No newline at end of file