Skip to content

Commit

Permalink
Balance weight of $ under heavy weights (be5invis#1302).
Browse files Browse the repository at this point in the history
  • Loading branch information
be5invis committed Feb 15, 2022
1 parent 5b08cb2 commit 95ede5b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
1 change: 1 addition & 0 deletions changes/14.0.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Balance weight of `$` under heavy weights (#1302).
18 changes: 10 additions & 8 deletions font-src/glyphs/letter/latin/c.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -310,29 +310,31 @@ glyph-block Letter-Latin-C : begin
set-width 0
set-mark-anchor 'cvDecompose' 0 0
include : dispiro
widths.center
widths.center [AdviceStroke 3]
flat Middle (XH - HalfStroke)
curl Middle (XH - Descender / 2) [heading Upward]
include : dispiro
widths.center
widths.center [AdviceStroke 3]
flat Middle (Descender / 2) [heading Upward]
curl Middle HalfStroke

create-glyph 'currency/centSignBar.through' : glyph-proc
define fine : AdviceStroke 4
include [refer-glyph 'currency/centSignBar.open'] AS_BASE ALSO_METRICS

define fine : AdviceStroke [StrokeWidthBlend 4 5]
include : VBar Middle (XH - HalfStroke) (0 + HalfStroke) fine

create-glyph 'currency/centSignBar.barInterrupted' : glyph-proc
set-width 0
set-mark-anchor 'cvDecompose' 0 0
define fine : AdviceStroke 4
include [refer-glyph 'currency/centSignBar.open'] AS_BASE ALSO_METRICS

define cofine : AdviceStroke 4
define fine : AdviceStroke [StrokeWidthBlend 4 5]
define gap : Math.max (XH / 8) [AdviceStroke2 6 6 XH]
include : dispiro
flat Middle (XH - Descender / 2) [widths.center.heading Stroke Downward]
flat Middle (XH - HalfStroke) [widths.center.heading cofine Downward]
curl Middle (XH / 2 + gap / 2) [widths.center.heading fine Downward]
include : dispiro
flat Middle (Descender / 2) [widths.center.heading Stroke Upward]
flat Middle (HalfStroke) [widths.center.heading cofine Upward]
curl Middle (XH / 2 - gap / 2) [widths.center.heading fine Upward]

select-variant 'currency/centSignBar' (follow -- 'cent')
Expand Down
32 changes: 16 additions & 16 deletions font-src/glyphs/letter/latin/s.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ glyph-block Letter-Latin-S : begin
define bot : CAP * 0.05
include : MarkSet.capital
set-base-anchor 'cvDecompose' 0 0
include : SStrokeImpl top bot doTS doBS [AdviceStroke2 3 3 (top - bot)] EssUpper
include : SStrokeImpl top bot doTS doBS [AdviceStroke2 2 3 (top - bot)] EssUpper
include : SAutoSlabStart doTS top Stroke Hook
include : SAutoSlabEnd doBS bot Stroke Hook
RightDependentLink.set currentGlyph "cap" "DollarKernelCap.\(suffix)"
Expand All @@ -247,7 +247,7 @@ glyph-block Letter-Latin-S : begin
define bot : CAP * 0.12
include : MarkSet.capital
set-base-anchor 'cvDecompose' 0 0
include : SStrokeImpl top bot doTS doBS [AdviceStroke2 3 3 (top - bot)] EssUpper
include : SStrokeImpl top bot doTS doBS [AdviceStroke2 2 3 (top - bot)] EssUpper
include : SAutoSlabStart doTS top Stroke Hook
include : SAutoSlabEnd doBS bot Stroke Hook

Expand Down Expand Up @@ -441,31 +441,31 @@ glyph-block Letter-Latin-S : begin
define top : CAP * kTop
define bot : CAP * kBot
define w : AdviceStroke 3
define fine : AdviceStroke 4
define fine : AdviceStroke [StrokeWidthBlend 4 5]

include : dispiro
widths.center w
flat Middle (top - HalfStroke)
curl Middle (CAP - overflow) [heading Upward]
include : dispiro
widths.center w
flat Middle overflow [heading Upward]
curl Middle (bot + HalfStroke)
if (fillType === 1) : include : VBar Middle (bot + HalfStroke) (top - HalfStroke) fine
if (fillType === 0 || fillType === 1) : begin
include : dispiro
widths.center w
flat Middle (top - HalfStroke)
curl Middle (CAP - overflow) [heading Upward]
include : dispiro
widths.center w
flat Middle overflow [heading Upward]
curl Middle (bot + HalfStroke)
if (fillType === 2) : begin
local cofine : AdviceStroke 4
local gap : (w / Stroke * EssUpper) + [Math.max ((top - bot) / 6) [AdviceStroke2 3 3 (top - bot)]]
local yMid : mix bot top 0.5
local yTermLeft : mix yMid (top - [adviceSSmooth (top - bot) (-1) w]) 0.5
local yTermRight : mix yMid (bot + [adviceSSmooth (top - bot) (-1) w]) 0.5
include : difference
union
dispiro
flat Middle (CAP - overflow) [widths.center.heading w Downward]
curl Middle [mix bot top 0.5] [widths.center.heading fine Downward]
flat Middle (top - HalfStroke) [widths.center.heading cofine Downward]
curl Middle [mix bot top 0.5] [widths.center.heading fine Downward]
dispiro
flat Middle overflow [widths.center.heading w Upward]
curl Middle [mix bot top 0.5] [widths.center.heading fine Upward]
flat Middle (bot + HalfStroke) [widths.center.heading cofine Upward]
curl Middle [mix bot top 0.5] [widths.center.heading fine Upward]

dispiro [corner 0 yTermLeft : widths.center gap] [corner Width yTermRight]

Expand Down

0 comments on commit 95ede5b

Please sign in to comment.