Skip to content

Commit

Permalink
More toothless b and d (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
be5invis committed Jul 2, 2020
1 parent 8d1e942 commit 1cc6e83
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 41 deletions.
2 changes: 1 addition & 1 deletion changes/3.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* Add Cyrillic Fita (#617).
* Add a more rounded variant of `D` (#616).
* Add support for open number sign (`VXBI` and `VXBJ`, #621).
* Add toothless variant of `b` (#462).
* Add toothless variant of `b` and `d` (#462).
91 changes: 85 additions & 6 deletions font-src/glyphs/common-shapes.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,9 @@ glyph-block CommonShapes : begin
flat (left + (Stroke - fine) * HVContrast) (top - SmallSmoothA) [widths fine 0]
curl (left + (Stroke - fine) * HVContrast) (top - SmallSmoothA - 0.01) [widths fine 0]

define [OBarLeftToothlessShape _top _left _hBlend _rise _mBlend] : glyph-construction
define [OBarLeftToothlessShape _top _left _rise _mBlend] : glyph-construction
local top : fallback _top XH
local left : fallback _left SB
local hBlend : fallback _hBlend 0.5
local rise : fallback _rise SHook
local mBlend : fallback _mBlend [Math.sqrt (1 / 2)]
local fine ShoulderFine
Expand All @@ -302,9 +301,89 @@ glyph-block CommonShapes : begin
flat (left + (Stroke - fine) * HVContrast) (top - SmallSmoothA) [widths fine 0]
curl (left + (Stroke - fine) * HVContrast) (top - SmallSmoothA - 0.01) [widths fine 0]

define [OBarRightShape top right] : glyph-construction
include : create-glyph [OBarLeftShape top (Width - [fallback right RightSB])]
include : FlipAround Middle ([fallback top XH] / 2)
define [OBarLeftRoundedShape _top _left _yTerminal] : glyph-construction
local top : fallback _top XH
local left : fallback _left SB
local yTerminal : fallback _yTerminal CAP
local fine ShoulderFine
local st : shoulderMidSlope fine nothing 1
local sb : shoulderMidSlope fine nothing (-1)
local mt : [mix left RightSB 0.5] + (st - CorrectionOMidX) * Stroke
local mb : [mix left RightSB 0.5] + CorrectionOMidX * Stroke
include : dispiro
flat left yTerminal [widths.lhs.heading Stroke Downward]
curl left SmallSmoothB
arcvh
g4.right.mid mb O
archv
flat (RightSB - OX) (0 + SmallSmoothA)
curl (RightSB - OX) (top - SmallSmoothB)
arcvh
g4 (mt) (top - O) [widths.heading Stroke 0 {.y (-1) .x (-st)}]
archv
flat (left + (Stroke - fine) * HVContrast) (top - SmallSmoothA) [widths fine 0]
curl (left + (Stroke - fine) * HVContrast) (top - SmallSmoothA - 0.01) [widths fine 0]

define [OBarLeftToothlessTopShape _top _left _rise _mBlend] : glyph-construction
local top : fallback _top XH
local left : fallback _left SB
local rise : fallback _rise SHook
local mBlend : fallback _mBlend [Math.sqrt (1 / 2)]
local fine ShoulderFine
local st : shoulderMidSlope fine nothing 1
local sb : shoulderMidSlope fine nothing (-1)
local mt : [mix left RightSB 0.5] - CorrectionOMidX * Stroke
local mb : [mix left RightSB 0.5] + (sb + CorrectionOMidX) * Stroke
include : dispiro
flat (left + (Stroke - fine) * HVContrast) (top - SmallSmoothA - 0.01) [widths fine 0]
curl (left + (Stroke - fine) * HVContrast) (0 + SmallSmoothB) [widths fine 0]
arcvh
g4 (mb) O [widths.heading Stroke 0 {.y (1) .x (-sb)}]
archv
flat (RightSB - OX) (0 + SmallSmoothA)
curl (RightSB - OX) (top - SmallSmoothB)
arcvh
g4 mt (top - O) [widths.lhs Stroke]
alsoThru.g2 0.5 (1 - mBlend) important
g4 left (top - rise) [widths.lhs Stroke]

define [OBarLeftRoundedTopShape _top _left _yTerminal] : glyph-construction
local top : fallback _top XH
local left : fallback _left SB
local yTerminal : fallback _yTerminal Descender
local fine ShoulderFine
local st : shoulderMidSlope fine nothing 1
local sb : shoulderMidSlope fine nothing (-1)
local mt : [mix left RightSB 0.5] - CorrectionOMidX * Stroke
local mb : [mix left RightSB 0.5] + (sb + CorrectionOMidX) * Stroke
include : dispiro
flat (left + (Stroke - fine) * HVContrast) (top - SmallSmoothA - 0.01) [widths fine 0]
curl (left + (Stroke - fine) * HVContrast) (0 + SmallSmoothB) [widths fine 0]
arcvh
g4 (mb) O [widths.heading Stroke 0 {.y (1) .x (-sb)}]
archv
flat (RightSB - OX) (0 + SmallSmoothA)
curl (RightSB - OX) (top - SmallSmoothB)
arcvh
g4 mt (top - O) [widths.lhs Stroke]
archv
flat left (top - SmallSmoothA)
curl left yTerminal [widths.lhs.heading Stroke Downward]

define [OBarRightShape _top _right] : create-glyph : glyph-construction
include : OBarLeftShape _top (Width - [fallback _right RightSB])
include : FlipAround Middle ([fallback _top XH] / 2)

define [OBarRightToothlessShape _top _right _rise _mBlend] : create-glyph : glyph-construction
include : OBarLeftToothlessTopShape _top (Width - [fallback _right RightSB]) _rise _mBlend
include : FlipAround Middle ([fallback _top XH] / 2)

define [OBarRightRoundedShape _top _right _yTerminal] : create-glyph : glyph-construction
local top : fallback _top XH
local right : fallback right RightSB
local yTerminal : fallback _yTerminal CAP
include : OBarLeftRoundedTopShape top (Width - right) (top - yTerminal)
include : FlipAround Middle (top / 2)

define SERIF_SHIFT_X 0.6
define [LeftwardTopSerif x y length _sw] : glyph-construction
Expand Down Expand Up @@ -838,4 +917,4 @@ glyph-block CommonShapes : begin
set currentGlyph.markAnchors {.}
set currentGlyph.markBnchors {.}

glyph-block-export select-variant italic-variant alias composite refer-glyph query-glyph into-unicode turned HDual hcombine VDual vcombine Rect Ring RingAt DotAt RingStroke RingStrokeAt DotStrokeAt CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs nShoulderKnots nShoulder mShoulderSpiro HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar CurlyTail HCurlyTail FlatSlashShape determineMixR hookstart hookend CyrDescender Fork Miniature Thinner Widen FlipAround ScaleAround Realign ForceUpright Overlay diagCor CreateWaveShape NameUni PointingTo WithDerivatives WithAIHSerifsMask SNeck WithTransform ReverseContours clear-anchors OBarLeftToothlessShape
glyph-block-export select-variant italic-variant alias composite refer-glyph query-glyph into-unicode turned HDual hcombine VDual vcombine Rect Ring RingAt DotAt RingStroke RingStrokeAt DotStrokeAt CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs nShoulderKnots nShoulder mShoulderSpiro HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar CurlyTail HCurlyTail FlatSlashShape determineMixR hookstart hookend CyrDescender Fork Miniature Thinner Widen FlipAround ScaleAround Realign ForceUpright Overlay diagCor CreateWaveShape NameUni PointingTo WithDerivatives WithAIHSerifsMask SNeck WithTransform ReverseContours clear-anchors OBarLeftToothlessShape OBarLeftRoundedShape OBarRightToothlessShape OBarRightRoundedShape
92 changes: 63 additions & 29 deletions font-src/glyphs/letter-latin.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -2268,7 +2268,6 @@ glyph-block Letter-Latin-Lower-B : begin
glyph-block-import Letter-Shared : CreateDerivedLetter

define BToothlessRise : Hook * 0.375 + Stroke / 16
define BHBlend 0.475
define BMBlend 0.80

create-glyph 'b.toothed' : glyph-construction
Expand All @@ -2281,15 +2280,23 @@ glyph-block Letter-Latin-Lower-B : begin
include : tagged 'serifLT' : LeftwardTopSerif SB CAP SideJut
include : tagged 'serifLB' : LeftwardBottomSerif SB 0 SideJut

create-glyph 'b.toothless' : glyph-construction
create-glyph 'b.toothlessCorner' : glyph-construction
set-width Width
include MarkSet.b

include : OBarLeftToothlessShape XH SB BHBlend BToothlessRise BMBlend
include : OBarLeftToothlessShape XH SB BToothlessRise BMBlend
include : VBarLeft SB BToothlessRise CAP
if SLAB : begin
include : tagged 'serifLT' : LeftwardTopSerif SB CAP SideJut

create-glyph 'b.toothlessRounded' : glyph-construction
set-width Width
include MarkSet.b

include : OBarLeftRoundedShape XH SB CAP
if SLAB : begin
include : tagged 'serifLT' : LeftwardTopSerif SB CAP SideJut

select-variant 'b' 'b'

create-glyph 'bhooktop.toothed' : glyph-construction
Expand All @@ -2299,11 +2306,16 @@ glyph-block Letter-Latin-Lower-B : begin
if SLAB : begin
include : tagged 'serifLB' : LeftwardBottomSerif SB 0 SideJut

create-glyph 'bhooktop.toothless' : glyph-construction
create-glyph 'bhooktop.toothlessCorner' : glyph-construction
include MarkSet.b
include : OBarLeftToothlessShape XH SB BHBlend BToothlessRise BMBlend
include : OBarLeftToothlessShape XH SB BToothlessRise BMBlend
include : HooktopLeftBar (bottom -- BToothlessRise)

create-glyph 'bhooktop.toothlessRounded' : glyph-construction
include MarkSet.b
include : OBarLeftRoundedShape XH SB XH
include : HooktopLeftBar (bottom -- SmallSmoothB)

select-variant 'bhooktop' 0x253 (follow -- 'b')

CreateDerivedLetter 'b' 'bbar' 0x180 : lambda [src sel] : glyph-construction
Expand Down Expand Up @@ -2400,34 +2412,45 @@ glyph-block Letter-Latin-Upper-D : begin
glyph-block Letter-Latin-Lower-D : begin
glyph-block-import CommonShapes
glyph-block-import Overmarks
glyph-block-import Letter-Shared : CreateDerivedLetter

sketch # d
set-width Width
include MarkSet.b
define DToothlessRise : Hook * 0.375 + Stroke / 16
define DMBlend 0.80

create-glyph 'd.toothed' : glyph-construction
include MarkSet.b
include : OBarRightShape
include : VBarRight RightSB 0 CAP
if SLAB : begin
include : tagged 'serifRB' : RightwardBottomSerif RightSB 0 SideJut
include : LeftwardTopSerif (RightSB - Stroke * HVContrast) CAP SideJut

save 'd' 'd'
create-glyph 'd.toothlessCorner' : glyph-construction
include MarkSet.b
include : OBarRightToothlessShape XH RightSB DToothlessRise DMBlend
include : VBarRight RightSB DToothlessRise CAP
if SLAB : begin
include : LeftwardTopSerif (RightSB - Stroke * HVContrast) CAP SideJut

sketch # dcroat
include [refer-glyph 'd'] AS_BASE
include : HBar [mix (SB + Stroke) (RightSB - Stroke) 0.5] [mix RightSB Width 0.7] [mix XH CAP 0.45] OverlayStroke
create-glyph 'd.toothlessRounded' : glyph-construction
include MarkSet.b
include : OBarRightRoundedShape XH RightSB CAP
if SLAB : begin
include : LeftwardTopSerif (RightSB - Stroke * HVContrast) CAP SideJut

select-variant 'd' 'd'

save 'dcroat' 0x111
CreateDerivedLetter 'd' 'dcroat' 0x111 : lambda [src sel] : glyph-construction
include [refer-glyph src] AS_BASE
include : HBar [mix (SB + Stroke) (RightSB - Stroke) 0.5] [mix RightSB Width 0.7] [mix XH CAP 0.45] OverlayStroke

sketch # dcaron
CreateDerivedLetter 'd' 'dcaron' 0x10f : lambda [src sel] : glyph-construction
include : refer-glyph "commaAbove"
apply-transform : Translate (Width + (RightSB - SB) / 2 + markExtend / 2) 0
local f : Widen {'d'} 0.95 1
include f.d
local f : Widen {src} 0.95 1
include f.(src)
include MarkSet.b

save 'dcaron' 0x10F

sketch # dcurlytail
local fine : adviceBlackness 4
local rinner : clamp (Width * 0.065) (XH * 0.05) (fine * 0.35)
Expand All @@ -2447,28 +2470,39 @@ glyph-block Letter-Latin-Lower-D : begin

save 'dcurlytail' 0x221

sketch # dhooktop
define yDHookTopConnect : CAP - Hook - HalfStroke
create-glyph 'dhooktop.toothed' : glyph-construction
include MarkSet.b
include : OBarRightShape
include : VBarRight RightSB 0 XH
include : VerticalHook (RightSB - HalfStroke * HVContrast) XH HookX (-Hook)
include : VBarRight RightSB 0 yDHookTopConnect
include : VerticalHook (RightSB - HalfStroke * HVContrast) yDHookTopConnect HookX (-Hook)
if SLAB : include : tagged 'serifRB' : RightwardBottomSerif RightSB 0 SideJut

save 'dhooktop' 0x257
create-glyph 'dhooktop.toothlessCorner' : glyph-construction
include MarkSet.b
include : OBarRightToothlessShape XH RightSB DToothlessRise DMBlend
include : VBarRight RightSB DToothlessRise yDHookTopConnect
include : VerticalHook (RightSB - HalfStroke * HVContrast) yDHookTopConnect HookX (-Hook)
if SLAB : include : tagged 'serifRB' : RightwardBottomSerif RightSB 0 SideJut

create-glyph 'dhooktop.toothlessRounded' : glyph-construction
include MarkSet.b
include : OBarRightRoundedShape XH RightSB yDHookTopConnect
include : VerticalHook (RightSB - HalfStroke * HVContrast) yDHookTopConnect HookX (-Hook)
if SLAB : include : tagged 'serifRB' : RightwardBottomSerif RightSB 0 SideJut

sketch # ddot
select-variant 'dhooktop' 0x257 (follow -- 'd')

CreateDerivedLetter 'd' 'ddot' 0x1E0B : lambda [src sel] : glyph-construction
include : refer-glyph "dotAbove"
apply-transform : Translate (Width - HalfStroke) 0
include [refer-glyph 'd'] AS_BASE
save 'ddot' 0x1E0B
include [refer-glyph src] AS_BASE

sketch # latinde
include [refer-glyph 'd'] AS_BASE
CreateDerivedLetter 'd' 'latinde' 0x18C : lambda [src sel] : glyph-construction
include [refer-glyph src] AS_BASE
include : HBarTop [mix RightSB SB 0.9] (RightSB + O) CAP
if SLAB : begin
include : DownwardLeftSerif [mix RightSB SB 0.9] CAP VJut
save 'latinde' 0x18C


glyph-block Letter-Latin-Upper-P : begin
glyph-block-import CommonShapes
Expand Down
3 changes: 2 additions & 1 deletion font-src/meta/macros.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ define-macro glyph-block-import : syntax-rules
HooktopLeftBar CurlyTail HCurlyTail FlatSlashShape determineMixR hookstart hookend
CyrDescender Fork Miniature Thinner Widen FlipAround ScaleAround Realign ForceUpright
Overlay diagCor CreateWaveShape NameUni PointingTo WithDerivatives WithAIHSerifsMask
SNeck WithTransform ReverseContours clear-anchors OBarLeftToothlessShape]
SNeck WithTransform ReverseContours clear-anchors OBarLeftToothlessShape
OBarLeftRoundedShape OBarRightToothlessShape OBarRightRoundedShape]

Overmarks `[markExtend markHalfStroke markStress markFine markMiddle markDotsRadius
aboveMarkTop aboveMarkBot aboveMarkMid belowMarkBot belowMarkTop commaOvershoot
Expand Down
33 changes: 29 additions & 4 deletions params/variants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,35 @@ sampler = 'b'
description = '`b` with bottom-left tooth'
variant.b = "toothed"

[simple.v-b-toothless]
[simple.v-b-toothless-corner]
tag = "VXBL"
sampler = 'b'
description = '`b` without botton-left tooth'
variant.b = "toothless"
description = '`b` without botton-left tooth, with a corner transition'
variant.b = "toothlessCorner"

[simple.v-b-toothless-rounded]
tag = "VXBM"
sampler = 'b'
description = '`b` without botton-left tooth, with a rounded transition'
variant.b = "toothlessRounded"

[simple.v-d-toothed]
tag = "VXBN"
sampler = 'd'
description = '`d` with bottom-right tooth'
variant.d = "toothed"

[simple.v-d-toothless-corner]
tag = "VXBO"
sampler = 'd'
description = '`d` without botton-right tooth, with a corner transition'
variant.d = "toothlessCorner"

[simple.v-d-toothless-rounded]
tag = "VXBP"
sampler = 'd'
description = '`d` without botton-right tooth, with a rounded transition'
variant.d = "toothlessRounded"

[simple.v-f-serifed]
tag = "cv84"
Expand Down Expand Up @@ -921,7 +945,8 @@ design = [
'v-q-straight',
'v-z-standard',
'v-capital-d-standard',
'v-b-toothed'
'v-b-toothed',
'v-d-toothed'
]
upright = [
'v-a-doublestorey',
Expand Down

0 comments on commit 1cc6e83

Please sign in to comment.