The /s is finally perfect.

This commit is contained in:
be5invis 2015-12-28 01:27:45 +08:00
parent 07aa54b200
commit 6d6d009b61
4 changed files with 22 additions and 21 deletions

View File

@ -242,7 +242,7 @@ export as build : define [buildFont para recursive recursiveCodes] : begin
define [superxy x] : Math.pow (1 - [Math.pow x SUPERNESS]) (1 / SUPERNESS)
define [adviceSSmooth y sign] : begin
local ss : y * 0.22 + STROKE * 0.23 + 0.02 * (RIGHTSB - SB)
local ss : y * 0.22 + STROKE * 0.225 * [clamp 1 2 : linreg 126 1 137 1.1 STROKE] + 0.02 * (RIGHTSB - SB)
return : ss + sign * TANSLANT * para.smoothadjust * (ss / SMALLSMOOTH)
define [adviceGlottalStopSmooth y sign] : ((y - STROKE) * 0.24 + STROKE * 0.625) + sign * TANSLANT * para.smoothadjust
define [shoulderMidSlope _fine _stroke _dir] : 0.5 * HVCONTRAST * ([fallback _stroke STROKE] - [fallback _fine SHOULDERFINE]) / [fallback _stroke STROKE] + [fallback _dir 1] * TANSLANT

View File

@ -726,9 +726,9 @@ symbol-block 'CJK Double Width Characters'
### Generate Features and remove double-width glyphs when necessary
if [not recursive] : begin
if [not para.cjk] : begin
set font.glyf : font.glyf.filter [lambda [g] : g.advanceWidth <= WIDTH]
set glyphList font.glyf
# if [not para.cjk] : begin
# set font.glyf : font.glyf.filter [lambda [g] : g.advanceWidth <= WIDTH]
# set glyphList font.glyf
set font.features.cv {.}
foreach [name : items-of : Object.keys glyphs] : begin

View File

@ -433,12 +433,14 @@ define [FlatSlashShape middlex middle fine kx ky] : glyph-construction
curl (middlex + LONGJUT * [fallback kx 0.8]) (middle + LONGJUT * [fallback ky 0.4])
# Spiro shapes
define [determineMixR w v adj] : piecewise
(w <= v) 0.5
true : (adj || 1) / ([Math.pow (1 - [Math.pow (1 - v / w) SUPERNESS]) (1 / SUPERNESS)] + 1)
define nHookSegments 8
define [determineMixR w v u] : begin
local smallSMix : clamp 0 1 : linreg 0 [linreg 18 1 108 0.975 STROKE] 50 1 [clamp 0 500 : 500 - WIDTH]
return : piecewise
(w <= v) 0.5
true : 1 / ([Math.pow (1 - [Math.pow (1 - v / w) SUPERNESS]) (1 / SUPERNESS)] + 1)
define [HookShape toStraight toFinish isStart y tight s kkaf adj] : begin
define nHookSegments 16
define [HookShape toStraight toFinish isStart y tight s kkaf] : begin
local atBottom : toStraight.y > y
local ltr : if isStart (toFinish.x < toStraight.x) (toFinish.x > toStraight.x)
local dtu : if isStart (y > toFinish.y) (y < toFinish.y)
@ -450,7 +452,7 @@ define [HookShape toStraight toFinish isStart y tight s kkaf adj] : begin
local w : Math.abs (toStraight.y - y)
local v : Math.abs (toFinish.y - y)
local u : Math.abs (toFinish.x - toStraight.x)
local mixr : determineMixR w v adj
local mixr : determineMixR w v u
local mx ([mix toStraight.x toFinish.x mixr] + ([if tight 0 : if atBottom 1 (-1)] * CORRECTION_OMIDX) * [fallback s STROKE])
local keyKnot : g4.[if ltr "right" "left"].mid mx y [fallback kkaf : if tight [heading [if ltr RIGHTWARD LEFTWARD]] nothing]
@ -487,8 +489,8 @@ define [HookShape toStraight toFinish isStart y tight s kkaf adj] : begin
* keyKnot
* segAfter
define [hookstart y tight s kkaf adj] : return {.type 'interpolate' .af [lambda [before after] [HookShape after before true y tight s kkaf adj]]}
define [hookend y tight s kkaf adj] : return {.type 'interpolate' .af [lambda [before after] [HookShape before after false y tight s kkaf adj]]}
define [hookstart y tight s kkaf] : return {.type 'interpolate' .af [lambda [before after] [HookShape after before true y tight s kkaf]]}
define [hookend y tight s kkaf] : return {.type 'interpolate' .af [lambda [before after] [HookShape before after false y tight s kkaf]]}
define [WaveShape l r cy extendy tension sw] : glyph-construction
local cx : mix l r 0.5

View File

@ -2730,20 +2730,19 @@ symbol-block 'S'
g4 SB HOOK
alias 'cyrDze' 0x405 'S'
local smallSMix : clamp 0 1 : linreg 0 [linreg 18 1 108 0.975 STROKE] 50 1 [clamp 0 500 : 500 - WIDTH]
create-glyph 's' : glyph-construction
set-width WIDTH
assign-unicode 's'
include eMarks
define smooth : adviceSSmooth XH (-1 - TANSLANT * (15 - (WIDTH / 500) * 12) * [clamp 0 1 : linreg 126 1 135 0.5 STROKE])
define smooth : adviceSSmooth XH (-1 - [linreg 18 0 126 1 STROKE] * (2.375 - (WIDTH / 500) * 2 * [linreg 18 0 126 1 STROKE]))
include : dispiro
widths.lhs
g4 RIGHTSB (XH - SHOOK)
hookstart XO nothing nothing nothing smallSMix
g4.down.mid SB (XH - smooth)
hookstart XO
g4.down.mid (SB + OX / 2) (XH - smooth)
alsothru 0.5 0.5 [widths.center ESS]
g4.down.mid RIGHTSB (smooth) [widths 0 STROKE]
hookend O nothing nothing nothing smallSMix
g4.down.mid (RIGHTSB - OX / 2) (smooth) [widths 0 STROKE]
hookend O
g4 SB SHOOK
alias 'cyrdze' 0x455 's'
@ -2764,15 +2763,15 @@ symbol-block 'S'
create-glyph 'revs' : glyph-construction
assign-unicode 0x1A8
include eMarks
local smooth : adviceSSmooth XH (1 + TANSLANT * 5)
local smooth : adviceSSmooth XH (1 + [linreg 18 0 126 1 STROKE] * (3.25 - (WIDTH / 500) * 2 * [linreg 18 0 126 1 STROKE]))
include : dispiro
widths.rhs
g4 SB (XH - SHOOK)
hookstart XO nothing nothing nothing smallSMix
hookstart XO
g4 RIGHTSB (XH - smooth)
alsothru 0.5 0.5 [widths.center ESS]
g4 SB (smooth) [widths STROKE 0]
hookend O nothing nothing nothing smallSMix
hookend O
g4 RIGHTSB SHOOK
create-glyph 'srtail' : glyph-construction