Skip to content

Commit

Permalink
random stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Logo121 committed Sep 10, 2024
1 parent 635ad0c commit 76630f0
Show file tree
Hide file tree
Showing 7 changed files with 198 additions and 22 deletions.
1 change: 1 addition & 0 deletions packages/font-glyphs/src/index.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export : define [buildGlyphs para recursive] : begin
run-glyph-module "./symbol/math.mjs"
run-glyph-module "./symbol/letter.mjs"
run-glyph-module "./symbol/braille.mjs"
run-glyph-module "./symbol/counting-rod.mjs"
run-glyph-module "./symbol/ligation.mjs"

# Auto-builds
Expand Down
134 changes: 134 additions & 0 deletions packages/font-glyphs/src/symbol/counting-rod.ptl
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
$$include '../meta/macros.ptl'

import [mix linreg clamp fallback] from "@iosevka/util"

glyph-module

glyph-block Symbol-Counting-Rod : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives

define isProportional : para.diversityII < 1
define rodDiv : mix 1 para.diversityM 2
define rodDf : DivFrame rodDiv 5
define rodSw rodDf.mvs
define hRodSw : AdviceStroke 3 rodDiv
define rodSpace : rodDf.width / 5

do "Counting Rod Ones"
define [RodY i sw] : mix (0 + sw / 2) (CAP - sw / 2) (i / 4)
create-glyph 'countingRod1' 0x1D360 : glyph-proc
local df : include : DivFrame rodDiv
include : df.markSet.capital
include : HBar.m df.leftSB df.rightSB [RodY 0 hRodSw] hRodSw
create-glyph 'countingRod2' 0x1D361 : glyph-proc
local df : include : DivFrame rodDiv
include : refer-glyph 'countingRod1' AS_BASE ALSO_METRICS
include : HBar.m df.leftSB df.rightSB [RodY 1 hRodSw] hRodSw
create-glyph 'countingRod3' 0x1D362 : glyph-proc
local df : include : DivFrame rodDiv
include : refer-glyph 'countingRod2' AS_BASE ALSO_METRICS
include : HBar.m df.leftSB df.rightSB [RodY 2 hRodSw] hRodSw
create-glyph 'countingRod4' 0x1D363 : glyph-proc
local df : include : DivFrame rodDiv
include : refer-glyph 'countingRod3' AS_BASE ALSO_METRICS
include : HBar.m df.leftSB df.rightSB [RodY 3 hRodSw] hRodSw
create-glyph 'countingRod5' 0x1D364 : glyph-proc
local df : include : DivFrame rodDiv
include : refer-glyph 'countingRod4' AS_BASE ALSO_METRICS
include : HBar.m df.leftSB df.rightSB [RodY 4 hRodSw] hRodSw
create-glyph 'countingRod6' 0x1D365 : glyph-proc
local df : include : DivFrame rodDiv
include : refer-glyph 'countingRod1' AS_BASE ALSO_METRICS
include : VBar.m df.middle [RodY 0 hRodSw] CAP rodSw
create-glyph 'countingRod7' 0x1D366 : glyph-proc
local df : include : DivFrame rodDiv
include : refer-glyph 'countingRod2' AS_BASE ALSO_METRICS
include : VBar.m df.middle [RodY 1 hRodSw] CAP rodSw
create-glyph 'countingRod8' 0x1D367 : glyph-proc
local df : include : DivFrame rodDiv
include : refer-glyph 'countingRod3' AS_BASE ALSO_METRICS
include : VBar.m df.middle [RodY 2 hRodSw] CAP rodSw
create-glyph 'countingRod9' 0x1D368 : glyph-proc
local df : include : DivFrame rodDiv
include : refer-glyph 'countingRod4' AS_BASE ALSO_METRICS
include : VBar.m df.middle [RodY 3 hRodSw] CAP rodSw

do "Counting Rod Tens"
define [rodTens nStrokes plusFive] : glyph-proc
local qpDiv : rodDiv * nStrokes / 5
local div : if plusFive rodDiv : if isProportional qpDiv 1
local df : include : DivFrame div nStrokes
include : df.markSet.capital

if plusFive : include : HBar.t df.leftSB df.rightSB CAP hRodSw

if (nStrokes === 1) : begin
include : VBar.m df.middle 0 CAP rodSw
: else : begin
local radius : (rodSpace * (nStrokes - 1)) / 2
foreach [j : range 0 nStrokes] : do
include : VBar.m (df.middle + [mix (-radius) radius : j / (nStrokes - 1)]) 0 CAP rodSw

create-glyph 'countingRodTens1' 0x1D369 : glyph-proc
include : rodTens 1 0
create-glyph 'countingRodTens2' 0x1D36A : glyph-proc
include : rodTens 2 0
create-glyph 'countingRodTens3' 0x1D36B : glyph-proc
include : rodTens 3 0
create-glyph 'countingRodTens4' 0x1D36C : glyph-proc
include : rodTens 4 0
create-glyph 'countingRodTens5' 0x1D36D : glyph-proc
include : rodTens 5 0
create-glyph 'countingRodTens6' 0x1D36E : glyph-proc
include : rodTens 1 1
create-glyph 'countingRodTens7' 0x1D36F : glyph-proc
include : rodTens 2 1
create-glyph 'countingRodTens8' 0x1D370 : glyph-proc
include : rodTens 3 1
create-glyph 'countingRodTens9' 0x1D371 : glyph-proc
include : rodTens 4 1

do "Tally Mark Ideographic"
create-glyph 'tallyIdeograph1' 0x1D372 : glyph-proc
local df : include : DivFrame rodDiv 3 1.1
include : df.markSet.capital
include : HBar.t df.leftSB df.rightSB CAP df.mvs
create-glyph 'tallyIdeograph2' 0x1D373 : glyph-proc
local df : include : DivFrame rodDiv 3
include : refer-glyph 'tallyIdeograph1' AS_BASE ALSO_METRICS
include : VBar.m df.middle 0 CAP df.mvs
create-glyph 'tallyIdeograph3' 0x1D374 : glyph-proc
local df : include : DivFrame rodDiv 3 1.4
include : refer-glyph 'tallyIdeograph2' AS_BASE ALSO_METRICS
include : HBar.m df.middle df.rightSB (CAP / 2) df.mvs
create-glyph 'tallyIdeograph4' 0x1D375 : glyph-proc
local df : include : DivFrame rodDiv 3
include : refer-glyph 'tallyIdeograph3' AS_BASE ALSO_METRICS
include : VBar.m [mix df.leftSB (df.middle - [HSwToV : df.mvs / 2]) 0.4] 0 (CAP * 0.55) df.mvs
create-glyph 'tallyIdeograph5' 0x1D376 : glyph-proc
local df : include : DivFrame rodDiv 3
include : refer-glyph 'tallyIdeograph4' AS_BASE ALSO_METRICS
include : HBar.b df.leftSB df.rightSB 0 df.mvs

do "Tally Marks"
create-glyph 'tallyMarkOne' 0x1D377 : glyph-proc
local df : include : DivFrame : if isProportional (rodDiv / 4) 1
include : df.markSet.capital
include : VBar.m df.middle 0 CAP df.mvs

create-glyph 'tallyMarkFive' 0x1D378 : glyph-proc
local df : include : DivFrame rodDiv 4
include : df.markSet.capital

local left : df.leftSB + [HSwToV : 0.5 * df.mvs]
local right : df.rightSB - [HSwToV : 0.5 * df.mvs]

include : VBar.m left 0 CAP df.mvs
include : VBar.m [mix left right (1/3)] 0 CAP df.mvs
include : VBar.m [mix left right (2/3)] 0 CAP df.mvs
include : VBar.m right 0 CAP df.mvs

include : dispiro
flat (left - LongJut / 2 + OX) (CAP * (1/3)) [widths.center df.mvs]
curl (right + LongJut / 2 - OX) (CAP * (2/3))
34 changes: 34 additions & 0 deletions packages/font-glyphs/src/symbol/geometric/masked.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,41 @@ glyph-block Symbol-Geometric-Masked : for-width-kinds WideWidth1
ExtLineLhs 4 OperatorStroke (Geom.MidX - Geom.Size) Geom.MidY Geom.MidX (Geom.MidY - Geom.Size)
ExtLineLhs 4 OperatorStroke Geom.MidX (Geom.MidY - Geom.Size) (Geom.MidX + Geom.Size) Geom.MidY

# Compositions
create-glyph [MangleName 'compositionSymbol'] [MangleUnicode 0x2384] : glyph-proc
set-width Geom.Width
local offsetX : Geom.Size * Size.Medium.size / 2
include : union
with-transform [Translate offsetX 0] : refer-glyph : MangleName 'whiteMediumCircle'
with-transform [Translate (-offsetX) 0] : refer-glyph : MangleName 'whiteMediumSquare'

create-glyph [MangleName 'whiteSquareVertLine'] [MangleUnicode 0x2385] : glyph-proc
set-width Geom.Width
include : refer-glyph : MangleName 'whiteSquare'
include : BarShape Geom.MidX ParenTop ParenBot

create-glyph [MangleName 'whiteSquareContainingWhiteDiamond'] [MangleUnicode 0x26CB] : glyph-proc
set-width Geom.Width
include : union
refer-glyph : MangleName 'whiteSquare'
refer-glyph : MangleName 'whiteDiamond'

create-glyph [MangleName 'squaredSaltire'] [MangleUnicode 0x26DD] : glyph-proc
set-width Geom.Width
include : union
refer-glyph : MangleName 'whiteSquare'
intersection
refer-glyph : MangleName 'blackSquare'
union
dispiro [widths.center GeometryStroke] [flat Geom.Left Geom.Top] [curl Geom.Right Geom.Bot]
dispiro [widths.center GeometryStroke] [flat Geom.Left Geom.Bot] [curl Geom.Right Geom.Top]

create-glyph [MangleName 'uni26DE'] [MangleUnicode 0x26DE] : glyph-proc
set-width Geom.Width
include : union
difference
refer-glyph : MangleName 'blackSquare'
refer-glyph : MangleName 'blackCircle'
intersection
refer-glyph : MangleName 'blackSquare'
dispiro [widths.center GeometryStroke] [flat Geom.Left Geom.Top] [curl Geom.Right Geom.Bot]
11 changes: 11 additions & 0 deletions packages/font-glyphs/src/symbol/geometric/square-corners.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ glyph-block Symbol-Geometric-Square-Corners : for-width-kinds WideWidth1
intersection [MaskBelow (Geom.MidY + Geom.Size / 3)] [MaskAbove (Geom.MidY - Geom.Size / 3)]
intersection [MaskLeft (Geom.MidX + Geom.Size / 3)] [MaskRight (Geom.MidX - Geom.Size / 3)]

create-glyph [MangleName 'driveSlowSign'] [MangleUnicode 0x26DA] : glyph-proc
set-width Geom.Width
include : intersection
refer-glyph : MangleName 'blackSquare'
union
RingAt Geom.Left Geom.Top (Geom.Size / 2)
RingAt Geom.Left Geom.Bot (Geom.Size / 2)
RingAt Geom.Right Geom.Top (Geom.Size / 2)
RingAt Geom.Right Geom.Bot (Geom.Size / 2)

create-glyph [MangleName 'squareCornersSaltires'] [MangleUnicode 0x1CC89] : glyph-proc
set-width Geom.Width
include : intersection
Expand Down Expand Up @@ -102,3 +112,4 @@ glyph-block Symbol-Geometric-Square-Corners : for-width-kinds WideWidth1
widths.center lineWidth
flat (Geom.MidX - Geom.Size - aperature) (Geom.MidY + Geom.Size)
curl (Geom.MidX + Geom.Size - aperature) (Geom.MidY - Geom.Size)

22 changes: 0 additions & 22 deletions packages/font-glyphs/src/symbol/letter.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -290,28 +290,6 @@ glyph-block Symbol-Letter : begin
flat (Middle + [HSwToV HalfStroke]) 0 [widths.lhs : AdviceStroke 3]
curl (RightSB - O) [mix 0 CAP 0.375]

do "Tally Marks"
create-glyph 'tallyMarkOne' 0x1D377 : glyph-proc
local df : include : DivFrame : if (para.diversityII < 1) ([mix 1 para.diversityM 2] / 4) 1
include : df.markSet.capital
include : VBar.m df.middle 0 CAP df.mvs

create-glyph 'tallyMarkFive' 0x1D378 : glyph-proc
local df : include : DivFrame [mix 1 para.diversityM 2] 4
include : df.markSet.capital

local left : df.leftSB + [HSwToV : 0.5 * df.mvs]
local right : df.rightSB - [HSwToV : 0.5 * df.mvs]

include : VBar.m left 0 CAP df.mvs
include : VBar.m [mix left right (1/3)] 0 CAP df.mvs
include : VBar.m [mix left right (2/3)] 0 CAP df.mvs
include : VBar.m right 0 CAP df.mvs

include : dispiro
flat (left - LongJut / 2 + OX) (CAP * (1/3)) [widths.center df.mvs]
curl (right + LongJut / 2 - OX) (CAP * (2/3))

glyph-block Symbol-Cyrl-Thousands : begin
glyph-block-import CommonShapes
create-glyph 'cyrlThousandsSign' 0x482 : glyph-proc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ glyph-block Symbol-Pictograph-IEC-Power-And-Playback : for-width-kinds WideWidth
set-width df.width
include : RingStrokeAt df.middle SymbolMid squareRadiusFW GeometryStroke

create-glyph [MangleName 'heavyCircledSaltire'] [MangleUnicode 0x2B59] : glyph-proc
set-width df.width
include : RingStrokeAt df.middle SymbolMid squareRadiusFW GeometryStroke
include : intersection
RingAt df.middle SymbolMid squareRadiusFW
union
dispiro [widths.center GeometryStroke] [flat leftFW topFW] [curl rightFW bottomFW]
dispiro [widths.center GeometryStroke] [flat leftFW bottomFW] [curl rightFW topFW]

create-glyph [MangleName 'powerOn'] [MangleUnicode 0x23FD] : glyph-proc
set-width df.width
include : Rect
Expand Down
9 changes: 9 additions & 0 deletions packages/font-glyphs/src/symbol/punctuation/brackets.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ glyph-block Symbol-Punctuation-Brackets : begin

turned 'zNotationParenRight' 0x2988 'zNotationParenLeft' Middle SymbolMid

create-glyph 'parenLeftUHalf' 0x2E59 : intersection
refer-glyph 'parenLeft'
MaskAbove SymbolMid
create-glyph 'parenLeftLHalf' 0x2E5B : intersection
refer-glyph 'parenLeft'
MaskBelow SymbolMid
turned 'parenRightUHalf' 0x2E5A 'parenLeftLHalf' Middle SymbolMid
turned 'parenRightLHalf' 0x2E5C 'parenLeftUHalf' Middle SymbolMid

define Bracket : namespace
export : define [HDim barLeft ext] : namespace
export : define l : fallback barLeft : [mix SB RightSB DesignParameters.bracketOutside] - [HSwToV DesignParameters.bracketOutsideSwAdj] * Stroke
Expand Down

0 comments on commit 76630f0

Please sign in to comment.