From 1ea7b98c35cfd62770ac17fe23023c4eb4bdfe03 Mon Sep 17 00:00:00 2001 From: Logo121 <21302803+Logo121@users.noreply.github.com> Date: Fri, 29 Mar 2024 21:39:20 +0800 Subject: [PATCH 01/11] dense fills are swapped --- changes/29.0.5.md | 1 + packages/font-glyphs/src/symbol/mosaic/block.ptl | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/changes/29.0.5.md b/changes/29.0.5.md index 3338cfa212..5f1010a505 100644 --- a/changes/29.0.5.md +++ b/changes/29.0.5.md @@ -1,4 +1,5 @@ * Fix side bearings of multi-dot punctuation (`U+10FB`, `U+2056`, `U+2058`..`205B`, `U+2E2A`..`U+2E2D`) under Quasi-Proportional. +* Fix mapping of DENSE VERTICAL FILL (`U+1CC44`) and DENSE HORIZONTAL FILL (`U+1CC45`). * Fix glyph visuals: - MATHEMATICAL RISING DIAGONAL (`U+27CB`). - MATHEMATICAL FALLING DIAGONAL (`U+27CD`). diff --git a/packages/font-glyphs/src/symbol/mosaic/block.ptl b/packages/font-glyphs/src/symbol/mosaic/block.ptl index 96ed0ba447..f9a8f598f4 100644 --- a/packages/font-glyphs/src/symbol/mosaic/block.ptl +++ b/packages/font-glyphs/src/symbol/mosaic/block.ptl @@ -248,11 +248,11 @@ glyph-block Symbol-Mosaic-Block : begin set-width MosaicWidth include : DiagShade 4 include : DiagShade (-4) - create-glyph [MangleName 'denseHoriShade'] [MangleUnicode 0x1CC44] : glyph-proc + create-glyph [MangleName 'denseVertShade'] [MangleUnicode 0x1CC44] : glyph-proc set-width MosaicWidth include : ForceUpright - include : HShade 8 top bottom left right - create-glyph [MangleName 'denseVertShade'] [MangleUnicode 0x1CC45] : glyph-proc + include : VShade (4 * MosaicWidthScalar) top bottom left right + create-glyph [MangleName 'denseHoriShade'] [MangleUnicode 0x1CC45] : glyph-proc set-width MosaicWidth include : ForceUpright - include : VShade (4 * MosaicWidthScalar) top bottom left right + include : HShade 8 top bottom left right From 6041f9e44e5c85e5ca9441904564df07164f5776 Mon Sep 17 00:00:00 2001 From: Logo121 <21302803+Logo121@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:06:06 +0800 Subject: [PATCH 02/11] energy wave --- .../src/symbol/pictograph/game-sprite.ptl | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl b/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl index 210f741efe..4efac0a445 100644 --- a/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl +++ b/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl @@ -152,6 +152,44 @@ glyph-block Symbol-Pictograph-Game-Sprite : for-width-kinds WideWidth4 set-width MosaicWidth include : StickManDressBody scaffold 0 0 + do "Energy Waves" + define [LeftEnergyWave top bottom left right] : glyph-proc + local midX : mix left right 0.5 + local midY : mix top bottom 0.5 + + include : difference + spiro-outline + corner right top + corner (midX + 0.01) top + flat midX top + archv.superness 2 + g4 left midY + arcvh.superness 2 + curl midX bottom + corner (midX + 0.01) bottom + corner right bottom + spiro-outline + corner right [mix top bottom 0.1] + flat [mix left right 0.9] [mix top bottom 0.1] + archv.superness 2 + g4 midX midY + arcvh.superness 2 + curl [mix left right 0.9] [mix top bottom 0.9] + corner right [mix top bottom 0.9] + + create-glyph [MangleName "energyWaveLeft"] [MangleUnicode 0x1CC78] : glyph-proc + set-width MosaicWidth + include : LeftEnergyWave Geom.Top Geom.Bot Geom.Left Geom.Right + create-glyph [MangleName "energyWaveUp"] [MangleUnicode 0x1CC79] : glyph-proc + set-width MosaicWidth + include : WithD4Transform midX 3 0 : lambda [] : LeftEnergyWave Geom.Top Geom.Bot Geom.Left Geom.Right + create-glyph [MangleName "energyWaveRight"] [MangleUnicode 0x1CC7A] : glyph-proc + set-width MosaicWidth + include : WithD4Transform midX 2 0 : lambda [] : LeftEnergyWave Geom.Top Geom.Bot Geom.Left Geom.Right + create-glyph [MangleName "energyWaveDown"] [MangleUnicode 0x1CC7B] : glyph-proc + set-width MosaicWidth + include : WithD4Transform midX 1 0 : lambda [] : LeftEnergyWave Geom.Top Geom.Bot Geom.Left Geom.Right + do "Square Spiral" define directions : list * {.dx 1 .dy 0 .heading Rightward} From 5b5de3579995caf948f9082e2ff83c663a4ad3eb Mon Sep 17 00:00:00 2001 From: Logo121 <21302803+Logo121@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:11:13 +0800 Subject: [PATCH 03/11] turning triangle into a function --- .../src/symbol/pictograph/game-sprite.ptl | 27 +++++-------------- packages/font-glyphs/src/symbol/shared.ptl | 27 +++++++++++++++++-- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl b/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl index 4efac0a445..666b078ee9 100644 --- a/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl +++ b/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl @@ -2,12 +2,14 @@ $$include '../../meta/macros.ptl' import [mix linreg clamp fallback] from "@iosevka/util" import [Box] from "@iosevka/geometry/box" +import [Transform] from "@iosevka/geometry/transform" glyph-module glyph-block Symbol-Pictograph-Game-Sprite : for-width-kinds WideWidth4 glyph-block-import CommonShapes glyph-block-import Common-Derivatives + glyph-block-import Shared-Symbol-Shapes : TriangleShape glyph-block-import Symbol-Pictograph-Stick-Figure : StickFigureKit WithD4Transform D4Transform glyph-block-import Symbol-Geometric-Shared : GeometricDim glyph-block-import Symbol-Mosaic-Block : HShade VShade @@ -26,6 +28,8 @@ glyph-block Symbol-Pictograph-Game-Sprite : for-width-kinds WideWidth4 define uiRight : right - SB define Geom : GeometricDim MosaicUnitWidth MosaicWidth + define graphicSw : AdviceStroke 3.5 + define smallGraphicSw : AdviceStroke 3.5 : Math.sqrt (MosaicWidthScalar / 2) define [SidewaysBox top bottom left right _left2 _right2] : begin local left2 : fallback _left2 left @@ -51,7 +55,7 @@ glyph-block Symbol-Pictograph-Game-Sprite : for-width-kinds WideWidth4 bot bottom left left right right - stroke : fallback _sw : AdviceStroke 3.5 + stroke : fallback _sw graphicSw xMiddle : mix left right 0.5 yMiddle : mix top bottom 0.5 armRaiseK 0.4 @@ -101,31 +105,14 @@ glyph-block Symbol-Pictograph-Game-Sprite : for-width-kinds WideWidth4 define dressRight : scaffold.xRightFoot + scaffold.stroke / 2 include : StickManArms scaffold p kl kr include : VBar.m scaffold.xMiddle [scaffold.yShoulder p] scaffold.yNeck - include : intersection - spiro-outline - corner scaffold.xMiddle ([scaffold.yShoulder p] + scaffold.stroke) - corner dressRight dressBottom - corner dressLeft dressBottom - union - dispiro - widths.rhs scaffold.stroke - corner scaffold.xMiddle ([scaffold.yShoulder p] + scaffold.stroke) - corner dressRight dressBottom - dispiro - widths.rhs scaffold.stroke - corner dressRight dressBottom - corner dressLeft dressBottom - dispiro - widths.rhs scaffold.stroke - corner dressLeft dressBottom - corner scaffold.xMiddle ([scaffold.yShoulder p] + scaffold.stroke) + include : TriangleShape scaffold.xMiddle ([scaffold.yShoulder p] + scaffold.stroke) dressRight dressBottom dressLeft dressBottom scaffold.stroke include : VBar.m [mix dressLeft dressRight 0.3] scaffold.bot (dressBottom - O) scaffold.stroke include : VBar.m [mix dressLeft dressRight 0.7] scaffold.bot (dressBottom - O) scaffold.stroke define scaffold : StickManScaffold uiTop uiBot uiLeft uiRight define hBox : SidewaysBox uiTop uiBot uiLeft uiRight - define hScaffold : StickManScaffold hBox.top hBox.bottom hBox.left hBox.right [AdviceStroke 3.5 : Math.sqrt (MosaicWidthScalar / 2)] + define hScaffold : StickManScaffold hBox.top hBox.bottom hBox.left hBox.right smallGraphicSw create-glyph [MangleName 'stickMan'] [MangleUnicode 0x1FBC5] : glyph-proc set-width MosaicWidth diff --git a/packages/font-glyphs/src/symbol/shared.ptl b/packages/font-glyphs/src/symbol/shared.ptl index 6a9e4c5d3b..b46689fdac 100644 --- a/packages/font-glyphs/src/symbol/shared.ptl +++ b/packages/font-glyphs/src/symbol/shared.ptl @@ -9,11 +9,11 @@ glyph-block Shared-Symbol-Shapes : begin glyph-block-import Common-Derivatives glyph-block-export CreateWaveShape - define [CreateWaveShape dist sw _phaesShift] : begin + define [CreateWaveShape dist sw _phaseShift] : begin define WaveResolution 256 define WaveMagnitude : dist * (3 / 4) - sw / 2 define WaveAdj : TanSlope * WaveMagnitude * (-0.75) - define phaseShift : fallback _phaesShift 0 + define phaseShift : fallback _phaseShift 0 define [WaveShapeImpl] : with-params [left right ts te xsJoin xfJoin diagJoinS diagJoinF] : glyph-proc local resolution : Math.ceil (WaveResolution * (te - ts)) local knots {} @@ -35,3 +35,26 @@ glyph-block Shared-Symbol-Shapes : begin define [WaveShape] : with-params [left right xsJoin xfJoin diagJoinS diagJoinF [waveCount 1] [unitWidth Width]] : WaveShapeImpl (unitWidth * -left) (unitWidth * (1 + right)) (-left * waveCount) ((1 + right) * waveCount) xsJoin xfJoin diagJoinS diagJoinF return WaveShape + + glyph-block-export TriangleShape + define [TriangleShape x1 y1 x2 y2 x3 y3 sw] : begin + local widthSide : if ((y2 - y1) * (y3 - y2) + (x2 - x1) * (x3 - x2) < 0) widths.rhs widths.lhs + + return : intersection + spiro-outline + corner x1 y1 + corner x2 y2 + corner x3 y3 + union + dispiro + widthSide sw + corner x1 y1 + corner x2 y2 + dispiro + widthSide sw + corner x2 y2 + corner x3 y3 + dispiro + widthSide sw + corner x3 y3 + corner x1 y1 From 7d729b14a237486305b348399cdebb3a626818fd Mon Sep 17 00:00:00 2001 From: Logo121 <21302803+Logo121@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:12:14 +0800 Subject: [PATCH 04/11] funnel, antenna, epxlosion --- .../font-glyphs/src/symbol/pictograph.ptl | 1 + .../src/symbol/pictograph/schematic.ptl | 91 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 packages/font-glyphs/src/symbol/pictograph/schematic.ptl diff --git a/packages/font-glyphs/src/symbol/pictograph.ptl b/packages/font-glyphs/src/symbol/pictograph.ptl index edc3de21ce..d11e45081d 100644 --- a/packages/font-glyphs/src/symbol/pictograph.ptl +++ b/packages/font-glyphs/src/symbol/pictograph.ptl @@ -19,6 +19,7 @@ export : define [apply] : begin run-glyph-module "./pictograph/metric-marks.mjs" run-glyph-module "./pictograph/musical.mjs" run-glyph-module "./pictograph/powerline-and-gui.mjs" + run-glyph-module "./pictograph/schematic.mjs" run-glyph-module "./pictograph/stick-figure.mjs" run-glyph-module "./pictograph/suit.mjs" run-glyph-module "./pictograph/telephone-recorder.mjs" diff --git a/packages/font-glyphs/src/symbol/pictograph/schematic.ptl b/packages/font-glyphs/src/symbol/pictograph/schematic.ptl new file mode 100644 index 0000000000..767237c2b6 --- /dev/null +++ b/packages/font-glyphs/src/symbol/pictograph/schematic.ptl @@ -0,0 +1,91 @@ +$$include '../../meta/macros.ptl' + +import [mix linreg clamp fallback] from "@iosevka/util" + +glyph-module + +glyph-block Symbol-Pictograph-Schematic : for-width-kinds WideWidth4 : begin + glyph-block-import CommonShapes + glyph-block-import Common-Derivatives + glyph-block-import Shared-Symbol-Shapes : TriangleShape + glyph-block-import Symbol-Geometric-Shared : GeometricDim + + define top fontMetrics.os2.sTypoAscender + define bottom fontMetrics.os2.sTypoDescender + define left 0 + define right MosaicWidth + + define midx : mix left right 0.5 + define midy : mix bottom top 0.5 + define MosaicHeight : top - bottom + + define Geom : GeometricDim MosaicUnitWidth MosaicWidth + + define boxDrawingStroke : AdviceStroke 3.5 + define fineStroke : AdviceStroke 3.5 : Math.sqrt (MosaicWidthScalar / 2) + define gateSize : MosaicHeight / 2 + define gateBot : midy - gateSize + define gateTop : midy + gateSize + define ringSize : Math.min (Geom.Size * 0.5) (MosaicWidth / 6) + define [InvertRingAt x y fMask] : [if fMask spiro-outline dispiro] + if fMask {} : list + widths.rhs fineStroke + g4 x (y - ringSize) + archv 32 2.0 + g4 (x - ringSize) y + arcvh 32 2.0 + g4 x (y + ringSize) + archv 32 2.0 + g4 (x + ringSize) y + arcvh 32 2.0 + close + + do "Explosion at Horizon" + define horizon : Geom.MidY - Geom.Size * 0.8 + create-glyph [MangleName 'explosionHorizon'] [MangleUnicode 0x1CE02] : glyph-proc + set-width MosaicWidth + include : HBar.m Geom.Left Geom.Right horizon boxDrawingStroke + include : dispiro + widths.center fineStroke + corner (Geom.MidX - Geom.Size * 0.8) (horizon + Geom.Size * 0.7) + corner (Geom.MidX - Geom.Size * 0.4) (horizon + Geom.Size * 0.3) + include : dispiro + widths.center fineStroke + corner (Geom.MidX + Geom.Size * 0.8) (horizon + Geom.Size * 0.7) + corner (Geom.MidX + Geom.Size * 0.4) (horizon + Geom.Size * 0.3) + include : dispiro + widths.center fineStroke + corner (Geom.MidX - Geom.Size * 0.4) (horizon + Geom.Size * 1.4) + corner (Geom.MidX - Geom.Size * 0.2) (horizon + Geom.Size * 0.4) + include : dispiro + widths.center fineStroke + corner (Geom.MidX + Geom.Size * 0.4) (horizon + Geom.Size * 1.4) + corner (Geom.MidX + Geom.Size * 0.2) (horizon + Geom.Size * 0.4) + + do "Funnel" + create-glyph [MangleName 'funnel'] [MangleUnicode 0x1CE08] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : TriangleShape Geom.Left Geom.Top Geom.Right Geom.Top Geom.MidX Geom.Bot boxDrawingStroke + include : VBar.m midx bottom (Geom.Bot + boxDrawingStroke * 2) boxDrawingStroke + + do "Antenna" + define rodLeft : Geom.Left + [HSwToV : boxDrawingStroke / 2] + define rodRight : Geom.Right - [HSwToV : boxDrawingStroke / 2] + define rodTop Geom.Top + create-glyph [MangleName 'antenna'] [MangleUnicode 0x1CC08] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : VBar.m midx bottom rodTop boxDrawingStroke + include : intersection + MaskBelow rodTop + union + dispiro + widths.center boxDrawingStroke + corner [mix midx rodLeft 2] [mix midy rodTop 2] + corner midx midy + dispiro + widths.center boxDrawingStroke + corner [mix midx rodRight 2] [mix midy rodTop 2] + corner midx midy + From 185d5af45875b49bd4fc7f835616e09d593acbda Mon Sep 17 00:00:00 2001 From: Logo121 <21302803+Logo121@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:13:25 +0800 Subject: [PATCH 05/11] cars --- .../src/symbol/pictograph/game-sprite.ptl | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl b/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl index 666b078ee9..a2991da41f 100644 --- a/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl +++ b/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl @@ -31,6 +31,7 @@ glyph-block Symbol-Pictograph-Game-Sprite : for-width-kinds WideWidth4 define graphicSw : AdviceStroke 3.5 define smallGraphicSw : AdviceStroke 3.5 : Math.sqrt (MosaicWidthScalar / 2) + define squareBox : new Box Geom.Top Geom.Bot Geom.Left Geom.Right define [SidewaysBox top bottom left right _left2 _right2] : begin local left2 : fallback _left2 left local right2 : fallback _right2 right @@ -44,6 +45,69 @@ glyph-block Symbol-Pictograph-Game-Sprite : for-width-kinds WideWidth4 midX - newHeight / 2 midX + newHeight / 2 + do "Top-down Vehicles" + define scaffold : object + set scaffold.xWheelFront : 1.5 / 9 + set scaffold.xWheel : 1 / 9 + set scaffold.xWheelRear : 0.5 / 9 + set scaffold.wheelDiam : 3 / 9 + set scaffold.yAxle : scaffold.wheelDiam / 2 + + define [Car box fJut fWindow fSymmetric rot bodyWidth _sw] : glyph-proc + local yBody : if fJut 0 scaffold.yAxle + local xFront : if fSymmetric scaffold.xWheel scaffold.xWheelFront + local xRear : if fSymmetric scaffold.xWheel scaffold.xWheelRear + + local sw : fallback _sw smallGraphicSw + local tfm : D4Transform midX rot 0 + local Kit : StickFigureKit box tfm sw + local Kit2 : if [not fSymmetric] Kit : StickFigureKit box tfm (sw * 2) + + local shape : union + Kit2.RoundSeg xFront 1 xFront (1 - scaffold.wheelDiam) + Kit.RoundSeg xFront (1 - scaffold.yAxle) (1 - xFront) (1 - scaffold.yAxle) + Kit2.RoundSeg (1 - xFront) 1 (1 - xFront) (1 - scaffold.wheelDiam) + Kit2.RoundSeg xRear scaffold.wheelDiam xRear 0 + Kit.RoundSeg xRear (scaffold.yAxle) (1 - xRear) (scaffold.yAxle) + Kit2.RoundSeg (1 - xRear) scaffold.wheelDiam (1 - xRear) 0 + if (bodyWidth <= 0) + Kit.RoundSeg (1 / 2) (1 - yBody) (1 / 2) (yBody) + Kit.Box (1 / 2 - bodyWidth / 2) (1 - yBody) (1 / 2 + bodyWidth / 2) (yBody) + + if fWindow + include : difference shape + Kit.Box (1 / 2 - bodyWidth / 6) (1 - yBody - 1 / 9) (1 / 2 + bodyWidth / 6) (1 - yBody - 3 / 9) + include shape + + create-glyph [MangleName 'goKartUp'] [MangleUnicode 0x1CC00] : glyph-proc + set-width MosaicWidth + include : Car squareBox 0 0 0 0 0 + create-glyph [MangleName 'goKartRight'] [MangleUnicode 0x1CC01] : glyph-proc + set-width MosaicWidth + include : Car squareBox 0 0 0 3 0 + create-glyph [MangleName 'raceCarLeft'] [MangleUnicode 0x1CC97] : glyph-proc + set-width MosaicWidth + include : Car squareBox 1 1 1 1 (3 / 9) + create-glyph [MangleName 'raceCarUp'] [MangleUnicode 0x1CC98] : glyph-proc + set-width MosaicWidth + include : Car squareBox 1 1 1 0 (3 / 9) + create-glyph [MangleName 'raceCarRight'] [MangleUnicode 0x1CC99] : glyph-proc + set-width MosaicWidth + include : Car squareBox 1 1 1 3 (3 / 9) + create-glyph [MangleName 'raceCarDown'] [MangleUnicode 0x1CC9A] : glyph-proc + set-width MosaicWidth + include : Car squareBox 1 1 1 2 (3 / 9) + create-glyph [MangleName 'raceCarHori'] [MangleUnicode 0x1CC9B] : glyph-proc + set-width MosaicWidth + include : Car squareBox 1 0 1 1 (3 / 9) + create-glyph [MangleName 'raceCarVert'] [MangleUnicode 0x1CC9C] : glyph-proc + set-width MosaicWidth + include : Car squareBox 1 0 1 0 (3 / 9) + create-glyph [MangleName 'goKartVert'] [MangleUnicode 0x1CC9D] : glyph-proc + set-width MosaicWidth + include : Car squareBox 0 0 1 0 (3 / 9) + + do "Stick Man" define [StickManScaffold top bottom left right _sw] : begin local baseHeight : uiTop - uiBot From fd9d2264f26b0a42edca4c5d8463c765fe474f6a Mon Sep 17 00:00:00 2001 From: Logo121 <21302803+Logo121@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:34:35 +0800 Subject: [PATCH 06/11] more schematics --- .../src/symbol/pictograph/schematic.ptl | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/packages/font-glyphs/src/symbol/pictograph/schematic.ptl b/packages/font-glyphs/src/symbol/pictograph/schematic.ptl index 767237c2b6..a151ca5b98 100644 --- a/packages/font-glyphs/src/symbol/pictograph/schematic.ptl +++ b/packages/font-glyphs/src/symbol/pictograph/schematic.ptl @@ -89,3 +89,90 @@ glyph-block Symbol-Pictograph-Schematic : for-width-kinds WideWidth4 : begin corner [mix midx rodRight 2] [mix midy rodTop 2] corner midx midy + + do "Diode" + define diodeGap : MosaicWidth / 9 + define diodeLeft : left + diodeGap + define diodeRight : right - diodeGap + + create-glyph [MangleName 'diodeLeft'] [MangleUnicode 0x1CC0E] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : HBar.m left diodeLeft midy boxDrawingStroke + include : HBar.m diodeRight right midy boxDrawingStroke + include : VBar.l diodeLeft gateBot gateTop boxDrawingStroke + include : TriangleShape diodeLeft midy diodeRight gateTop diodeRight gateBot boxDrawingStroke + + create-glyph [MangleName 'diodeRight'] [MangleUnicode 0x1CC0F] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : HBar.m left diodeLeft midy boxDrawingStroke + include : HBar.m diodeRight right midy boxDrawingStroke + include : VBar.r diodeRight gateBot gateTop boxDrawingStroke + include : TriangleShape diodeLeft gateBot diodeLeft gateTop diodeRight midy boxDrawingStroke + + do "Receptacle" + create-glyph [MangleName 'receptacle'] [MangleUnicode 0x1CC12] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : refer-glyph : MangleName : NameUni 0x1FBDB + include : refer-glyph : MangleName : NameUni 0x2576 + + do "Capacitor" + define capacitorSize Geom.Size + define capacitorGap : Geom.Size / 4 + + create-glyph [MangleName 'capacitorHori'] [MangleUnicode 0x1CC13] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : HBar.m left (midx - capacitorGap) midy boxDrawingStroke + include : VBar.r (midx - capacitorGap) (midy - capacitorSize) (midy + capacitorSize) boxDrawingStroke + include : VBar.l (midx + capacitorGap) (midy - capacitorSize) (midy + capacitorSize) boxDrawingStroke + include : HBar.m (midx + capacitorGap) right midy boxDrawingStroke + + create-glyph [MangleName 'capacitorVert'] [MangleUnicode 0x1CC14] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : VBar.m midx bottom (midy - capacitorGap) boxDrawingStroke + include : HBar.t (midx - capacitorSize) (midx + capacitorSize) (midy - capacitorGap) boxDrawingStroke + include : HBar.b (midx - capacitorSize) (midx + capacitorSize) (midy + capacitorGap) boxDrawingStroke + include : VBar.m midx (midy + capacitorGap) top boxDrawingStroke + + do "Rings" + create-glyph [MangleName 'twoRings'] [MangleUnicode 0x1CC88] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : InvertRingAt (left + ringSize) midy + include : InvertRingAt (right - ringSize) midy + + create-glyph [MangleName 'invertedInputs'] [MangleUnicode 0x1CC17] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : InvertRingAt (right - ringSize) (top - ringSize) + include : InvertRingAt (right - ringSize) (bottom + ringSize) + include : difference + HBar.t left (right - ringSize) top boxDrawingStroke + InvertRingAt (right - ringSize) (top - ringSize) 1 + include : difference + HBar.b left (right - ringSize) bottom boxDrawingStroke + InvertRingAt (right - ringSize) (bottom + ringSize) 1 + + create-glyph [MangleName 'invertedOutput'] [MangleUnicode 0x1CC18] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : InvertRingAt (left + ringSize) midy + include : HBar.m (left + ringSize * 2 - fineStroke / 2) right midy boxDrawingStroke + + do "Buffer" + create-glyph [MangleName 'bufferGate'] [MangleUnicode 0x1CC19] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : HBar.m left midx midy boxDrawingStroke + include : TriangleShape midx bottom midx top right midy boxDrawingStroke + + create-glyph [MangleName 'invertedBufferGate'] [MangleUnicode 0x1CC1A] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : HBar.m left (midx - ringSize * 2 + fineStroke / 2) midy boxDrawingStroke + include : InvertRingAt (midx - ringSize) midy + include : TriangleShape midx bottom midx top right midy boxDrawingStroke From 576c534d3ae556d68d91eadaaa5bd43a1d7993f9 Mon Sep 17 00:00:00 2001 From: Logo121 <21302803+Logo121@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:34:59 +0800 Subject: [PATCH 07/11] resistor --- .../src/symbol/pictograph/schematic.ptl | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/packages/font-glyphs/src/symbol/pictograph/schematic.ptl b/packages/font-glyphs/src/symbol/pictograph/schematic.ptl index a151ca5b98..f31f78e66a 100644 --- a/packages/font-glyphs/src/symbol/pictograph/schematic.ptl +++ b/packages/font-glyphs/src/symbol/pictograph/schematic.ptl @@ -111,6 +111,40 @@ glyph-block Symbol-Pictograph-Schematic : for-width-kinds WideWidth4 : begin include : VBar.r diodeRight gateBot gateTop boxDrawingStroke include : TriangleShape diodeLeft gateBot diodeLeft gateTop diodeRight midy boxDrawingStroke + do "Transistor" + local slope : MosaicHeight / MosaicWidth + local tipDx : Math.max (Geom.Size / 5) (boxDrawingStroke / slope) + local tipDy : tipDx * (-slope) + local baseDx : -tipDy / [Math.sqrt 3] * 2 + local baseDy : baseDx / (-slope) + define arrowPos : (1 - [HSwToV boxDrawingStroke] / (MosaicWidth / 2)) * 0.4 + + create-glyph [MangleName 'transistorPNP'] [MangleUnicode 0x1CC10] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : VBar.l left gateBot gateTop boxDrawingStroke + include : refer-glyph : MangleName : NameUni 0x1FBA4 + + local arrowCx : mix midx left arrowPos + local arrowCy : mix bottom midy arrowPos + include : spiro-outline + corner (arrowCx + tipDx) (arrowCy + tipDy) + corner (arrowCx - tipDx - baseDx) (arrowCy - tipDy + baseDy) + corner (arrowCx - tipDx + baseDx) (arrowCy - tipDy - baseDy) + + create-glyph [MangleName 'transistorNPN'] [MangleUnicode 0x1CC11] : glyph-proc + set-width MosaicWidth + include : ForceUpright + include : VBar.l left gateBot gateTop boxDrawingStroke + include : refer-glyph : MangleName : NameUni 0x1FBA4 + + local arrowCx : mix midx left arrowPos + local arrowCy : mix top midy arrowPos + include : spiro-outline + corner (arrowCx - tipDx) (arrowCy + tipDy) + corner (arrowCx + tipDx - baseDx) (arrowCy - tipDy - baseDy) + corner (arrowCx + tipDx + baseDx) (arrowCy - tipDy + baseDy) + do "Receptacle" create-glyph [MangleName 'receptacle'] [MangleUnicode 0x1CC12] : glyph-proc set-width MosaicWidth From f6917e61fed2862a7851c3f4c6142ea1b0b07eb3 Mon Sep 17 00:00:00 2001 From: Logo121 <21302803+Logo121@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:35:24 +0800 Subject: [PATCH 08/11] pointers --- .../symbol/pictograph/powerline-and-gui.ptl | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/font-glyphs/src/symbol/pictograph/powerline-and-gui.ptl b/packages/font-glyphs/src/symbol/pictograph/powerline-and-gui.ptl index fe0b8fcd01..d015779928 100644 --- a/packages/font-glyphs/src/symbol/pictograph/powerline-and-gui.ptl +++ b/packages/font-glyphs/src/symbol/pictograph/powerline-and-gui.ptl @@ -8,7 +8,9 @@ glyph-module glyph-block Symbol-Pictograph-Powerline-And-GUI : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives + glyph-block-import Shared-Symbol-Shapes : TriangleShape glyph-block-import Symbol-Pictograph-Stick-Figure : StickFigureKit PointingHandShape + glyph-block-import Symbol-Geometric-Shared : GeometricDim define uiFigTop : mix ParenBot ParenTop 0.95 define uiFigBot : mix ParenBot ParenTop 0.05 @@ -97,6 +99,8 @@ glyph-block Symbol-Pictograph-Powerline-And-GUI : begin frameRight - [HSwToV GeometryStroke] - [HSwToV progressBarGap] for-width-kinds WideWidth4 + define Geom : GeometricDim MosaicUnitWidth MosaicWidth + do "arrowheadShapedPointer" define scaffold : object set scaffold.top : mix uiFigBot uiFigTop 0.85 @@ -113,6 +117,22 @@ glyph-block Symbol-Pictograph-Powerline-And-GUI : begin corner [mix scaffold.xLeft scaffold.xRight (2 / 5)] [mix scaffold.bot scaffold.top (1 / 4)] corner scaffold.xLeft scaffold.bot + do "Pointer" + define pointerTop : mix uiFigBot uiFigTop (0.25 * MosaicWidthScalar) + define fineStroke : AdviceStroke 3.5 : Math.sqrt (MosaicWidthScalar / 2) + + create-glyph [MangleName "whiteLowerLeftPointer"] [MangleUnicode 0x1CC86] : glyph-proc + set-width MosaicWidth + include : TriangleShape SB uiFigBot SB pointerTop (MosaicWidth - SB) uiFigBot fineStroke + + create-glyph [MangleName "whiteLowerRightPointer"] [MangleUnicode 0x1CC87] : glyph-proc + set-width MosaicWidth + include : TriangleShape SB uiFigBot (MosaicWidth - SB) pointerTop (MosaicWidth - SB) uiFigBot fineStroke + + create-glyph [MangleName "topLeftBlackSmallTriangleLeft"] [MangleUnicode 0x1CE07] : glyph-proc + set-width MosaicWidth + include : with-transform [ApparentTranslate (-MosaicWidth / 4) ((CAP - Geom.MidY) * 0.3 + AccentStackOffset / 2)] : refer-glyph : MangleName 'blackSmallTriangleLeft' + do "Split graphics" define [BoxN n] : new Box uiFigTop uiFigBot SB (MosaicWidth * n - SB) From 4d56a48d664160e41d64a4a0680b87cd2936c5be Mon Sep 17 00:00:00 2001 From: Logo121 <21302803+Logo121@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:35:46 +0800 Subject: [PATCH 09/11] transistor --- .../src/symbol/pictograph/schematic.ptl | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/packages/font-glyphs/src/symbol/pictograph/schematic.ptl b/packages/font-glyphs/src/symbol/pictograph/schematic.ptl index f31f78e66a..02a772d02d 100644 --- a/packages/font-glyphs/src/symbol/pictograph/schematic.ptl +++ b/packages/font-glyphs/src/symbol/pictograph/schematic.ptl @@ -89,6 +89,59 @@ glyph-block Symbol-Pictograph-Schematic : for-width-kinds WideWidth4 : begin corner [mix midx rodRight 2] [mix midy rodTop 2] corner midx midy + do "Resistor" + define amplitude Geom.Size + define vWaves 2 + define hWaves MosaicWidthScalar + + define [HoriWaveSegment left right lefty righty sw] : intersection + MaskRight left + MaskLeft right + dispiro + widths.center sw + corner [mix left right (-1)] [mix lefty righty (-1)] + corner [mix left right 2 ] [mix lefty righty 2 ] + define [VertWaveSegment bot top botx topx sw] : intersection + MaskAbove bot + MaskBelow top + dispiro + widths.center sw + corner [mix botx topx (-1)] [mix bot top (-1)] + corner [mix botx topx 2 ] [mix bot top 2 ] + + create-glyph [MangleName 'resistorHori'] [MangleUnicode 0x1CC09] : glyph-proc + set-width MosaicWidth + include : ForceUpright + local segs : 2 * hWaves - 1 + local halfPeriod : MosaicWidth / (2 * hWaves) + local up : midy + amplitude + local down : midy - amplitude + include : HoriWaveSegment left (left + 0.5 * halfPeriod) midy up boxDrawingStroke + foreach [j : range 0 segs] : begin + include : HoriWaveSegment + left + (j + 0.5) * halfPeriod + left + (j + 1.5) * halfPeriod + if (j % 2) down up + if (j % 2) up down + * boxDrawingStroke + include : HoriWaveSegment (right - halfPeriod * 0.5) right down midy boxDrawingStroke + + create-glyph [MangleName 'resistorVert'] [MangleUnicode 0x1CC0A] : glyph-proc + set-width MosaicWidth + include : ForceUpright + local segs : 2 * vWaves - 1 + local halfPeriod : MosaicHeight / (2 * vWaves) + local up : midx + amplitude + local down : midx - amplitude + include : VertWaveSegment bottom (bottom + halfPeriod * 0.5) midx up boxDrawingStroke + foreach [j : range 0 segs] : begin + include : VertWaveSegment + bottom + (j + 0.5) * halfPeriod + bottom + (j + 1.5) * halfPeriod + if (j % 2) down up + if (j % 2) up down + * boxDrawingStroke + include : VertWaveSegment (top - halfPeriod * 0.5) top down midx boxDrawingStroke do "Diode" define diodeGap : MosaicWidth / 9 From b9d7497f9d01b6334bebe58d1f629be1697af657 Mon Sep 17 00:00:00 2001 From: Logo121 <21302803+Logo121@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:43:23 +0800 Subject: [PATCH 10/11] doc --- changes/29.0.5.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/changes/29.0.5.md b/changes/29.0.5.md index 5f1010a505..1c84571d90 100644 --- a/changes/29.0.5.md +++ b/changes/29.0.5.md @@ -9,4 +9,13 @@ * Add characters: - LOWER RIGHT CORNER WITH DOT (`U+27D3`). - UPPER LEFT CORNER WITH DOT (`U+27D4`). -* Add APL form for WHITE DIAMOND (`U+25C7`). + - UP-POINTING GO-KART (`U+1CC00`) ... VERTICAL RESISTOR SEGMENT (`U+1CC0A`) (Proposed for Unicode 16; L2/21-235). + - LEFT-POINTING DIODE (`U+1CC0E`) ... VERTICAL CAPACITOR (`U+1CC14`) (Proposed for Unicode 16; L2/21-235). + - LOGIC GATE INVERTED INPUTS (`U+1CC17`) ... LOGIC GATE BUFFER WITH INVERTED INPUT (`U+1CC1A`) (Proposed for Unicode 16; L2/21-235). + - LEFT-POINTING ENERGY WAVE (`U+1CC78`) ... DOWN-POINTING ENERGY WAVE (`U+1CC7B`) (Proposed for Unicode 16; L2/21-235). + - WHITE LOWER LEFT POINTER (`U+1CC86`) (Proposed for Unicode 16; L2/21-235). + - WHITE LOWER RIGHT POINTER (`U+1CC87`) (Proposed for Unicode 16; L2/21-235). + - TWO RINGS ALIGNED HORIZONTALLY (`U+1CC88`) (Proposed for Unicode 16; L2/21-235). + - LEFT-POINTING RACING CAR (`U+1CC97`) ... VERTICAL GO-KART (`U+1CC9D`) (Proposed for Unicode 16; L2/21-235). + - TOP LEFT BLACK LEFT-POINTING SMALL TRIANGLE (`U+1CE07`) (Proposed for Unicode 16; L2/21-235). +* Add APL form for WHITE DIAMOND (`U+25C7`) (Proposed for Unicode 16; L2/21-235). From b5212b6b6a1493e8bb40fd210b0346c163b60955 Mon Sep 17 00:00:00 2001 From: Logo121 <21302803+Logo121@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:53:30 +0800 Subject: [PATCH 11/11] apl for white diamond is not proposed for unicode 16.0. --- changes/29.0.5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes/29.0.5.md b/changes/29.0.5.md index 1c84571d90..eef0e81260 100644 --- a/changes/29.0.5.md +++ b/changes/29.0.5.md @@ -18,4 +18,4 @@ - TWO RINGS ALIGNED HORIZONTALLY (`U+1CC88`) (Proposed for Unicode 16; L2/21-235). - LEFT-POINTING RACING CAR (`U+1CC97`) ... VERTICAL GO-KART (`U+1CC9D`) (Proposed for Unicode 16; L2/21-235). - TOP LEFT BLACK LEFT-POINTING SMALL TRIANGLE (`U+1CE07`) (Proposed for Unicode 16; L2/21-235). -* Add APL form for WHITE DIAMOND (`U+25C7`) (Proposed for Unicode 16; L2/21-235). +* Add APL form for WHITE DIAMOND (`U+25C7`).