4 Smalltalk symbols (and 2 other arrows) (#2686)

* oshape variants

* observer eye

* new arrows

* keyhole and caret

* log
This commit is contained in:
Logo 2025-02-21 10:33:45 +08:00 committed by GitHub
parent cd2661d653
commit c661de7403
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 171 additions and 88 deletions

View file

@ -35,5 +35,11 @@
* Make certain characters slightly wider under Quasi-Proportional. Affected characters:
- LATIN SMALL LIGATURE FF (`U+FB00`) ... LATIN SMALL LIGATURE FFL (`U+FB04`).
* Add Characters:
- OBSERVER EYE SYMBOL (`U+23FF`).
- LATIN SMALL LETTER SCRIPT R (`U+AB4B`).
- LATIN SMALL LETTER SCRIPT R WITH RING (`U+AB4C`).
- KEYHOLE (`U+1CEB1`).
- BLACK RIGHT TRIANGLE CARET (`U+1CEB3`).
- RIGHTWARDS ARROW WITH LOWER HOOK (`U+1F8B2`).
- LEFTWARDS ARROW FROM DOWNWARDS ARROW (`U+1F8C0`).
- RIGHTWARDS ARROW FROM DOWNWARDS ARROW (`U+1F8C1`).

View file

@ -0,0 +1,93 @@
$$include '../meta/macros.ptl'
import [mix linreg clamp fallback boole boolePn] from "@iosevka/util"
import [Transform] from "@iosevka/geometry/transform"
import [Point] from "@iosevka/geometry/point"
import [FunctionInterpolator AfCombine] from "@iosevka/geometry/spiro-control"
import [RadicalGeometry StrokeGeometry RemoveHolesGeometry] from "@iosevka/geometry"
glyph-module
glyph-block Common-OShape-Variants : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-export OvalShapeT DiamondShapeT RoundRectShapeT
define [OvalShapeT sink t b l r _sw _refAda _refAdb] : begin
local m : mix l r 0.5
local sw : fallback _sw Stroke
local refAda : fallback _refAda SmallArchDepthA
local refAdb : fallback _refAdb SmallArchDepthB
return : sink
widths.rhs sw
arch.rhs.centerAt.ltr.t m t (sw -- sw)
archv
g4 (r - OX) [YSmoothMidR t b refAda refAdb]
arcvh
arch.rhs.centerAt.rtl.b m b (sw -- sw)
archv
g4 (l + OX) [YSmoothMidL t b refAda refAdb]
arcvh
close
define diamondFineRatio : [AdviceStroke 3] / [AdviceStroke 2]
define [DiamondShapeT sink t b l r sw] : begin
local body : fallback sw : AdviceStroke 2
local fine : diamondFineRatio * body
local sw1 fine
local sw2 : mix body fine 0.375
local mxb : arch.adjust-x.bot [mix (l - OX) (r + OX) 0.5] (sw -- fine)
local mxt : arch.adjust-x.top [mix (l - OX) (r + OX) 0.5] (sw -- fine)
local myl : YSmoothMidL t b
local myr : YSmoothMidR t b
local p1 : 0.45 + 0.8 * (fine / (r - l))
local p2 : 0.15 + 0.5 * (fine / (t - b))
local p3 : 0.35 + 0.8 * (body / (t - b))
local p4 : 0.15 + 0.0 * (body / (r - l))
local pcx 0.5
local pcy 0.1
return : sink
g2.right.mid mxb (b + O) [widths.lhs fine]
alsoThru.g2 pcx pcy
flat [mix mxb r p1] [mix b myr p2] [widths.lhs sw1]
curl [mix mxb r (1 - p4)] [mix b myr (1 - p3)] [widths.lhs sw2]
g2.up.mid (r - OX) myr [widths.lhs body]
flat [mix r mxt p4] [mix myr t p3] [widths.lhs sw2]
curl [mix r mxt (1 - p1)] [mix myr t (1 - p2)] [widths.lhs sw1]
alsoThru.g2 (1 - pcx) (1 - pcy)
g2.left.mid mxt (t - O) [widths.lhs fine]
alsoThru.g2 pcx pcy
flat [mix mxt l p1] [mix t myl p2] [widths.lhs sw1]
curl [mix mxt l (1 - p4)] [mix t myl (1 - p3)] [widths.lhs sw2]
g2.down.mid (l + OX) myl [widths.lhs body]
flat [mix l mxb p4] [mix myl b p3] [widths.lhs sw2]
curl [mix l mxb (1 - p1)] [mix myl b (1 - p2)] [widths.lhs sw1]
alsoThru.g2 (1 - pcx) (1 - pcy)
close
define [RoundRectShapeT sink u d l r _sw _cr] : begin
local sw : fallback _sw Stroke
local cr : fallback _cr : clamp ((r - l) / 5) ((r - l) / 2.5) : HSwToV sw
local lMid : l + cr
local rMid : r - cr
local ada : ArchDepthAOf cr (r - l)
local adb : ArchDepthBOf cr (r - l)
return : sink
widths.lhs sw
arch.lhs.centerAt.rtl.t lMid u (sw -- sw) (knot-ty -- curl)
archv
flatside.ld l d u ada adb
arcvh
arch.lhs.centerAt.ltr.b lMid d (sw -- sw) (knot-ty -- flat)
arch.lhs.centerAt.ltr.b rMid d (sw -- sw) (knot-ty -- curl)
archv
flatside.ru r d u ada adb
arcvh
arch.lhs.centerAt.rtl.t rMid u (sw -- sw) (knot-ty -- flat)
close

View file

@ -81,7 +81,7 @@ glyph-block CommonShapes : begin
spiro-outline
corner (-VERY-FAR) [mix y1 y2 (-ext)]
corner [mix x1 x2 (-ext)] [mix y1 y2 (-ext)]
corner [mix x2 x2 (1 + ext)] [mix y1 y2 (1 + ext)]
corner [mix x1 x2 (1 + ext)] [mix y1 y2 (1 + ext)]
corner (-VERY-FAR) [mix y1 y2 (1 + ext)]
glyph-block-export MaskRightLine
@ -90,7 +90,7 @@ glyph-block CommonShapes : begin
spiro-outline
corner (+VERY-FAR) [mix y1 y2 (-ext)]
corner [mix x1 x2 (-ext)] [mix y1 y2 (-ext)]
corner [mix x2 x2 (1 + ext)] [mix y1 y2 (1 + ext)]
corner [mix x1 x2 (1 + ext)] [mix y1 y2 (1 + ext)]
corner (+VERY-FAR) [mix y1 y2 (1 + ext)]
glyph-block-export HalfRectTriangle

View file

@ -67,6 +67,7 @@ export : define [buildGlyphs para recursive] : begin
### HERE WE GO
run-glyph-module "./common/derivatives.mjs"
run-glyph-module "./common/shapes.mjs"
run-glyph-module "./common/o-shape-variants.mjs"
run-glyph-module "./space/index.mjs"
run-glyph-module "./marks/index.mjs"

View file

@ -8,6 +8,7 @@ glyph-module
glyph-block Digits-Zero : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Common-OShape-Variants : OvalShapeT DiamondShapeT
glyph-block-import Digits-Shared : OnumHeight OnumMarks CodeLnum CodeOnum
define CircleInnerWidth : RightSB - SB - [HSwToV : 2 * Stroke]
@ -15,58 +16,6 @@ glyph-block Digits-Zero : begin
define CutoutVerticalStrokeWidth : Math.max (0.2 * CircleInnerWidth) : Math.min (0.4 * CircleInnerWidth) [AdviceStroke 3]
define [CutoutStrokeWidth top] : Math.max (0.1 * top) : Math.min (0.125 * top) (0.5 * CircleInnerWidth) [AdviceStroke 3]
glyph-block-export OvalShapeT
define [OvalShapeT sink t b l r sw] : let [m : mix l r 0.5] : sink
widths.rhs [fallback sw Stroke]
arch.rhs.centerAt.ltr.t m t
archv
g4 (r - OX) [YSmoothMidR t b SmallArchDepthA SmallArchDepthB]
arcvh
arch.rhs.centerAt.rtl.b m b
archv
g4 (l + OX) [YSmoothMidL t b SmallArchDepthA SmallArchDepthB]
arcvh
close
define [DiamondShapeT sink t b l r] : begin
local fine : AdviceStroke 3
local body : AdviceStroke 2
local sw1 fine
local sw2 : mix body fine 0.375
local mxb : arch.adjust-x.bot [mix (l - OX) (r + OX) 0.5] (sw -- fine)
local mxt : arch.adjust-x.top [mix (l - OX) (r + OX) 0.5] (sw -- fine)
local myl : YSmoothMidL t b
local myr : YSmoothMidR t b
local p1 : 0.45 + 0.8 * (fine / (r - l))
local p2 : 0.15 + 0.5 * (fine / (t - b))
local p3 : 0.35 + 0.8 * (body / (t - b))
local p4 : 0.15 + 0.0 * (body / (r - l))
local pcx 0.5
local pcy 0.1
return : sink
g2.right.mid mxb (b + O) [widths.lhs fine]
alsoThru.g2 pcx pcy
flat [mix mxb r p1] [mix b myr p2] [widths.lhs sw1]
curl [mix mxb r (1 - p4)] [mix b myr (1 - p3)] [widths.lhs sw2]
g2.up.mid (r - OX) myr [widths.lhs body]
flat [mix r mxt p4] [mix myr t p3] [widths.lhs sw2]
curl [mix r mxt (1 - p1)] [mix myr t (1 - p2)] [widths.lhs sw1]
alsoThru.g2 (1 - pcx) (1 - pcy)
g2.left.mid mxt (t - O) [widths.lhs fine]
alsoThru.g2 pcx pcy
flat [mix mxt l p1] [mix t myl p2] [widths.lhs sw1]
curl [mix mxt l (1 - p4)] [mix t myl (1 - p3)] [widths.lhs sw2]
g2.down.mid (l + OX) myl [widths.lhs body]
flat [mix l mxb p4] [mix myl b p3] [widths.lhs sw2]
curl [mix l mxb (1 - p1)] [mix myl b (1 - p2)] [widths.lhs sw1]
alsoThru.g2 (1 - pcx) (1 - pcy)
close
define [ZeroShapeBase shapeT] : namespace
define [outlineT sink offsetX offsetY top] : shapeT sink (top - offsetY) (offsetY) (SB + offsetX) (RightSB - offsetX)
export : define [Shape top] : outlineT dispiro 0 0 top
@ -76,7 +25,6 @@ glyph-block Digits-Zero : begin
define Oval : ZeroShapeBase OvalShapeT
define Diamond : ZeroShapeBase DiamondShapeT
define [InsetShape zero overlay fnMask height] : glyph-proc
include zero
if fnMask

View file

@ -618,12 +618,13 @@ glyph-block Symbol-Arrow : for-width-kinds WideWidth1
MkArrow TrigDashArrowShape [MangleName 'trigDashArrowDown'] [MangleUnicode 0x2B6D] arrowMidX arrowTop arrowMidX arrowBot
do "Hook Straight Arrow"
MkArrow [HookArrowShape 1] [MangleName 'hookArrowLeft'] [MangleUnicode 0x21A9] arrowRSB SymbolMid arrowSB SymbolMid
MkArrow [HookArrowShape (-1)] [MangleName 'hookArrowRight'] [MangleUnicode 0x21AA] arrowSB SymbolMid arrowRSB SymbolMid
MkArrow [HookArrowShape (-1)] [MangleName 'hookArrowUpLeft'] [MangleUnicode 0x2923] arrowDiagRSB arrowDiagBot arrowDiagSB arrowDiagTop
MkArrow [HookArrowShape 1] [MangleName 'hookArrowUpRight'] [MangleUnicode 0x2924] arrowDiagSB arrowDiagBot arrowDiagRSB arrowDiagTop
MkArrow [HookArrowShape (-1)] [MangleName 'hookArrowDownRight'] [MangleUnicode 0x2925] arrowDiagSB arrowDiagTop arrowDiagRSB arrowDiagBot
MkArrow [HookArrowShape 1] [MangleName 'hookArrowDownLeft'] [MangleUnicode 0x2926] arrowDiagRSB arrowDiagTop arrowDiagSB arrowDiagBot
MkArrow [HookArrowShape 1] [MangleName 'hookArrowLeft'] [MangleUnicode 0x21A9] arrowRSB SymbolMid arrowSB SymbolMid
MkArrow [HookArrowShape (-1)] [MangleName 'hookArrowRight'] [MangleUnicode 0x21AA] arrowSB SymbolMid arrowRSB SymbolMid
MkArrow [HookArrowShape (-1)] [MangleName 'hookArrowUpLeft'] [MangleUnicode 0x2923] arrowDiagRSB arrowDiagBot arrowDiagSB arrowDiagTop
MkArrow [HookArrowShape 1] [MangleName 'hookArrowUpRight'] [MangleUnicode 0x2924] arrowDiagSB arrowDiagBot arrowDiagRSB arrowDiagTop
MkArrow [HookArrowShape (-1)] [MangleName 'hookArrowDownRight'] [MangleUnicode 0x2925] arrowDiagSB arrowDiagTop arrowDiagRSB arrowDiagBot
MkArrow [HookArrowShape 1] [MangleName 'hookArrowDownLeft'] [MangleUnicode 0x2926] arrowDiagRSB arrowDiagTop arrowDiagSB arrowDiagBot
MkArrow [HookArrowShape 1] [MangleName 'lowerHookArrowRight'] [MangleUnicode 0x1F8B2] arrowSB SymbolMid arrowRSB SymbolMid
do "Loop Straight Arrow"
MkArrow [LoopArrowShape 1] [MangleName 'loopArrowLeft'] [MangleUnicode 0x21AB] arrowRSB SymbolMid arrowSB SymbolMid
@ -1477,6 +1478,17 @@ glyph-block Symbol-Arrow : for-width-kinds WideWidth1
create-glyph [MangleName 'uni2948'] [MangleUnicode 0x2948]
RingOverlayShape 'arrowLeftRight' 'thinArrowLeftRight' 'arrRingOverLR' 'arrRingOverLRMask'
do "Branched Arrows"
local branchInset : 0.5 * MosaicWidth - 1.5 * arrowHeadSize
create-glyph [MangleName 'arrowLeftFromDown'] [MangleUnicode 0x1F8C0] : composite-proc
refer-glyph : MangleName 'arrowDown'
intersection [MaskLeft arrowMidX]
with-transform [ApparentTranslate branchInset 0] : refer-glyph : MangleName 'arrowLeft'
create-glyph [MangleName 'arrowRightFromDown'] [MangleUnicode 0x1F8C1] : composite-proc
refer-glyph : MangleName 'arrowDown'
intersection [MaskRight arrowMidX]
with-transform [ApparentTranslate (-branchInset) 0] : refer-glyph : MangleName 'arrowRight'
do "Stacked Arrows"
local hcDist : Math.max (halfArrowSw * 5) (arrowWidth / 2)
VCombine [MangleName 'uni21C4'] [MangleUnicode 0x21C4] [MangleName 'arrowRight'] [MangleName 'arrowLeft'] (arrowHeadSize * 1.75)

View file

@ -7,7 +7,7 @@ glyph-module
glyph-block Symbol-Math-Letter-Like : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Digits-Zero : OvalShapeT
glyph-block-import Common-OShape-Variants : OvalShapeT
turned 'forall' 0x2200 'A.straightSerifless' Middle (CAP / 2)
alias 'exists' 0x2203 'revE.serifless'

View file

@ -497,6 +497,17 @@ glyph-block Symbol-Math-Relation-Inequality : begin
LessShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB [AdviceStroke 4]
DrawAt (RightSB - DotRadius) SymbolMid (DotRadius * kr * [AdviceStroke 4] / Stroke - ov)
create-glyph 'observerEye' 0x23FF : glyph-proc
local lensXP 0.8
local lensRX : (RightSB - SB) * (1 - lensXP) + [HSwToV : 0.25 * OperatorStroke]
local lensRY : dH * lensXP + 0.25 * OperatorStroke
include : refer-glyph 'less'
include : intersection
union
LessMaskShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB
MaskRight RightSB
Ellipse.Outline.At [mix SB RightSB lensXP] SymbolMid lensRX lensRY
create-glyph 'normalSubsetOf' 0x22B2 : glyph-proc
include : NormalSubsetShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB

View file

@ -9,6 +9,7 @@ glyph-module
glyph-block Symbol-Mosaic-Split-Graphic : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Common-OShape-Variants : RoundRectShapeT
glyph-block-import Symbol-Pictograph-Stick-Figure : StickFigureKit
glyph-block-import Symbol-Pictograph-Keyboard : KeyGen
@ -103,23 +104,7 @@ glyph-block Symbol-Mosaic-Split-Graphic : begin
set scaffold.screenInset : (top - bottom) / 8
set scaffold.cornerRad : (top - bottom) / 8
define [Screen top bot left right] : glyph-proc
include : dispiro
widths.lhs graphicSw
flat left ([mix top bot 0.5] + 1)
curl left (bot + scaffold.cornerRad)
arcvh 2
flat (left + scaffold.cornerRad) bot
curl (right - scaffold.cornerRad) bot
archv 2
flat right (bot + scaffold.cornerRad)
curl right (top - scaffold.cornerRad)
arcvh 2
flat (right - scaffold.cornerRad) top
curl (left + scaffold.cornerRad) top
archv 2
flat left (top - scaffold.cornerRad)
flat left ([mix top bot 0.5] - 1)
define [Screen top bot left right] : RoundRectShapeT dispiro top bot left right graphicSw scaffold.cornerRad
define [Television top bot left right] : glyph-proc
local tvBot : mix bot top scaffold.legSize

View file

@ -150,7 +150,7 @@ glyph-block Symbol-Pictograph-Faces : begin
face.Ring OShape
face.Eyes
face.Mouth 1
include : FlipAround (MosaicWidth / 2) [mix faceTop faceBot 0.5]
include : FlipAround MosaicMiddle [mix faceTop faceBot 0.5]
for-width-kinds WideWidth4
glyph-block-import Symbol-Mosaic-Split-Graphic : Multicell

View file

@ -8,6 +8,7 @@ glyph-module
glyph-block Symbol-Pictograph-Powerline-And-GUI : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Common-OShape-Variants : OvalShapeT
glyph-block-import Shared-Symbol-Shapes : TriangleShape
glyph-block-import Symbol-Pictograph-Stick-Figure : StickFigureKit PointingHandShape
glyph-block-import Symbol-Geometric-Shared : GeometricDim
@ -55,23 +56,44 @@ glyph-block Symbol-Pictograph-Powerline-And-GUI : begin
close
OShapeOutline lockHoleTop lockHoleBottom lockHoleLeft lockHoleRight fine (SmallArchDepthA * lockHoleWidth) (SmallArchDepthB * lockHoleWidth)
define [KeyholeStroke t b l r sw circBot] : glyph-proc
local trigTop : mix b t 1.5
local trigClip : mix t circBot 0.5
local mx : mix l r 0.5
local circ : OvalShapeT dispiro t circBot l r sw
local circMask : OvalShapeT spiro-outline t circBot l r
local trig : intersection [MaskBelow trigClip]
TriangleShape mx trigTop r b l b sw
local trigMask : intersection [MaskBelow trigClip]
spiro-outline [corner mx trigTop] [corner r b] [corner l b]
include : difference
union circMask trigMask
union
difference circMask circ
difference trigMask trig
create-glyph 'keyhole' 0x1CEB1 : glyph-proc
local diameter : RightSB - SB - OX * 2
include : KeyholeStroke (PictTop - O) PictBot (SB + OX) (RightSB - OX) GeometryStroke (PictTop - O - diameter)
do "Progress Bar"
define frameLeft : mix SB RightSB DesignParameters.bracketOutside
define frameRight : mix RightSB SB DesignParameters.bracketOutside
define progressBarGap : Math.min ((TackTop - TackBot) / 6) (Width / 6) [AdviceStroke 5]
create-glyph 'powerline/progressBarStartEmpty' 0xEE00 : glyph-proc
include : VBar.l frameLeft TackTop TackBot GeometryStroke
include : HBar.t frameLeft (Width - O) TackTop GeometryStroke
include : VBar.l frameLeft TackTop TackBot GeometryStroke
include : HBar.t frameLeft (Width - O) TackTop GeometryStroke
include : HBar.b frameLeft (Width - O) TackBot GeometryStroke
create-glyph 'powerline/progressBarMiddleEmpty' 0xEE01 : glyph-proc
include : HBar.t O (Width - O) TackTop GeometryStroke
include : HBar.t O (Width - O) TackTop GeometryStroke
include : HBar.b O (Width - O) TackBot GeometryStroke
create-glyph 'powerline/progressBarEndEmpty' 0xEE02 : glyph-proc
include : VBar.r frameRight TackTop TackBot GeometryStroke
include : HBar.t O frameRight TackTop GeometryStroke
include : VBar.r frameRight TackTop TackBot GeometryStroke
include : HBar.t O frameRight TackTop GeometryStroke
include : HBar.b O frameRight TackBot GeometryStroke
create-glyph 'powerline/progressBarStartFilled' 0xEE03 : glyph-proc
@ -133,6 +155,11 @@ glyph-block Symbol-Pictograph-Powerline-And-GUI : begin
set-width MosaicWidth
include : with-transform [ApparentTranslate (-MosaicWidth / 4) ((CAP - Geom.MidY) * 0.3 + AccentStackOffset / 2)] : refer-glyph : MangleName 'blackSmallTriangleLeft'
if (MosaicWidthScalar == 1) : begin
create-glyph "blackRightTriangleCaret" 0x1CEB3 : glyph-proc
set-width 0
include : HalfRectTriangle MosaicWidth ParenBot 0 [mix 0 ParenBot 0.2]
do "Split graphics"
define [BoxN n] : new Box uiFigTop uiFigBot SB (MosaicWidth * n - SB)

View file

@ -201,13 +201,13 @@ glyph-block Symbol-Pictograph-Stick-Figure : begin
create-glyph [MangleName "whiteLeftPointingIndex"] [MangleUnicode 0x261C] : glyph-proc
set-width MosaicWidth
include : PointingHandShape hBox [D4Transform (MosaicWidth / 2) 0 1] sw
include : PointingHandShape hBox [D4Transform MosaicMiddle 0 1] sw
create-glyph [MangleName "whiteDownPointingIndex"] [MangleUnicode 0x261F] : glyph-proc
set-width MosaicWidth
include : PointingHandShape vBox [D4Transform (MosaicWidth / 2) 3 0] sw
include : PointingHandShape vBox [D4Transform MosaicMiddle 3 0] sw
create-glyph [MangleName "whiteUpPointingIndex"] [MangleUnicode 0x261D] : glyph-proc
set-width MosaicWidth
local tfm : Transform.Combine
include : PointingHandShape vBox [D4Transform (MosaicWidth / 2) 3 1] sw
include : PointingHandShape vBox [D4Transform MosaicMiddle 3 1] sw