diff --git a/glyphs/common-shapes.patel b/glyphs/common-shapes.patel index e9f5eec..48e7f4b 100644 --- a/glyphs/common-shapes.patel +++ b/glyphs/common-shapes.patel @@ -1,15 +1,22 @@ ###### COMMON SHAPES -define [Ring u d l r] : begin { +define [Ring u d l r transformShiftOnly] : begin { local my [[u + d] / 2] local mx [[l + r] / 2] local s : new Stroke - :.set-transform globalTransform - :.start-from mx d + if [not transformShiftOnly] : s.set-transform globalTransform + s.start-from mx d :.cubic-to [mx + [l - mx] * CKAPPA] d l [my + [d - my] * CKAPPA] l my :.cubic-to l [my + [u - my] * CKAPPA] [mx + [l - mx] * CKAPPA] u mx u :.cubic-to [mx + [r - mx] * CKAPPA] u r [my + [u - my] * CKAPPA] r my :.cubic-to r [my + [d - my] * CKAPPA] [mx + [r - mx] * CKAPPA] d mx d + if transformShiftOnly : begin { + local (.x mx1 .y my1) [tp globalTransform (.x mx .y my)] + foreach p [items-of s.points] : begin { + set p.x : p.x + mx1 - mx + set p.y : p.y + my1 - my + } + } return s.points } define [RingAt x y r] : Ring [y + r] [y - r] [x - r] [x + r] diff --git a/glyphs/latin-basic-lower.patel b/glyphs/latin-basic-lower.patel index c08409a..da931ab 100644 --- a/glyphs/latin-basic-lower.patel +++ b/glyphs/latin-basic-lower.patel @@ -123,11 +123,7 @@ create-glyph 'g' : glyph-construction { assign-unicode 'g' include pMarks - include : list { - Ring XO [XH * GBARPOS] SB [RIGHTSB - 0.3 * SB] SMALLSMOOTH - Ring [XO - STROKE] [[XH * GBARPOS] + STROKE] [SB + STROKE] [[RIGHTSB - 0.3 * SB] - STROKE] [SMALLSMOOTH - STROKE] - } - reverse-last + include : smallo XH [XH * GBARPOS - O] SB [RIGHTSB - 0.3 * SB] local gleftx [SB * 0.8 + O] local grightx [RIGHTSB + SB * 0.1 - O] diff --git a/glyphs/symbol-geometric.patel b/glyphs/symbol-geometric.patel index 17e3d25..81bb3a3 100644 --- a/glyphs/symbol-geometric.patel +++ b/glyphs/symbol-geometric.patel @@ -1,5 +1,87 @@ ###### GEOMETRIC SHAPES +### Standard geometric shapes +define squareRadius : [RIGHTSB - SB] / 2 +define [hollowScale w] : [w - [adviceBlackness 5]] / w +define [hollow newid unicode oldid zx zy] : create-glyph newid : glyph-construction { + assign-unicode unicode + include glyphs.(oldid) + reverse-last + local zoom : hollowScale squareRadius + include : FlipAround MIDDLE parenMid [fallback zx zoom] [fallback zy zx zoom] + include glyphs.(oldid) +} +create-glyph 'blacksquare' : glyph-construction { + assign-unicode 0x25A0 + start-from SB [parenMid + squareRadius] + line-to RIGHTSB [parenMid + squareRadius] + line-to RIGHTSB [parenMid - squareRadius] + line-to SB [parenMid - squareRadius] +} +create-glyph 'blackrectangle' : glyph-construction { + assign-unicode 0x25AC + start-from SB [parenMid + squareRadius / 1.5] + line-to RIGHTSB [parenMid + squareRadius / 1.5] + line-to RIGHTSB [parenMid - squareRadius / 1.5] + line-to SB [parenMid - squareRadius / 1.5] +} +create-glyph 'blacklongrectangle' : glyph-construction { + assign-unicode 0x25AE + start-from SB [parenMid + squareRadius * 1.5] + line-to RIGHTSB [parenMid + squareRadius * 1.5] + line-to RIGHTSB [parenMid - squareRadius * 1.5] + line-to SB [parenMid - squareRadius * 1.5] +} +create-glyph 'blacktriangleup' : glyph-construction { + assign-unicode 0x25B2 + start-from MIDDLE [parenMid + squareRadius] + line-to RIGHTSB [parenMid - squareRadius] + line-to SB [parenMid - squareRadius] +} +create-glyph 'blackdiamond' : glyph-construction { + assign-unicode 0x25C6 + start-from MIDDLE [parenMid + squareRadius] + line-to RIGHTSB parenMid + line-to MIDDLE [parenMid - squareRadius] + line-to SB parenMid +} +create-glyph 'blacktriangledown' : glyph-construction { + assign-unicode 0x25BC + start-from MIDDLE [parenMid - squareRadius] + line-to SB [parenMid + squareRadius] + line-to RIGHTSB [parenMid + squareRadius] +} +create-glyph 'blackcircle' : glyph-construction { + assign-unicode 0x25CF + include : list : Ring [parenMid + squareRadius] [parenMid - squareRadius] SB RIGHTSB +} +create-glyph 'dottedcircle' : glyph-construction { + assign-unicode 0x25CC + local n 12 + local fine : [adviceBlackness 5] / 2 + foreach j [range 0 n] : begin { + local angle : Math.PI * 2 * j / n + local cx : MIDDLE + [RIGHTSB - MIDDLE] * [Math.cos angle] + local cy : [XH / 2] + [RIGHTSB - MIDDLE] * [Math.sin angle] + include : list : Ring [cy + fine] [cy - fine] [cx - fine] [cx + fine] true + } + apply-transform : Upright + apply-transform : Translate 0 [parenMid - [XH / 2]] + apply-transform : Italify + include eMarks + foreach k [items-of : Object.keys this.anchors] : begin { + set this.anchors.(k).x : this.anchors.(k).x + [parenMid - [XH / 2]] * globalTransform.yx + set this.anchors.(k).y : this.anchors.(k).y + [parenMid - [XH / 2]] + } +} + +hollow 'whitesquare' 0x25A1 'blacksquare' +hollow 'whiterectangle' 0x25AD 'blackrectangle' [hollowScale squareRadius] [hollowScale [squareRadius / 1.5]] +hollow 'whitelongrectangle' 0x25AF 'blacklongrectangle' [hollowScale squareRadius] [hollowScale [squareRadius * 1.5]] +hollow 'whitecircle' 0x25CB 'blackcircle' +hollow 'whitebullet' 0x25E6 'bullet' [hollowScale [PERIODSIZE - O]] +hollow 'whitediamond' 0x25C7 'blackdiamond' + ### Blocks create-glyph 'fullblock' : glyph-construction { assign-unicode 0x2588 diff --git a/parameters.patel b/parameters.patel index 4268a3c..562418f 100644 --- a/parameters.patel +++ b/parameters.patel @@ -40,7 +40,7 @@ define regular ( .family 'Iosevka' .style 'Regular' .weight 400 - .version 'r0.0.14' + .version 'r0.0.15' .variantSelector (.) .copyright 'Copyright (c) 2015 Belleve Invis.' ) diff --git a/testdrive/index.html b/testdrive/index.html index a28db75..3c63824 100644 --- a/testdrive/index.html +++ b/testdrive/index.html @@ -3,6 +3,9 @@ Iosevka