diff --git a/buildglyphs.ptl b/buildglyphs.ptl index 6e79d92..4af4c1b 100644 --- a/buildglyphs.ptl +++ b/buildglyphs.ptl @@ -33,10 +33,10 @@ define [$NamedParameterPair$ l r] : begin set this.right r return this -define-macro "--" : syntax-rules +define-operator "--" 890 'right' : syntax-rules `(@l -- @r) [atom l] `[new $NamedParameterPair$ @{".quote" [formOf l]} @r] -define-macro "<>" : begin +define-operator "<>" 800 "never" : begin local tClass [definingEnv.newt 'class'] local m : syntax-rules `(@x <> @y) `[new @tClass @x @y] diff --git a/glyphs/autobuilds.ptl b/glyphs/autobuilds.ptl index 5e6cc25..09460d6 100644 --- a/glyphs/autobuilds.ptl +++ b/glyphs/autobuilds.ptl @@ -241,7 +241,7 @@ define [suggestName name] : begin # Build miniature clyphs : circled, superscripts, subscripts... define [createCircledGlyphs records] : if [not recursive] : begin local dscale 0.55 - local pendingGlyphs : records.map : [record] -> record.1 + local pendingGlyphs : records.map : [record] => record.1 local miniatureFont : Miniature pendingGlyphs [fallback para.smallCrowd 3.75] 0.65 nothing true foreach {unicode glyphid w} [items-of records] : create-glyph [suggestName : 'circle' + glyphid] : glyph-construction @@ -273,7 +273,7 @@ define [createCircledGlyphs records] : if [not recursive] : begin apply-transform : Italify define [createSuperscripts records] : if [not recursive] : begin - local pendingGlyphs : records.map : [record] -> record.1 + local pendingGlyphs : records.map : [record] => record.1 local miniatureFont : Miniature pendingGlyphs [fallback para.smallCrowd 3.5] 0.7 nothing true foreach {unicode glyphid} [items-of records] : create-glyph [suggestName : 'sup' + glyphid] : glyph-construction if unicode : assign-unicode unicode @@ -286,7 +286,7 @@ define [createSuperscripts records] : if [not recursive] : begin refair this define [createSubscripts records] : if [not recursive] : begin - local pendingGlyphs : records.map : [record] -> record.1 + local pendingGlyphs : records.map : [record] => record.1 local miniatureFont : Miniature pendingGlyphs [fallback para.smallCrowd 3.5] 0.7 nothing true foreach {unicode glyphid} [items-of records] : create-glyph [suggestName : 'sub' + glyphid] : glyph-construction if unicode : assign-unicode unicode @@ -299,7 +299,7 @@ define [createSubscripts records] : if [not recursive] : begin refair this define [createSMCPs records] : if [not recursive] : begin - local pendingGlyphs : records.map : [record] -> record.1 + local pendingGlyphs : records.map : [record] => record.1 local params : Object.create para set params.cap0 para.cap set params.cap XH @@ -311,7 +311,7 @@ define [createSMCPs records] : if [not recursive] : begin if tfm : include tfm define [createMedievalCombs records] : if [not recursive] : begin - local pendingGlyphs : records.map : [record] -> record.1 + local pendingGlyphs : records.map : [record] => record.1 local miniatureFont : Miniature pendingGlyphs [fallback para.smallCrowd2 3.5] 0.7 nothing true foreach {unicode glyphid} [items-of records] : create-glyph [suggestName : 'comb' + glyphid] : glyph-construction set-width 0 @@ -326,7 +326,7 @@ define [createMedievalCombs records] : if [not recursive] : begin set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop define [createFractions records] : if [not recursive] : begin - local pendingGlyphs : [records.map : [record] -> record.1].concat : records.map : [record] -> record.2 + local pendingGlyphs : [records.map : [record] => record.1].concat : records.map : [record] => record.2 local miniatureFont : Miniature pendingGlyphs 4 0.6 nothing true foreach {unicode numid denid height} [items-of records] : create-glyph [suggestName : numid + 'over' + denid] : glyph-construction if unicode : assign-unicode unicode @@ -641,7 +641,7 @@ progress 'Medival Combining Characters' symbol-block 'Unicode Ligatures' define shrink : clamp 0.75 0.9 : linreg 72 0.75 108 0.9 STROKE define [createLigatures records] : if [not recursive] : begin - local pendingGlyphs : [records.map : [record] -> record.1].concat : records.map : [record] -> record.2 + local pendingGlyphs : [records.map : [record] => record.1].concat : records.map : [record] => record.2 local df : Thinner pendingGlyphs shrink 1 foreach [{unicode c1 c2} : items-of records] : begin local glyphName "\(c1)_\(c2)" @@ -711,7 +711,7 @@ progress 'Double Superscripts' symbol-block 'CJK Double Width Characters' define [createDoubleWidth records] : if [not recursive] : begin local scale 1.25 - local pendingGlyphs : records.map : [record] -> record.1 + local pendingGlyphs : records.map : [record] => record.1 local widenFont : Widen pendingGlyphs scale (scale * 1.1) foreach {unicode glyphid} [items-of records] : create-glyph [suggestName : 'dw' + glyphid] : glyph-construction set-width UPM diff --git a/glyphs/common-shapes.ptl b/glyphs/common-shapes.ptl index bbabfd0..2b6705f 100644 --- a/glyphs/common-shapes.ptl +++ b/glyphs/common-shapes.ptl @@ -537,10 +537,10 @@ define [Fork gs params] : begin set sbh.(k) PENDING set found true - local shouldBuildList : Object.keys sbh :.filter ([x] -> [not [not x]]) + local shouldBuildList : Object.keys sbh :.filter ([x] => [not [not x]]) #console.log shouldBuildList - local shouldBuildUnicodes : shouldBuildList.map ([x] -> [if (glyphs.(x) && glyphs.(x).unicode) glyphs.(x).unicode.0 nothing]) - :.filter ([x] -> [not [not x]]) + local shouldBuildUnicodes : shouldBuildList.map ([x] => [if (glyphs.(x) && glyphs.(x).unicode) glyphs.(x).unicode.0 nothing]) + :.filter ([x] => [not [not x]]) local p : Object.create params try : begin diff --git a/glyphs/symbol-geometric.ptl b/glyphs/symbol-geometric.ptl index f400c8e..344add8 100644 --- a/glyphs/symbol-geometric.ptl +++ b/glyphs/symbol-geometric.ptl @@ -18,13 +18,13 @@ define {ArrowHead ArrowShape} : symbol-block 'Arrows' widths.rhs fine flat 0 0 [heading UPWARD] curl (size * 1) size - end [[] -> (this.contrast = 1)] + end [[] => (this.contrast = 1)] include : dispiro function [set this.gizmo [Transform.Id]] widths.lhs fine flat 0 0 [heading DOWNWARD] curl (size * 1) (-size) - end [[] -> (this.contrast = 1)] + end [[] => (this.contrast = 1)] apply-transform : Translate O 0 local {.x xo .y yo} : tp globalTransform {.x x1 .y y1} local {.x xt .y yt} : tp globalTransform {.x x2 .y y2} @@ -40,7 +40,7 @@ define {ArrowHead ArrowShape} : symbol-block 'Arrows' widths.center (halfstroke * 2) flat x1 y1 curl [mix x1 x2 p] [mix y1 y2 p] - end [[] -> (this.contrast = 1)] + end [[] => (this.contrast = 1)] define [arrow id unicode x1 y1 x2 y2] : sketch set-width FULLWIDTH @@ -257,17 +257,17 @@ symbol-block 'Block Shapes' sketch # lightshade set-width FULLWIDTH - include : Shade ([j k] -> ((k % 2) && (j + (k - 1) / 2) % 2)) + include : Shade ([j k] => ((k % 2) && (j + (k - 1) / 2) % 2)) save 'lightshade' 0x2591 sketch # mediumshade set-width FULLWIDTH - include : Shade ([j k] -> ((j + k) % 2)) + include : Shade ([j k] => ((j + k) % 2)) save 'mediumshade' 0x2592 sketch # heavyshade set-width FULLWIDTH - include : Shade ([j k] -> ((k % 2) || (j + k / 2) % 2)) + include : Shade ([j k] => ((k % 2) || (j + k / 2) % 2)) save 'heavyshade' 0x2593 let : foreach fill [range 1 8] : begin create-glyph ('vfill' + fill) : glyph-construction diff --git a/package.json b/package.json index 25d0d80..bf7405c 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.7", "main": "./generate.js", "dependencies": { - "patel": ">=0.25.3", + "patel": ">=0.26.0", "node-sfnt": ">=0.0.20", "bezier-js": "*", "yargs": "*",