Skip to content

Commit e866ee9

Browse files
Make attachment serifs of 3 K chars automatic. (be5invis#2281)
1 parent 5ee5a4e commit e866ee9

File tree

3 files changed

+64
-60
lines changed

3 files changed

+64
-60
lines changed

changes/29.1.1.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* Make presence of descender serif automatic for GREEK CAPITAL KAI SYMBOL (`U+03CF`).
2+
* Make presence of top-left serif automatic for CYRILLIC {CAPITAL|SMALL} LETTER BASHKIR KA (`U+04A0`..`U+04A1`).

packages/font-glyphs/src/letter/latin/k.ptl

+42-49
Original file line numberDiff line numberDiff line change
@@ -340,20 +340,18 @@ glyph-block Letter-Latin-K : begin
340340
curly KLegs.Curly
341341
symmetricTouching [KLegs.Symmetric 0]
342342
symmetricConnected [KLegs.Symmetric : AdviceStroke 6]
343-
symmetricConnectedKH [KLegs.Symmetric [AdviceStroke 6] Descender]
343+
symmetricConnectedKH [KLegs.Symmetric [AdviceStroke 6] Descender]
344344
symmetricConnectedVB [KLegs.Symmetric CyrlVbGap]
345-
object # serifs
346-
serifless { 0 0 0 0 }
347-
topLeftSerifed { 2 0 0 0 }
348-
bottomRightSerifed { 0 0 1 0 }
349-
bottomRightSerifed2 { 0 0 0 1 }
350-
topLeftAndBottomRightSerifed { 2 0 1 0 }
351-
topLeftAndBottomRightSerifed2 { 2 0 0 1 }
352-
serifed { 1 1 3 0 }
353-
serifedKH { 1 1 2 0 }
354-
serifed2 { 1 1 2 1 }
355-
serifedKra { 2 1 3 0 }
356-
serifedKappa { 2 0 3 0 }
345+
function [body] : object # serifs
346+
serifless { 0 0 0 }
347+
topLeftSerifed { 2 0 0 }
348+
bottomRightSerifed { 0 0 1 }
349+
topLeftAndBottomRightSerifed { 2 0 1 }
350+
serifedKra { 2 1 3 }
351+
serifedKappa { 2 0 3 }
352+
serifed : match body
353+
[Just 'symmetricConnectedKH'] { 1 1 2 }
354+
__ { 1 1 3 }
357355

358356
define [UpperKLTSerif top sw xBarLeft slabType] : match slabType
359357
2 : HSerif.lt xBarLeft top SideJut
@@ -371,31 +369,26 @@ glyph-block Letter-Latin-K : begin
371369
top / 2 + [CyrlVbLength top] / 2
372370
Math.min [AdviceStroke 5] (CyrlVbGap * 0.5)
373371

374-
# Attachment glyphs used for Greek Kai Symbol
375-
define [GrekKaiAttachmentshape fSerif] : begin
372+
# Attachment glyph used for Greek Kai Symbol
373+
create-glyph 'UpperKaiSymbolAttachment' : glyph-proc
374+
set-width 0
375+
set-mark-anchor 'trailing' 0 0
376376
define shapeDepth : 0.8 * Descender - 0.25 * Stroke
377-
return : PointingTo 0 0 shapeDepth shapeDepth : function [mag] : glyph-proc
378-
define kSw : mix 1 HVContrast ([Math.sqrt 2] / 2)
379-
include : dispiro
377+
define kSw : mix 1 HVContrast Math.SQRT1_2
378+
include : PointingTo 0 0 shapeDepth shapeDepth : function [mag] : union
379+
dispiro
380380
widths.lhs (Stroke * kSw)
381381
flat 0 0
382382
curl mag 0
383-
if fSerif : include : dispiro
384-
widths.center (Stroke / kSw)
385-
flat 0 (Stroke * kSw + SideJut)
386-
curl 0 (0 - SideJut)
387-
388-
create-glyph 'UpperKaiSymbolAttachment/sans' : glyph-proc
389-
set-width 0
390-
set-mark-anchor 'trailing' 0 0
391-
include : GrekKaiAttachmentshape false
392-
create-glyph 'UpperKaiSymbolAttachment/serifed' : glyph-proc
393-
set-width 0
394-
set-mark-anchor 'trailing' 0 0
395-
include : GrekKaiAttachmentshape true
383+
if SLAB
384+
dispiro
385+
widths.center (Stroke / kSw)
386+
flat 0 (Stroke * kSw + SideJut)
387+
curl 0 (0 - SideJut)
388+
no-shape
396389

397390
# Main building
398-
foreach { suffix { LegsImpl {slabLT slabLB slabLegs slabKS} } } [pairs-of UpperKConfig] : do
391+
foreach { suffix { LegsImpl {slabLT slabLB slabLegs} } } [pairs-of UpperKConfig] : do
399392
local straightBar : LegsImpl !== KLegs.Curly
400393
local xBarLeft : SB + [KBalance slabLT straightBar]
401394

@@ -429,10 +422,9 @@ glyph-block Letter-Latin-K : begin
429422

430423
create-glyph "grek/KaiSymbol.\(suffix)" : glyph-proc
431424
include [refer-glyph "K.\(suffix)"] AS_BASE ALSO_METRICS
425+
eject-contour 'serifRB'
432426
include : ExtendBelowBaseAnchors Descender
433-
include : refer-glyph : match slabKS
434-
0 'UpperKaiSymbolAttachment/sans'
435-
1 'UpperKaiSymbolAttachment/serifed'
427+
include [refer-glyph "UpperKaiSymbolAttachment"]
436428

437429
create-glyph "smcpK.\(suffix)" : glyph-proc
438430
include : MarkSet.e
@@ -457,25 +449,26 @@ glyph-block Letter-Latin-K : begin
457449
if slabLB : include : UpperKLBSerif CAP Stroke xBarLeft slabLB
458450

459451
define [BashkirKaShape df top] : glyph-proc
460-
local left : if slabLT ([mix SB RightSB 0.35] - [HSwToV : 0.5 * df.mvs]) [mix SB RightSB 0.2]
461-
local leftNB : left - [KBalance slabLT straightBar]
462-
local xTopBarLeftEnd : mix 0 SB [if slabLT 0.25 0.375]
452+
local left : if SLAB ([mix SB RightSB 0.35] - [HSwToV : 0.5 * df.mvs]) [mix SB RightSB 0.2]
453+
local leftNB : left - [KBalance SLAB straightBar]
454+
local xTopBarLeftEnd : mix 0 SB [if SLAB 0.25 0.375]
463455
local sw : AdviceStroke 3
464456

465457
include : HBar.t xTopBarLeftEnd (Stroke * 0.1 + left) top
466458
include : VBar.l left 0 top sw
467-
include : LegsImpl false leftNB RightSB sw top slabLT slabLegs
468-
if slabLT : include : VSerif.dl xTopBarLeftEnd top VJut
469-
Math.min (VJutStroke * df.mvs / Stroke) (0.625 * (left - xTopBarLeftEnd))
470-
if slabLB : begin
471-
include : HSerif.mb (left + [HSwToV : 0.5 * sw]) 0 Jut
472-
473-
create-glyph "cyrl/BashkirUpperKa.\(suffix)" : glyph-proc
459+
include : LegsImpl false leftNB RightSB sw top SLAB slabLegs
460+
if SLAB : begin
461+
include : VSerif.dl xTopBarLeftEnd top VJut
462+
Math.min (VJutStroke * df.mvs / Stroke) (0.625 * (left - xTopBarLeftEnd))
463+
if slabLT : include : UpperKLTSerif top sw left slabLT
464+
if slabLB : include : UpperKLBSerif top sw left slabLB
465+
466+
create-glyph "cyrl/KaBashkir.\(suffix)" : glyph-proc
474467
define df : include : DivFrame 1
475468
include : df.markSet.capital
476469
include : BashkirKaShape df CAP
477470

478-
create-glyph "cyrl/BashkirKa.\(suffix)" : glyph-proc
471+
create-glyph "cyrl/kaBashkir.\(suffix)" : glyph-proc
479472
define df : include : DivFrame 1
480473
include : df.markSet.e
481474
include : BashkirKaShape df XH
@@ -592,10 +585,10 @@ glyph-block Letter-Latin-K : begin
592585

593586
select-variant 'turnk' 0x29E (follow -- 'k')
594587

595-
select-variant 'cyrl/BashkirUpperKa' 0x4A0 (follow -- 'cyrl/Ka')
596-
select-variant 'cyrl/BashkirKa' 0x4A1 (follow -- 'cyrl/ka')
588+
select-variant 'cyrl/KaBashkir' 0x4A0
589+
select-variant 'cyrl/kaBashkir' 0x4A1
597590

598-
select-variant 'grek/KaiSymbol' 0x3CF
591+
select-variant 'grek/KaiSymbol' 0x3CF (follow -- 'KDescender')
599592

600593
derive-multi-part-glyphs 'kDot' null {'k' 'dotAbove'} : lambda [srcs gr] : glyph-proc
601594
local { base mark } srcs

params/variants.toml

+20-11
Original file line numberDiff line numberDiff line change
@@ -566,31 +566,27 @@ rank = 1
566566
descriptionAffix = "straight shape"
567567
selectorAffix.K = "straight"
568568
selectorAffix."K/sansSerif" = "straight"
569-
selectorAffix."grek/KaiSymbol" = "straight"
570569
selectorAffix.KDescender = "straight"
571570

572571
[prime.capital-k.variants-buildup.stages.body.curly]
573572
rank = 2
574573
descriptionAffix = "curly shape"
575574
selectorAffix.K = "curly"
576575
selectorAffix."K/sansSerif" = "curly"
577-
selectorAffix."grek/KaiSymbol" = "curly"
578576
selectorAffix.KDescender = "curly"
579577

580578
[prime.capital-k.variants-buildup.stages.body.symmetric-touching]
581579
rank = 3
582580
descriptionAffix = "symmetric legs touching the vertical bar"
583581
selectorAffix.K = "symmetricTouching"
584582
selectorAffix."K/sansSerif" = "symmetricTouching"
585-
selectorAffix."grek/KaiSymbol" = "symmetricTouching"
586583
selectorAffix.KDescender = "symmetricTouching"
587584

588585
[prime.capital-k.variants-buildup.stages.body.symmetric-connected]
589586
rank = 4
590587
descriptionAffix = "symmetric legs connected to the vertical bar"
591588
selectorAffix.K = "symmetricConnected"
592589
selectorAffix."K/sansSerif" = "symmetricConnected"
593-
selectorAffix."grek/KaiSymbol" = "symmetricConnected"
594590
selectorAffix.KDescender = "symmetricConnected"
595591

596592
[prime.capital-k.variants-buildup.stages.serifs.serifless]
@@ -599,39 +595,34 @@ descriptionAffix = "serifs"
599595
descriptionJoiner = "without"
600596
selectorAffix.K = "serifless"
601597
selectorAffix."K/sansSerif" = "serifless"
602-
selectorAffix."grek/KaiSymbol" = "serifless"
603598
selectorAffix.KDescender = "serifless"
604599

605600
[prime.capital-k.variants-buildup.stages.serifs.top-left-serifed]
606601
rank = 2
607602
descriptionAffix = "serifs at top left"
608603
selectorAffix.K = "topLeftSerifed"
609604
selectorAffix."K/sansSerif" = "serifless"
610-
selectorAffix."grek/KaiSymbol" = "topLeftSerifed"
611605
selectorAffix.KDescender = "topLeftSerifed"
612606

613607
[prime.capital-k.variants-buildup.stages.serifs.bottom-right-serifed]
614608
rank = 3
615609
descriptionAffix = "serifs at bottom right"
616610
selectorAffix.K = "bottomRightSerifed"
617611
selectorAffix."K/sansSerif" = "serifless"
618-
selectorAffix."grek/KaiSymbol" = "bottomRightSerifed2"
619612
selectorAffix.KDescender = "serifless"
620613

621614
[prime.capital-k.variants-buildup.stages.serifs.top-left-and-bottom-right-serifed]
622615
rank = 4
623616
descriptionAffix = "serifs at top left and bottom right"
624617
selectorAffix.K = "topLeftAndBottomRightSerifed"
625618
selectorAffix."K/sansSerif" = "serifless"
626-
selectorAffix."grek/KaiSymbol" = "topLeftAndBottomRightSerifed2"
627619
selectorAffix.KDescender = "topLeftSerifed"
628620

629621
[prime.capital-k.variants-buildup.stages.serifs.serifed]
630622
rank = 5
631623
descriptionAffix = "serifs"
632624
selectorAffix.K = "serifed"
633625
selectorAffix."K/sansSerif" = "serifless"
634-
selectorAffix."grek/KaiSymbol" = "serifed2"
635626
selectorAffix.KDescender = "serifed"
636627

637628

@@ -5374,6 +5365,7 @@ selectorAffix."cyrl/Ka" = "straight"
53745365
selectorAffix."cyrl/KaDescender" = "straight"
53755366
selectorAffix."cyrl/KaVBar" = "symmetricConnectedVB"
53765367
selectorAffix."cyrl/KaHook" = "symmetricConnectedKH"
5368+
selectorAffix."cyrl/KaBashkir" = "straight"
53775369

53785370
[prime.cyrl-capital-ka.variants-buildup.stages.body.curly]
53795371
rank = 2
@@ -5382,6 +5374,7 @@ selectorAffix."cyrl/Ka" = "curly"
53825374
selectorAffix."cyrl/KaDescender" = "curly"
53835375
selectorAffix."cyrl/KaVBar" = "symmetricConnectedVB"
53845376
selectorAffix."cyrl/KaHook" = "symmetricConnectedKH"
5377+
selectorAffix."cyrl/KaBashkir" = "curly"
53855378

53865379
[prime.cyrl-capital-ka.variants-buildup.stages.body.symmetric-touching]
53875380
rank = 3
@@ -5390,6 +5383,7 @@ selectorAffix."cyrl/Ka" = "symmetricTouching"
53905383
selectorAffix."cyrl/KaDescender" = "symmetricTouching"
53915384
selectorAffix."cyrl/KaVBar" = "symmetricConnectedVB"
53925385
selectorAffix."cyrl/KaHook" = "symmetricConnectedKH"
5386+
selectorAffix."cyrl/KaBashkir" = "symmetricTouching"
53935387

53945388
[prime.cyrl-capital-ka.variants-buildup.stages.body.symmetric-connected]
53955389
rank = 4
@@ -5398,6 +5392,7 @@ selectorAffix."cyrl/Ka" = "symmetricConnected"
53985392
selectorAffix."cyrl/KaDescender" = "symmetricConnected"
53995393
selectorAffix."cyrl/KaVBar" = "symmetricConnectedVB"
54005394
selectorAffix."cyrl/KaHook" = "symmetricConnectedKH"
5395+
selectorAffix."cyrl/KaBashkir" = "symmetricConnected"
54015396

54025397
[prime.cyrl-capital-ka.variants-buildup.stages.serifs.serifless]
54035398
rank = 1
@@ -5407,6 +5402,7 @@ selectorAffix."cyrl/Ka" = "serifless"
54075402
selectorAffix."cyrl/KaDescender" = "serifless"
54085403
selectorAffix."cyrl/KaVBar" = "serifless"
54095404
selectorAffix."cyrl/KaHook" = "serifless"
5405+
selectorAffix."cyrl/KaBashkir" = "serifless"
54105406

54115407
[prime.cyrl-capital-ka.variants-buildup.stages.serifs.top-left-serifed]
54125408
rank = 2
@@ -5415,6 +5411,7 @@ selectorAffix."cyrl/Ka" = "topLeftSerifed"
54155411
selectorAffix."cyrl/KaDescender" = "topLeftSerifed"
54165412
selectorAffix."cyrl/KaVBar" = "topLeftSerifed"
54175413
selectorAffix."cyrl/KaHook" = "topLeftSerifed"
5414+
selectorAffix."cyrl/KaBashkir" = "serifless"
54185415

54195416
[prime.cyrl-capital-ka.variants-buildup.stages.serifs.bottom-right-serifed]
54205417
rank = 3
@@ -5423,6 +5420,7 @@ selectorAffix."cyrl/Ka" = "bottomRightSerifed"
54235420
selectorAffix."cyrl/KaDescender" = "serifless"
54245421
selectorAffix."cyrl/KaVBar" = "bottomRightSerifed"
54255422
selectorAffix."cyrl/KaHook" = "serifless"
5423+
selectorAffix."cyrl/KaBashkir" = "bottomRightSerifed"
54265424

54275425
[prime.cyrl-capital-ka.variants-buildup.stages.serifs.top-left-and-bottom-right-serifed]
54285426
rank = 4
@@ -5431,14 +5429,16 @@ selectorAffix."cyrl/Ka" = "topLeftAndBottomRightSerifed"
54315429
selectorAffix."cyrl/KaDescender" = "topLeftSerifed"
54325430
selectorAffix."cyrl/KaVBar" = "topLeftAndBottomRightSerifed"
54335431
selectorAffix."cyrl/KaHook" = "topLeftSerifed"
5432+
selectorAffix."cyrl/KaBashkir" = "bottomRightSerifed"
54345433

54355434
[prime.cyrl-capital-ka.variants-buildup.stages.serifs.serifed]
54365435
rank = 5
54375436
descriptionAffix = "serifs"
54385437
selectorAffix."cyrl/Ka" = "serifed"
54395438
selectorAffix."cyrl/KaDescender" = "serifed"
54405439
selectorAffix."cyrl/KaVBar" = "serifed"
5441-
selectorAffix."cyrl/KaHook" = "serifedKH"
5440+
selectorAffix."cyrl/KaHook" = "serifed"
5441+
selectorAffix."cyrl/KaBashkir" = "serifed"
54425442

54435443

54445444

@@ -5461,6 +5461,7 @@ selectorAffix."cyrl/ka" = "straight"
54615461
selectorAffix."cyrl/kaDescender" = "straight"
54625462
selectorAffix."cyrl/kaVBar" = "symmetricConnectedVB"
54635463
selectorAffix."cyrl/kaHook" = "symmetricConnectedKH"
5464+
selectorAffix."cyrl/kaBashkir" = "straight"
54645465

54655466
[prime.cyrl-ka.variants-buildup.stages.body.curly]
54665467
rank = 2
@@ -5469,6 +5470,7 @@ selectorAffix."cyrl/ka" = "curly"
54695470
selectorAffix."cyrl/kaDescender" = "curly"
54705471
selectorAffix."cyrl/kaVBar" = "symmetricConnectedVB"
54715472
selectorAffix."cyrl/kaHook" = "symmetricConnectedKH"
5473+
selectorAffix."cyrl/kaBashkir" = "curly"
54725474

54735475
[prime.cyrl-ka.variants-buildup.stages.body.symmetric-touching]
54745476
rank = 3
@@ -5477,6 +5479,7 @@ selectorAffix."cyrl/ka" = "symmetricTouching"
54775479
selectorAffix."cyrl/kaDescender" = "symmetricTouching"
54785480
selectorAffix."cyrl/kaVBar" = "symmetricConnectedVB"
54795481
selectorAffix."cyrl/kaHook" = "symmetricConnectedKH"
5482+
selectorAffix."cyrl/kaBashkir" = "symmetricTouching"
54805483

54815484
[prime.cyrl-ka.variants-buildup.stages.body.symmetric-connected]
54825485
rank = 4
@@ -5485,6 +5488,7 @@ selectorAffix."cyrl/ka" = "symmetricConnected"
54855488
selectorAffix."cyrl/kaDescender" = "symmetricConnected"
54865489
selectorAffix."cyrl/kaVBar" = "symmetricConnectedVB"
54875490
selectorAffix."cyrl/kaHook" = "symmetricConnectedKH"
5491+
selectorAffix."cyrl/kaBashkir" = "symmetricConnected"
54885492

54895493
[prime.cyrl-ka.variants-buildup.stages.serifs.serifless]
54905494
rank = 1
@@ -5494,6 +5498,7 @@ selectorAffix."cyrl/ka" = "serifless"
54945498
selectorAffix."cyrl/kaDescender" = "serifless"
54955499
selectorAffix."cyrl/kaVBar" = "serifless"
54965500
selectorAffix."cyrl/kaHook" = "serifless"
5501+
selectorAffix."cyrl/kaBashkir" = "serifless"
54975502

54985503
[prime.cyrl-ka.variants-buildup.stages.serifs.top-left-serifed]
54995504
rank = 2
@@ -5502,6 +5507,7 @@ selectorAffix."cyrl/ka" = "topLeftSerifed"
55025507
selectorAffix."cyrl/kaDescender" = "topLeftSerifed"
55035508
selectorAffix."cyrl/kaVBar" = "topLeftSerifed"
55045509
selectorAffix."cyrl/kaHook" = "topLeftSerifed"
5510+
selectorAffix."cyrl/kaBashkir" = "serifless"
55055511

55065512
[prime.cyrl-ka.variants-buildup.stages.serifs.bottom-right-serifed]
55075513
rank = 3
@@ -5510,6 +5516,7 @@ selectorAffix."cyrl/ka" = "bottomRightSerifed"
55105516
selectorAffix."cyrl/kaDescender" = "serifless"
55115517
selectorAffix."cyrl/kaVBar" = "bottomRightSerifed"
55125518
selectorAffix."cyrl/kaHook" = "serifless"
5519+
selectorAffix."cyrl/kaBashkir" = "bottomRightSerifed"
55135520

55145521
[prime.cyrl-ka.variants-buildup.stages.serifs.top-left-and-bottom-right-serifed]
55155522
rank = 4
@@ -5518,14 +5525,16 @@ selectorAffix."cyrl/ka" = "topLeftAndBottomRightSerifed"
55185525
selectorAffix."cyrl/kaDescender" = "topLeftSerifed"
55195526
selectorAffix."cyrl/kaVBar" = "topLeftAndBottomRightSerifed"
55205527
selectorAffix."cyrl/kaHook" = "topLeftSerifed"
5528+
selectorAffix."cyrl/kaBashkir" = "bottomRightSerifed"
55215529

55225530
[prime.cyrl-ka.variants-buildup.stages.serifs.serifed]
55235531
rank = 5
55245532
descriptionAffix = "serifs"
55255533
selectorAffix."cyrl/ka" = "serifed"
55265534
selectorAffix."cyrl/kaDescender" = "serifed"
55275535
selectorAffix."cyrl/kaVBar" = "serifed"
5528-
selectorAffix."cyrl/kaHook" = "serifedKH"
5536+
selectorAffix."cyrl/kaHook" = "serifed"
5537+
selectorAffix."cyrl/kaBashkir" = "serifed"
55295538

55305539

55315540

0 commit comments

Comments
 (0)