Skip to content

Commit 0028271

Browse files
committed
Add new characters and refine existing shapes in glyph definitions
1 parent 5aaf7f8 commit 0028271

File tree

6 files changed

+132
-86
lines changed

6 files changed

+132
-86
lines changed

changes/33.3.4.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
* Add Characters:
22
- COMBINING OPEN MARK BELOW (`U+1AB7`).
33
- COMBINING DOUBLE OPEN MARK BELOW (`U+1AB8`).
4+
- SUN (`U+2609`) (#2935).
5+
- PERMANENT PAPER SIGN (`U+267E`) (#2935).
6+
- BLACK CIRCLE WITH WHITE DOT RIGHT (`U+2688`) (#2935).
7+
- BLACK CIRCLE WITH TWO WHITE DOTS (`U+2689`) (#2935).
48
* Refine shape of the following characters:
59
- MODIFIER LETTER UNASPIRATED (`U+02ED`).
610
- MODIFIER LETTER LEFT TACK (`U+AB6A`).

packages/font-glyphs/src/auto-build/composite.ptl

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,29 @@ glyph-block Autobuild-Enclosure-Shared : begin
4848
: else : return : CAP / 2 - [mix g.baseAnchors.above.y g.baseAnchors.below.y 0.5]
4949
return 0
5050

51+
define [MapPartNameWithWidthSuffix parts suffix] : begin
52+
local results {}
53+
foreach part [items-of parts] : begin
54+
local partNameWithSuffix : if suffix (part + "." + suffix) part
55+
if [query-glyph partNameWithSuffix] : results.push partNameWithSuffix
56+
: else : results.push part
57+
return results
58+
5159
glyph-block-export CollectJobs
5260
define [CollectJobs globallyDecomposable centered allowProportional prefix suffix demands] : begin
5361
local nonDecomposable { }
5462
local decomposableJobs { }
5563
local relApplications { }
5664
local decomposableRelGlyphs : new Set
5765
foreach demand [items-of demands] : do
58-
local unicode demand.0
59-
local parts demand.1
60-
local restInfo : demand.slice 2
61-
local origJobGlyphGn : CircName unicode prefix parts suffix
66+
local unicode demand.0
67+
local origParts demand.1
68+
local mappedParts : MapPartNameWithWidthSuffix origParts suffix
69+
local restInfo : demand.slice 2
70+
local origJobGlyphGn : CircName unicode prefix origParts suffix
6271

6372
local demandDecomposable : para.enableCvSs && globallyDecomposable
64-
foreach part [items-of parts] : if [query-glyph part] : begin
73+
foreach part [items-of mappedParts] : if [query-glyph part] : begin
6574
local g : query-glyph part
6675
local relatedGlyphs : AnyCvOrCherryPicking.query g
6776
foreach gr [items-of relatedGlyphs] : if [query-glyph : gr.get g] : begin
@@ -73,15 +82,15 @@ glyph-block Autobuild-Enclosure-Shared : begin
7382
set demandDecomposable false
7483

7584
local jobsOrig : if demandDecomposable decomposableJobs nonDecomposable
76-
jobsOrig.push { origJobGlyphGn unicode parts :: restInfo }
85+
jobsOrig.push { origJobGlyphGn unicode mappedParts :: restInfo }
7786

7887
if demandDecomposable
79-
: then : foreach part [items-of parts] : begin
88+
: then : foreach part [items-of mappedParts] : begin
8089
local mesh : getGrMesh { part } AnyCvOrCherryPicking query-glyph
8190
foreach {gr fromParts toParts} [items-of mesh] : foreach gn [items-of toParts]
8291
decomposableRelGlyphs.add gn
8392
: else : begin
84-
local mesh : getGrMesh parts AnyCvOrCherryPicking query-glyph
93+
local mesh : getGrMesh mappedParts AnyCvOrCherryPicking query-glyph
8594
foreach {gr fromParts toParts} [items-of mesh] : do
8695
local fromGn : CircNameNoCheck unicode prefix fromParts suffix
8796
local toGn : CircName unicode prefix toParts suffix
@@ -807,7 +816,7 @@ glyph-block AutoBuild-Enclosure : begin
807816
list 0xA9 {'C'} WideWidth2
808817
list 0x1F12F {'revC'} WideWidth2
809818
list 0x2117 {'P'} WideWidth2
810-
# list 0x267E {'infty'} WideWidth1
819+
list 0x267E {'infty'} WideWidth1
811820
list 0x1F10E {'ccCcwArrow'} WideWidth2
812821
list 0x1F16F {'ccHumanFigure'} WideWidth2
813822
list 0x1F1AD {'M'} WideWidth2

packages/font-glyphs/src/auto-build/transformed.ptl

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -468,35 +468,3 @@ glyph-block Autobuild-Transformed-Mathematical : begin
468468

469469
CreateMathBoldFraktur 0x1D56C UpperLatin
470470
CreateMathBoldFraktur 0x1D586 LowerLatin
471-
472-
glyph-block Autobuild-Rotated : begin
473-
glyph-block-import CommonShapes
474-
glyph-block-import Common-Derivatives
475-
glyph-block-import Recursive-Build : Miniature
476-
glyph-block-import Symbol-Math-APL : LinkAplFormForNwidWwid
477-
478-
for-width-kinds WideWidth1 : do
479-
local s : (RightSB - SB - O * 4 + (MosaicWidth - Width) * 0.5) / CAP
480-
local df : Miniature {'eight.lnum.crossing' 'rotatedPropto' 'revS.serifless'}
481-
crowd -- (4 / [Math.sqrt MosaicWidthScalar])
482-
scale -- s
483-
forceUpright -- true
484-
485-
define [InftyLikeShape gn u gns] : begin
486-
create-glyph [MangleName gn] [MangleUnicode u] : glyph-proc
487-
set-width MosaicWidth
488-
if [not : df.queryByName gns] : throw : new Error "Cannot find glyph \(gns)"
489-
include : df.queryByName gns
490-
include : Translate ((-Width) / 2) ((-CAP) / 2)
491-
include : Rotate (Math.PI / 2)
492-
include : Scale s
493-
include : Translate (MosaicWidth / 2) SymbolMid
494-
include : Italify
495-
496-
InftyLikeShape 'propto' 0x221D 'rotatedPropto'
497-
InftyLikeShape 'infty' 0x221E 'eight.lnum.crossing'
498-
InftyLikeShape 'invLazyS' 0x223E 'revS.serifless'
499-
500-
# Link APLF for BQN
501-
LinkAplFormForNwidWwid 'infty'
502-
LinkAplFormForNwidWwid 'invLazyS'

packages/font-glyphs/src/number/8.ptl

Lines changed: 86 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
$$include '../meta/macros.ptl'
22

33
import [mix linreg clamp fallback] from "@iosevka/util"
4+
import [Box] from "@iosevka/geometry/box"
45

56
glyph-module
67

@@ -9,32 +10,35 @@ glyph-block Digits-Eight : begin
910
glyph-block-import Common-Derivatives
1011
glyph-block-import Digits-Shared : CodeLnum CodeOnum
1112
glyph-block-import Letter-Blackboard : BBS BBD
13+
glyph-block-import Letter-Latin-S : AdviceSArchDepth
1214

1315
local EightPr : StrokeWidthBlend 0.85 0.925
14-
define [EightShape top] : begin
15-
local stroke : AdviceStroke2 2 3 CAP
16-
local p 0.96
17-
local l (SB + OX)
18-
local r (RightSB - OX)
19-
return : dispiro
20-
widths.rhs stroke
21-
arch.rhs.centerAt.ltr.t Middle top (sw -- stroke)
16+
define [EightShape sw box p archDepthFactor _gizmo] : glyph-proc
17+
local archDepth : (box.height / CAP) * ArchDepth * EightPr * archDepthFactor
18+
local archDepthRefWidth : box.width + 2 * OX + 2 * SB
19+
local adaTop : ArchDepthAOf (archDepth * p) archDepthRefWidth
20+
local adbTop : ArchDepthBOf (archDepth * p) archDepthRefWidth
21+
local adaBot : ArchDepthAOf archDepth archDepthRefWidth
22+
local adbBot : ArchDepthBOf archDepth archDepthRefWidth
23+
include : dispiro
24+
arch.rhs.centerAt.rtl.b box.xMid box.bot (sw -- sw)
2225
archv
23-
g4 [mix l r p] (top - [ArchDepthBOf (ArchDepth * EightPr * p) Width])
24-
alsoThru.g2 0.5 0.5 [widths.center stroke]
25-
g4 (l) [ArchDepthBOf (ArchDepth * EightPr) Width] [widths.lhs stroke]
26+
g4 box.left (box.bot + adbBot) [widths.rhs sw]
27+
alsoThru.g2 0.5 0.5 [widths.center sw]
28+
g4 [box.xp p] (box.top - adbTop) [widths.lhs sw]
2629
arcvh
27-
arch.lhs.centerAt.ltr.b Middle 0 (sw -- stroke)
30+
arch.lhs.centerAt.rtl.t box.xMid box.top (sw -- sw)
2831
archv
29-
g4 (r) [ArchDepthAOf (ArchDepth * EightPr) Width] [widths.lhs stroke]
30-
alsoThru.g2 0.5 0.5 [widths.center stroke]
31-
g4 [mix r l p] (top - [ArchDepthAOf (ArchDepth * EightPr * p) Width]) [widths.rhs stroke]
32+
g4 [box.xp (1 - p)] (box.top - adaTop) [widths.lhs sw]
33+
alsoThru.g2 0.5 0.5 [widths.center sw]
34+
g4 box.right (box.bot + adaBot) [widths.rhs sw]
3235
arcvh
3336
close
3437

3538
create-glyph 'eight.lnum.crossing' : glyph-proc
3639
include : MarkSet.capital
37-
include : EightShape CAP
40+
local box : new Box CAP 0 (SB + OX) (RightSB - OX)
41+
include : EightShape [AdviceStroke2 2 3 CAP] box 0.96 1
3842

3943
define [EightCirclesShape stroke top] : begin
4044
local pShrink 1.00
@@ -137,25 +141,77 @@ glyph-block Digits-Eight : begin
137141
select-variant 'eight.lnum' [CodeLnum '8'] (follow -- 'eight')
138142
alias 'eight.onum' [CodeOnum '8'] 'eight.lnum'
139143

144+
define [PropToShape sw box p archDepthFactor _gizmo] : glyph-proc
145+
local py 0.42
146+
local archDepth : (box.height / CAP) * ArchDepth * EightPr * archDepthFactor
147+
local archDepthRefWidth : box.width + 2 * OX + 2 * SB
148+
local adaTop : ArchDepthAOf (archDepth * p) archDepthRefWidth
149+
local adbTop : ArchDepthBOf (archDepth * p) archDepthRefWidth
150+
include : dispiro
151+
straight.up.start box.left box.bot [widths.rhs.heading sw Upward]
152+
alsoThru.g2 0.5 (1 - py) [widths.center sw]
153+
g4 [box.xp p] (box.top - adbTop) [widths.lhs sw]
154+
arcvh
155+
arch.lhs.centerAt.rtl.t box.xMid box.top (sw -- sw) # [widths.lhs sw]
156+
archv
157+
g4 [box.xp (1 - p)] (box.top - adaTop) [widths.lhs sw]
158+
alsoThru.g2 0.5 py [widths.center sw]
159+
straight.down.end box.right box.bot [widths.rhs.heading sw Downward]
140160

141-
# There is an "eight without lower contour" shape used for /propto
142-
create-glyph 'rotatedPropto' : glyph-proc # rotatedPropto
143-
local p 0.96
144-
local py 0.4
145-
local l (SB + OX)
146-
local r (RightSB - OX)
161+
define [InvLazySShape sw box p archDepthFactor _gizmo] : glyph-proc
162+
local archDepth : AdviceSArchDepth box.height (+1) sw
163+
# (box.height / CAP) * ArchDepth * EightPr * archDepthFactor
164+
local archDepthRefWidth : box.width + 2 * OX + 2 * SB
165+
local adaTop : ArchDepthAOf (archDepth * p) archDepthRefWidth
166+
local adbTop : ArchDepthBOf (archDepth * p) archDepthRefWidth
167+
local adaBot : ArchDepthAOf archDepth archDepthRefWidth
168+
local adbBot : ArchDepthBOf archDepth archDepthRefWidth
147169
include : dispiro
148-
widths.lhs
149-
straight.up.start r 0 [heading Upward]
150-
alsoThru 0.5 (1 - py) [widths (Stroke * py) (Stroke * (1 - py))]
151-
g4 [mix r l p] (CAP - ArchDepthA * p * EightPr) [widths.rhs]
170+
g4.down.start box.right (box.bot + adaBot) [widths.rhs.heading sw Downward]
152171
arcvh
153-
g4 [arch.adjust-x.top Middle] (CAP - O)
172+
arch.rhs.centerAt.rtl.b box.xMid box.bot (sw -- sw)
154173
archv
155-
g4 [mix l r p] (CAP - ArchDepthB * p * EightPr)
156-
alsoThru 0.5 py [widths (Stroke * py) (Stroke * (1 - py))]
157-
straight.down.end l 0 [widths.heading Stroke 0 Downward]
174+
g4 box.left (box.bot + adbBot) [widths.rhs sw]
175+
alsoThru.g2 0.5 0.5 [widths.center sw]
176+
g4 [box.xp p] (box.top - adbTop) [widths.lhs sw]
177+
arcvh
178+
arch.lhs.centerAt.rtl.t box.xMid box.top (sw -- sw)
179+
archv
180+
g4.down.end [box.xp (1 - p)] (box.top - adaTop) [widths.lhs.heading sw Downward]
181+
182+
for-width-kinds WideWidth1 : do
183+
define xSF : 1 / [Math.pow (2 / MosaicWidthScalar) 0.6]
184+
define xSS : 1 / [Math.pow (2 / MosaicWidthScalar) 0.3]
185+
define xl : mix (MosaicWidth / 2) (MosaicWidthScalar * SB) (1 / xSF)
186+
define xr : mix (MosaicWidth / 2) (MosaicWidth - MosaicWidthScalar * SB) (1 / xSF)
187+
define yt : mix SymbolMid OperTop 0.75
188+
define yb : mix SymbolMid OperBot 0.75
189+
create-glyph [MangleName 'infty'] [MangleUnicode 0x221E] : glyph-proc
190+
set-width MosaicWidth
191+
include : PointingTo xr yt xr yb : function [] : glyph-proc
192+
set currentGlyph.gizmo : Italify para.slopeAngle
193+
local box : new Box (xr - xl) 0 0 (yt - yb)
194+
include : EightShape (OperatorStroke / xSS) box 1 0.9
195+
include : Italify (-para.slopeAngle)
196+
include : ScaleAround (MosaicUnitWidth / 2) SymbolMid xSF xSF
197+
198+
create-glyph [MangleName 'propto'] [MangleUnicode 0x221D] : glyph-proc
199+
set-width MosaicWidth
200+
include : PointingTo xr yt xr yb : function [] : glyph-proc
201+
set currentGlyph.gizmo : Italify para.slopeAngle
202+
local box : new Box (xr - xl) 0 0 (yt - yb)
203+
include : PropToShape (OperatorStroke / xSS) box 1 0.9
204+
include : Italify (-para.slopeAngle)
205+
include : ScaleAround (MosaicUnitWidth / 2) SymbolMid xSF xSF
158206

207+
create-glyph [MangleName 'invLazyS'] [MangleUnicode 0x223E] : glyph-proc
208+
set-width MosaicWidth
209+
include : PointingTo xr yt xr yb : function [] : glyph-proc
210+
set currentGlyph.gizmo : Italify para.slopeAngle
211+
local box : new Box (xr - xl) 0 0 (yt - yb)
212+
include : InvLazySShape (OperatorStroke / xSS) box 1 0.9
213+
include : Italify (-para.slopeAngle)
214+
include : ScaleAround (MosaicUnitWidth / 2) SymbolMid xSF xSF
159215

160216
define [BBEightSd] : with-params [top swStart swEnd kTop sign OffsetLT OffsetRB OffsetC] : begin
161217
define stroke : Math.max swStart swEnd

packages/font-glyphs/src/symbol/geometric/dotted.ptl

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,22 @@ glyph-block Symbol-Geometric-Dice : for-width-kinds WideWidth1
1313
define Geom : GeometricDim MosaicUnitWidth MosaicWidth
1414

1515
define diceCombinations : list
16-
list 0x2680 'whiteSquare' 7 { { 1 1 } }
17-
list 0x2681 'whiteSquare' 7 { { 0 0 } { 2 2 } }
18-
list 0x2682 'whiteSquare' 7 { { 0 0 } { 1 1 } { 2 2 } }
19-
list 0x2683 'whiteSquare' 7 { { 0 0 } { 2 0 } { 0 2 } { 2 2 } }
20-
list 0x2684 'whiteSquare' 7 { { 0 0 } { 2 0 } { 1 1 } { 0 2 } { 2 2 } }
21-
list 0x2685 'whiteSquare' 7 { { 0 0 } { 0 1 } { 0 2 } { 2 0 } { 2 1 } { 2 2 } }
22-
list 0x2686 'whiteCircle' 4.5 { { (5 / 3) 1 } }
23-
list 0x2687 'whiteCircle' 4.5 { { (1 / 3) 1 } { (5 / 3) 1 } }
16+
list 0x2680 'whiteSquare' union 7 { { 1 1 } }
17+
list 0x2681 'whiteSquare' union 7 { { 0 0 } { 2 2 } }
18+
list 0x2682 'whiteSquare' union 7 { { 0 0 } { 1 1 } { 2 2 } }
19+
list 0x2683 'whiteSquare' union 7 { { 0 0 } { 2 0 } { 0 2 } { 2 2 } }
20+
list 0x2684 'whiteSquare' union 7 { { 0 0 } { 2 0 } { 1 1 } { 0 2 } { 2 2 } }
21+
list 0x2685 'whiteSquare' union 7 { { 0 0 } { 0 1 } { 0 2 } { 2 0 } { 2 1 } { 2 2 } }
22+
list 0x2609 'whiteCircle' union 4.5 { { 1 1 } }
23+
list 0x2686 'whiteCircle' union 4.5 { { (5 / 3) 1 } }
24+
list 0x2687 'whiteCircle' union 4.5 { { (1 / 3) 1 } { (5 / 3) 1 } }
25+
list 0x2688 'blackCircle' difference 4.5 { { (5 / 3) 1 } }
26+
list 0x2689 'blackCircle' difference 4.5 { { (1 / 3) 1 } { (5 / 3) 1 } }
2427

25-
foreach { u frame dotSizeFactor dots } [items-of diceCombinations] : begin
28+
foreach { u frame fnCombine dotSizeFactor dots } [items-of diceCombinations] : begin
2629
create-glyph [MangleName : NameUni u] [MangleUnicode u] : glyph-proc
27-
include [refer-glyph : MangleName frame] AS_BASE ALSO_METRICS
30+
set-width Geom.Width
31+
2832
define dr : DotRadius / Stroke * [Math.min [AdviceStroke dotSizeFactor Geom.Scalar] [AdviceStroke 7 2]]
2933
define xLeftEx : Geom.MidX - Geom.Size + GeometryStroke
3034
define xRightEx : Geom.MidX + Geom.Size - GeometryStroke
@@ -34,11 +38,14 @@ glyph-block Symbol-Geometric-Dice : for-width-kinds WideWidth1
3438
define xRight : mix xLeftEx xRightEx (4 / 5)
3539
define yBottom : mix yBottomEx yTopEx (1 / 5)
3640
define yTop : mix yBottomEx yTopEx (4 / 5)
37-
foreach { px py } [items-of dots] : begin
38-
include : Circle.Outline.DotAt
39-
mix xLeft xRight (px / 2)
40-
mix yBottom yTop (py / 2)
41-
begin dr
41+
42+
include : fnCombine
43+
refer-glyph [MangleName frame]
44+
new-glyph : glyph-proc : foreach { px py } [items-of dots] : begin
45+
include : Circle.Outline.DotAt
46+
mix xLeft xRight (px / 2)
47+
mix yBottom yTop (py / 2)
48+
begin dr
4249

4350
create-glyph [MangleName 'dottedWhiteTriangle'] [MangleUnicode 0x25EC] : glyph-proc
4451
set-width Geom.Width

packages/font-glyphs/src/symbol/math/apl.ptl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ glyph-block Symbol-Math-APL : begin
266266
LinkAplFormForNwidWwid 'uni238A'
267267
LinkAplFormForNwidWwid 'uni25F6'
268268
LinkAplFormForNwidWwid 'uni2687'
269+
LinkAplFormForNwidWwid 'infty'
270+
LinkAplFormForNwidWwid 'invLazyS'
269271

270272
# Uiua symbols
271273
LinkAplFormForNwidWwid 'whiteDiamond'

0 commit comments

Comments
 (0)