Skip to content

Commit

Permalink
Add Cyrillic Ghe-with-hook and En-Ghe (#540).
Browse files Browse the repository at this point in the history
  • Loading branch information
be5invis committed May 23, 2020
1 parent 212749b commit 875916a
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 13 deletions.
3 changes: 2 additions & 1 deletion changes/3.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
* Match styles of `1` and `7` in `ss##` variants (#539).
* Refine the width of `A` and `V`.
* Changed the layout of character variants sample image for better clarity.
* Fix `head.fontRevision` computation (#545).
* Fix `head.fontRevision` computation (#545).
* Add Cyrillic Ghe-with-hook and En-Ghe (#540).
34 changes: 22 additions & 12 deletions glyphs/common-shapes.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,21 @@ glyph-block CommonShapes : begin
flat (x - sw / 2 * HVCONTRAST) y [widths.heading sw 0 RIGHTWARD]
curl (x + length + TANSLANT * (sw * SERIF_SHIFT_X)) y

define [CenterTopSerif x y length _sw] : glyph-construction
define [CenterTopSerif x y length _sw] : CenterTopSerifAsymmetric x y length length _sw

define [CenterBottomSerif x y length _sw] : CenterBottomSerifAsymmetric x y length length _sw

define [CenterTopSerifAsymmetric x y l r _sw] : begin
local sw : fallback _sw STROKE
include : dispiro
flat (x + length - TANSLANT * (sw * SERIF_SHIFT_X)) y [widths sw 0]
curl (x - length - TANSLANT * (sw * SERIF_SHIFT_X)) y
return : dispiro
flat (x + r - TANSLANT * (sw * SERIF_SHIFT_X)) y [widths sw 0]
curl (x - l - TANSLANT * (sw * SERIF_SHIFT_X)) y

define [CenterBottomSerif x y length _sw] : glyph-construction
define [CenterBottomSerifAsymmetric x y l r _sw] : begin
local sw : fallback _sw STROKE
include : dispiro
flat (x + length + TANSLANT * (sw * SERIF_SHIFT_X)) y [widths 0 sw]
curl (x - length + TANSLANT * (sw * SERIF_SHIFT_X)) y
return : dispiro
flat (x + r + TANSLANT * (sw * SERIF_SHIFT_X)) y [widths 0 sw]
curl (x - l + TANSLANT * (sw * SERIF_SHIFT_X)) y

define [DownwardRightSerif x y length sw] : glyph-construction
include : dispiro
Expand All @@ -351,28 +355,34 @@ glyph-block CommonShapes : begin
curl x (y + length) [heading UPWARD]

define sideSerifK 0.5
define [JutIn left right] : Math.min JUT (HALFSTROKE + [Math.max (HALFSTROKE * TANSLANT) ((right - left - STROKE * 2 * HVCONTRAST) / 4)])
define [AIVSerifs top _left _right] : glyph-construction
local left : fallback _left SB
local right : fallback _right RIGHTSB
local jutIn : JutIn left right
if SLAB : begin
include : CenterTopSerif (left + STROKE * sideSerifK * HVCONTRAST) top JUT
include : CenterTopSerifAsymmetric (left + STROKE * sideSerifK * HVCONTRAST) top JUT jutIn
tag-contour 'serifLT'
include : CenterTopSerif (right - STROKE * sideSerifK * HVCONTRAST) top JUT
include : CenterTopSerifAsymmetric (right - STROKE * sideSerifK * HVCONTRAST) top jutIn JUT
tag-contour 'serifRT'
define [AIHSerifs top _left _right] : glyph-construction
local left : fallback _left SB
local right : fallback _right RIGHTSB
local jutIn : JutIn left right
if SLAB : begin
include : AIVSerifs top _left _right
include : CenterBottomSerif (left + STROKE * sideSerifK * HVCONTRAST) 0 JUT
include : CenterBottomSerif (right - STROKE * sideSerifK * HVCONTRAST) 0 JUT
include : CenterBottomSerifAsymmetric (left + STROKE * sideSerifK * HVCONTRAST) 0 JUT jutIn
tag-contour 'serifLB'
include : CenterBottomSerifAsymmetric (right - STROKE * sideSerifK * HVCONTRAST) 0 jutIn JUT
tag-contour 'serifRB'
define [AINSerifs top _left _right sw xn] : glyph-construction
local left : fallback _left SB
local right : fallback _right RIGHTSB
local jut : JUT * [fallback xn 1]
if SLAB : begin
include : LeftwardTopSerif (left + sw * (sideSerifK - 0.5) * HVCONTRAST) top (jut - sw / 2 * HVCONTRAST)
include : CenterTopSerif (right - sw * sideSerifK * HVCONTRAST) top jut
tag-contour 'serifRB'
include : CenterBottomSerif (left + sw * sideSerifK * HVCONTRAST) 0 jut
tag-contour 'serifLB'
#include : CenterdBottomSerif (right - STROKE * (sideSerifK - 0.5) * HVCONTRAST) 0 (JUT / 2)
Expand Down
29 changes: 29 additions & 0 deletions glyphs/letters-unified-basic.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -3375,6 +3375,10 @@ glyph-block LetterUnified-Basic : begin
eject-contour 'serifRB'
include : VerticalHook (RIGHTSB - HALFSTROKE * HVCONTRAST) 0 (-HOOKX) HOOK

if SLAB : begin
include : tagged 'serifLT' : LeftwardTopSerif SB XH SIDEJUT
include : tagged 'serifLB' : CenterBottomSerif (SB + HALFSTROKE * HVCONTRAST) 0 JUT

save 'eng' 0x14B

sketch # Eng
Expand Down Expand Up @@ -3737,6 +3741,31 @@ glyph-block LetterUnified-Basic : begin
composite [refer-glyph 'cyrEn'] [CyrDescender RIGHTSB] [into-unicode 0x4A2]
composite [refer-glyph 'cyren'] [CyrDescender RIGHTSB] [into-unicode 0x4A3]

define [EnGheShape top] : glyph-construction
local right : if SLAB ([mix RIGHTSB SB 0.35] + MVERTSTROKE / 2 * HVCONTRAST) [mix RIGHTSB SB 0.2]
local barRight : mix WIDTH RIGHTSB [if SLAB 0.25 0.375]

include : VBarLeft SB 0 top
include : VBarRight right 0 top
include : HBar (SB - O) (right + O) (top * BARPOS)
include : HBarTop (right - STROKE * 0.1) barRight top

if SLAB : begin
include : AIHSerifs top SB right
include : DownwardRightSerif barRight top VJUT (MVERTSTROKE / HVCONTRAST)


sketch # cyrEnGhe
set-width WIDTH
include MarkSet.capital
include : EnGheShape CAP
save 'cyrEnGhe' 0x4A4

sketch # cyrenghe
include MarkSet.e
include : EnGheShape XH
save 'cyrenghe' 0x4A5

sketch # Hbar
include [refer-glyph 'H'] AS_BASE
include : HOverlayBar [mix SB 0 0.7] [mix RIGHTSB WIDTH 0.7] [mix CAPMIDDLE CAP 0.45]
Expand Down
22 changes: 22 additions & 0 deletions glyphs/letters-unified-extended.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,33 @@ glyph-block LetterUnified-Extended : begin
save 'Gamma' 0x393
save 'cyrGhe' 0x413

branch
include : nShoulder
left -- (SB + STROKE)
right -- RIGHTSB
top -- CAP * BARPOS + STROKE / 4
bottom -- 0
sma -- SMOOTHA
smb -- SMOOTHB
include : VerticalHook (RIGHTSB - HALFSTROKE * HVCONTRAST) 0 (-HOOKX) HOOK
save 'cyrGheHook' 0x494

sketch # cyrghe.upright
include MarkSet.e
include : GammaShape XH
save 'cyrghe.upright'

branch
include : nShoulder
left -- (SB + STROKE)
right -- RIGHTSB
top -- XH * BARPOS + STROKE / 4
bottom -- 0
sma -- SMOOTHA * [Math.pow BARPOS 0.3]
smb -- SMOOTHB * [Math.pow BARPOS 0.3]
include : VerticalHook (RIGHTSB - HALFSTROKE * HVCONTRAST) 0 (-HOOKX) HOOK
save 'cyrgheHook' 0x495

sketch # cyrghe.SRB
include [refer-glyph 'dotlessi'] AS_BASE
include : refer-glyph "macronAbove"
Expand Down

0 comments on commit 875916a

Please sign in to comment.