11$$include '../../meta/macros.ptl'
22
33import [mix linreg clamp fallback] from "@iosevka/util"
4+ import [Transform] from "@iosevka/geometry/transform"
45import [Box] from "@iosevka/geometry/box"
56
67glyph-module
78
89glyph-block Symbol-Mosaic-Split-Graphic : begin
910 glyph-block-import CommonShapes
1011 glyph-block-import Common-Derivatives
11- glyph-block-import Symbol-Pictograph-Stick-Figure : StickFigureKit PointingHandShape
12+ glyph-block-import Symbol-Pictograph-Stick-Figure : StickFigureKit
1213 glyph-block-import Symbol-Pictograph-Keyboard : KeyGen
1314
1415 define boxDrawingStroke : AdviceStroke 3.5
@@ -33,18 +34,24 @@ glyph-block Symbol-Mosaic-Split-Graphic : begin
3334
3435 return : new Box t2 b l r2
3536
36- export : define [Split t b l r vspan hspan vidx hidx fUpright shapeFunc] : begin
37+ export : define [Split t b l r vspan hspan shapeFunc mappings ] : glyph-proc
3738 local box : NBox t b l r vspan hspan
39+ local shape : shapeFunc box.top box.bottom box.left box.right
40+ local gizmo currentGlyph.gizmo
3841
39- return : intersection
42+ foreach { vidx hidx name code } [items-of mappings] : create-forked-glyph name code : glyph-proc
43+ set currentGlyph.gizmo gizmo
44+ include : intersection
45+ Mask
46+ composite-proc shape : Translate (-hidx * MosaicWidth) (-vidx * MosaicHeight)
47+
48+ export : define [Select t b l r vspan hspan shapeFunc vidx hidx] : glyph-proc
49+ local box : NBox t b l r vspan hspan
50+ local shape : shapeFunc box.top box.bottom box.left box.right
51+
52+ include : intersection
4053 Mask
41- with-transform
42- Translate (-hidx * MosaicWidth) (-vidx * MosaicHeight)
43- if fUpright
44- composite-proc
45- ForceUpright
46- shapeFunc box.top box.bottom box.left box.right
47- shapeFunc box.top box.bottom box.left box.right
54+ composite-proc shape : Translate (-hidx * MosaicWidth) (-vidx * MosaicHeight)
4855
4956 for-width-kinds WideWidth4
5057 define right MosaicWidth
@@ -64,28 +71,28 @@ glyph-block Symbol-Mosaic-Split-Graphic : begin
6471 archv.superness 2
6572 close
6673
67- define [BuildSplitCircle name unicode vspan hspan vidx hidx] : begin
68- create-glyph [MangleName name] [MangleUnicode unicode] : glyph-proc
69- set-width MosaicWidth
70- include : ForceUpright
71- include : multicell.Split top bottom left right vspan hspan vidx hidx 1 CircleTouchingBox
72-
73- BuildSplitCircle "twelfthCircleLT" 0x1CC30 4 4 3 0
74- BuildSplitCircle "twelfthCircleCLT" 0x1CC31 4 4 3 1
75- BuildSplitCircle "twelfthCircleCRT" 0x1CC32 4 4 3 2
76- BuildSplitCircle "twelfthCircleRT" 0x1CC33 4 4 3 3
77- BuildSplitCircle "twelfthCircleLMT" 0x1CC34 4 4 2 0
78- BuildSplitCircle "quarterCircleLT" 0x1CC35 2 2 1 0
79- BuildSplitCircle "quarterCircleRT" 0x1CC36 2 2 1 1
80- BuildSplitCircle "twelfthCircleRMT" 0x1CC37 4 4 2 3
81- BuildSplitCircle "twelfthCircleLMB" 0x1CC38 4 4 1 0
82- BuildSplitCircle "quarterCircleLB" 0x1CC39 2 2 0 0
83- BuildSplitCircle "quarterCircleRB" 0x1CC3A 2 2 0 1
84- BuildSplitCircle "twelfthCircleRMB" 0x1CC3B 4 4 1 3
85- BuildSplitCircle "twelfthCircleLB" 0x1CC3C 4 4 0 0
86- BuildSplitCircle "twelfthCircleCLB" 0x1CC3D 4 4 0 1
87- BuildSplitCircle "twelfthCircleCRB" 0x1CC3E 4 4 0 2
88- BuildSplitCircle "twelfthCircleRB" 0x1CC3F 4 4 0 3
74+ create-glyph : glyph-proc
75+ set-width MosaicWidth
76+ include : ForceUpright
77+ include : multicell.Split top bottom left right 2 2 CircleTouchingBox : list
78+ list 1 0 [MangleName 'quarterCircleLT'] [MangleUnicode 0x1CC35]
79+ list 1 1 [MangleName 'quarterCircleRT'] [MangleUnicode 0x1CC36]
80+ list 0 0 [MangleName 'quarterCircleLB'] [MangleUnicode 0x1CC39]
81+ list 0 1 [MangleName 'quarterCircleRB'] [MangleUnicode 0x1CC3A]
82+
83+ include : multicell.Split top bottom left right 4 4 CircleTouchingBox : list
84+ list 3 0 [MangleName 'twelfthCircleLT' ] [MangleUnicode 0x1CC30]
85+ list 3 1 [MangleName 'twelfthCircleCLT'] [MangleUnicode 0x1CC31]
86+ list 3 2 [MangleName 'twelfthCircleCRT'] [MangleUnicode 0x1CC32]
87+ list 3 3 [MangleName 'twelfthCircleRT' ] [MangleUnicode 0x1CC33]
88+ list 2 0 [MangleName 'twelfthCircleLMT'] [MangleUnicode 0x1CC34]
89+ list 2 3 [MangleName 'twelfthCircleRMT'] [MangleUnicode 0x1CC37]
90+ list 1 0 [MangleName 'twelfthCircleLMB'] [MangleUnicode 0x1CC38]
91+ list 1 3 [MangleName 'twelfthCircleRMB'] [MangleUnicode 0x1CC3B]
92+ list 0 0 [MangleName 'twelfthCircleLB' ] [MangleUnicode 0x1CC3C]
93+ list 0 1 [MangleName 'twelfthCircleCLB'] [MangleUnicode 0x1CC3D]
94+ list 0 2 [MangleName 'twelfthCircleCRB'] [MangleUnicode 0x1CC3E]
95+ list 0 3 [MangleName 'twelfthCircleRB' ] [MangleUnicode 0x1CC3F]
8996
9097 do "Television"
9198 define scaffold : object
@@ -141,22 +148,14 @@ glyph-block Symbol-Mosaic-Split-Graphic : begin
141148 include : DotAt dotX (top - graphicSw - scaffold.dotYOffset * 3) scaffold.dotSize
142149 include : Screen (top - scaffold.screenInset) (tvBot + scaffold.screenInset) (left + scaffold.screenInset) (dotX - scaffold.dotXOffset)
143150
144- create-glyph [MangleName 'televisionLT'] [MangleUnicode 0x1CCB2] : glyph-proc
151+ create-glyph : glyph-proc
145152 set-width MosaicWidth
146153 include : ForceUpright
147- include : multicell.Split top bottom left right 2 2 1 0 1 Television
148- create-glyph [MangleName 'televisionRT'] [MangleUnicode 0x1CCB3] : glyph-proc
149- set-width MosaicWidth
150- include : ForceUpright
151- include : multicell.Split top bottom left right 2 2 1 1 1 Television
152- create-glyph [MangleName 'televisionLB'] [MangleUnicode 0x1CCB4] : glyph-proc
153- set-width MosaicWidth
154- include : ForceUpright
155- include : multicell.Split top bottom left right 2 2 0 0 1 Television
156- create-glyph [MangleName 'televisionRB'] [MangleUnicode 0x1CCB5] : glyph-proc
157- set-width MosaicWidth
158- include : ForceUpright
159- include : multicell.Split top bottom left right 2 2 0 1 1 Television
154+ include : multicell.Split top bottom left right 2 2 Television : list
155+ list 1 0 [MangleName 'televisionLT'] [MangleUnicode 0x1CCB2]
156+ list 1 1 [MangleName 'televisionRT'] [MangleUnicode 0x1CCB3]
157+ list 0 0 [MangleName 'televisionLB'] [MangleUnicode 0x1CCB4]
158+ list 0 1 [MangleName 'televisionRB'] [MangleUnicode 0x1CCB5]
160159
161160 do "Microcomputer"
162161 define scaffold : object
@@ -187,7 +186,7 @@ glyph-block Symbol-Mosaic-Split-Graphic : begin
187186 # ** ** ** ** ** ** ****
188187 # *** ** ** ** ** ** ***
189188 # **** ** ** ** ** ******
190- # ****************
189+ # ****************
191190 include : KeyGen (kbdTop - graphicSw - scaffold.keyInset) (bot + graphicSw + scaffold.keyInset) keyLeft keyRight 28 4 graphicSw : list
192191 list 3 0 2
193192 list 3 4 6
@@ -211,21 +210,115 @@ glyph-block Symbol-Mosaic-Split-Graphic : begin
211210 list 1 22 28
212211 list 0 6 22
213212
214- create-glyph [MangleName 'microcomputerLT'] [MangleUnicode 0x1CCB6] : glyph-proc
215- set-width MosaicWidth
216- include : ForceUpright
217- include : multicell.Split top bottom left right 2 2 1 0 1 Microcomputer
218- create-glyph [MangleName 'microcomputerRT'] [MangleUnicode 0x1CCB7] : glyph-proc
219- set-width MosaicWidth
220- include : ForceUpright
221- include : multicell.Split top bottom left right 2 2 1 1 1 Microcomputer
222- create-glyph [MangleName 'microcomputerLB'] [MangleUnicode 0x1CCB8] : glyph-proc
213+ create-glyph : glyph-proc
223214 set-width MosaicWidth
224215 include : ForceUpright
225- include : multicell.Split top bottom left right 2 2 0 0 1 Microcomputer
226- create-glyph [MangleName 'microcomputerRB'] [MangleUnicode 0x1CCB9] : glyph-proc
227- set-width MosaicWidth
228- include : ForceUpright
229- include : multicell.Split top bottom left right 2 2 0 1 1 Microcomputer
216+ include : multicell.Split top bottom left right 2 2 Microcomputer : list
217+ list 1 0 [MangleName 'microcomputerLT'] [MangleUnicode 0x1CCB6]
218+ list 1 1 [MangleName 'microcomputerRT'] [MangleUnicode 0x1CCB7]
219+ list 0 0 [MangleName 'microcomputerLB'] [MangleUnicode 0x1CCB8]
220+ list 0 1 [MangleName 'microcomputerRB'] [MangleUnicode 0x1CCB9]
221+
222+ do "Knight"
223+ define [StandingKnight top bot left right] : glyph-proc
224+ local box : new Box top bot left right
225+
226+ local sw1 : graphicSw * MosaicWidthScalar
227+ local sw2 : graphicSw * 2 * [Math.sqrt MosaicWidthScalar]
228+ local kit1 : StickFigureKit box [Transform.Id] sw1
229+ local kit2 : StickFigureKit box [Translate (sw2 - sw1) 0] sw2
230+ local kit3 : StickFigureKit box [Translate (sw1 / 2) 0] sw1
230231
232+ # Flag
233+ local flagMidX : [box.mixX : 13 / 16] + (sw2 - sw1)
234+ include : union
235+ kit1.RoundSeg 1 0 1 1 0 0 (-1)
236+ intersection [MaskRight flagMidX]
237+ kit2.RoundSeg (16 / 16) 1 (13 / 16) (13 / 16) 0 0 1
238+ intersection [MaskLeft flagMidX]
239+ kit2.RoundSeg (13 / 16) (13 / 16) (10 / 16) 1 0 0 1
231240
241+ # Head
242+ local HelmetX1 : box.mixX (6 / 16)
243+ local HelmetMask : union
244+ kit1.Arc 0.75 0.5 (6 / 16) (14 / 16) 0.75 (10 / 16) 0 0 1 1
245+ MaskLeft HelmetX1
246+ include : union
247+ difference
248+ union
249+ kit1.RoundSeg ( 4 / 16) (25 / 32) ( 6 / 16) (14 / 16) 0 0 1
250+ kit1.Arc ( 6 / 16) (14 / 16) (10 / 16) (14 / 16) ( 8 / 16) (31 / 32) 0 0 1
251+ kit1.RoundSeg (10 / 16) (14 / 16) (12 / 16) (25 / 32) 0 0 1
252+ kit1.Arc (12 / 16) (25 / 32) (13 / 16) (11 / 16) (13 / 16) (47 / 64) 0 0 1
253+ kit1.ArcVH (13 / 16) (11 / 16) (11 / 16) ( 8 / 16) 0 0 1
254+ * HelmetMask
255+ intersection
256+ union
257+ kit1.Arc ( 2 / 16) (5 / 8) ( 6 / 16) (14 / 16) ( 2 / 16) (6 / 8) 0 0 1 1
258+ MaskRight HelmetX1
259+ kit1.Arc 0.75 0.5 (6 / 16) (14 / 16) 0.75 (10 / 16) 0 0 (-1)
260+ intersection
261+ * HelmetMask
262+ union
263+ kit1.RoundSeg 0.75 0.5 0.25 0.5 0 0 1
264+ kit1.ArcHV ( 4 / 16) 0.5 ( 2 / 16) (5 / 8) 0 0 1
265+ kit1.ArcHV ( 6 / 16) 0.5 ( 4 / 16) (5 / 8) 0 0 1
266+ kit1.ArcHV ( 8 / 16) 0.5 ( 6 / 16) (5 / 8) 0 0 1
267+ kit1.ArcHV (10 / 16) 0.5 ( 8 / 16) (5 / 8) 0 0 1
268+ kit1.ArcHV (12 / 16) 0.5 (10 / 16) (5 / 8) 0 0 1
269+ kit1.Arc ( 2 / 16) (5 / 8) ( 6 / 16) (14 / 16) ( 2 / 16) (6 / 8) 0 0 1
270+ kit1.Arc ( 4 / 16) (5 / 8) ( 8 / 16) (14 / 16) ( 4 / 16) (6 / 8) 0 0 1
271+ kit1.Arc ( 6 / 16) (5 / 8) (10 / 16) (14 / 16) ( 6 / 16) (6 / 8) 0 0 1
272+ kit1.Arc ( 8 / 16) (5 / 8) (12 / 16) (14 / 16) ( 8 / 16) (6 / 8) 0 0 1
273+ kit1.Arc (10 / 16) (5 / 8) (14 / 16) (14 / 16) (10 / 16) (6 / 8) 0 0 1
274+
275+ # Body
276+ include : union
277+ difference
278+ union
279+ kit1.ArcVH (12 / 16) ( 8 / 16) ( 7 / 16) ( 4 / 16) 0 0 1
280+ kit1.ArcHV ( 7 / 16) ( 4 / 16) ( 3 / 16) ( 6 / 16) 0 0 1
281+ kit1.Arc ( 3 / 16) ( 6 / 16) ( 4 / 16) ( 8 / 16) ( 3 / 16) ( 7 / 16) 0 0 1
282+ kit1.ArcHV ( 7 / 16) ( 6 / 16) ( 4 / 16) ( 8 / 16) 0 0 1 1
283+ intersection [MaskBelow : box.mixY 0.5]
284+ kit1.Arc (12 / 16) ( 8 / 16) ( 7 / 16) ( 6 / 16) ( 9 / 16) ( 6 / 16) 0 0 1
285+ kit1.ArcHV ( 7 / 16) ( 6 / 16) ( 4 / 16) ( 8 / 16) 0 0 1
286+
287+ # Limbs
288+ include : difference
289+ union
290+ # Left Arm
291+ kit1.RoundSeg 1 0.5 (5 / 8) 0.5 0 0 (-1)
292+ kit1.RoundSeg 1 0.5 (5 / 8) 0.5 0 0 (-3)
293+ kit1.RoundSeg 1 0.5 1 [Math.min (17 / 32) : 8 / 16 + 2 * sw1 / (top - bot)] 0 1 (-3)
294+ # Right Arm
295+ kit3.RoundSeg (0 / 16) (7 / 16) (4 / 16) ( 7 / 16) 1 0 1
296+ kit3.RoundSeg (0 / 16) (7 / 16) (4 / 16) ( 7 / 16) 1 0 3
297+ kit3.RoundSeg (1 / 32) (7 / 16) (1 / 32) [Math.min (15 / 32) : 7 / 16 + 2 * sw1 / (top - bot)] 0 1 1
298+ # Leg
299+ kit1.RoundSeg (8 / 16) 0 (8 / 16) (5 / 16) 0 0 1
300+ kit1.RoundSeg (7 / 16) 0 (7 / 16) (5 / 16) 0 0 (-1)
301+ union
302+ kit1.ArcVH (12 / 16) ( 8 / 16) ( 7 / 16) ( 4 / 16) 0 0 1 1
303+ kit1.ArcHV ( 7 / 16) ( 4 / 16) ( 3 / 16) ( 6 / 16) 0 0 1 1
304+ kit1.Arc ( 3 / 16) ( 6 / 16) ( 4 / 16) ( 8 / 16) ( 3 / 16) (7 / 16) 0 0 1 1
305+ kit1.Box ( 4 / 16) ( 6 / 16) ( 8 / 16) ( 8 / 16)
306+
307+ # Feet
308+ include : difference
309+ spiro-outline
310+ corner left bot
311+ g4 [box.mixX : 1 / 4] (bot + sw2)
312+ g4 [box.mixX : 2 / 4] (bot + 0.99 * sw2)
313+ g4 [box.mixX : 3 / 4] (bot + sw2)
314+ corner [box.mixX : 7 / 8] bot
315+ intersection [MaskRight : box.mixX : 7 / 16] [MaskLeft : box.mixX : 1 / 2]
316+
317+ create-glyph : glyph-proc
318+ set-width MosaicWidth
319+ include : ForceUpright
320+ include : multicell.Split top bottom left right 2 2 StandingKnight : list
321+ list 1 0 [MangleName 'standingknightLT'] [MangleUnicode 0x1CCD2]
322+ list 1 1 [MangleName 'standingknightRT'] [MangleUnicode 0x1CCD3]
323+ list 0 0 [MangleName 'standingknightLB'] [MangleUnicode 0x1CCD4]
324+ list 0 1 [MangleName 'standingknightRB'] [MangleUnicode 0x1CCD5]
0 commit comments