Some more Legacy Computing Symbols (pt 7) (#2266)

* dense fills are swapped

* energy wave

* turning triangle into a function

* funnel, antenna, epxlosion

* cars

* more schematics

* resistor

* pointers

* transistor

* doc

* apl for white diamond is not proposed for unicode 16.0.

---------

Co-authored-by: Belleve <belleve@typeof.net>
This commit is contained in:
Logo 2024-03-30 07:05:53 +08:00 committed by GitHub
parent e4feebf9d0
commit cda8fc8777
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 435 additions and 27 deletions

View file

@ -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`).
@ -8,4 +9,13 @@
* Add characters:
- LOWER RIGHT CORNER WITH DOT (`U+27D3`).
- UPPER LEFT CORNER WITH DOT (`U+27D4`).
- 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`).

View file

@ -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
set-width MosaicWidth
include : ForceUpright
include : HShade 8 top bottom left right
create-glyph [MangleName 'denseVertShade'] [MangleUnicode 0x1CC45] : glyph-proc
create-glyph [MangleName 'denseVertShade'] [MangleUnicode 0x1CC44] : glyph-proc
set-width MosaicWidth
include : ForceUpright
include : VShade (4 * MosaicWidthScalar) top bottom left right
create-glyph [MangleName 'denseHoriShade'] [MangleUnicode 0x1CC45] : glyph-proc
set-width MosaicWidth
include : ForceUpright
include : HShade 8 top bottom left right

View file

@ -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"

View file

@ -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,7 +28,10 @@ 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 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
@ -40,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
@ -51,7 +119,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 +169,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
@ -152,6 +203,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}

View file

@ -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)

View file

@ -0,0 +1,265 @@
$$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
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
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 "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
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

View file

@ -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