Add hook-inward-serifed variants for a (#2085).

This commit is contained in:
be5invis 2023-11-11 15:27:11 -08:00
parent 4117995b5c
commit 783ba78f62
6 changed files with 107 additions and 46 deletions

View file

@ -0,0 +1 @@
* Add hook-inward-serifed variants for `a` (#2085).

View file

@ -126,13 +126,13 @@ glyph-block Letter-Cyrillic-Iotified-A : begin
do "iotified a" do "iotified a"
glyph-block-import Letter-Latin-Lower-A : DoubleStorey DoubleStoreyConfig SingleStorey SingleStoreyConfig glyph-block-import Letter-Latin-Lower-A : DoubleStorey DoubleStoreyConfig SingleStorey SingleStoreyConfig
foreach { suffix { body xTrailing } } [Object.entries DoubleStoreyConfig] : do foreach { suffix { body xTrailing hookStyle } } [Object.entries DoubleStoreyConfig] : do
create-glyph "cyrl/aIotified.\(suffix)" : glyph-proc create-glyph "cyrl/aIotified.\(suffix)" : glyph-proc
define df : include : DivFrame para.diversityM 3 define df : include : DivFrame para.diversityM 3
include : df.markSet.e include : df.markSet.e
local { subDf shift } : SubDfAndShift 1 df local { subDf shift } : SubDfAndShift 1 df
include : with-transform [ApparentTranslate shift 0] [body subDf df.mvs] include : with-transform [ApparentTranslate shift 0] [body subDf hookStyle df.mvs]
include : difference include : difference
Iotified.full df XH [mix df.leftSB df.rightSB (3 / 4)] (XH / 2) Iotified.full df XH [mix df.leftSB df.rightSB (3 / 4)] (XH / 2)

View file

@ -18,32 +18,37 @@ glyph-block Letter-Latin-Lower-AE-OE : begin
return { subDf shift } return { subDf shift }
do "a subglyphs" do "a subglyphs"
define [AAShape pShift df body o] : begin define [AAShape body hookStyle pShift df o] : begin
local { subDf shift } : SubDfAndShift pShift df o local { subDf shift } : SubDfAndShift pShift df o
return : with-transform [ApparentTranslate shift 0] [body subDf df.mvs] return : with-transform [ApparentTranslate shift 0] [body subDf hookStyle df.mvs]
glyph-block-import Letter-Latin-Lower-A : DoubleStorey glyph-block-import Letter-Latin-Lower-A : DoubleStorey
define DoubleStoreyConfig : object define DoubleStoreyConfig : object
doubleStoreySerifless { DoubleStorey.Serifless } doubleStoreySerifless { DoubleStorey.Serifless 1 }
doubleStoreySerifed { DoubleStorey.Serifed } doubleStoreySerifed { DoubleStorey.Serifed 1 }
doubleStoreyTailed { DoubleStorey.Tailed } doubleStoreyTailed { DoubleStorey.Tailed 1 }
doubleStoreyToothlessCorner { DoubleStorey.ToothlessCorner } doubleStoreyToothlessCorner { DoubleStorey.ToothlessCorner 1 }
doubleStoreyToothlessRounded { DoubleStorey.ToothlessRounded } doubleStoreyToothlessRounded { DoubleStorey.ToothlessRounded 1 }
doubleStoreyHookInwardSerifedSerifless { DoubleStorey.Serifless 2 }
doubleStoreyHookInwardSerifedSerifed { DoubleStorey.Serifed 2 }
doubleStoreyHookInwardSerifedTailed { DoubleStorey.Tailed 2 }
doubleStoreyHookInwardSerifedToothlessCorner { DoubleStorey.ToothlessCorner 2 }
doubleStoreyHookInwardSerifedToothlessRounded { DoubleStorey.ToothlessRounded 2 }
create-glyph "ae/a" : glyph-proc foreach { suffix { bodyR hookStyle } } [Object.entries DoubleStoreyConfig] : do
local df : include : DivFrame para.diversityM 3
include : df.markSet.e
set-base-anchor 'cvDecompose' 0 0
include : AAShape 0 df DoubleStorey.ToothlessRounded 0
foreach { suffix { bodyR } } [Object.entries DoubleStoreyConfig] : do create-glyph "ae/a.\(suffix)" : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.e
set-base-anchor 'cvDecompose' 0 0
include : AAShape DoubleStorey.ToothlessRounded hookStyle 0 df 0
create-glyph "aa.\(suffix)" : glyph-proc create-glyph "aa.\(suffix)" : glyph-proc
local df : include : DivFrame para.diversityM 3 local df : include : DivFrame para.diversityM 3
include : df.markSet.e include : df.markSet.e
local [left] : AAShape 0 df DoubleStorey.ToothlessRounded local [left] : AAShape DoubleStorey.ToothlessRounded hookStyle 0 df
local [right] : AAShape 1 df bodyR local [right] : AAShape bodyR hookStyle 1 df
include : difference [right] : intersection include : difference [right] : intersection
MaskAbove (XH * OverlayPos * 1.02) MaskAbove (XH * OverlayPos * 1.02)
union union
@ -51,6 +56,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin
with-transform [ApparentTranslate (-0.50 * df.mvs) 0] [left] with-transform [ApparentTranslate (-0.50 * df.mvs) 0] [left]
with-transform [ApparentTranslate (-0.75 * df.mvs) 0] [left] with-transform [ApparentTranslate (-0.75 * df.mvs) 0] [left]
with-transform [ApparentTranslate (-1.00 * df.mvs) 0] [left] with-transform [ApparentTranslate (-1.00 * df.mvs) 0] [left]
include : difference [left] : intersection include : difference [left] : intersection
MaskBelow (XH * OverlayPos * 1.02) MaskBelow (XH * OverlayPos * 1.02)
union union
@ -251,6 +257,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin
select-variant "aa" 0xA733 (follow -- 'a/turnABase') select-variant "aa" 0xA733 (follow -- 'a/turnABase')
select-variant "ae/a"
select-variant "ae/e" (follow -- 'e') select-variant "ae/e" (follow -- 'e')
select-variant "aeInvE/right" (follow -- 'e') select-variant "aeInvE/right" (follow -- 'e')
select-variant "ue/u" select-variant "ue/u"

View file

@ -10,7 +10,7 @@ glyph-block Letter-Latin-Lower-A : begin
glyph-block-import Common-Derivatives glyph-block-import Common-Derivatives
glyph-block-import Mark-Shared-Metrics : markHalfStroke glyph-block-import Mark-Shared-Metrics : markHalfStroke
glyph-block-import Letter-Shared : CreateAccentedComposition CreateOgonekComposition glyph-block-import Letter-Shared : CreateAccentedComposition CreateOgonekComposition
glyph-block-import Letter-Shared-Shapes : SerifFrame OBarLeft OBarRight glyph-block-import Letter-Shared-Shapes : SerifFrame OBarLeft OBarRight ArcStartSerif
glyph-block-import Letter-Shared-Shapes : RightwardTailedBar InvRightwardTailedBar glyph-block-import Letter-Shared-Shapes : RightwardTailedBar InvRightwardTailedBar
glyph-block-import Letter-Shared-Shapes : DToothlessRise DMBlend RetroflexHook glyph-block-import Letter-Shared-Shapes : DToothlessRise DMBlend RetroflexHook
@ -24,20 +24,30 @@ glyph-block Letter-Latin-Lower-A : begin
local sw : ADoubleStoreyStroke df local sw : ADoubleStoreyStroke df
return : df.archDepthB (ArchDepth * [StrokeWidthBlend 0.9 0.81 sw]) sw return : df.archDepthB (ArchDepth * [StrokeWidthBlend 0.9 0.81 sw]) sw
define [ADoubleStoreyHookAndBarT df sink y0 stroke] : begin define [ADoubleStoreyHookAndBarT sink df hookStyle y0 stroke] : begin
local isMask : sink == spiro-outline local isMask : sink == spiro-outline
return : sink return : sink
widths.rhs stroke widths.rhs stroke
g4 df.leftSB (XH - AHook) match hookStyle
hookstart (XH - O) (sw -- stroke) 1 : list
g4 df.leftSB (XH - AHook)
hookstart (XH - O) (sw -- stroke)
2 : list
g4 df.leftSB (XH - DToothlessRise)
g4 (df.middle - CorrectionOMidX * stroke) (XH - O)
flat df.rightSB (XH - [ADoubleStoreySmoothB df]) flat df.rightSB (XH - [ADoubleStoreySmoothB df])
[if isMask corner curl] df.rightSB y0 [heading Downward] [if isMask corner curl] df.rightSB y0 [heading Downward]
if [not isMask] {} {[corner df.leftSB y0]} if [not isMask] {} {[corner df.leftSB y0]}
export : define [HookAndBar df y0 _stroke] : ADoubleStoreyHookAndBarT df dispiro y0 export : define [HookAndBar df hookStyle y0 _stroke] : glyph-proc
fallback _stroke [ADoubleStoreyStroke df] if ((hookStyle != 1) && (hookStyle != 2)) : throw : new Error "Invalid hookStyle"
export : define [HookAndBarMask df y0 _stroke] : ADoubleStoreyHookAndBarT df spiro-outline y0 local sw : fallback _stroke [ADoubleStoreyStroke df]
fallback _stroke [ADoubleStoreyStroke df] include : ADoubleStoreyHookAndBarT dispiro df hookStyle y0 sw
if (hookStyle == 2) : include : ArcStartSerif.L df.leftSB (XH - DToothlessRise) sw AHook
export : define [HookAndBarMask df hookStyle y0 _stroke] : begin
local sw : fallback _stroke [ADoubleStoreyStroke df]
return : ADoubleStoreyHookAndBarT spiro-outline df hookStyle y0 sw
define [ADoubleStoreyArcT df sink kind rise stroke] : glyph-proc define [ADoubleStoreyArcT df sink kind rise stroke] : glyph-proc
local isMask : sink == spiro-outline local isMask : sink == spiro-outline
@ -76,21 +86,21 @@ glyph-block Letter-Latin-Lower-A : begin
export : define [ArcMask df kind rise _sw] : ADoubleStoreyArcT df spiro-outline kind rise export : define [ArcMask df kind rise _sw] : ADoubleStoreyArcT df spiro-outline kind rise
fallback _sw [ADoubleStoreyStroke df] fallback _sw [ADoubleStoreyStroke df]
export : define [Serifless df sw] : union export : define [Serifless df hookStyle sw] : union
HookAndBar df 0 sw HookAndBar df hookStyle 0 sw
Arc df 0 nothing nothing sw Arc df 0 nothing nothing sw
export : define [Serifed df sw] : union export : define [Serifed df hookStyle sw] : union
Serifless df sw Serifless df hookStyle sw
begin [SerifFrame.fromDf df XH 0].rb.outer begin [SerifFrame.fromDf df XH 0].rb.outer
export : define [Tailed df sw] : union export : define [Tailed df hookStyle sw] : union
HookAndBar df (XH - [ADoubleStoreySmoothB df] + O) sw HookAndBar df hookStyle (XH - [ADoubleStoreySmoothB df] + O) sw
Arc df 0 nothing nothing sw Arc df 0 nothing nothing sw
RightwardTailedBar df.rightSB 0 (XH - [ADoubleStoreySmoothB df]) (sw -- [fallback sw : ADoubleStoreyStroke df]) RightwardTailedBar df.rightSB 0 (XH - [ADoubleStoreySmoothB df]) (sw -- [fallback sw : ADoubleStoreyStroke df])
export : define [ToothlessCorner df sw] : union export : define [ToothlessCorner df hookStyle sw] : union
HookAndBar df DToothlessRise sw HookAndBar df hookStyle DToothlessRise sw
Arc df 1 DToothlessRise sw Arc df 1 DToothlessRise sw
export : define [ToothlessRounded df sw] : union export : define [ToothlessRounded df hookStyle sw] : union
HookAndBar df [ADoubleStoreySmoothA df] sw HookAndBar df hookStyle [ADoubleStoreySmoothA df] sw
Arc df 2 [ADoubleStoreySmoothA df] sw Arc df 2 [ADoubleStoreySmoothA df] sw
export : define [GetMask shapeFn df sw] : match shapeFn export : define [GetMask shapeFn df sw] : match shapeFn
@ -99,27 +109,32 @@ glyph-block Letter-Latin-Lower-A : begin
__ : ArcMask df 0 nothing nothing sw __ : ArcMask df 0 nothing nothing sw
define DoubleStoreyConfig : object define DoubleStoreyConfig : object
doubleStoreySerifless { DoubleStorey.Serifless (RightSB ) } doubleStoreySerifless { DoubleStorey.Serifless (RightSB ) 1 }
doubleStoreySerifed { DoubleStorey.Serifed (RightSB + SideJut) } doubleStoreySerifed { DoubleStorey.Serifed (RightSB + SideJut) 1 }
doubleStoreyTailed { DoubleStorey.Tailed (RightSB + SideJut) } doubleStoreyTailed { DoubleStorey.Tailed (RightSB + SideJut) 1 }
doubleStoreyToothlessCorner { DoubleStorey.ToothlessCorner nothing } doubleStoreyToothlessCorner { DoubleStorey.ToothlessCorner nothing 1 }
doubleStoreyToothlessRounded { DoubleStorey.ToothlessRounded nothing } doubleStoreyToothlessRounded { DoubleStorey.ToothlessRounded nothing 1 }
doubleStoreyHookInwardSerifedSerifless { DoubleStorey.Serifless (RightSB ) 2 }
doubleStoreyHookInwardSerifedSerifed { DoubleStorey.Serifed (RightSB + SideJut) 2 }
doubleStoreyHookInwardSerifedTailed { DoubleStorey.Tailed (RightSB + SideJut) 2 }
doubleStoreyHookInwardSerifedToothlessCorner { DoubleStorey.ToothlessCorner nothing 2 }
doubleStoreyHookInwardSerifedToothlessRounded { DoubleStorey.ToothlessRounded nothing 2 }
foreach { suffix { body xTrailing } } [Object.entries DoubleStoreyConfig] : do foreach { suffix { body xTrailing hookStyle } } [Object.entries DoubleStoreyConfig] : do
create-glyph "a.\(suffix)" : glyph-proc create-glyph "a.\(suffix)" : glyph-proc
local df : include : DivFrame 1 local df : include : DivFrame 1
include : df.markSet.e include : df.markSet.e
if xTrailing : set-base-anchor 'trailing' xTrailing 0 if xTrailing : set-base-anchor 'trailing' xTrailing 0
include : body df include : body df hookStyle
glyph-block-import Letter-Blackboard : BBS BBD glyph-block-import Letter-Blackboard : BBS BBD
create-glyph 'mathbb/a' 0x1D552 : glyph-proc create-glyph 'mathbb/a' 0x1D552 : glyph-proc
local df : include : DivFrame 1 local df : include : DivFrame 1
include : df.markSet.e include : df.markSet.e
include : DoubleStorey.HookAndBar df 0 BBS include : DoubleStorey.HookAndBar df 1 0 BBS
include : intersection include : intersection
DoubleStorey.HookAndBarMask df 0 DoubleStorey.HookAndBarMask df 1 0
VBar.r (RightSB - BBD) 0 XH BBS VBar.r (RightSB - BBD) 0 XH BBS
include : difference include : difference
union union

View file

@ -32,7 +32,7 @@ export class BiKnotCollector {
this.controls.push(c); this.controls.push(c);
this.needsUnwrap = true; this.needsUnwrap = true;
} else { } else {
throw new Error("Invalid spiro control type"); throw new Error("Invalid spiro control type " + String(c));
} }
} }
unwrap() { unwrap() {

View file

@ -1505,9 +1505,10 @@ descriptionLeader = "`a`"
[prime.a.variants-buildup.stages.storey.double-storey] [prime.a.variants-buildup.stages.storey.double-storey]
rank = 1 rank = 1
next = "terminal" next = "double-storey-hook"
descriptionAffix = "double-storey body" descriptionAffix = "double-storey body"
selectorAffix.a = "doubleStorey" selectorAffix.a = "doubleStorey"
selectorAffix."ae/a" = "doubleStorey"
selectorAffix."a/sansSerif" = "doubleStorey" selectorAffix."a/sansSerif" = "doubleStorey"
selectorAffix."a/rtailBase" = "doubleStorey" selectorAffix."a/rtailBase" = "doubleStorey"
selectorAffix."a/turnABase" = "doubleStorey" selectorAffix."a/turnABase" = "doubleStorey"
@ -1519,12 +1520,41 @@ rank = 2
next = "ear" next = "ear"
descriptionAffix = "single-storey body" descriptionAffix = "single-storey body"
selectorAffix.a = "singleStorey" selectorAffix.a = "singleStorey"
selectorAffix."ae/a" = "doubleStorey"
selectorAffix."a/sansSerif" = "singleStorey" selectorAffix."a/sansSerif" = "singleStorey"
selectorAffix."a/rtailBase" = "singleStorey" selectorAffix."a/rtailBase" = "singleStorey"
selectorAffix."a/turnABase" = "doubleStorey" selectorAffix."a/turnABase" = "doubleStorey"
selectorAffix."a/single" = "singleStorey" selectorAffix."a/single" = "singleStorey"
selectorAffix.scripta = "singleStorey" selectorAffix.scripta = "singleStorey"
[prime.a.variants-buildup.stages.double-storey-hook."*"]
next = "terminal"
[prime.a.variants-buildup.stages.double-storey-hook.hook-serifless]
rank = 1
keyAffix = ""
descriptionAffix = "serifless hook"
selectorAffix.a = ""
selectorAffix."ae/a" = ""
selectorAffix."a/sansSerif" = ""
selectorAffix."a/rtailBase" = ""
selectorAffix."a/turnABase" = ""
selectorAffix."a/single" = ""
selectorAffix.scripta = ""
[prime.a.variants-buildup.stages.double-storey-hook.hook-serifed]
rank = 2
nonBreakingVariantAdditionPriority = 100
keyAffix = "hook-inward-serifed"
descriptionAffix = "serifed hook"
selectorAffix.a = "hookInwardSerifed"
selectorAffix."ae/a" = "hookInwardSerifed"
selectorAffix."a/sansSerif" = "hookInwardSerifed"
selectorAffix."a/rtailBase" = "hookInwardSerifed"
selectorAffix."a/turnABase" = "hookInwardSerifed"
selectorAffix."a/single" = ""
selectorAffix.scripta = ""
[prime.a.variants-buildup.stages.ear."*"] [prime.a.variants-buildup.stages.ear."*"]
next = "terminal" next = "terminal"
@ -1532,6 +1562,7 @@ next = "terminal"
rank = 1 rank = 1
keyAffix = "" keyAffix = ""
selectorAffix.a = "" selectorAffix.a = ""
selectorAffix."ae/a" = ""
selectorAffix."a/sansSerif" = "" selectorAffix."a/sansSerif" = ""
selectorAffix."a/rtailBase" = "" selectorAffix."a/rtailBase" = ""
selectorAffix."a/turnABase" = "" selectorAffix."a/turnABase" = ""
@ -1542,6 +1573,7 @@ selectorAffix.scripta = ""
rank = 2 rank = 2
descriptionAffix = "earless (cornered top-right)" descriptionAffix = "earless (cornered top-right)"
selectorAffix.a = "earlessCorner" selectorAffix.a = "earlessCorner"
selectorAffix."ae/a" = ""
selectorAffix."a/sansSerif" = "earlessCorner" selectorAffix."a/sansSerif" = "earlessCorner"
selectorAffix."a/rtailBase" = "earlessCorner" selectorAffix."a/rtailBase" = "earlessCorner"
selectorAffix."a/turnABase" = "" selectorAffix."a/turnABase" = ""
@ -1552,6 +1584,7 @@ selectorAffix.scripta = ""
rank = 3 rank = 3
descriptionAffix = "earless (rounded top-right)" descriptionAffix = "earless (rounded top-right)"
selectorAffix.a = "earlessRounded" selectorAffix.a = "earlessRounded"
selectorAffix."ae/a" = ""
selectorAffix."a/sansSerif" = "earlessRounded" selectorAffix."a/sansSerif" = "earlessRounded"
selectorAffix."a/rtailBase" = "earlessRounded" selectorAffix."a/rtailBase" = "earlessRounded"
selectorAffix."a/turnABase" = "" selectorAffix."a/turnABase" = ""
@ -1563,6 +1596,7 @@ rank = 1
descriptionAffix = "serif at terminal" descriptionAffix = "serif at terminal"
descriptionJoiner = "without" descriptionJoiner = "without"
selectorAffix.a = "serifless" selectorAffix.a = "serifless"
selectorAffix."ae/a" = "serifless"
selectorAffix."a/sansSerif" = "serifless" selectorAffix."a/sansSerif" = "serifless"
selectorAffix."a/rtailBase" = "serifless" selectorAffix."a/rtailBase" = "serifless"
selectorAffix."a/turnABase" = "serifless" selectorAffix."a/turnABase" = "serifless"
@ -1573,6 +1607,7 @@ selectorAffix.scripta = "serifless"
rank = 2 rank = 2
descriptionAffix = "curly tail" descriptionAffix = "curly tail"
selectorAffix.a = "tailed" selectorAffix.a = "tailed"
selectorAffix."ae/a" = "serifless"
selectorAffix."a/sansSerif" = "tailed" selectorAffix."a/sansSerif" = "tailed"
selectorAffix."a/rtailBase" = "serifless" selectorAffix."a/rtailBase" = "serifless"
selectorAffix."a/turnABase" = "tailed" selectorAffix."a/turnABase" = "tailed"
@ -1584,6 +1619,7 @@ rank = 3
disableIf = [{ storey = "single-storey" }] disableIf = [{ storey = "single-storey" }]
descriptionAffix = "toothless (cornered bottom-right)" descriptionAffix = "toothless (cornered bottom-right)"
selectorAffix.a = "toothlessCorner" selectorAffix.a = "toothlessCorner"
selectorAffix."ae/a" = "serifless"
selectorAffix."a/sansSerif" = "toothlessCorner" selectorAffix."a/sansSerif" = "toothlessCorner"
selectorAffix."a/rtailBase" = "serifless" selectorAffix."a/rtailBase" = "serifless"
selectorAffix."a/turnABase" = "toothlessCorner" selectorAffix."a/turnABase" = "toothlessCorner"
@ -1595,6 +1631,7 @@ rank = 4
disableIf = [{ storey = "single-storey" }] disableIf = [{ storey = "single-storey" }]
descriptionAffix = "toothless (rounded bottom-right)" descriptionAffix = "toothless (rounded bottom-right)"
selectorAffix.a = "toothlessRounded" selectorAffix.a = "toothlessRounded"
selectorAffix."ae/a" = "serifless"
selectorAffix."a/sansSerif" = "toothlessRounded" selectorAffix."a/sansSerif" = "toothlessRounded"
selectorAffix."a/rtailBase" = "serifless" selectorAffix."a/rtailBase" = "serifless"
selectorAffix."a/turnABase" = "toothlessRounded" selectorAffix."a/turnABase" = "toothlessRounded"
@ -1605,6 +1642,7 @@ selectorAffix.scripta = "serifless"
rank = 5 rank = 5
descriptionAffix = "serif at terminal" descriptionAffix = "serif at terminal"
selectorAffix.a = "serifed" selectorAffix.a = "serifed"
selectorAffix."ae/a" = "serifless"
selectorAffix."a/sansSerif" = "serifless" selectorAffix."a/sansSerif" = "serifless"
selectorAffix."a/rtailBase" = "serifless" selectorAffix."a/rtailBase" = "serifless"
selectorAffix."a/turnABase" = "serifed" selectorAffix."a/turnABase" = "serifed"