Skip to content

Commit

Permalink
Add standing variants of R (#810).
Browse files Browse the repository at this point in the history
  • Loading branch information
be5invis committed Jan 22, 2021
1 parent 1a598bf commit 10bfe14
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 70 deletions.
1 change: 1 addition & 0 deletions changes/4.6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Add diagonal-tailed variants of `f`, `i`, `j`, `k`, `l`, `q`, `t` (#795).
* Add motion-serifed variants of `A`, `B`, `D`, `E`, `F`, `P`, `R`, `V`, `W`, `Z`, `v`, `w`, `y`, `z` (#806).
* Add open-contour variants of `P` and `R` (#810).
* Add standing variants of `R` (#810).
* Fix broken geometry of `K` and `%` under ultra-wide (#800).
* Add straight-bar AE (`Æ`), follows variant selector for `A` (#800).
* Refine the shape of Slab `S` and `s` to add serifs at both terminals (#800).
Expand Down
181 changes: 117 additions & 64 deletions font-src/glyphs/letter/latin/upper-r.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -13,88 +13,138 @@ glyph-block Letter-Latin-Upper-R : begin
glyph-block-import Letter-Blackboard : BBS BBD

### R and CyrYa
glyph-block-export RLegShape RLegTerminalX
define [RLegTerminalX straight right sw] : right - [if straight (OX * 2) 0] - sw / 2 * HVContrast
define [RSlabExtraShift slab sw] : if slab (-Jut / 2 + 0.25 * sw * HVContrast) 0
define [RLegDiagCor top bottom left right extraShift sw] : DiagCor (top - bottom) (right - left - extraShift) 0 sw
define [RLegShape] : params [top bottom left right charTop slab straight sw extraShift] : glyph-proc

define [RStandingLegFine sw] : sw * CThinB
define [RStandingLegBend left right top bottom sw] : Math.min ((right - left) * 0.99) : Math.max (sw * 1.5) ((right - left) * 0.875)
define [RStandingBottomOverflow slab] : if slab 0 (2 * OX)

define [RLegShape-Straight] : params [top bottom left right charTop slab sw extraShift] : glyph-proc
local xRightBottom : RLegTerminalX straight right sw
if straight : do
local shift : RSlabExtraShift slab sw
include : dispiro
widths.center (sw * [RLegDiagCor top bottom left right extraShift sw])
corner (left + extraShift + shift / 2) top [heading Downward]
corner (xRightBottom + shift) bottom [heading Downward]
if slab : begin
include : RightwardBottomSerif (xRightBottom + shift + 0.25 * sw * HVContrast) bottom (SideJut + Jut / 8)
: else : begin
include : intersection
Rect top bottom (-Width) (2 * Width)
dispiro
widths.center sw
g4.up.start xRightBottom bottom [heading Upward]
quadcontrols 0 0.4 8
g4 left top
if slab : begin
include : RightwardBottomSerif right bottom (SideJut + Jut / 8)
local shift : RSlabExtraShift slab sw
include : dispiro
widths.center (sw * [RLegDiagCor top bottom left right extraShift sw])
corner (left + extraShift + shift / 2) top [heading Downward]
corner (xRightBottom + shift) bottom [heading Downward]
if slab : begin
include : RightwardBottomSerif (xRightBottom + shift + 0.25 * sw * HVContrast) bottom (SideJut + Jut / 8)

define [RLegShape-Curly] : params [top bottom left right charTop slab sw extraShift] : glyph-proc
local xRightBottom : RLegTerminalX straight right sw
include : intersection
Rect top bottom (-Width) (2 * Width)
dispiro
widths.center sw
g4.up.start xRightBottom bottom [heading Upward]
quadcontrols 0 0.4 8
g4 left top
if slab : begin
include : RightwardBottomSerif right bottom (SideJut + Jut / 8)

define [RLegShape-Standing] : params [top bottom left right charTop slab sw extraShift] : glyph-proc
local fine : RStandingLegFine sw
local bend : RStandingLegBend left right top bottom sw
local ytopRef : top + sw * (1 - PShape.SwBelowBar)
local yTopStroke : top + fine - sw * PShape.SwBelowBar
local yOffset : mix bottom top 0.2
local xOverflow : RStandingBottomOverflow slab
include : dispiro
widths.rhs fine
flat left yTopStroke [heading Rightward]
curl (right - bend) yTopStroke [heading Rightward]
archv
flat (right + O) (ytopRef - bend) [widths.rhs.heading sw Downward]
curl (right + O) yOffset [heading Downward]
curl (right + O - xOverflow) bottom [heading Downward]
if slab : include : RightwardBottomSerif right bottom SideJut

define RLegShapes { RLegShape-Curly RLegShape-Straight RLegShape-Standing }

define [RevRLegTerminalX straight left sw] : left + [if straight (OX * 2) 0] + sw / 2 * HVContrast
define [RevRLegShape] : params [top bottom left right charTop slab straight sw extraShift] : glyph-proc

define [RevRLegShape-Straight] : params [top bottom left right charTop slab sw extraShift] : glyph-proc
local xLeftBottom : RevRLegTerminalX straight left sw
local shift : RSlabExtraShift slab sw
include : dispiro
widths.center (sw * [RLegDiagCor top bottom left right extraShift sw])
corner (right + extraShift + shift / 2) top [heading Downward]
corner (xLeftBottom + shift) bottom [heading Downward]
if slab : begin
include : LeftwardBottomSerif (xLeftBottom + shift - 0.25 * sw * HVContrast) bottom (SideJut + Jut / 8)

define [RevRLegShape-Curly] : params [top bottom left right charTop slab sw extraShift] : glyph-proc
local xLeftBottom : RevRLegTerminalX straight left sw
if straight : do
local shift : RSlabExtraShift slab sw
include : dispiro
widths.center (sw * [RLegDiagCor top bottom left right extraShift sw])
corner (right + extraShift + shift / 2) top [heading Downward]
corner (xLeftBottom + shift) bottom [heading Downward]
if slab : begin
include : LeftwardBottomSerif (xLeftBottom + shift - 0.25 * sw * HVContrast) bottom (SideJut + Jut / 8)
: else : begin
include : intersection
Rect top 0 (-Width) (2 * Width)
dispiro
widths.center sw
g4.up.start xLeftBottom bottom [heading Upward]
quadcontrols 0 0.4 8
g4 right top
if slab : begin
include : LeftwardBottomSerif left bottom (SideJut + Jut / 8)
include : intersection
Rect top 0 (-Width) (2 * Width)
dispiro
widths.center sw
g4.up.start xLeftBottom bottom [heading Upward]
quadcontrols 0 0.4 8
g4 right top
if slab : begin
include : LeftwardBottomSerif left bottom (SideJut + Jut / 8)

define [RevRLegShape-Standing] : params [top bottom left right charTop slab sw extraShift] : glyph-proc
local fine : RStandingLegFine sw
local bend : RStandingLegBend left right top bottom sw
local ytopRef : top + sw * (1 - PShape.SwBelowBar)
local yTopStroke : top + fine - sw * PShape.SwBelowBar
local yOffset : mix bottom top 0.2
local xOverflow : RStandingBottomOverflow slab
include : dispiro
widths.lhs fine
flat right yTopStroke [heading Leftward]
curl (left + bend) yTopStroke [heading Leftward]
archv
flat (left - O) (ytopRef - bend) [widths.lhs.heading sw Downward]
curl (left - O) yOffset [heading Downward]
curl (left - O + xOverflow) bottom [heading Downward]
if slab : include : LeftwardBottomSerif left bottom SideJut

define RevRLegShapes { RevRLegShape-Curly RevRLegShape-Straight RevRLegShape-Standing }


define [RBarPos charTop slab] : if slab (0.5 + Stroke * PShape.SwBelowBar / charTop) PShape.BarPos
define [RBarTop p charTop stroke straightBar slab] : (charTop - Stroke) * [fallback p 1] * [RBarPos charTop slab] + [if straightBar 0 (Stroke / 2)]
define [RBarTop p charTop stroke legShape slab] : (charTop - Stroke) * [fallback p 1] * [RBarPos charTop slab] + [if legShape 0 (Stroke / 2)]

define [RShape] : params [straightBar top [bp : RBarPos top SLAB] [mul 1] [slab null]] : glyph-proc
define [RShape] : params [legShape top [bp : RBarPos top SLAB] [mul 1] [slab null]] : glyph-proc
include : PShape top (mul -- mul) (overshoot -- O) (slab -- slab)
local right (RightSB - O - [if SLAB (Jut / 8) 0])
include : RLegShape [RBarTop 1 top Stroke straightBar slab] 0 Middle right top (slab === PShape.SlabSymmetric) straightBar Stroke 0
include : RLegShapes.(legShape) [RBarTop 1 top Stroke legShape (slab === PShape.SlabSymmetric)] 0 Middle right top (slab === PShape.SlabSymmetric) Stroke 0

define [RRotundaShape] : params [straightBar top [mul 1] [pmRotunda 0] [endX Middle] [hook Hook] [pBar 1]] : glyph-proc
local legTop : RBarTop pBar top Stroke straightBar SLAB
define [RRotundaShape] : params [legShape top [mul 1] [pmRotunda 0] [endX Middle] [hook Hook] [pBar 1]] : glyph-proc
local legTop : RBarTop pBar top Stroke legShape SLAB
local right (RightSB - O - [if SLAB (Jut / 8) 0])
local cor : RLegDiagCor legTop 0 endX right 0 Stroke
local endX1 : endX - [if straightBar (HalfStroke * cor * HVContrast) HalfStroke] + [if straightBar [RSlabExtraShift SLAB Stroke] 0]
local endX1 : endX - [if legShape (HalfStroke * cor * HVContrast) HalfStroke] + [if legShape [RSlabExtraShift SLAB Stroke] 0]
include : PRotundaShape top (mul -- mul) (bp -- (pBar * [RBarPos top false])) (overshoot -- O) (slab -- false) (endX -- endX1) (hook -- hook)
include : RLegShape legTop 0 endX right top SLAB straightBar Stroke 0
include : RLegShapes.(legShape) legTop 0 endX right top SLAB Stroke 0

define [RevRShape] : params [straightBar top [bp : RBarPos top SLAB] [mul 1]] : glyph-proc
define [RevRShape] : params [legShape top [bp : RBarPos top SLAB] [mul 1]] : glyph-proc
include : RevPShape top (mul -- mul) (overshoot -- O) (slab -- SLAB)
local left (SB + O + [if SLAB (Jut / 8) 0])
include : RevRLegShape [RBarTop 1 top Stroke straightBar SLAB] 0 left Middle top SLAB straightBar Stroke 0
include : RevRLegShapes.(legShape) [RBarTop 1 top Stroke legShape SLAB] 0 left Middle top SLAB Stroke 0

define [ROverlayAnchor] : glyph-proc
set-base-anchor 'overlay'
SB + Stroke * HVContrast
PBarPosY CAP Stroke : RBarPos CAP SLAB

define RConfig : object
straight { true [if SLAB PShape.SlabSymmetric] false }
curly { false [if SLAB PShape.SlabSymmetric] false }
straightOpen { true [if SLAB PShape.SlabSymmetric] true }
curlyOpen { false [if SLAB PShape.SlabSymmetric] true }
straightMotionSerifed { true PShape.SlabMotion false }
curlyMotionSerifed { false PShape.SlabMotion false }
straightOpenMotionSerifed { true PShape.SlabMotion true }
curlyOpenMotionSerifed { false PShape.SlabMotion true }
standing { 2 [if SLAB PShape.SlabSymmetric] false }
straight { 1 [if SLAB PShape.SlabSymmetric] false }
curly { 0 [if SLAB PShape.SlabSymmetric] false }
standingOpen { 2 [if SLAB PShape.SlabSymmetric] true }
straightOpen { 1 [if SLAB PShape.SlabSymmetric] true }
curlyOpen { 0 [if SLAB PShape.SlabSymmetric] true }
standingMotionSerifed { 2 PShape.SlabMotion false }
straightMotionSerifed { 1 PShape.SlabMotion false }
curlyMotionSerifed { 0 PShape.SlabMotion false }
standingOpenMotionSerifed { 2 PShape.SlabMotion true }
straightOpenMotionSerifed { 1 PShape.SlabMotion true }
curlyOpenMotionSerifed { 0 PShape.SlabMotion true }

foreach { suffix { fStraight slabs fOpen } } [Object.entries RConfig] : begin
local fMotion : slabs === PShape.SlabMotion
Expand Down Expand Up @@ -164,21 +214,22 @@ glyph-block Letter-Latin-Upper-R : begin
select-variant 'cyrl/ya' 0x44F (follow -- 'cyrl/Ya')
turned 'invsmcpR' 0x281 'cyrl/ya' Middle (XH / 2)

define [IndianRupeeShape suffix straightBar] : glyph-proc
define [IndianRupeeShape suffix legShape] : glyph-proc
define bp : RBarPos CAP 0
include : intersection
Rect CAP 0 SB Width
WithTransform [Translate (-Width / 8) 0]
PShape CAP (bp -- bp) (withBar -- false)
local right : RightSB - O - [if straightBar 0 (Width / 16)]
include : RLegShape [RBarTop 1 CAP Stroke straightBar false] 0 (Width * 0.375) right CAP false straightBar Stroke 0
local right : RightSB - O - [if legShape 0 (Width / 16)]
include : RLegShapes.(legShape) [RBarTop 1 CAP Stroke legShape false] 0 (Width * 0.375) right CAP false Stroke 0

define sw : AdviceStroke2 2 4 CAP
include : HBarTop SB RightSB CAP sw
include : HBar SB RightSB [mix CAP [PBarPosY CAP Stroke bp] 0.5] sw

create-glyph 'currency/indianRupeeSign.straight' : IndianRupeeShape 'straight' true
create-glyph 'currency/indianRupeeSign.curly' : IndianRupeeShape 'curly' false
create-glyph 'currency/indianRupeeSign.curly' : IndianRupeeShape 'curly' 0
create-glyph 'currency/indianRupeeSign.straight' : IndianRupeeShape 'straight' 1
create-glyph 'currency/indianRupeeSign.standing' : IndianRupeeShape 'curly' 2

select-variant 'currency/indianRupeeSign' 0x20B9 (follow -- 'Rrotunda')

Expand All @@ -200,15 +251,17 @@ glyph-block Letter-Latin-Upper-R : begin

local right (RightSB - O - [if SLAB (Jut / 8) 0])
create-derived 'Yr.straight'
RLegShape ((top - Stroke) * bp) Descender Middle right (top - Descender) SLAB true Stroke 0
RLegShape-Straight ((top - Stroke) * bp) Descender Middle right (top - Descender) SLAB Stroke 0
create-derived 'Yr.curly'
RLegShape ((top - Stroke) * bp) Descender Middle right (top - Descender) SLAB false Stroke 0
RLegShape-Curly ((top - Stroke) * bp) Descender Middle right (top - Descender) SLAB Stroke 0
create-derived 'Yr.standing'
RLegShape-Standing ((top - Stroke) * bp) Descender Middle right (top - Descender) SLAB Stroke 0

select-variant 'Yr' 0x1A6 (follow -- 'Rrotunda')


create-glyph 'mathbb/R' 0x211D : glyph-proc
define [SingleLeg] : RLegShape ((CAP - BBS) * HBarPos) 0 Middle (RightSB - O) CAP false true BBS (BBD / 2)
define [SingleLeg] : RLegShape-Straight ((CAP - BBS) * HBarPos) 0 Middle (RightSB - O) CAP false BBS (BBD / 2)
define terminalX : RLegTerminalX true (RightSB - O) BBS
include : MarkSet.capital
include : BBPShape (mul -- 1) (overshoot -- O)
Expand Down
39 changes: 33 additions & 6 deletions params/variants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -322,48 +322,75 @@ selector.R = "curly"
selector."cyrl/Ya" = "curly"
selector.Rrotunda = "curly"

[prime.capital-r.variants.straight-open]
[prime.capital-r.variants.standing]
rank = 3
description = '`R` with near-vertical standing leg'
selector.R = "standing"
selector."cyrl/Ya" = "standing"
selector.Rrotunda = "standing"

[prime.capital-r.variants.straight-open]
rank = 4
description = 'Standard, straight-leg `R`, with open contour at bottom'
selector.R = "straightOpen"
selector."cyrl/Ya" = "straightOpen"
selector.Rrotunda = "straight"

[prime.capital-r.variants.curly-open]
rank = 4
rank = 5
description = ' Slightly curly-legged `R`, like Iosevka 2.x, with open contour at bottom'
selector.R = "curlyOpen"
selector."cyrl/Ya" = "curlyOpen"
selector.Rrotunda = "curly"

[prime.capital-r.variants.standing-open]
rank = 6
description = '`R` with near-vertical standing leg, with open contour at bottom'
selector.R = "standingOpen"
selector."cyrl/Ya" = "standingOpen"
selector.Rrotunda = "standing"

[prime.capital-r.variants.straight-motion-serifed]
rank = 5
rank = 7
description = 'Standard, straight-leg `R`, with motion serifs'
selector.R = "straightMotionSerifed"
selector."cyrl/Ya" = "straight"
selector.Rrotunda = "straight"

[prime.capital-r.variants.curly-motion-serifed]
rank = 6
rank = 8
description = ' Slightly curly-legged `R`, like Iosevka 2.x, with motion serifs'
selector.R = "curlyMotionSerifed"
selector."cyrl/Ya" = "curly"
selector.Rrotunda = "curly"

[prime.capital-r.variants.standing-motino-serifed]
rank = 9
description = '`R` with near-vertical standing leg'
selector.R = "standingMotionSerifed"
selector."cyrl/Ya" = "standing"
selector.Rrotunda = "standing"

[prime.capital-r.variants.straight-open-motion-serifed]
rank = 7
rank = 10
description = 'Standard, straight-leg `R`, with open contour at bottom and motion serifs'
selector.R = "straightOpenMotionSerifed"
selector."cyrl/Ya" = "straightOpen"
selector.Rrotunda = "straight"

[prime.capital-r.variants.curly-open-motion-serifed]
rank = 8
rank = 11
description = ' Slightly curly-legged `R`, like Iosevka 2.x, with open contour at bottom and motion serifs'
selector.R = "curlyOpenMotionSerifed"
selector."cyrl/Ya" = "curlyOpen"
selector.Rrotunda = "curly"

[prime.capital-r.variants.standing-open-motion-serifed]
rank = 12
description = '`R` with near-vertical standing leg, with open contour at bottom'
selector.R = "standingOpenMotionSerifed"
selector."cyrl/Ya" = "standingOpen"
selector.Rrotunda = "standing"


[prime.capital-v]
Expand Down

0 comments on commit 10bfe14

Please sign in to comment.