Add v-f-flat-hook-crossbar-at-x-height and v-t-flat-hook-short-neck2

This commit is contained in:
be5invis 2020-08-21 20:05:00 -07:00
parent c4f271e910
commit 7f5df7dba1
8 changed files with 53 additions and 32 deletions

View file

@ -4,6 +4,7 @@ import '../support/point' as Point
import './kits/spiro-kit' as spirokit import './kits/spiro-kit' as spirokit
import './kits/boole-kit' as BooleKit import './kits/boole-kit' as BooleKit
import '../support/anchor' as Anchor import '../support/anchor' as Anchor
import [ designParameters ] from "../meta/aesthetics"
extern isFinite extern isFinite
@ -29,7 +30,7 @@ export all : define [buildGlyphs para recursive recursiveCodes] : begin
local glyphStore : new GlyphStore local glyphStore : new GlyphStore
define metrics : calculateMetrics para 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 {.}} define fontMetrics {.head {.} .hhea {.} .OS_2 {.} .post {.}}
setFontMetrics para metrics fontMetrics setFontMetrics para metrics fontMetrics
@ -107,7 +108,7 @@ export all : define [buildGlyphs para recursive recursiveCodes] : begin
### Spiro constructions ### Spiro constructions
# Basic knots # 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 define booleFns : BooleKit.SetupBuilders : object GlobalTransform Glyph
# IDKY, but wrapping "metrics" prevents Node.js on Arch modifying it. # IDKY, but wrapping "metrics" prevents Node.js on Arch modifying it.

View file

@ -5,7 +5,7 @@ import '../../support/transform' as Transform
import '../../support/utils' as [object fallback mix bez2 bez3] import '../../support/utils' as [object fallback mix bez2 bez3]
export : define [SetupBuilders args] : begin 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 [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} 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 DEFAULT_STEPS 6
define {jhv, jvh} : let [cache {}] : begin define {jhv, jvh} : let [cache {}] : begin
local [build samples _superness] : begin local [build samples _superness] : begin
local superness : fallback _superness Superness local superness : fallback _superness args.superness
local hv {} local hv {}
local vh {} local vh {}
foreach [j : range 1 samples] : begin foreach [j : range 1 samples] : begin

View file

@ -472,7 +472,7 @@ glyph-block CommonShapes : begin
# Spiro shapes # Spiro shapes
define [determineMixR w v u sw swash] : begin define [determineMixR w v u sw swash] : begin
if (!swash && w < v) : return : 1 - [determineMixR v w u sw swash] if (!swash && w < v) : return : 1 - [determineMixR v w u sw swash]
local superness Superness local superness designParameters.superness
local r : piecewise local r : piecewise
(w <= v) 0.5 (w <= v) 0.5
true : 1 / ([Math.pow (1 - [Math.pow (1 - v / w) superness]) (1 / superness)] + 1) 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 ltr : if isStart (toFinish.x < toStraight.x) (toFinish.x > toStraight.x)
local dtu : if isStart (y > toFinish.y) (y < toFinish.y) local dtu : if isStart (y > toFinish.y) (y < toFinish.y)
local doSwash : !tight && para.isItalic && ltr && atBottom && !isStart 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 # Adjust terminal's position if necessary
toFinish.x = toFinish.x + OXHook * [if ltr (-1) 1] * [if isStart (-1) 1] toFinish.x = toFinish.x + OXHook * [if ltr (-1) 1] * [if isStart (-1) 1]

View file

@ -4824,7 +4824,7 @@ glyph-block Letter-Latin-Lower-F : begin
include : VerticalHook Middle 0 LongJut Hook 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 create-glyph : glyph-proc
local fovershoot2 (O * 2) local fovershoot2 (O * 2)
include MarkSet.b include MarkSet.b
@ -4864,7 +4864,7 @@ glyph-block Letter-Latin-Lower-F : begin
curl (RightSB - HalfStroke * TanSlope) fbar curl (RightSB - HalfStroke * TanSlope) fbar
define dfNarrowF : DivFrame para.diversityF 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 crossLeft : mix 0 SB m
local crossRight : mix df.width df.rightSB m local crossRight : mix df.width df.rightSB m
local barLeft : [mix crossLeft crossRight 0.42] - Stroke * 0.375 * HVContrast + df.width / 32 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] curl barLeft 0 [heading Downward]
include : dispiro include : dispiro
widths.rhs widths.rhs
flat (crossLeft - HalfStroke * TanSlope) fbar flat (crossLeft - HalfStroke * TanSlope) bh
curl (crossRight - HalfStroke * TanSlope) fbar curl (crossRight - HalfStroke * TanSlope) bh
create-glyph 'f.narrow' : glyph-proc create-glyph 'f.narrow' : glyph-proc
set-width dfNarrowF.width set-width dfNarrowF.width
include dfNarrowF.markSet.b include dfNarrowF.markSet.b
include : NarrowFShape dfNarrowF 0.5 include : NarrowFShape dfNarrowF 0.5 fbar
create-glyph 'f.flatHook' : glyph-proc create-glyph 'f.flatHook' : glyph-proc
include MarkSet.b 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 create-glyph 'f.tailed' : glyph-proc
include [refer-glyph 'longs.italic'] AS_BASE 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.straightTailed' nothing 'f.straightTailed' Middle (XH / 2) MarkSet.p
turned 'turnf.tailed' nothing 'f.tailed' 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.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 turned 'turnf.narrow' nothing 'f.narrow' dfNarrowF.middle (XH / 2) dfNarrowF.markSet.p
select-variant 'turnf' 0x25F (follow -- 'f') select-variant 'turnf' 0x25F (follow -- 'f')
@ -5176,6 +5181,10 @@ glyph-block Letter-Latin-Lower-T : begin
include MarkSet.b include MarkSet.b
include : TFlatShape [DivFrame 1] [Math.min CAP ([mix XH CAP 0.75] + Stroke * 0.25)] 1 0 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 define dfNarrowT : DivFrame para.diversityF
create-glyph 't.narrow' : glyph-proc create-glyph 't.narrow' : glyph-proc
set-width dfNarrowT.width 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.standard' nothing 't.standard' Middle (XH / 2) MarkSet.p
turned 'turnt.cross' nothing 't.cross' 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.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.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 turned 'turnt.narrow' nothing 't.narrow' dfNarrowT.middle (XH / 2) dfNarrowT.markSet.p
select-variant 'turnt' 0x287 (follow -- 't') select-variant 'turnt' 0x287 (follow -- 't')

View file

@ -169,8 +169,7 @@ export : define [calculateMetrics para] : begin
define GeometryStroke : adviceBlackness 4.5 define GeometryStroke : adviceBlackness 4.5
define ShoulderFine : Math.min (Stroke * para.shoulderfineMin) [adviceBlackness 16] 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 designParameters.superness]]) (1 / [fallback superness designParameters.superness])
define [superXY x superness] : Math.pow (1 - [Math.pow x [fallback superness Superness]]) (1 / [fallback superness Superness])
define [adviceSSmooth y sign _stroke] : begin define [adviceSSmooth y sign _stroke] : begin
# Handle with extreme care. # Handle with extreme care.
@ -201,7 +200,7 @@ export : define [calculateMetrics para] : begin
HalfStroke RightSB Middle CapMiddle DotRadius PeriodRadius SideJut SmoothA HalfStroke RightSB Middle CapMiddle DotRadius PeriodRadius SideJut SmoothA
SmoothB SmallSmoothA SmallSmoothB CorrectionOMidX CorrectionOMidS compositeBaseAnchors SmoothB SmallSmoothA SmallSmoothB CorrectionOMidX CorrectionOMidS compositeBaseAnchors
adviceBlackness adviceBlackness2 MVertStroke MVertStrokeD OverlayStroke OperatorStroke 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] shoulderMidSlope StrokeWidthBlend SmoothAOf SmoothBOf SmoothAdjust MidJutSide MidJutCenter YSmoothMidR YSmoothMidL]
export : define [setFontMetrics para metrics fm] : begin export : define [setFontMetrics para metrics fm] : begin
@ -312,9 +311,13 @@ export : define designParameters : object
eBarPos 0.5 eBarPos 0.5
fiveBarPos 0.64 fiveBarPos 0.64
overlayPos 0.52 overlayPos 0.52
fBarPos 0.91 fBarPosToXH 0.91
gBarPos 0.42 gBarPos 0.42
upperEBarPos : lambda [slab] : if slab 0.52 0.53 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 export : define [GenDivFrame metrics] : lambda [_div _hPack _sbMul] : begin
local div : fallback _div 1 local div : fallback _div 1

View file

@ -222,7 +222,7 @@ define-macro glyph-block : syntax-rules
Middle CapMiddle DotRadius PeriodRadius SideJut SmoothA SmoothB Middle CapMiddle DotRadius PeriodRadius SideJut SmoothA SmoothB
SmallSmoothA SmallSmoothB CorrectionOMidX CorrectionOMidS adviceBlackness SmallSmoothA SmallSmoothB CorrectionOMidX CorrectionOMidS adviceBlackness
adviceBlackness2 MVertStroke OverlayStroke OperatorStroke GeometryStroke ShoulderFine 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] SmoothAOf SmoothBOf SmoothAdjust MidJutSide MidJutCenter compositeBaseAnchors YSmoothMidR YSmoothMidL]
define spiroFnImports `[g4 g2 corner flat curl close end straight widths disable-gizmo define spiroFnImports `[g4 g2 corner flat curl close end straight widths disable-gizmo
disable-contrast heading unimportant important alsoThru alsoThruThem bezcontrols disable-contrast heading unimportant important alsoThru alsoThruThem bezcontrols

View file

@ -7,14 +7,10 @@ periodsize = 140 # Size of period
jut = 85 # Length of slab serif jut = 85 # Length of slab serif
vjut = 145 # Length of vertical 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. smooth = 195 # Vertical arc size in capital letters.
smallsmooth = 200 # Vertical arc size in lowercase 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
rbalance = 60 rbalance = 60
rbalance2 = 15 rbalance2 = 15

View file

@ -261,6 +261,12 @@ sampler = "f"
description = '`f` with flat hook' description = '`f` with flat hook'
variant.f = 'flatHook' 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] [simple.v-g-singlestorey]
tag = 'cv12' tag = 'cv12'
sampler = 'g' sampler = 'g'
@ -557,7 +563,6 @@ variant.m = 'earlessRoundedDoubleArchShortlegTailed'
variantUpright."cyrl/te" = "upright" variantUpright."cyrl/te" = "upright"
variantItalic."cyrl/te" = "italicNormal" variantItalic."cyrl/te" = "italicNormal"
[simple.v-m-earless-single-arch] [simple.v-m-earless-single-arch]
tag = "VXEC" tag = "VXEC"
sampler = "m" sampler = "m"
@ -745,18 +750,24 @@ sampler = "t"
description = "`t` with flat hook" description = "`t` with flat hook"
variant.t = 'flatHook' 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] [simple.v-t-hookless-asymmetric]
tag = "VXEH" tag = "VXEH"
sampler = "t" sampler = "t"
description = "`t` without hook and ony half the cross bar" description = "`t` without hook and ony half the cross bar"
variant.t = 'hooklessAsymmetric' 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] [simple.v-u-with-bar]
tag = "cv89" tag = "cv89"
sampler = "u" sampler = "u"