Ancillary Ogonek fixes

This commit is contained in:
be5invis 2022-10-19 19:44:57 -07:00
parent 6e285a4c8e
commit 1e116ed291
7 changed files with 134 additions and 22 deletions

View file

@ -92,7 +92,7 @@ glyph-block Common-Derivatives : begin
DeriveMeshT { srcGid } AnyDerivingCv : function [gns gr] : begin
local gn gns.0
local gnDst : if [not gr] dstGid ".derive{\(dstGid)}{\(gn)}"
local gnDst : if [not gr] dstGid "\(dstGid)/derive{\(gn)}"
local unicodeDst : if [not gr] dstUnicode null
create-glyph gnDst unicodeDst : Fn gn gr
return gnDst
@ -102,7 +102,7 @@ glyph-block Common-Derivatives : begin
if [not : glyph-is-needed dstGid] : return nothing
DeriveMeshT gnSoruces AnyDerivingCv : function [gns gr] : begin
local gnDst : if [not gr] dstGid ".derive{\(dstGid)}{\[gns.join '}{']}"
local gnDst : if [not gr] dstGid "\(dstGid)/derive{\[gns.join '}{']}"
local unicodeDst : if [not gr] dstUnicode null
create-glyph gnDst unicodeDst : Fn gns gr
return gnDst

View file

@ -15,21 +15,24 @@ glyph-block Letter-Latin-Lower-J : begin
glyph-block-export FlatHookDotlessJShape
define [FlatHookDotlessJShape] : params [df dfHook top crossLeft barCenter serif] : glyph-proc
local terminal : crossLeft - OX * 2
local bar : barCenter + HalfStroke * HVContrast
local hd : FlatHookDepth dfHook
local terminal : Math.min
bar - hd.x - [Math.max (Stroke / 3) (df.width / 6)]
crossLeft - OX * 2
if serif : include : LeftwardTopSerif barCenter top (LongJut * df.div)
include : dispiro
widths.lhs
flat [Math.min terminal (bar - hd.x - [Math.max (Stroke / 3) (df.width / 6)])] Descender
flat terminal Descender
curl (bar - hd.x) Descender
archv.superness DesignParameters.tightHookSuperness
flat bar (Descender + hd.y)
curl bar top [heading Upward]
set-base-anchor 'above' barCenter top
set-base-anchor 'trailing' (bar - hd.x) Descender
set-base-anchor 'overlay' barCenter (top / 2)
define XMiddle : namespace
export : define [Straight df] : begin df.middle
export : define [Hooky df] : df.middle + [IBalance2 df]
@ -41,6 +44,7 @@ glyph-block Letter-Latin-Lower-J : begin
export : define [Regular df top xMiddle] : glyph-proc
local hookx : xMiddle - (Width * 0.5) - HalfStroke * HVContrast + OXHook
local turn : xMiddle - Width * 0.25 + CorrectionOMidS
set-base-anchor "below" [mix hookx xMiddle 0.5] Descender
include : dispiro
widths.rhs
flat (xMiddle + HalfStroke * HVContrast) top [heading Downward]
@ -50,13 +54,16 @@ glyph-block Letter-Latin-Lower-J : begin
export : define [Straight df top xMiddle] : glyph-proc
include : VBar xMiddle Descender top
set-base-anchor "below" xMiddle Descender
set-base-anchor "trailing" (xMiddle + HalfStroke * HVContrast) Descender
export : define [FlatHook df top xMiddle] : glyph-proc
local dfHook : DivFrame para.diversityI
local crossLeft : df.middle - (dfHook.middle - [mix 0 dfHook.leftSB : mix 1 dfHook.div 2])
set-width df.width
include : df.markSet.p
include : FlatHookDotlessJShape df dfHook top
crossLeft -- (df.middle - (dfHook.middle - [mix 0 dfHook.leftSB : mix 1 dfHook.div 2]))
crossLeft -- crossLeft
barCenter -- xMiddle
serif -- false
@ -66,6 +73,7 @@ glyph-block Letter-Latin-Lower-J : begin
widths.center
flat xMiddle top [heading Downward]
DiagonalTailL df xMiddle Descender [DiagonalTailStdDepth dfHook Stroke] Stroke
set-base-anchor "trailing" (xMiddle - HalfStroke * HVContrast) Descender
define Serifs : namespace
export : define [Long df top xMiddle] : LeftwardTopSerif xMiddle top (LongJut * df.div)

View file

@ -14,14 +14,25 @@ glyph-block Letter-Latin-Lower-N : begin
glyph-block-import Letter-Shared-Shapes : RightwardTailedBar DToothlessRise DMBlend
glyph-block-import Letter-Shared-Shapes : CyrDescender
define [AdjustTrailingAnchor] : glyph-proc
define trAnchor currentGlyph.baseAnchors.trailing
if trAnchor : set-base-anchor 'trailing' (trAnchor.x + SideJut) trAnchor.y
define [NTopLeftSerif top] : tagged 'serifLT' : LeftwardTopSerif SB top SideJut
define [NHTB top] : VBarLeft SB 0 top
define [NTopLeftSerifAuto top] : NeedSlab SLAB : LeftwardTopSerif SB top SideJut
define [NBottomLeftSerifAuto y] : NeedSlab SLAB : NeedNotItalic
tagged 'serifLB' : CenterBottomSerif (SB + HalfStroke * HVContrast) y Jut
define [NBottomRightSerifAuto y] : NeedSlab SLAB : if (para.isItalic) [NBottomRightSerifItalic y]
tagged 'serifRB' : CenterBottomSerif (RightSB - HalfStroke * HVContrast) y Jut
define [NBottomRightSerifItalic y] : tagged 'serifRB' : RightwardBottomSerif RightSB y SideJut
define [NBottomRightSerifAuto y] : NeedSlab SLAB : if (para.isItalic)
then : NBottomRightSerifItalic y
else : NBottomRightSerifUpright y
define [NBottomRightSerifUpright y] : glyph-proc
include : tagged 'serifRB' : CenterBottomSerif (RightSB - HalfStroke * HVContrast) y Jut
include : AdjustTrailingAnchor
define [NBottomRightSerifItalic y] : glyph-proc
include : tagged 'serifRB' : RightwardBottomSerif RightSB y SideJut
include : AdjustTrailingAnchor
define [EaredBody top left right yBR sw] : glyph-proc
include : VBarLeft left 0 top sw
@ -56,6 +67,7 @@ glyph-block Letter-Latin-Lower-N : begin
define [EndingTail right yBot yBR sw] : glyph-proc
include : RightwardTailedBar right yBot yBR sw
include : AdjustTrailingAnchor
define NConfig : object
'straight' { EaredBody 0 NTopLeftSerifAuto NBottomLeftSerifAuto NBottomRightSerifAuto }
@ -75,7 +87,7 @@ glyph-block Letter-Latin-Lower-N : begin
foreach { suffix { Body tailed sLT sLB sRB } } [Object.entries NConfig] : do
create-glyph "n.\(suffix)" : glyph-proc
include : MarkSet.e
set-base-anchor 'trailing' (RightSB - markHalfStroke) 0
set-base-anchor 'trailing' RightSB 0
include : Body XH SB RightSB [if tailed (XH - SmallArchDepthB + O) 0] Stroke
if tailed : include : EndingTail RightSB 0 (XH - SmallArchDepthB) Stroke
if sLT : include : sLT XH

View file

@ -9,6 +9,8 @@ glyph-block Letter-Latin-Lower-Y : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared : CreateAccentedComposition
glyph-block-import Mark-Shared-Metrics : markExtend markStroke markStress markFine
glyph-block-import Mark-Above : aboveMarkTop aboveMarkBot aboveMarkMid aboveMarkStack
glyph-block-import Mark-Below : belowMarkStack
glyph-block-import Letter-Shared-Shapes : nShoulder FlatHookDepth SerifFrame
@ -62,21 +64,38 @@ glyph-block Letter-Latin-Lower-Y : begin
curl x (top - ds) [widths.heading hl hr Downward]
quadControls 0 dpy1 16
define [yBaseKnots top bottom shrink hooktop] : begin
local {ds ds2} : CalcDS top bottom
define [yBaseKnots top bottom shrink hooktop ogonek] : begin
define {ds ds2} : CalcDS top bottom
define coJoinX : mix yrstrokel yrstroker px1
define coJoinY : mix (bottom + ds2) (top - ds) py1
define joinX : mix yrstrokel yrstroker (1 - px2)
define joinY : mix (bottom + ds2) (top - ds) (1 - py2)
define [ConnectZ shrink] : curl joinX joinY [widths.rhs : Stroke * shrink]
define [ogonekKnots] : begin
local stopX : mix joinX coJoinX ((0 - joinY) / (coJoinY - joinY))
local stopY 0
local depth : 0 - Descender - markStroke
local extL : (0.5 * 0.75 * depth / coJoinY) * depth + 0.25 * markStress
local extR : Math.max (0.5 * markExtend) (1.5 * TanSlope * markStroke)
local turnSlope : 0.5 * ((markStroke - Stroke) / markStroke - (ArchDepthB - ArchDepth) / ArchDepth)
list
curl stopX stopY [widths.rhs : Stroke * [if useStraightBottom shrink 1]]
g4.down.mid (stopX - extL) (stopY - 0.75 * depth) [widths.rhs.heading [mix Stroke markStroke 0.25] {.x HVContrast .y (-turnSlope)}]
arcvh [widths.rhs markStroke]
g4 (stopX + [mix (-extL) extR (11/16)]) (stopY - depth + O) [heading Rightward]
g4 (stopX + extR) (stopY - depth + 0.5 * O) [heading Rightward]
return : list
if (straightBar && (! hooktop))
then : list
else : list
flat
mix yrstrokel yrstroker px1
mix (bottom + ds2) (top - ds) py1
else : list [flat coJoinX coJoinY]
piecewise
ogonek : ogonekKnots
useStraightBottom : list
ConnectZ shrink
curl [mix yrstroker joinX ((top - bottom) / (top - joinY))] bottom [widths.heading 0 (Stroke * [yDiagCor (top - bottom)]) Downward]
@ -164,6 +183,35 @@ glyph-block Letter-Latin-Lower-Y : begin
if doSlabBottom : include : yBaseSerif top bottom
if doSlabMotion : include : LeftwardTopSerif SB top SideJut
define [SmallYOgonekShape top bottom] : glyph-proc
local {ds ds2} : CalcDS top bottom
include : intersection
union
SmallYStrokeSplitMask top bottom false 1
MaskBelow 0
dispiro
yTopKnots yrstroker top bottom ds 1
yBaseKnots top bottom 1 false true
include : difference
dispiro
yTopKnots yrstroker top bottom ds 1
yBaseKnots top bottom yshrink false true
SmallYStrokeSplitMask top bottom false 1 1
MaskBelow 0
include : difference
dispiro
yTopKnots (Width - yrstroker) top bottom ds (-1)
yJoinKnots ds ds2 top bottom
SmallYStrokeSplitMask top bottom false (-1)
Rect (bottom + HalfStroke) (bottom - top) 0 Width
if doSlabTop : include : let [sf : SerifFrame top bottom SB RightSB]
composite-proc sf.lt.full sf.rt.full
if doSlabMotion : include : LeftwardTopSerif SB top SideJut
define [SmallYHookTopShape top bottom] : glyph-proc
local {ds ds2} : CalcDS top bottom
local joinHeight : yJoinHeight ds ds2 top bottom true
@ -200,7 +248,7 @@ glyph-block Letter-Latin-Lower-Y : begin
include : Scale 1 (-1)
include : Translate 0 (+[mix bottom top 0.5])
return : object SmallYShape SmallYHookTopShape SmallLambdaShape
return : object SmallYShape SmallYOgonekShape SmallYHookTopShape SmallLambdaShape
create-glyph : glyph-proc
include : MarkSet.p
@ -223,6 +271,19 @@ glyph-block Letter-Latin-Lower-Y : begin
create-forked-glyph 'y.curlyTurnMotionSerifed' : glyph-proc
include : [GenSmallYShape false true SLAB-MOTION].SmallYShape XH Descender
create-glyph : glyph-proc
include : MarkSet.p
set-base-anchor 'overlay' Middle (XH / 2)
set-base-anchor 'yBelowDot' (RightSB - 0.5 * DotRadius) (Descender + AccentStackOffset + DotRadius)
create-forked-glyph 'yOgonek.straight' : glyph-proc
include : [GenSmallYShape true false SLAB-AUTO].SmallYOgonekShape XH Descender
create-forked-glyph 'yOgonek.curly' : glyph-proc
include : [GenSmallYShape false false SLAB-AUTO].SmallYOgonekShape XH Descender
create-forked-glyph 'yOgonek.straightMotionSerifed' : glyph-proc
include : [GenSmallYShape true false SLAB-MOTION].SmallYOgonekShape XH Descender
create-forked-glyph 'yOgonek.curlyMotionSerifed' : glyph-proc
include : [GenSmallYShape false false SLAB-MOTION].SmallYOgonekShape XH Descender
define [SmallYCursiveArc top bottom] : new-glyph : glyph-proc
include : nShoulder
top -- top
@ -282,8 +343,25 @@ glyph-block Letter-Latin-Lower-Y : begin
include : LeftwardTopSerif SB XH SideJut
set-base-anchor 'overlay' Middle (XH / 2)
create-glyph 'yOgonek.cursive' : glyph-proc
include [refer-glyph 'y.cursive'] AS_BASE ALSO_METRICS
include [refer-glyph 'ogonekBelow']
create-glyph 'yOgonek.cursiveFlatHook' : glyph-proc
include [refer-glyph 'y.cursiveFlatHook'] AS_BASE ALSO_METRICS
include [refer-glyph 'ogonekBelow']
create-glyph 'yOgonek.cursiveMotionSerifed' : glyph-proc
include [refer-glyph 'y.cursiveMotionSerifed'] AS_BASE ALSO_METRICS
include [refer-glyph 'ogonekBelow']
create-glyph 'yOgonek.cursiveFlatHookMotionSerifed' : glyph-proc
include [refer-glyph 'y.cursiveFlatHookMotionSerifed'] AS_BASE ALSO_METRICS
include [refer-glyph 'ogonekBelow']
select-variant 'y' 'y'
link-reduced-variant 'y/sansSerif' 'y' MathSansSerif
select-variant 'yOgonek' 0xE011
alias 'cyrl/u' 0x443 'y'
foreach { suffix { DrawAt kdr } } [Object.entries DotVariants] : do

View file

@ -59,11 +59,13 @@ glyph-block Letter-Latin-Z : begin
corner RightSB (XH - Stroke)
corner (SB + Stroke * cor) [if (mode === MODE-ZSWASH) 0 Stroke]
if [DisplayBottomStroke mode] : include : tagged 'strokeBottom' : HBarBottom SB RightSB 0
set-base-anchor "trailing" RightSB 0
define [SmallZCurlyShape mode] : glyph-proc
include : tagged 'strokeTop' : HBarTop SB (RightSB - Stroke * HVContrast) XH
include : XStrand false SLAB SB 0 RightSB XH 0.125 0.4 0.36
if [DisplayBottomStroke mode] : include : tagged 'strokeBottom' : HBarBottom (SB + Stroke * HVContrast) RightSB 0
set-base-anchor "trailing" RightSB 0
define [ZCursiveShapeImpl top mode] : glyph-proc
define hookTerminalWidth : AdviceStroke 3.5
@ -144,6 +146,9 @@ glyph-block Letter-Latin-Z : begin
flat [mix (RightSB - xHookDepth) SB kBot] (kBot * yTailDepth)
curl SB (yTailDepth)
if (mode != MODE-RTAIL) : begin
set-base-anchor "trailing" (RightSB - 0.55 * xHookDepth) 0
define [ZCursiveShape mode] : ZCursiveShapeImpl CAP mode
define [SmallZCursiveShape mode] : ZCursiveShapeImpl XH mode

View file

@ -30,6 +30,8 @@ export : define markCompositionTf : object
'perispomeniAbove' 'dasiaPerispomeni'
'cyrlPsiliAbove' : object
'cyrlPokrytieAbove' 'cyrlPsiliPokrytieAbove'
'y' : object
'ogonekBelow' 'yOgonek'
export : define decompositionOverrides : object
# Latvians use comma instead of cedillas in several letters.
@ -159,8 +161,3 @@ export : define decompositionOverrides : object
."\uA7BB" "a\uE010"
."\uA7BD" "i\uE010"
."\uA7BF" "u\uE010"
# Suppress incorrect slashed arrows... so far
."\u219A" ""
."\u219B" ""
."\u21AE" ""

View file

@ -4270,6 +4270,7 @@ rank = 1
description = "Letter `y` that is fully straight"
selector.y = "straight"
selector."y/sansSerif" = "straight"
selector.yOgonek = "straight"
selector.yHookTop = "straight"
[prime.y.variants.straight-turn]
@ -4277,6 +4278,7 @@ rank = 2
description = "Letter `y` with straight upper and a tail turns leftward"
selector.y = "straightTurn"
selector."y/sansSerif" = "straightTurn"
selector.yOgonek = "straight"
selector.yHookTop = "straightTurn"
[prime.y.variants.curly]
@ -4284,6 +4286,7 @@ rank = 3
description = "More curly letter `y`, like Iosevka 2.x"
selector.y = "curly"
selector."y/sansSerif" = "curly"
selector.yOgonek = "curly"
selector.yHookTop = "curly"
[prime.y.variants.curly-turn]
@ -4291,6 +4294,7 @@ rank = 4
description = "More curly letter `y`, like Iosevka 2.x, with a tail turns leftward"
selector.y = "curlyTurn"
selector."y/sansSerif" = "curlyTurn"
selector.yOgonek = "curly"
selector.yHookTop = "curlyTurn"
[prime.y.variants.cursive]
@ -4298,6 +4302,7 @@ rank = 5
description = "Cursive-like `y`"
selector.y = "cursive"
selector."y/sansSerif" = "cursive"
selector.yOgonek = "cursive"
selector.yHookTop = "cursive"
[prime.y.variants.cursive-flat-hook]
@ -4305,6 +4310,7 @@ rank = 6
description = "Cursive-like `y` with flat terminal hook"
selector.y = "cursiveFlatHook"
selector."y/sansSerif" = "cursiveFlatHook"
selector.yOgonek = "cursiveFlatHook"
selector.yHookTop = "cursiveFlatHook"
[prime.y.variants.straight-motion-serifed]
@ -4312,6 +4318,7 @@ rank = 7
description = "Letter `y` that is fully straight, with motion serifs"
selector.y = "straightMotionSerifed"
selector."y/sansSerif" = "straight"
selector.yOgonek = "straightMotionSerifed"
selector.yHookTop = "straight"
[prime.y.variants.straight-turn-motion-serifed]
@ -4319,6 +4326,7 @@ rank = 8
description = "Letter `y` with straight upper and a tail turns leftward, and motion serifs"
selector.y = "straightTurnMotionSerifed"
selector."y/sansSerif" = "straightTurn"
selector.yOgonek = "straightMotionSerifed"
selector.yHookTop = "straightTurn"
[prime.y.variants.curly-motion-serifed]
@ -4326,6 +4334,7 @@ rank = 9
description = "More curly letter `y`, like Iosevka 2.x, with motion serifs"
selector.y = "curlyMotionSerifed"
selector."y/sansSerif" = "curly"
selector.yOgonek = "curlyMotionSerifed"
selector.yHookTop = "curly"
[prime.y.variants.curly-turn-motion-serifed]
@ -4333,6 +4342,7 @@ rank = 10
description = "More curly letter `y`, like Iosevka 2.x, with a tail turns leftward and motion serifs"
selector.y = "curlyTurnMotionSerifed"
selector."y/sansSerif" = "curlyTurn"
selector.yOgonek = "curlyMotionSerifed"
selector.yHookTop = "curlyTurn"
[prime.y.variants.cursive-motion-serifed]
@ -4340,6 +4350,7 @@ rank = 11
description = "Cursive-like `y`, with motion serifs"
selector.y = "cursiveMotionSerifed"
selector."y/sansSerif" = "cursive"
selector.yOgonek = "cursiveMotionSerifed"
selector.yHookTop = "cursive"
[prime.y.variants.cursive-flat-hook-motion-serifed]
@ -4347,6 +4358,7 @@ rank = 12
description = "Cursive-like `y` with flat terminal hook, and motion serifs"
selector.y = "cursiveFlatHookMotionSerifed"
selector."y/sansSerif" = "cursiveFlatHook"
selector.yOgonek = "cursiveFlatHookMotionSerifed"
selector.yHookTop = "cursiveFlatHook"