Optimize shapes of Barred B and R with Stroke (#1956)

This commit is contained in:
John McWilliams 2023-08-23 16:17:45 -04:00 committed by GitHub
parent 9fbd76e59e
commit cb3f71ea8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 6 deletions

View file

@ -103,6 +103,10 @@ glyph-block Letter-Latin-Upper-B : begin
return : LetterBarOverlay.l.in SB stroke (top * bp - 0.5 * stroke)
space -- { 0 (RightSB - [HSwToV Stroke]) }
define [BOverlayBar top bp] : begin
local stroke : AdviceStroke2 2 3 top
return : HBar.m [mix 0 SB 0.3] [mix Width RightSB 0.3] (top * bp)
define [BahtBar sw] : VBar.m [mix SB RightSB 0.48] (CAP - Descender / 2) (Descender / 2) sw
define [BitcoinBar sw] : begin
local xMid : mix SB RightSB 0.48
@ -133,6 +137,10 @@ glyph-block Letter-Latin-Upper-B : begin
include [refer-glyph "B.\(suffix)"] AS_BASE ALSO_METRICS
include : BOverlayStroke CAP bp
create-glyph "BBar.\(suffix)" : glyph-proc
include [refer-glyph "B.\(suffix)"] AS_BASE ALSO_METRICS
include : BOverlayBar CAP bp
create-glyph "currency/baht.\(suffix)" : union
body CAP currencySw ts bs
intersection [BahtBar : AdviceStroke 5] [mask CAP : AdviceStroke2 2 3 CAP]
@ -146,6 +154,10 @@ glyph-block Letter-Latin-Upper-B : begin
include : MarkSet.e
include : body XH [AdviceStroke2 2 3 XH] ts bs
create-glyph "smcpBBar.\(suffix)" : glyph-proc
include [refer-glyph "smcpB.\(suffix)"] AS_BASE ALSO_METRICS
include : BOverlayBar XH bp
create-glyph "latn/Beta.\(suffix)" : glyph-proc
include : MarkSet.capDesc
include : body CAP [AdviceStroke2 2 3 CAP] ts false
@ -167,8 +179,8 @@ glyph-block Letter-Latin-Upper-B : begin
select-variant 'smcpB' 0x299
alias 'cyrl/ve.upright' null 'smcpB'
derive-composites 'BBar' null 'B' 'hStrike'
derive-composites 'smcpBBar' 0x1D03 'smcpB' 'hStrike'
select-variant 'BBar'
select-variant 'smcpBBar' 0x1D03 (follow -- 'BBar')
create-glyph 'mathbb/B' 0x1D539 : glyph-proc
include : MarkSet.capital

View file

@ -184,6 +184,10 @@ glyph-block Letter-Latin-Upper-R : begin
include : StrikeAnchor
include : RShape legShape CAP (slab -- slabs) (bp -- bpCap) (open -- fOpen)
if (!fOpen) : create-glyph "RBar.\(suffix)" : glyph-proc
include [refer-glyph "R.\(suffix)"] AS_BASE ALSO_METRICS
include : HBar.m [mix 0 SB 0.3] (SB - O) ((CAP - Stroke) * [RBarPos CAP SLAB] + Stroke * 0.25)
create-glyph "smcpR.\(suffix)" : glyph-proc
include : MarkSet.e
include : StrikeAnchor
@ -237,6 +241,9 @@ glyph-block Letter-Latin-Upper-R : begin
select-variant 'R' 'R'
link-reduced-variant 'R/sansSerif' 'R' MathSansSerif
select-variant 'RBar' 0x24C
select-variant 'smcpR' 0x280 (follow -- 'R')
turned 'turnSmapR' 0x1D1A 'smcpR' Middle (XH / 2)
@ -252,10 +259,6 @@ glyph-block Letter-Latin-Upper-R : begin
select-variant 'currency/indianRupeeSign' 0x20B9 (follow -- 'RRotunda')
derive-glyphs 'RBar' 0x24C 'R' : lambda [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
include : HBar.m [mix 0 SB 0.3] (SB - O) ((CAP - Stroke) * [RBarPos CAP SLAB] + Stroke * 0.25)
derive-glyphs 'RRTail' 0x2C64 'R' : lambda [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
eject-contour 'serifLB'