From 7f5df7dba1a07c6f8e8dcfc0025297725f22697a Mon Sep 17 00:00:00 2001 From: be5invis Date: Fri, 21 Aug 2020 20:05:00 -0700 Subject: [PATCH] Add `v-f-flat-hook-crossbar-at-x-height` and `v-t-flat-hook-short-neck2` --- font-src/gen/build-glyphs.ptl | 5 +++-- font-src/gen/kits/spiro-kit.ptl | 4 ++-- font-src/glyphs/common/shapes.ptl | 4 ++-- font-src/glyphs/letter/latin.ptl | 24 +++++++++++++++++------- font-src/meta/aesthetics.ptl | 11 +++++++---- font-src/meta/macros.ptl | 2 +- params/shape-weight.toml | 10 +++------- params/variants.toml | 25 ++++++++++++++++++------- 8 files changed, 53 insertions(+), 32 deletions(-) diff --git a/font-src/gen/build-glyphs.ptl b/font-src/gen/build-glyphs.ptl index 2c78aecac..0b39fb2df 100644 --- a/font-src/gen/build-glyphs.ptl +++ b/font-src/gen/build-glyphs.ptl @@ -4,6 +4,7 @@ import '../support/point' as Point import './kits/spiro-kit' as spirokit import './kits/boole-kit' as BooleKit import '../support/anchor' as Anchor +import [ designParameters ] from "../meta/aesthetics" extern isFinite @@ -29,7 +30,7 @@ export all : define [buildGlyphs para recursive recursiveCodes] : begin local glyphStore : new GlyphStore define metrics : calculateMetrics para - define [object GlobalTransform UPM Middle CAP XH SB RightSB Contrast Stroke Superness Width TanSlope OverlayPos Descender SymbolMid ParenTop ParenBot OperTop OperBot PlusTop PlusBot TackTop TackBot adviceBlackness MVertStrokeD] metrics + define [object GlobalTransform UPM Middle CAP XH SB RightSB Contrast Stroke Width TanSlope OverlayPos Descender SymbolMid ParenTop ParenBot OperTop OperBot PlusTop PlusBot TackTop TackBot adviceBlackness MVertStrokeD] metrics define fontMetrics {.head {.} .hhea {.} .OS_2 {.} .post {.}} setFontMetrics para metrics fontMetrics @@ -107,7 +108,7 @@ export all : define [buildGlyphs para recursive recursiveCodes] : begin ### Spiro constructions # Basic knots - define spirofns : spirokit.SetupBuilders : object GlobalTransform Contrast Stroke Glyph para Superness + define spirofns : spirokit.SetupBuilders : object GlobalTransform Contrast Stroke Glyph para [superness designParameters.superness] define booleFns : BooleKit.SetupBuilders : object GlobalTransform Glyph # IDKY, but wrapping "metrics" prevents Node.js on Arch modifying it. diff --git a/font-src/gen/kits/spiro-kit.ptl b/font-src/gen/kits/spiro-kit.ptl index 2b461b85d..d1eb225b1 100644 --- a/font-src/gen/kits/spiro-kit.ptl +++ b/font-src/gen/kits/spiro-kit.ptl @@ -5,7 +5,7 @@ import '../../support/transform' as Transform import '../../support/utils' as [object fallback mix bez2 bez3] export : define [SetupBuilders args] : begin - define [object para Glyph Contrast GlobalTransform Stroke Superness] args + define [object para Glyph Contrast GlobalTransform Stroke] args define [g4 x y f] {.x x .y y .type 'g4' .af f} define [g2 x y f] {.x x .y y .type 'g2' .af f} @@ -98,7 +98,7 @@ export : define [SetupBuilders args] : begin define DEFAULT_STEPS 6 define {jhv, jvh} : let [cache {}] : begin local [build samples _superness] : begin - local superness : fallback _superness Superness + local superness : fallback _superness args.superness local hv {} local vh {} foreach [j : range 1 samples] : begin diff --git a/font-src/glyphs/common/shapes.ptl b/font-src/glyphs/common/shapes.ptl index 4bf8aecbb..41fc8b691 100644 --- a/font-src/glyphs/common/shapes.ptl +++ b/font-src/glyphs/common/shapes.ptl @@ -472,7 +472,7 @@ glyph-block CommonShapes : begin # Spiro shapes define [determineMixR w v u sw swash] : begin if (!swash && w < v) : return : 1 - [determineMixR v w u sw swash] - local superness Superness + local superness designParameters.superness local r : piecewise (w <= v) 0.5 true : 1 / ([Math.pow (1 - [Math.pow (1 - v / w) superness]) (1 / superness)] + 1) @@ -495,7 +495,7 @@ glyph-block CommonShapes : begin local ltr : if isStart (toFinish.x < toStraight.x) (toFinish.x > toStraight.x) local dtu : if isStart (y > toFinish.y) (y < toFinish.y) local doSwash : !tight && para.isItalic && ltr && atBottom && !isStart - local superness : if tight para.tightHookSuperness Superness + local superness : if tight designParameters.tightHookSuperness designParameters.superness # Adjust terminal's position if necessary toFinish.x = toFinish.x + OXHook * [if ltr (-1) 1] * [if isStart (-1) 1] diff --git a/font-src/glyphs/letter/latin.ptl b/font-src/glyphs/letter/latin.ptl index fcbfd5941..b5f9f8dd0 100644 --- a/font-src/glyphs/letter/latin.ptl +++ b/font-src/glyphs/letter/latin.ptl @@ -4824,7 +4824,7 @@ glyph-block Letter-Latin-Lower-F : begin include : VerticalHook Middle 0 LongJut Hook - define fbar : XH * designParameters.fBarPos + Stroke * para.fbarStrokeAdj + define fbar : XH * designParameters.fBarPosToXH + Stroke * designParameters.fbarStrokeAdj create-glyph : glyph-proc local fovershoot2 (O * 2) include MarkSet.b @@ -4864,7 +4864,7 @@ glyph-block Letter-Latin-Lower-F : begin curl (RightSB - HalfStroke * TanSlope) fbar define dfNarrowF : DivFrame para.diversityF - define [NarrowFShape df m] : glyph-proc + define [NarrowFShape df m bh] : glyph-proc local crossLeft : mix 0 SB m local crossRight : mix df.width df.rightSB m local barLeft : [mix crossLeft crossRight 0.42] - Stroke * 0.375 * HVContrast + df.width / 32 @@ -4878,17 +4878,21 @@ glyph-block Letter-Latin-Lower-F : begin curl barLeft 0 [heading Downward] include : dispiro widths.rhs - flat (crossLeft - HalfStroke * TanSlope) fbar - curl (crossRight - HalfStroke * TanSlope) fbar + flat (crossLeft - HalfStroke * TanSlope) bh + curl (crossRight - HalfStroke * TanSlope) bh create-glyph 'f.narrow' : glyph-proc set-width dfNarrowF.width include dfNarrowF.markSet.b - include : NarrowFShape dfNarrowF 0.5 + include : NarrowFShape dfNarrowF 0.5 fbar create-glyph 'f.flatHook' : glyph-proc include MarkSet.b - include : NarrowFShape [DivFrame 1] 1 + include : NarrowFShape [DivFrame 1] 1 fbar + + create-glyph 'f.flatHookCrossbarAtXHeight' : glyph-proc + include MarkSet.b + include : NarrowFShape [DivFrame 1] 1 XH create-glyph 'f.tailed' : glyph-proc include [refer-glyph 'longs.italic'] AS_BASE @@ -4904,6 +4908,7 @@ glyph-block Letter-Latin-Lower-F : begin turned 'turnf.straightTailed' nothing 'f.straightTailed' Middle (XH / 2) MarkSet.p turned 'turnf.tailed' nothing 'f.tailed' Middle (XH / 2) MarkSet.p turned 'turnf.flatHook' nothing 'f.flatHook' Middle (XH / 2) MarkSet.p + turned 'turnf.flatHookCrossbarAtXHeight' nothing 'f.flatHookCrossbarAtXHeight' Middle (XH / 2) MarkSet.p turned 'turnf.narrow' nothing 'f.narrow' dfNarrowF.middle (XH / 2) dfNarrowF.markSet.p select-variant 'turnf' 0x25F (follow -- 'f') @@ -5176,6 +5181,10 @@ glyph-block Letter-Latin-Lower-T : begin include MarkSet.b include : TFlatShape [DivFrame 1] [Math.min CAP ([mix XH CAP 0.75] + Stroke * 0.25)] 1 0 + create-glyph 't.flatHookShortNeck2' : glyph-proc + include MarkSet.b + include : TFlatShape [DivFrame 1] [Math.min CAP ([mix XH CAP 0.625] + Stroke * 0.25)] 1 0 + define dfNarrowT : DivFrame para.diversityF create-glyph 't.narrow' : glyph-proc set-width dfNarrowT.width @@ -5213,8 +5222,9 @@ glyph-block Letter-Latin-Lower-T : begin turned 'turnt.standard' nothing 't.standard' Middle (XH / 2) MarkSet.p turned 'turnt.cross' nothing 't.cross' Middle (XH / 2) MarkSet.p turned 'turnt.flatHook' nothing 't.flatHook' Middle (XH / 2) MarkSet.p - turned 'turnt.flatHookShortNeck' nothing 't.flatHookShortNeck' Middle (XH / 2) MarkSet.p turned 'turnt.hooklessAsymmetric' nothing 't.hooklessAsymmetric' Middle (XH / 2) MarkSet.p + turned 'turnt.flatHookShortNeck' nothing 't.flatHookShortNeck' Middle (XH / 2) MarkSet.p + turned 'turnt.flatHookShortNeck2' nothing 't.flatHookShortNeck2' Middle (XH / 2) MarkSet.p turned 'turnt.narrow' nothing 't.narrow' dfNarrowT.middle (XH / 2) dfNarrowT.markSet.p select-variant 'turnt' 0x287 (follow -- 't') diff --git a/font-src/meta/aesthetics.ptl b/font-src/meta/aesthetics.ptl index d094d64a5..4ae5bb755 100644 --- a/font-src/meta/aesthetics.ptl +++ b/font-src/meta/aesthetics.ptl @@ -169,8 +169,7 @@ export : define [calculateMetrics para] : begin define GeometryStroke : adviceBlackness 4.5 define ShoulderFine : Math.min (Stroke * para.shoulderfineMin) [adviceBlackness 16] - define Superness : fallback para.superness 2 - define [superXY x superness] : Math.pow (1 - [Math.pow x [fallback superness Superness]]) (1 / [fallback superness Superness]) + define [superXY x superness] : Math.pow (1 - [Math.pow x [fallback superness designParameters.superness]]) (1 / [fallback superness designParameters.superness]) define [adviceSSmooth y sign _stroke] : begin # Handle with extreme care. @@ -201,7 +200,7 @@ export : define [calculateMetrics para] : begin HalfStroke RightSB Middle CapMiddle DotRadius PeriodRadius SideJut SmoothA SmoothB SmallSmoothA SmallSmoothB CorrectionOMidX CorrectionOMidS compositeBaseAnchors adviceBlackness adviceBlackness2 MVertStroke MVertStrokeD OverlayStroke OperatorStroke - GeometryStroke ShoulderFine Superness superXY adviceSSmooth adviceGlottalStopSmooth + GeometryStroke ShoulderFine superXY adviceSSmooth adviceGlottalStopSmooth shoulderMidSlope StrokeWidthBlend SmoothAOf SmoothBOf SmoothAdjust MidJutSide MidJutCenter YSmoothMidR YSmoothMidL] export : define [setFontMetrics para metrics fm] : begin @@ -312,9 +311,13 @@ export : define designParameters : object eBarPos 0.5 fiveBarPos 0.64 overlayPos 0.52 - fBarPos 0.91 + fBarPosToXH 0.91 gBarPos 0.42 upperEBarPos : lambda [slab] : if slab 0.52 0.53 + # Fine adjustments + fbarStrokeAdj 0.25 + superness 2.275 + tightHookSuperness 2.30 export : define [GenDivFrame metrics] : lambda [_div _hPack _sbMul] : begin local div : fallback _div 1 diff --git a/font-src/meta/macros.ptl b/font-src/meta/macros.ptl index 194ca6018..0338117ea 100644 --- a/font-src/meta/macros.ptl +++ b/font-src/meta/macros.ptl @@ -222,7 +222,7 @@ define-macro glyph-block : syntax-rules Middle CapMiddle DotRadius PeriodRadius SideJut SmoothA SmoothB SmallSmoothA SmallSmoothB CorrectionOMidX CorrectionOMidS adviceBlackness adviceBlackness2 MVertStroke OverlayStroke OperatorStroke GeometryStroke ShoulderFine - Superness superXY adviceSSmooth adviceGlottalStopSmooth shoulderMidSlope StrokeWidthBlend + superXY adviceSSmooth adviceGlottalStopSmooth shoulderMidSlope StrokeWidthBlend SmoothAOf SmoothBOf SmoothAdjust MidJutSide MidJutCenter compositeBaseAnchors YSmoothMidR YSmoothMidL] define spiroFnImports `[g4 g2 corner flat curl close end straight widths disable-gizmo disable-contrast heading unimportant important alsoThru alsoThruThem bezcontrols diff --git a/params/shape-weight.toml b/params/shape-weight.toml index a92c76151..c67a7ab05 100644 --- a/params/shape-weight.toml +++ b/params/shape-weight.toml @@ -7,14 +7,10 @@ periodsize = 140 # Size of period jut = 85 # Length of slab serif vjut = 145 # Length of vertical slab serif -longjut = 175 # Length of long serifs, like that in `i`. +longjut = 175 # Length of long serifs, like that in `i`. -smooth = 195 # Vertical arc size in capital letters. -smallsmooth = 200 # Vertical arc size in lowercase letters. -superness = 2.275 # Superness of arcs. -tightHookSuperness = 2.3 # superness of tight hooks - -fbarStrokeAdj = 0.25 # Portion of the fill above the f-bar position +smooth = 195 # Vertical arc size in capital letters. +smallsmooth = 200 # Vertical arc size in lowercase letters. rbalance = 60 rbalance2 = 15 diff --git a/params/variants.toml b/params/variants.toml index 29cc7132d..f5cf5a548 100644 --- a/params/variants.toml +++ b/params/variants.toml @@ -261,6 +261,12 @@ sampler = "f" description = '`f` with flat hook' variant.f = 'flatHook' +[simple.v-f-flat-hook-crossbar-at-x-height] +tag = "VXEG" +sampler = "f" +description = '`f` with flat hook and crossbar placed right at X-height' +variant.f = 'flatHookCrossbarAtXHeight' + [simple.v-g-singlestorey] tag = 'cv12' sampler = 'g' @@ -557,7 +563,6 @@ variant.m = 'earlessRoundedDoubleArchShortlegTailed' variantUpright."cyrl/te" = "upright" variantItalic."cyrl/te" = "italicNormal" - [simple.v-m-earless-single-arch] tag = "VXEC" sampler = "m" @@ -745,18 +750,24 @@ sampler = "t" description = "`t` with flat hook" variant.t = 'flatHook' -[simple.v-t-flat-hook-short-neck] -tag = "VXEG" -sampler = "t" -description = "`t` with flat hook and a slightly shorter neck" -variant.t = 'flatHookShortNeck' - [simple.v-t-hookless-asymmetric] tag = "VXEH" sampler = "t" description = "`t` without hook and ony half the cross bar" variant.t = 'hooklessAsymmetric' +[simple.v-t-flat-hook-short-neck] +tag = "VXEI" +sampler = "t" +description = "`t` with flat hook and a slightly shorter neck" +variant.t = 'flatHookShortNeck' + +[simple.v-t-flat-hook-short-neck2] +tag = "VXEJ" +sampler = "t" +description = "`t` with flat hook and a more shorter neck" +variant.t = 'flatHookShortNeck2' + [simple.v-u-with-bar] tag = "cv89" sampler = "u"