Shape fixes

This commit is contained in:
be5invis 2022-12-10 01:37:29 -08:00
parent a6111714f4
commit 72bd86d6dd
10 changed files with 81 additions and 60 deletions

View file

@ -323,7 +323,7 @@ glyph-block Autobuild-Transformed : begin
list 0x207C 'equal'
list 0x207D 'parenLeft'
list 0x207E 'parenRight'
list 0xA7F8 'smcpHbar'
list 0xA7F8 'smcpHStroke'
list 0xA7F9 'oe'
list 0xA702 'subst'
list 0xA703 'substBarNoRise'

View file

@ -416,29 +416,28 @@ glyph-block CommonShapes : begin
flat (x + r + TanSlope * (sw * DesignParameters.serifShiftX)) y [widths 0 sw]
curl (x - l + TanSlope * (sw * DesignParameters.serifShiftX)) y
define VJutSw : AdviceStroke 3.5
glyph-block-export DownwardRightSerif
define [DownwardRightSerif x y length sw] : glyph-proc
include : dispiro
widths.rhs [fallback sw VJutSw]
widths.rhs [fallback sw VJutStroke]
flat x y [heading Downward]
curl x (y - length) [heading Downward]
glyph-block-export UpwardRightSerif
define [UpwardRightSerif x y length sw] : glyph-proc
include : dispiro
widths.lhs [fallback sw VJutSw]
widths.lhs [fallback sw VJutStroke]
flat x y [heading Upward]
curl x (y + length) [heading Upward]
glyph-block-export DownwardLeftSerif
define [DownwardLeftSerif x y length sw] : glyph-proc
include : dispiro
widths.lhs [fallback sw VJutSw]
widths.lhs [fallback sw VJutStroke]
flat x y [heading Downward]
curl x (y - length) [heading Downward]
glyph-block-export UpwardLeftSerif
define [UpwardLeftSerif x y length sw] : glyph-proc
include : dispiro
widths.rhs [fallback sw VJutSw]
widths.rhs [fallback sw VJutStroke]
flat x y [heading Upward]
curl x (y + length) [heading Upward]

View file

@ -113,17 +113,18 @@ glyph-block Letter-Cyrillic-Yeri : begin
CenterTopSerif (right - stroke / 2 * HVContrast) top jut
define [CyrYerShape Yeri df top] : glyph-proc
local left : Math.max (df.rightSB - (RightSB - SB)) : if SLAB
local xLeftBarLeftEdge : Math.max (df.rightSB - (RightSB - SB)) : if SLAB
Just ([mix df.leftSB df.rightSB 0.35] - df.mvs / 2 * HVContrast)
Just [mix df.leftSB df.rightSB 0.2]
local barLeft : mix 0 df.leftSB [if SLAB 0.25 0.375]
local xTopBarLeftEnd : mix 0 df.leftSB [if SLAB 0.25 0.375]
include : Yeri top
left -- left
left -- xLeftBarLeftEdge
right -- df.rightSB - O * 2
stroke -- [AdviceStroke 2.5]
include : HBarTop barLeft (Stroke * 0.1 + left) top
include : HBarTop xTopBarLeftEnd (Stroke * 0.1 + xLeftBarLeftEdge) top
if SLAB : begin
include : DownwardLeftSerif barLeft top VJut (df.mvs / HVContrast)
include : DownwardLeftSerif xTopBarLeftEnd top VJut
Math.min (VJutStroke * df.mvs / Stroke) (0.625 * (xLeftBarLeftEdge - xTopBarLeftEnd))
define [CyrYeryShape Yeri df top fTail] : glyph-proc
local jut : Math.min Jut : [Math.pow (df.mvs / Stroke) 0.5] * Jut

View file

@ -314,10 +314,10 @@ glyph-block Letter-Latin-C : begin
CShapeOutline [DivFrame 1] XH 0 SmallArchDepthA SmallArchDepthB Hook BBS
VBarLeft (SB + BBD + OX) 0 CAP BBS
derive-glyphs 'currency/euroSign' 0x20AC 'C' : lambda [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
include : HOverlayBar [mix SB 0 0.7] [mix SB RightSB 0.7] (CAP * 0.4)
include : HOverlayBar [mix SB 0 0.7] [mix SB RightSB 0.7] (CAP * 0.6)
create-glyph 'currency/euroSign/overlay' : union
LetterBarOverlay.l SB (CAP * 0.4)
LetterBarOverlay.l SB (CAP * 0.6)
derive-composites 'currency/euroSign' 0x20AC 'C' 'currency/euroSign/overlay'
create-glyph 'currency/centSignBar.open' : glyph-proc
set-width 0
@ -398,13 +398,10 @@ glyph-block Letter-Latin-C : begin
derive-composites 'grek/dotLunateSmallSigma' 0x37C 'grek/lunateSmallSigma' 'grek/lunateSigmaDotSmall'
derive-composites 'grek/dotRevLunateSmallSigma' 0x37D 'grek/revLunateSmallSigma' 'grek/lunateSigmaDotSmall'
derive-glyphs 'Cbar' 0xA792 'C' : lambda [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
include : LetterBarOverlay.l.in SB 0 CAP 0.5
derive-glyphs 'cbar' 0xA793 'c' : lambda [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
include : LetterBarOverlay.l.in SB 0 XH 0.5
create-glyph 'CBarOverlay' : LetterBarOverlay.l.in SB 0 CAP 0.5
create-glyph 'cBarOverlay' : LetterBarOverlay.l.in SB 0 XH 0.5
derive-composites 'CBar' 0xA792 'C' 'CBarOverlay'
derive-composites 'cBar' 0xA793 'c' 'cBarOverlay'
derive-glyphs 'cyrl/E' 0x42D 'revC' : lambda [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS

View file

@ -80,6 +80,13 @@ glyph-block Letter-Latin-Upper-H : begin
local sf2 : SerifFrame XH 0 (df.middle - df.mvs * 0.5 * HVContrast) df.rightSB df.mvs
if (slabType === SLAB-ALL || slabType === SLAB-TAILED-CYRILLIC) : include sf2.rt.full
define [OverlayStrokeShape top slabType] : begin
local yb : top * HBarPos + HalfStroke
local yt : top - [if slabType Stroke 0]
return : HOverlayBar [mix SB 0 0.7] [mix RightSB Width 0.7]
mix yb yt 0.5
Math.min OverlayStroke (0.625 * (yt - yb))
define HConfig : object
serifless { HShape HTurned SLAB-NONE false }
tailed { TailedHShape HTurned SLAB-NONE false }
@ -152,6 +159,14 @@ glyph-block Letter-Latin-Upper-H : begin
eject-contour "serifLT"
include : LeftHook SB CAP
create-glyph "HStroke.\(suffix)" : glyph-proc
include [refer-glyph "H.\(suffix)"] AS_BASE ALSO_METRICS
include : OverlayStrokeShape CAP slabType
create-glyph "smcpHStroke.\(suffix)" : glyph-proc
include [refer-glyph "smcpH.\(suffix)"] AS_BASE ALSO_METRICS
include : OverlayStrokeShape XH slabType
select-variant 'H' 'H'
link-reduced-variant 'H/sansSerif' 'H' MathSansSerif
select-variant 'grek/Eta' 0x397 (follow -- 'H')
@ -180,6 +195,9 @@ glyph-block Letter-Latin-Upper-H : begin
select-variant 'Hwair' 0x1F6
select-variant 'HHookLeft' 0xA7AA
select-variant 'HStroke' 0x126 (follow -- 'H')
select-variant 'smcpHStroke' null (follow -- 'H')
create-glyph 'mathbb/H' 0x210D : glyph-proc
include : MarkSet.capital
include : VBarLeft SB 0 CAP BBS
@ -192,12 +210,6 @@ glyph-block Letter-Latin-Upper-H : begin
include : HBarBottom SB (SB + BBD) 0 BBS
include : HBarBottom (RightSB - BBD) RightSB 0 BBS
derive-composites 'Hbar' 0x126 'H'
HOverlayBar [mix SB 0 0.7] [mix RightSB Width 0.7] (CAP * 0.725)
derive-composites 'smcpHbar' null 'smcpH'
HOverlayBar [mix SB 0 0.7] [mix RightSB Width 0.7] (XH * 0.725)
derive-glyphs 'HCedilla' 0x1E28 'H' : lambda [src gr] : glyph-proc
include [refer-glyph 'cedillaBelow']
include : Translate (Width + SB - Middle + HalfStroke * HVContrast) 0

View file

@ -10,6 +10,7 @@ glyph-block Letter-Latin-Upper-P : begin
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared : SetGrekUpperTonos
glyph-block-import Letter-Shared-Metrics : BowlXDepth
glyph-block-import Letter-Shared-Shapes : LetterBarOverlay
glyph-block-import Letter-Blackboard : BBS BBD
glyph-block-export PShape PShapeOutline RevPShape PBarPosY PRotundaShape BBPShape
@ -184,9 +185,13 @@ glyph-block Letter-Latin-Upper-P : begin
flat [mix SB RightSB 0.5] (yBowl + XH * 0.25)
curl [mix SB RightSB 0.875] (yBowl - XH * 0.25)
derive-glyphs 'PBar' 0x2C63 'P' : lambda [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
include : HBar [mix 0 SB 0.3] [mix SB RightSB 0.5] (CAP * [mix PShape.BarPos 1 0.5] - Stroke * 0.25)
create-glyph 'PBar/overlay' : LetterBarOverlay.l.in
x -- (SB * PShape.defaultMul)
bot -- ([PBarPosY CAP Stroke PShape.BarPos] + Stroke)
top -- (CAP - Stroke)
py -- 0.5
space -- { 0 (RightSB - Stroke * HVContrast) }
derive-composites 'PBar' 0x2C63 'P' 'PBar/overlay'
define [BBPShape] : params [[mul PShape.defaultMul] [overshoot PShape.defaultOvershoot]] : glyph-proc
define sb : SB * mul

View file

@ -40,9 +40,12 @@ glyph-block Letter-Latin-Upper-Y : begin
include : VBar Middle bot (cross + HalfStroke)
set-base-anchor 'overlay' Middle cross
define [YenOverlayShape] : glyph-proc
include : HOverlayBar SB RightSB (CAP * 0.45)
include : HOverlayBar SB RightSB (CAP * 0.25)
define [YenOverlayShape slabType] : glyph-proc
define { ks bot } : match slabType
([Just SLAB-ALL] || [Just SLAB-BASE]) { 0.25 Stroke }
otherwise { 0 0 }
include : HOverlayBar SB RightSB ([mix bot [YCrossPos CAP 0] 0.5] - OverlayStroke * ks)
include : HOverlayBar SB RightSB [mix bot [YCrossPos CAP 0] 1.0]
define [YHookLeftHookedStroke top bot] : begin
local cross : YCrossPos top bot
@ -126,6 +129,10 @@ glyph-block Letter-Latin-Upper-Y : begin
include : HOverlayBar [mix 0 SB 0.5] [mix Width RightSB 0.5] [mix b t 0.5]
Math.min OverlayStroke ((t - b) * 0.625)
create-glyph "currency/yenSign.\(suffix)" : glyph-proc
include [refer-glyph "Y.\(suffix)"] AS_BASE ALSO_METRICS
include : YenOverlayShape slabType
select-variant 'Y' 'Y'
link-reduced-variant 'Y/sansSerif' 'Y' MathSansSerif
select-variant 'YHookTop' 0x1B3 (follow -- 'Y')
@ -137,9 +144,7 @@ glyph-block Letter-Latin-Upper-Y : begin
select-variant 'grek/Upsilon' 0x3A5 (follow -- 'Y')
link-reduced-variant 'grek/Upsilon/sansSerif' 'grek/Upsilon' MathSansSerif (follow -- 'Y/sansSerif')
alias 'cyrl/Ue' 0x4AE 'Y'
derive-glyphs 'currency/yenSign' 0xA5 'Y' : lambda [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
include : YenOverlayShape
select-variant 'currency/yenSign' 0xA5 (follow -- 'Y')
create-glyph 'YStrokeOverlay' : HOverlayBar ([mix 0 SB 0.5]) ([mix Width RightSB 0.5]) [mix 0 CAP 0.75]
derive-composites 'YStroke' 0x24E 'Y' 'YStrokeOverlay'

View file

@ -469,8 +469,6 @@ glyph-block Letter-Shared-Shapes : begin
alsoThruThem {{0.5 0.94}}
straight.left.end zbot.x (zbot.y + fine) [heading Leftward]
define VJutSw : AdviceStroke 3.5
glyph-block-export CyrDescender
define [CyrDescender] : params [x [connex 0.5] [overflow nothing]] : glyph-proc
local attachAnchor currentGlyph.baseAnchors.cyrlDescenderAttach
@ -479,12 +477,12 @@ glyph-block Letter-Shared-Shapes : begin
local attach : currentGlyph.gizmo.unapply attachAnchor
local descenderOverflow : fallback overflow SideJut
include : union
VBarRight attach.x (HalfStroke - LongJut) attach.y VJutSw
VBarRight attach.x (HalfStroke - LongJut) attach.y VJutStroke
HBarTop (attach.x - connex * Stroke * HVContrast) attach.x attach.y
: else : begin
local descenderOverflow : fallback overflow SideJut
include : union
VBarRight (x + descenderOverflow + 0.125 * Stroke) (HalfStroke - LongJut) Stroke VJutSw
VBarRight (x + descenderOverflow + 0.125 * Stroke) (HalfStroke - LongJut) Stroke VJutStroke
HBarTop (x - connex * Stroke * HVContrast) (x + descenderOverflow) Stroke
glyph-block-export CyrHookDescender
@ -495,12 +493,12 @@ glyph-block Letter-Shared-Shapes : begin
return : union
HBarTop (x - connex * Stroke * HVContrast) (x + descenderOverflow) Stroke
dispiro
widths.rhs VJutSw
widths.rhs VJutStroke
flat xRef Stroke [heading Downward]
curl xRef (hd.y - Hook - 0.25 * VJutSw) [heading Downward]
curl xRef (hd.y - Hook - 0.25 * VJutStroke) [heading Downward]
arcvh
flat (xRef - hd.x + 0.25 * VJutSw * HVContrast) (0 - Hook)
curl (xRef - HookX - 0.5 * VJutSw * HVContrast) (0 - Hook)
flat (xRef - hd.x + 0.25 * VJutStroke * HVContrast) (0 - Hook)
curl (xRef - HookX - 0.5 * VJutStroke * HVContrast) (0 - Hook)
glyph-block-export CyrTailDescender
define [CyrTailDescender] : params [x [connex 0.5] [overflow nothing]] : begin
@ -508,7 +506,7 @@ glyph-block Letter-Shared-Shapes : begin
local xRef : x + descenderOverflow + (0.3 + TanSlope) * Stroke
return : union
difference
ExtLineLhs 4 VJutSw (xRef - 0.275 * LongJut) (HalfStroke - LongJut) xRef Stroke
ExtLineLhs 4 VJutStroke (xRef - 0.275 * LongJut) (HalfStroke - LongJut) xRef Stroke
MaskAbove Stroke
MaskBelow (HalfStroke - LongJut)
if (!SLAB && descenderOverflow > Stroke * 0.7 || connex)
@ -519,7 +517,7 @@ glyph-block Letter-Shared-Shapes : begin
define [CyrLeftDescender] : params [x [connex 0.5] [overflow nothing]] : begin
local descenderOverflow : fallback overflow SideJut
return : union
VBarLeft (x - descenderOverflow - 0.25 * Stroke) (HalfStroke - LongJut) Stroke VJutSw
VBarLeft (x - descenderOverflow - 0.25 * Stroke) (HalfStroke - LongJut) Stroke VJutStroke
if (!SLAB && descenderOverflow > Stroke * 0.75 || connex)
HBarTop (x + connex * Stroke * HVContrast) (x - descenderOverflow) Stroke
glyph-proc
@ -559,10 +557,13 @@ glyph-block Letter-Shared-Shapes : begin
local {xLeftSpace xRightSpace} space
local xLeftEdge : x - pXInSw * refSw * HVContrast
local xRightEdge : x + (1 - pXInSw) * refSw * HVContrast
local xStrokeCenter : mix xLeftEdge xRightEdge 0.5
local p : (xLeftEdge - xLeftSpace) / ((xRightSpace - xRightEdge) + (xLeftEdge - xLeftSpace))
local xC : mix xLeftEdge xRightEdge (1 - p)
return : HOverlayBar
Math.max [mix xLeftSpace xLeftEdge 0.3] (xStrokeCenter - 0.75 * LongJut)
Math.min [mix xRightSpace xRightEdge 0.3] (xStrokeCenter + 0.75 * LongJut)
Math.min (xLeftEdge - SideJut)
Math.max (xC - 0.75 * LongJut) [mix xLeftSpace xLeftEdge 0.3]
Math.max (xRightEdge + SideJut)
Math.min [mix xRightSpace xRightEdge 0.3] (xC + 0.75 * LongJut)
begin y
begin sw

View file

@ -143,6 +143,7 @@ export : define [calculateMetrics para] : begin
define DotRadius : DotSize / 2
define PeriodRadius : PeriodSize / 2
define SideJut : Jut - HalfStroke * HVContrast
define VJutStroke : AdviceStroke 3.5
define [StrokeWidthBlend min max sw] : linreg para.canonicalStrokeWidthMin min para.canonicalStrokeWidthMax max [fallback sw Stroke]
@ -207,7 +208,7 @@ export : define [calculateMetrics para] : begin
BgOpBot Italify Upright Scale Translate ApparentTranslate Rotate GlobalTransform TanSlope
HVContrast Upward Downward Rightward Leftward UpwardT DownwardT LeftwardT RightwardT O OX
OXHook Hook AHook SHook RHook JHook FHook HookX ArchDepth SmallArchDepth Stroke DotSize
PeriodSize HBarPos OverlayPos LongJut Jut VJut AccentStackOffset AccentWidth
PeriodSize HBarPos OverlayPos LongJut Jut VJut VJutStroke AccentStackOffset AccentWidth
AccentClearance AccentHeight CThin CThinB SLAB TailAdjX TailAdjY IBalance IBalance2
JBalance JBalance2 TBalance TBalance2 RBalance RBalance2 FBalance OneBalance WideWidth0
WideWidth1 WideWidth2 WideWidth3 WideWidth4 EssUpper EssLower EssQuestion HalfStroke

View file

@ -214,15 +214,15 @@ define-macro glyph-block : syntax-rules
GlobalTransform TanSlope HVContrast Upward Downward Rightward Leftward UpwardT
DownwardT LeftwardT RightwardT O OX OXHook Hook AHook SHook RHook JHook FHook HookX
ArchDepth SmallArchDepth Stroke DotSize PeriodSize HBarPos OverlayPos LongJut Jut VJut
AccentStackOffset AccentWidth AccentClearance AccentHeight CThin CThinB SLAB TailAdjX
TailAdjY IBalance IBalance2 JBalance JBalance2 TBalance TBalance2 RBalance RBalance2
FBalance OneBalance WideWidth0 WideWidth1 WideWidth2 WideWidth3 WideWidth4 EssUpper
EssLower EssQuestion HalfStroke RightSB Middle DotRadius PeriodRadius SideJut ArchDepthA
ArchDepthB SmallArchDepthA SmallArchDepthB CorrectionOMidX CorrectionOMidS ArchXAdjust
AdviceStroke AdviceStroke2 OverlayStroke OperatorStroke GeometryStroke ShoulderFine
_SuperXY adviceSSmooth AdviceGlottalStopArchDepth shoulderMidSlope StrokeWidthBlend
ArchDepthAOf ArchDepthBOf SmoothAdjust MidJutSide MidJutCenter compositeBaseAnchors
YSmoothMidR YSmoothMidL HSwToV NarrowUnicodeT WideUnicodeT]
VJutStroke AccentStackOffset AccentWidth AccentClearance AccentHeight CThin CThinB SLAB
TailAdjX TailAdjY IBalance IBalance2 JBalance JBalance2 TBalance TBalance2 RBalance
RBalance2 FBalance OneBalance WideWidth0 WideWidth1 WideWidth2 WideWidth3 WideWidth4
EssUpper EssLower EssQuestion HalfStroke RightSB Middle DotRadius PeriodRadius SideJut
ArchDepthA ArchDepthB SmallArchDepthA SmallArchDepthB CorrectionOMidX CorrectionOMidS
ArchXAdjust AdviceStroke AdviceStroke2 OverlayStroke OperatorStroke GeometryStroke
ShoulderFine _SuperXY adviceSSmooth AdviceGlottalStopArchDepth shoulderMidSlope
StrokeWidthBlend ArchDepthAOf ArchDepthBOf SmoothAdjust MidJutSide MidJutCenter
compositeBaseAnchors YSmoothMidR YSmoothMidL HSwToV NarrowUnicodeT WideUnicodeT]
define spiroFnImports `[g4 g2 corner flat curl close end straight widths
disable-contrast heading unimportant important alsoThru alsoThruThem bezControls
quadControls archv arcvh dispiro spiro-outline]