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

@ -126,13 +126,13 @@ glyph-block Letter-Cyrillic-Iotified-A : begin
do "iotified a"
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
define df : include : DivFrame para.diversityM 3
include : df.markSet.e
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
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 }
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
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
define DoubleStoreyConfig : object
doubleStoreySerifless { DoubleStorey.Serifless }
doubleStoreySerifed { DoubleStorey.Serifed }
doubleStoreyTailed { DoubleStorey.Tailed }
doubleStoreyToothlessCorner { DoubleStorey.ToothlessCorner }
doubleStoreyToothlessRounded { DoubleStorey.ToothlessRounded }
doubleStoreySerifless { DoubleStorey.Serifless 1 }
doubleStoreySerifed { DoubleStorey.Serifed 1 }
doubleStoreyTailed { DoubleStorey.Tailed 1 }
doubleStoreyToothlessCorner { DoubleStorey.ToothlessCorner 1 }
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
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 hookStyle } } [Object.entries DoubleStoreyConfig] : do
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
local df : include : DivFrame para.diversityM 3
include : df.markSet.e
local [left] : AAShape 0 df DoubleStorey.ToothlessRounded
local [right] : AAShape 1 df bodyR
local [left] : AAShape DoubleStorey.ToothlessRounded hookStyle 0 df
local [right] : AAShape bodyR hookStyle 1 df
include : difference [right] : intersection
MaskAbove (XH * OverlayPos * 1.02)
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.75 * df.mvs) 0] [left]
with-transform [ApparentTranslate (-1.00 * df.mvs) 0] [left]
include : difference [left] : intersection
MaskBelow (XH * OverlayPos * 1.02)
union
@ -251,6 +257,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin
select-variant "aa" 0xA733 (follow -- 'a/turnABase')
select-variant "ae/a"
select-variant "ae/e" (follow -- 'e')
select-variant "aeInvE/right" (follow -- 'e')
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 Mark-Shared-Metrics : markHalfStroke
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 : DToothlessRise DMBlend RetroflexHook
@ -24,20 +24,30 @@ glyph-block Letter-Latin-Lower-A : begin
local sw : ADoubleStoreyStroke df
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
return : sink
widths.rhs stroke
g4 df.leftSB (XH - AHook)
hookstart (XH - O) (sw -- stroke)
match hookStyle
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])
[if isMask corner curl] df.rightSB y0 [heading Downward]
if [not isMask] {} {[corner df.leftSB y0]}
export : define [HookAndBar df y0 _stroke] : ADoubleStoreyHookAndBarT df dispiro y0
fallback _stroke [ADoubleStoreyStroke df]
export : define [HookAndBarMask df y0 _stroke] : ADoubleStoreyHookAndBarT df spiro-outline y0
fallback _stroke [ADoubleStoreyStroke df]
export : define [HookAndBar df hookStyle y0 _stroke] : glyph-proc
if ((hookStyle != 1) && (hookStyle != 2)) : throw : new Error "Invalid hookStyle"
local sw : 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
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
fallback _sw [ADoubleStoreyStroke df]
export : define [Serifless df sw] : union
HookAndBar df 0 sw
export : define [Serifless df hookStyle sw] : union
HookAndBar df hookStyle 0 sw
Arc df 0 nothing nothing sw
export : define [Serifed df sw] : union
Serifless df sw
export : define [Serifed df hookStyle sw] : union
Serifless df hookStyle sw
begin [SerifFrame.fromDf df XH 0].rb.outer
export : define [Tailed df sw] : union
HookAndBar df (XH - [ADoubleStoreySmoothB df] + O) sw
export : define [Tailed df hookStyle sw] : union
HookAndBar df hookStyle (XH - [ADoubleStoreySmoothB df] + O) sw
Arc df 0 nothing nothing sw
RightwardTailedBar df.rightSB 0 (XH - [ADoubleStoreySmoothB df]) (sw -- [fallback sw : ADoubleStoreyStroke df])
export : define [ToothlessCorner df sw] : union
HookAndBar df DToothlessRise sw
export : define [ToothlessCorner df hookStyle sw] : union
HookAndBar df hookStyle DToothlessRise sw
Arc df 1 DToothlessRise sw
export : define [ToothlessRounded df sw] : union
HookAndBar df [ADoubleStoreySmoothA df] sw
export : define [ToothlessRounded df hookStyle sw] : union
HookAndBar df hookStyle [ADoubleStoreySmoothA df] sw
Arc df 2 [ADoubleStoreySmoothA df] sw
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
define DoubleStoreyConfig : object
doubleStoreySerifless { DoubleStorey.Serifless (RightSB ) }
doubleStoreySerifed { DoubleStorey.Serifed (RightSB + SideJut) }
doubleStoreyTailed { DoubleStorey.Tailed (RightSB + SideJut) }
doubleStoreyToothlessCorner { DoubleStorey.ToothlessCorner nothing }
doubleStoreyToothlessRounded { DoubleStorey.ToothlessRounded nothing }
doubleStoreySerifless { DoubleStorey.Serifless (RightSB ) 1 }
doubleStoreySerifed { DoubleStorey.Serifed (RightSB + SideJut) 1 }
doubleStoreyTailed { DoubleStorey.Tailed (RightSB + SideJut) 1 }
doubleStoreyToothlessCorner { DoubleStorey.ToothlessCorner nothing 1 }
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
local df : include : DivFrame 1
include : df.markSet.e
if xTrailing : set-base-anchor 'trailing' xTrailing 0
include : body df
include : body df hookStyle
glyph-block-import Letter-Blackboard : BBS BBD
create-glyph 'mathbb/a' 0x1D552 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.e
include : DoubleStorey.HookAndBar df 0 BBS
include : DoubleStorey.HookAndBar df 1 0 BBS
include : intersection
DoubleStorey.HookAndBarMask df 0
DoubleStorey.HookAndBarMask df 1 0
VBar.r (RightSB - BBD) 0 XH BBS
include : difference
union

View file

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