Random collection of more geometry characters (#2540)

* shapes

* lozenge

* zigzag

* wave/wiggly line

* dots

* math

* doc

* fixes
This commit is contained in:
Logo 2024-10-10 08:31:23 +08:00 committed by GitHub
parent e955d30870
commit 3aa0107191
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 179 additions and 33 deletions

View file

@ -6,3 +6,17 @@
* Optimize glyph for Cyrillic Lower Dzze (`U+A689`) under italics.
* Optimize glyphs for Volapük Ae/Oe/Ue (`U+A79A`..`U+A79F`).
* Optimize glyph for Latin Lower Dezh Digraph with Palatal Hook (`U+1DF12`).
* Add characters:
- WAVY LINE (`U+2307`).
- SYMMETRY (`U+232F`).
- CONICAL TAPER (`U+2332`).
- SLOPE (`U+2333`).
- LARGE UP TACK (`U+27D8`).
- LARGE DOWN TACK (`U+27D9`).
- LOZENGE DIVIDED BY HORIZONTAL RULE (`U+27E0`).
- VERTICAL ZIGZAG LINE (`U+299A`).
- LEFT WIGGLY FENCE (`U+29D8`) ... RIGHT DOUBLE WIGGLY FENCE (`U+29DB`).
- N-ARY SQUARE INTERSECTION OPERATOR (`U+2A05`).
- N-ARY SQUARE UNION OPERATOR (`U+2A06`).
- VERTICAL SIX DOTS (`U+2E3D`).
- WIGGLY VERTICAL LINE (`U+2E3E`).

View file

@ -9,10 +9,10 @@ glyph-block Symbol-Arrow : for-width-kinds WideWidth1
glyph-block-import Common-Derivatives
glyph-block-import Symbol-Geometric-Shared : GeometricDim UnicodeWeightGrade GeometricSizes
define arrowHeight : para.arrowHeight * (Width - SB / 2) * [Math.pow (MosaicWidth / MosaicUnitWidth) (1 / 3)]
define arrowHeight : para.arrowHeight * (Width - SB / 2) * [Math.pow MosaicWidthScalar (1 / 3)]
define arrowWidth : Math.min (MosaicWidth - SB / 2) arrowHeight
define arrowTop : [mix OperBot OperTop (1 / 2)] + arrowHeight / 2
define arrowBot : [mix OperBot OperTop (1 / 2)] - arrowHeight / 2
define arrowTop : SymbolMid + arrowHeight / 2
define arrowBot : SymbolMid - arrowHeight / 2
define arrowMidX : MosaicWidth / 2
define arrowSB : (MosaicWidth - arrowWidth) / 2
define arrowRSB : MosaicWidth - arrowSB

View file

@ -372,13 +372,13 @@ glyph-block Symbol-Geometric-Masked : for-width-kinds WideWidth1
corner (Geom.MidX - 0.375 * Geom.Size) (Geom.MidY + Geom.Size)
corner (Geom.MidX - Geom.Size) (Geom.MidY + 0.375 * Geom.Size)
create-glyph [MangleName 'uni2334'] [MangleUnicode 0x2334] : glyph-proc
create-glyph [MangleName 'counterbore'] [MangleUnicode 0x2334] : glyph-proc
set-width Geom.Width
include : intersection
LowerHalfMask
refer-glyph : MangleName 'whiteSquare'
create-glyph [MangleName 'uni2335'] [MangleUnicode 0x2335] : glyph-proc
create-glyph [MangleName 'countersink'] [MangleUnicode 0x2335] : glyph-proc
set-width Geom.Width
include : intersection
refer-glyph : MangleName 'blackDiamond'
@ -424,3 +424,11 @@ glyph-block Symbol-Geometric-Masked : for-width-kinds WideWidth1
intersection
refer-glyph : MangleName 'blackSquare'
dispiro [widths.center GeometryStroke] [flat Geom.Left Geom.Top] [curl Geom.Right Geom.Bot]
create-glyph [MangleName 'whiteLozengeBar'] [MangleUnicode 0x27E0] : glyph-proc
set-width Geom.Width
include : union
refer-glyph : MangleName 'whiteLozenge'
intersection
refer-glyph : MangleName 'blackLozenge'
HBar.m 0 MosaicWidth Geom.MidY GeometryStroke

View file

@ -393,27 +393,27 @@ glyph-block Symbol-Geometric-Plain : for-width-kinds WideWidth1
StdGeomTargetShape DiamondFill 'diamondTarget' 0x1F79C Size.Oblique
do "Lonzenge"
define [LonzengeFill cx cy size] : spiro-outline
do "Lozenge"
define [LozengeFill cx cy size] : spiro-outline
corner cx (cy + size)
corner (cx + size * 2 / 3) cy
corner cx (cy - size)
corner (cx - size * 2 / 3) cy
StdBlackShape LonzengeFill 'blackLonzenge' 0x29EB Size.Oblique
ConvexWhitePolygon LonzengeFill 'whiteLonzenge' 0x25CA Size.Oblique
StdBlackShape LozengeFill 'blackLozenge' 0x29EB Size.Oblique
ConvexWhitePolygon LozengeFill 'whiteLozenge' 0x25CA Size.Oblique
StdBlackShape LonzengeFill 'blackMediumLonzenge' 0x2B27 Size.MediumOblique
StdBlackShape LonzengeFill 'blackSmallLonzenge' 0x2B2A Size.SmallOblique
StdBlackShape LozengeFill 'blackMediumLozenge' 0x2B27 Size.MediumOblique
StdBlackShape LozengeFill 'blackSmallLozenge' 0x2B2A Size.SmallOblique
ConvexWhitePolygon LonzengeFill 'whiteMediumLonzenge' 0x2B28 Size.MediumOblique
ConvexWhitePolygon LonzengeFill 'whiteSmallLonzenge' 0x2B2B Size.SmallOblique
ConvexWhitePolygon LozengeFill 'whiteMediumLozenge' 0x2B28 Size.MediumOblique
ConvexWhitePolygon LozengeFill 'whiteSmallLozenge' 0x2B2B Size.SmallOblique
StdBlackShape LonzengeFill 'blackTinyLonzenge' 0x1F79D Size.TinyOblique
StdBlackShape LonzengeFill 'blackVerySmallLonzenge' 0x1F79E Size.VerySmallOblique
StdBlackShape LonzengeFill 'blackMediumSmallLonzenge' 0x1F79F Size.MediumSmallOblique
StdBlackShape LozengeFill 'blackTinyLozenge' 0x1F79D Size.TinyOblique
StdBlackShape LozengeFill 'blackVerySmallLozenge' 0x1F79E Size.VerySmallOblique
StdBlackShape LozengeFill 'blackMediumSmallLozenge' 0x1F79F Size.MediumSmallOblique
ConvexPolygonWhiteContainingBlackShape LonzengeFill 'whiteLozengeContainingBlackSmallLozenge' 0x1F7A0 [Object.assign {.} Size.SmallInner Size.Oblique]
ConvexPolygonWhiteContainingBlackShape LozengeFill 'whiteLozengeContainingBlackSmallLozenge' 0x1F7A0 [Object.assign {.} Size.SmallInner Size.Oblique]
do "Square-lozenge"
define [SquareLozengeShape cx cy size] : begin
@ -612,6 +612,27 @@ glyph-block Symbol-Geometric-Plain : for-width-kinds WideWidth1
StdWhiteShape RightArrowHeadShape 'whiteArrowHeadRight' null {.sw ([Math.min GeometryStroke : AdviceStroke 4.75 : Math.sqrt Geom.Scalar] * [Math.sqrt 5])}
do "Other Polygon"
glyph-block-import Shared-Symbol-Shapes : TriangleShape
define fineGeometryStroke : AdviceStroke2 4 4 (Geom.Size * 2)
create-glyph [MangleName 'straightness'] [MangleUnicode 0x23E4] : glyph-proc
set-width Geom.Width
include : HBar.m Geom.Left Geom.Right Geom.MidY GeometryStroke
create-glyph [MangleName 'symmetry'] [MangleUnicode 0x232F] : glyph-proc
set-width Geom.Width
define yOffset : Geom.Size * 0.4
define xShrink : Geom.Size * 0.25
include : HBar.m Geom.Left Geom.Right Geom.MidY GeometryStroke
include : HBar.b (Geom.Left + xShrink) (Geom.Right - xShrink) (Geom.MidY + yOffset) GeometryStroke
include : HBar.t (Geom.Left + xShrink) (Geom.Right - xShrink) (Geom.MidY - yOffset) GeometryStroke
create-glyph [MangleName 'conicalTaper'] [MangleUnicode 0x2332] : glyph-proc
set-width Geom.Width
include : TriangleShape Geom.Left (Geom.MidY - Geom.Size * 0.8) Geom.Left (Geom.MidY + Geom.Size * 0.8) Geom.Right Geom.MidY fineGeometryStroke
include : HBar.m [mix 0 Geom.Left 0.5] [mix Geom.Right Geom.Width 0.5] Geom.MidY fineGeometryStroke
create-glyph [MangleName 'slope'] [MangleUnicode 0x2333] : glyph-proc
set-width Geom.Width
include : TriangleShape Geom.Left Geom.Bot Geom.Left Geom.MidY Geom.Right Geom.Bot fineGeometryStroke

View file

@ -7,6 +7,7 @@ glyph-module
glyph-block Symbol-Math-Geometry : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Shared-Symbol-Shapes : VZigzag
local kBox : 2 / 3
local leftBox : SB * kBox
@ -123,3 +124,53 @@ glyph-block Symbol-Math-Geometry : begin
mix bottomBox topBox : 0.5 + 0.5 * [Wave : 2 * Math.PI * t / N]
include : dispiro [widths.center GeometryStroke] knots
create-glyph 'wavyLine' 0x2307 : glyph-proc
define N 64
local knots {}
define [Wave x] : [Math.sin x] + 0.05 * [Math.sin (3 * x)]
foreach t [range 0 till N] : begin
knots.push : g2
mix leftBox rightBox : 0.5 + 0.1 * [Wave : 4 * Math.PI * t / N]
mix TackBot TackTop (t / N)
include : dispiro [widths.center GeometryStroke] knots
create-glyph 'wigglyLine' 0x2E3E : glyph-proc
define N 4
local knots {}
local stroke : AdviceStroke2 4 11 (ParenTop - ParenBot)
local halfSw : 0.5 * stroke
local halfVSw : HSwToV halfSw
local bot : ParenBot + halfSw
local top : ParenTop - halfSw
local left : Middle - [Math.max (radiusBox / 4) (halfVSw * 1.1)] - halfVSw
local right : Middle + [Math.max (radiusBox / 4) (halfVSw * 1.1)] + halfVSw
foreach t [range 0 N] : begin
knots.push : list
g4 [mix right left 0.5] [mix bot top (t / N)]
g4.up.mid (right - halfVSw) [mix bot top ((t + 0.25) / N)]
g4 [mix right left 0.5] [mix bot top ((t + 0.5) / N)]
g4.up.mid (left + halfVSw) [mix bot top ((t + 0.75) / N)]
include : dispiro
widths.center stroke
straight.right.start left bot
* knots
g4 [mix right left 0.5] top
straight.right.end right top
do 'Zigzags'
create-glyph 'zigzag' 0x299A : VZigzag Middle ParenBot ParenTop (radiusBox / 4) 9 1 GeometryStroke
create-glyph 'wigglyFenceLeft' 0x29D8 : VZigzag Middle ParenBot ParenTop (radiusBox / 4) 10 0 GeometryStroke
create-glyph 'wigglyFenceRight' 0x29D9 : VZigzag Middle ParenBot ParenTop (radiusBox / 4) 10 1 GeometryStroke
define space : (rightBox - leftBox - [HSwToV GeometryStroke] * 2) / 3
create-glyph 'doubleWigglyFenceLeft' 0x29DA : glyph-proc
include : with-transform [ApparentTranslate space 0] : refer-glyph 'wigglyFenceLeft'
include : with-transform [ApparentTranslate (-space) 0] : refer-glyph 'wigglyFenceLeft'
create-glyph 'doubleWigglyFenceRight' 0x29DB : glyph-proc
include : with-transform [ApparentTranslate space 0] : refer-glyph 'wigglyFenceRight'
include : with-transform [ApparentTranslate (-space) 0] : refer-glyph 'wigglyFenceRight'

View file

@ -69,3 +69,16 @@ glyph-block Symbol-Math-Large-Operators : for-width-kinds WideWidth1
adb -- [ArchDepthBOf (ArchDepth * [Math.sqrt df.div]) (df.width)]
turned [MangleName 'Cap'] [MangleUnicode 0x22C2] [MangleName 'Cup'] df.middle SymbolMid
create-glyph [MangleName 'Top'] 0x27D9 : glyph-proc
set-width df.width
include : HBar.t df.leftSB df.rightSB BgOpTop OperatorStroke
include : VBar.m df.middle BgOpTop BgOpBot OperatorStroke
turned [MangleName 'Bot'] [MangleUnicode 0x27D8] [MangleName 'Top'] df.middle SymbolMid
create-glyph [MangleName 'SquareCap'] 0x2A05 : glyph-proc
set-width df.width
include : PiShape df BgOpTop BgOpBot (shrinkRate -- 0) (fine -- OperatorStroke) (doSerif -- false)
turned [MangleName 'SquareCup'] [MangleUnicode 0x2A06] [MangleName 'SquareCap'] df.middle SymbolMid

View file

@ -23,10 +23,6 @@ glyph-block Symbol-Pictograph-Schematic : for-width-kinds WideWidth4 : begin
define boxDrawingStroke : AdviceStroke 3.5
define fineStroke : AdviceStroke 3.5 : Math.sqrt (MosaicWidthScalar / 2)
define [LineExt x1 y1 x2 y2 sw] : dispiro
widths.center sw
corner [mix x1 x2 (-1)] [mix y1 y2 (-1)]
corner [mix x1 x2 2 ] [mix y1 y2 2 ]
define gateSize : MosaicHeight / 4 * MosaicWidthScalar
define gateBot : midy - gateSize
@ -134,11 +130,11 @@ glyph-block Symbol-Pictograph-Schematic : for-width-kinds WideWidth4 : begin
define [HoriWaveSegment left right lefty righty sw] : intersection
MaskRight left
MaskLeft right
LineExt left lefty right righty sw
ExtLineCenter 1 sw left lefty right righty
define [VertWaveSegment bot top botx topx sw] : intersection
MaskAbove bot
MaskBelow top
LineExt botx bot topx top sw
ExtLineCenter 1 sw botx bot topx top
create-glyph [MangleName 'resistorHori'] [MangleUnicode 0x1CC09] : glyph-proc
set-width MosaicWidth
@ -150,7 +146,7 @@ glyph-block Symbol-Pictograph-Schematic : for-width-kinds WideWidth4 : begin
include : intersection
MaskLeft : left + 0.5 * halfPeriod
MaskAbove : midy - 0.5 * boxDrawingStroke
LineExt left midy (left + 0.5 * halfPeriod) up boxDrawingStroke
ExtLineCenter 1 boxDrawingStroke left midy (left + 0.5 * halfPeriod) up
foreach [j : range 0 segs] : begin
include : HoriWaveSegment
left + (j + 0.5) * halfPeriod
@ -161,7 +157,7 @@ glyph-block Symbol-Pictograph-Schematic : for-width-kinds WideWidth4 : begin
include : intersection
MaskRight : right - 0.5 * halfPeriod
MaskBelow : midy + 0.5 * boxDrawingStroke
LineExt (right - 0.5 * halfPeriod) down right midy boxDrawingStroke
ExtLineCenter 1 boxDrawingStroke (right - 0.5 * halfPeriod) down right midy
create-glyph [MangleName 'resistorVert'] [MangleUnicode 0x1CC0A] : glyph-proc
set-width MosaicWidth
@ -173,7 +169,7 @@ glyph-block Symbol-Pictograph-Schematic : for-width-kinds WideWidth4 : begin
include : intersection
MaskBelow : bottom + 0.5 * halfPeriod
MaskRight : midx - [HSwToV : 0.5 * boxDrawingStroke]
LineExt midx bottom up (bottom + 0.5 * halfPeriod) boxDrawingStroke
ExtLineCenter 1 boxDrawingStroke midx bottom up (bottom + 0.5 * halfPeriod)
foreach [j : range 0 segs] : begin
include : VertWaveSegment
bottom + (j + 0.5) * halfPeriod
@ -184,7 +180,7 @@ glyph-block Symbol-Pictograph-Schematic : for-width-kinds WideWidth4 : begin
include : intersection
MaskAbove : top - 0.5 * halfPeriod
MaskLeft : midx + [HSwToV : 0.5 * boxDrawingStroke]
LineExt down (top - 0.5 * halfPeriod) midx top boxDrawingStroke
ExtLineCenter 1 boxDrawingStroke down (top - 0.5 * halfPeriod) midx top
do "Coil"
glyph-block-import Symbol-Mosaic-Split-Graphic : Multicell
@ -272,8 +268,8 @@ glyph-block Symbol-Pictograph-Schematic : for-width-kinds WideWidth4 : begin
define [VerticalPart] : intersection
Rect top bottom left (midx + [HSwToV : 0.5 * boxDrawingStroke])
union
LineExt midx bottom left midy boxDrawingStroke
LineExt left midy midx top boxDrawingStroke
ExtLineCenter 1 boxDrawingStroke midx bottom left midy
ExtLineCenter 1 boxDrawingStroke left midy midx top
create-glyph [MangleName 'transistorPNP'] [MangleUnicode 0x1CC10] : glyph-proc
set-width MosaicWidth

View file

@ -27,15 +27,19 @@ glyph-block Symbol-Punctuation-Ellipsis : begin
include : DrawAt xMid [yp (2 / 3)] (radius - overshoot)
include : DrawAt xMid [yp 1] (radius - overshoot)
define [VNDotShape nDots DrawAt radius overshoot xMid bottom top] : glyph-proc
local [yp p] : mix (bottom + radius) (top - radius) p
foreach [j : range 0 nDots] : include : DrawAt xMid [yp (j / (nDots - 1))] (radius - overshoot)
for-width-kinds WideWidth1 "Ellipsis"
foreach { suffix { DrawAt kDotRadius overshoot } } [Object.entries DotVariants] : do
create-glyph "\[MangleName 'onedotLeader'].\(suffix)" : glyph-proc
create-glyph "\[MangleName 'oneDotLeader'].\(suffix)" : glyph-proc
local width : MosaicWidth * [mix para.diversityF para.diversityII (MosaicWidthScalar - 1)]
set-width width
local radius : [EllipsisDotRadius 2 MosaicWidth] * kDotRadius
include : DrawAt (width / 2) radius (radius - overshoot)
create-glyph "\[MangleName 'twodotsLEader'].\(suffix)" : glyph-proc
create-glyph "\[MangleName 'twoDotsLeader'].\(suffix)" : glyph-proc
local width : MosaicWidth * [mix 1 para.diversityF (MosaicWidthScalar - 1)]
set-width width
local radius : [EllipsisDotRadius 2 MosaicWidth] * kDotRadius
@ -67,8 +71,8 @@ glyph-block Symbol-Punctuation-Ellipsis : begin
create-forked-glyph "\[MangleName 'mathCD2Dots'].\(suffix)" : begin
VThreeDotsShape DrawAt radius overshoot left right (+1) (bot - radius) (top + radius)
select-variant [MangleName 'onedotLeader'] [MangleUnicode 0x2024] (follow -- 'punctuationDot')
select-variant [MangleName 'twodotsLEader'] [MangleUnicode 0x2025] (follow -- 'punctuationDot')
select-variant [MangleName 'oneDotLeader'] [MangleUnicode 0x2024] (follow -- 'punctuationDot')
select-variant [MangleName 'twoDotsLeader'] [MangleUnicode 0x2025] (follow -- 'punctuationDot')
select-variant [MangleName 'ellipsis'] [MangleUnicode 0x2026] (follow -- 'punctuationDot')
select-variant [MangleName 'mathCDots'] [MangleUnicode 0x22EF] (follow -- 'punctuationDot')
select-variant [MangleName 'mathCVDots'] [MangleUnicode 0x22EE] (follow -- 'punctuationDot')
@ -95,7 +99,12 @@ glyph-block Symbol-Punctuation-Ellipsis : begin
local df : include : DivFrame para.diversityF
include : VFourDotShape DrawAt radius overshoot df.middle (SymbolMid - XH * 2 / 3) (SymbolMid + XH * 2 / 3)
create-glyph "vSixDots.\(suffix)" : glyph-proc
local radius : kDotRadius * [EllipsisDotRadius 7 (ParenTop - ParenBot)]
include : VNDotShape 6 DrawAt radius overshoot Middle ParenBot ParenTop
select-variant "triColon" 0x205D (follow -- 'punctuationDot')
select-variant "quadColon" 0x205E (follow -- 'punctuationDot')
select-variant "mathTriColon" 0x2AF6 (follow -- 'punctuationDot')
select-variant "mathQuadColon" 0x2999 (follow -- 'punctuationDot')
select-variant "vSixDots" 0x2E3D (follow -- 'punctuationDot')

View file

@ -58,3 +58,37 @@ glyph-block Shared-Symbol-Shapes : begin
widthSide sw
corner x3 y3
corner x1 y1
define [HZigzagSegment x1 x2 y1 y2 sw] : intersection
MaskRight x1
MaskLeft x2
ExtLineCenter 1 sw x1 y1 x2 y2
define [VZigzagSegment y1 y2 x1 x2 sw] : intersection
MaskAbove y1
MaskBelow y2
ExtLineCenter 1 sw x1 y1 x2 y2
glyph-block-export HZigzag VZigzag
define [HZigzag midy left right amp sgmts phase sw] : glyph-proc
local halfPeriod : (right - left) / sgmts
local up : midy + amp
local down : midy - amp
foreach [j : range 0 sgmts] : begin
include : HZigzagSegment
left + j * halfPeriod
left + (j + 1) * halfPeriod
if ((j + phase) % 2) down up
if ((j + phase) % 2) up down
* sw
define [VZigzag midx bot top amp sgmts phase sw] : glyph-proc
local halfPeriod : (top - bot) / sgmts
local up : midx + amp
local down : midx - amp
foreach [j : range 0 sgmts] : begin
include : VZigzagSegment
bot + j * halfPeriod
bot + (j + 1) * halfPeriod
if ((j + phase) % 2) down up
if ((j + phase) % 2) up down
* sw