From d190dbd0bc5c980e0ec13e9c0deb4010b1c8504c Mon Sep 17 00:00:00 2001 From: be5invis Date: Tue, 15 Dec 2015 13:10:01 +0800 Subject: [PATCH] WE HAVE HEAVY! --- buildglyphs.aki | 3 ++- glyphs/common-shapes.aki | 15 ++++++++++++ glyphs/letters-unified-basic.aki | 14 +++++------ glyphs/letters-unified-extended.aki | 8 +++--- glyphs/numbers.aki | 6 ++--- glyphs/symbol-punctuation.aki | 38 ++++++++++++++--------------- parameters.toml | 8 ++++-- 7 files changed, 56 insertions(+), 36 deletions(-) diff --git a/buildglyphs.aki b/buildglyphs.aki index 941e719..aefb19a 100644 --- a/buildglyphs.aki +++ b/buildglyphs.aki @@ -202,6 +202,7 @@ export as build : define [buildFont para recursive recursiveCodes] : begin define FULLWIDTH : if para.cjkSpacing (WIDTH * 2) WIDTH define VSTROKE : STROKE * CONTRAST define ESS : STROKE * [fallback para.essx CONTRAST] + define ESSQUESTION : STROKE * [fallback para.essxq CONTRAST] define XO : XH - O define CAPO : CAP - O define HALFSTROKE : STROKE / 2 @@ -240,7 +241,7 @@ export as build : define [buildFont para recursive recursiveCodes] : begin define [adviceSSmooth y sign] : begin local ss : y * 0.22 + STROKE * 0.225 + 0.02 * (RIGHTSB - SB) return : ss + sign * globalTransform.yx * para.smoothadjust * (ss / SMALLSMOOTH) - define [adviceGlottalStopSmooth y sign] : ((y - STROKE) * 0.25 + STROKE / 2) + sign * globalTransform.yx * para.smoothadjust + define [adviceGlottalStopSmooth y sign] : ((y - STROKE) * 0.24 + STROKE * 0.625) + sign * globalTransform.yx * para.smoothadjust define [shoulderMidSlope _fine _stroke _dir] : 0.5 * CORRECTION_HX * ([fallback _stroke STROKE] - [fallback _fine SHOULDERFINE]) / [fallback _stroke STROKE] + [fallback _dir 1] * globalTransform.yx # Anchor parameters diff --git a/glyphs/common-shapes.aki b/glyphs/common-shapes.aki index cc60bc8..948c704 100644 --- a/glyphs/common-shapes.aki +++ b/glyphs/common-shapes.aki @@ -476,6 +476,7 @@ define nHookSegments 8 define [HookShape toStraight toFinish isStart y tight s kkaf adj] : 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) toFinish.x = toFinish.x + OXHOOK * [if ltr (-1) 1] * [if isStart (-1) 1] if (atBottom && ltr && !isStart) : begin toFinish.x = toFinish.x + TAILADJX * globalTransform.yx @@ -488,6 +489,20 @@ define [HookShape toStraight toFinish isStart y tight s kkaf adj] : begin 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] + local faf toFinish.af + set toFinish.af : lambda [] : begin + local sw : fallback s STROKE + local rad : Math.min w (mixr * u) + local skew0 : [clamp 0 w (w - v)] / rad + ([clamp 1 1.5 (mixr * u / w)] - 1) * 0.5 + local depth : v + skew0 * sw - sw + local shallowLimit (sw * 0.5) + local skew : clamp 0 (1 / 2) : skew0 + [clamp 0 shallowLimit (shallowLimit - depth)] / rad + if faf : faf.apply this arguments + this.heads-to { + .x (CONTRAST / [Math.sqrt : 1 + skew * skew] * [if dtu (-1) 1]) + .y (skew / [Math.sqrt : 1 + skew * skew] * [if ltr 1 (-1)]) + } + local segBefore {} local segAfter {} foreach [j : range 1 nHookSegments] : begin diff --git a/glyphs/letters-unified-basic.aki b/glyphs/letters-unified-basic.aki index 55df896..0d82ff6 100644 --- a/glyphs/letters-unified-basic.aki +++ b/glyphs/letters-unified-basic.aki @@ -68,14 +68,14 @@ symbol-block 'i' create-glyph 'dotlessi.italic' : glyph-construction local left : [mix SB RIGHTSB 0.48] - HALFSTROKE * CORRECTION_HX - local right : mix SB RIGHTSB 1.05 + local right : mix SB RIGHTSB [linreg 18 1.05 120 1.1 STROKE] local middle : mix left right 0.55 include : dispiro widths.lhs flat left XH [heading DOWNWARD] curl left (SMALLSMOOTHB * 0.8) hookend O - g4 right (SHOOK * 0.8) + g4 right (SHOOK * [linreg 18 0.8 120 1 STROKE]) include : dispiro flat (left - LONGJUT + HALFSTROKE * CORRECTION_HX) XH [widths 0 STROKE] curl left XH @@ -1495,7 +1495,7 @@ define {CShape} : symbol-block 'C' flat.ai (SB + OX) (XH - SMALLSMOOTHA) curl.ai (SB + OX) SMALLSMOOTHB arcvh - CurlyTail fine rinner m1 0 RIGHTSB x2 y2 [linreg 500 (0.5) 375 (-0.25) WIDTH] nothing 1 + CurlyTail fine rinner m1 0 RIGHTSB x2 y2 [linreg 500 (0.5) 375 (-0.25) WIDTH] nothing [linreg 500 (0) 375 (1) WIDTH] create-glyph 'cyrE' : glyph-construction assign-unicode 0x42D @@ -2262,7 +2262,7 @@ define {FShape} : symbol-block 'F' define [FShape top y] : glyph-construction include : VBarLeft (SB * 1.5) 0 [fallback top CAP] include : HBarTop (SB * 1.5 - O) RIGHTSB [fallback top CAP] - include : HBar (SB * 1.5 - O) (RIGHTSB - [Math.max HALFSTROKE ((RIGHTSB - SB) * 0.1)] - [if SLAB (STROKE * 0.25) 0]) ([fallback top CAP] * [fallback y [if SLAB 0.52 0.54]]) + include : HBar (SB * 1.5 - O) (RIGHTSB - [Math.max HALFSTROKE ((RIGHTSB - SB) * 0.15)] - [if SLAB (STROKE * 0.25) 0]) ([fallback top CAP] * [fallback y [if SLAB 0.52 0.54]]) if SLAB : begin include : LeftwardTopSerif (SB * 1.5) [fallback top CAP] SIDEJUT include : CenterBottomSerif (SB * 1.5 + HALFSTROKE * CORRECTION_HX) 0 JUT @@ -2487,7 +2487,7 @@ define {SmallEShape} : symbol-block 'e' [if ((SMALLSMOOTHA + SMALLSMOOTHB) / top > 0.75) flat.ai flat] (SB + OX) (top - SMALLSMOOTHA) [if ((SMALLSMOOTHA + SMALLSMOOTHB) / top > 0.75) curl.ai curl] (SB + OX) (0 + SMALLSMOOTHB) hookend O nothing stroke - g4 (RIGHTSB - OX * 0.5) AHOOK + g4 (RIGHTSB - OX * [if para.isItalic 0 0.5]) AHOOK include : HBarBottom (SB + (stroke / 2) + OX) (RIGHTSB - (stroke / 2) - OX) barbottom stroke create-glyph 'e' : glyph-construction @@ -2677,12 +2677,12 @@ symbol-block 'S' g4 SB HOOK alias 'cyrDze' 0x405 'S' - local smallSMix : clamp 0 1 : linreg 0 [linreg 18 1 108 0.95 STROKE] 50 1 [Math.abs : WIDTH - 500] + 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 - globalTransform.yx * 3) + define smooth : adviceSSmooth XH (-1 - globalTransform.yx * (8.5 - (WIDTH / 500) * 5.5)) include : dispiro widths.lhs g4 RIGHTSB (XH - SHOOK) diff --git a/glyphs/letters-unified-extended.aki b/glyphs/letters-unified-extended.aki index fb0bfa4..7e0fdb2 100644 --- a/glyphs/letters-unified-extended.aki +++ b/glyphs/letters-unified-extended.aki @@ -1553,7 +1553,7 @@ symbol-block 'Glottal stop' curl (MIDDLE + HALFSTROKE * CORRECTION_HX) 0 [heading DOWNWARD] if SLAB : begin include : CenterBottomSerif MIDDLE 0 JUT - + create-glyph 'smallglottalstop' : glyph-construction assign-unicode 0x242 include bMarks @@ -1561,7 +1561,7 @@ symbol-block 'Glottal stop' widths.rhs g4 SB (XH - HOOK) hookstart XO - g4 RIGHTSB (XH - [adviceGlottalStopSmooth XH 1]) + g4 RIGHTSB (XH - [adviceGlottalStopSmooth XH 1]) [heading DOWNWARD] alsothru 0.5 0.45 [widths (ESS / 2) (ESS / 2)] flat (MIDDLE - HALFSTROKE * CORRECTION_HX) (XH * 0.15) [widths STROKE 0] curl (MIDDLE - HALFSTROKE * CORRECTION_HX) 0 [heading DOWNWARD] @@ -1575,7 +1575,7 @@ symbol-block 'Glottal stop' widths.lhs g4 RIGHTSB (XH - HOOK) hookstart XO - g4 SB (XH - [adviceGlottalStopSmooth XH 1]) + g4 SB (XH - [adviceGlottalStopSmooth XH (-1)]) [heading DOWNWARD] alsothru 0.5 0.45 [widths (ESS / 2) (ESS / 2)] flat (MIDDLE + HALFSTROKE * CORRECTION_HX) (XH * 0.15) [widths 0 STROKE] curl (MIDDLE + HALFSTROKE * CORRECTION_HX) 0 [heading DOWNWARD] @@ -1631,7 +1631,7 @@ symbol-block 'eth' : create-glyph 'eth' : glyph-construction local ymiddlea : (CAP * 0.6 + SMALLSMOOTHA - SMALLSMOOTHB) / 2 include : dispiro widths.lhs - g4.up.start (RIGHTSB - O) ymiddlea + g4.up.start (RIGHTSB - OX) ymiddlea quadcontrols 0 0.8 g4 (SB + STROKE * 1.1) CAP diff --git a/glyphs/numbers.aki b/glyphs/numbers.aki index be3d0e0..2258308 100644 --- a/glyphs/numbers.aki +++ b/glyphs/numbers.aki @@ -43,13 +43,13 @@ symbol-block "Numbers" set-width WIDTH assign-unicode '2' - define smooth [adviceGlottalStopSmooth CAP 1] + define smooth : [adviceGlottalStopSmooth CAP 1] * 0.95 include : dispiro widths.rhs g4 SB (CAP - HOOK) hookstart (CAP - O) - g4 RIGHTSB (CAP - smooth) - alsothru 0.5 0.425 [widths (ESS / 2) (ESS / 2)] + g4 (RIGHTSB - OX / 2) (CAP - smooth) + alsothru 0.5 [linreg 18 0.425 120 0.4 STROKE] [widths.center STROKE] flat SB 1 [widths.heading STROKE 0 DOWNWARD] curl SB 0 [heading DOWNWARD] diff --git a/glyphs/symbol-punctuation.aki b/glyphs/symbol-punctuation.aki index f946b63..4a652d4 100644 --- a/glyphs/symbol-punctuation.aki +++ b/glyphs/symbol-punctuation.aki @@ -176,6 +176,7 @@ symbol-block 'Small Punctuations' alias 'greeksemicolon' 0x37E 'semicolon' symbol-block 'Emotion Punctuations' + local questionBottom : Math.max (CAP * 0.3) (DOTSIZE * 1.5) create-glyph 'question' : glyph-construction set-width WIDTH assign-unicode '?' @@ -184,10 +185,20 @@ symbol-block 'Emotion Punctuations' widths.rhs g4 SB (CAP - HOOK) hookstart CAPO - g4 RIGHTSB (CAP - SMOOTHB * 0.85) - alsothru 0.5 0.5 [widths HALFSTROKE HALFSTROKE] - flat (MIDDLE - HALFSTROKE * CORRECTION_HX) [mix (DOTSIZE + STROKE) (XH / 2) 0.5] [widths STROKE 0] - curl (MIDDLE - HALFSTROKE * CORRECTION_HX) ([mix (DOTSIZE + STROKE) (XH / 2) 0.5] - 1) + g4 RIGHTSB (CAP - SMOOTHB * 0.9) + alsothru 0.5 0.45 [widths.center ESSQUESTION] + straight.down.end (MIDDLE - HALFSTROKE * CORRECTION_HX) questionBottom [widths STROKE 0] + create-glyph 'dwquestion' : glyph-construction + set-width UPM + assign-unicode 0xFF1F + include : Ring (DOTSIZE - O) O (UPM / 2 - DOTRADIUS + O) (UPM / 2 + DOTRADIUS - O) true + include : dispiro + widths.rhs + g4 (UPM * 0.25) (CAP - HOOK) + hookstart CAPO + g4 (UPM * 0.75) (CAP - SMOOTHB * 0.9) + alsothru 0.5 0.45 [widths.center ESSQUESTION] + straight.down.end (UPM / 2 - HALFSTROKE * CORRECTION_HX) questionBottom [widths STROKE 0] create-glyph 'questionDown' : glyph-construction assign-unicode 0xBF @@ -199,7 +210,7 @@ symbol-block 'Emotion Punctuations' set-width WIDTH include capitalMarks assign-unicode '!' - include : VBar MIDDLE [mix (DOTSIZE + STROKE) (XH / 2) 0.5] CAP + include : VBar MIDDLE questionBottom CAP include : Ring (DOTSIZE - O) O (MIDDLE - DOTRADIUS + O) (MIDDLE + DOTRADIUS - O) true create-glyph 'exclamDown' : glyph-construction @@ -225,8 +236,9 @@ symbol-block 'Emotion Punctuations' include : VBar MIDDLE parenBot parenTop create-glyph 'brokenbar' : glyph-construction assign-unicode 0xA6 - include : VBar MIDDLE (parenMid + HALFSTROKE) parenTop - include : VBar MIDDLE parenBot (parenMid - HALFSTROKE) + local breakDist : Math.max STROKE (CAP / 8) + include : VBar MIDDLE (parenMid + breakDist / 2) parenTop + include : VBar MIDDLE parenBot (parenMid - breakDist / 2) # Click symbols alias 'dentalclick' 0x1C0 'bar' @@ -729,15 +741,3 @@ symbol-block 'Double-width punctuations' dwl nothing 0xFF0E 'period' dwr nothing 0xFF08 'parenLeft' dwl nothing 0xFF09 'parenRight' - create-glyph 'dwquestion' : glyph-construction - set-width UPM - assign-unicode 0xFF1F - include : Ring (DOTSIZE - O) O (UPM / 2 - DOTRADIUS + O) (UPM / 2 + DOTRADIUS - O) true - include : dispiro - widths.rhs - g4 (UPM * 0.25) (CAP - HOOK) - hookstart CAPO - g4 (UPM * 0.75) (CAP - SMOOTHB * 0.85) - alsothru 0.5 0.5 [widths HALFSTROKE HALFSTROKE] - flat (UPM / 2 - HALFSTROKE * CORRECTION_HX) [mix (DOTSIZE + STROKE) (XH / 2) 0.5] [widths STROKE 0] - curl (UPM / 2 - HALFSTROKE * CORRECTION_HX) ([mix (DOTSIZE + STROKE) (XH / 2) 0.5] - 1) diff --git a/parameters.toml b/parameters.toml index ed40090..e56daa4 100644 --- a/parameters.toml +++ b/parameters.toml @@ -36,7 +36,7 @@ gbarpos = 0.42 pbarpos = 0.53 fivebarpos = 0.63 -hook = 155 # Hook depth in most letters +hook = 155 # Hook depth in most letters ahook = 130 shook = 110 jhook = 135 @@ -137,11 +137,13 @@ stroke = 108 dotsize = 160 periodsize = 180 essx = 1.05 +essxq = 1.15 jut = 90 vjut = 165 barpos = 0.51 fivebarpos = 0.64 +hook = 160 oxhook = -5 ahook = 120 rbalance = 50 @@ -163,11 +165,13 @@ stroke = 120 dotsize = 180 periodsize = 200 essx = 1.05 +essxq = 1.15 jut = 95 vjut = 170 barpos = 0.51 fivebarpos = 0.64 +hook = 165 oxhook = -5 ahook = 120 rbalance = 50 @@ -190,7 +194,7 @@ isItalic = false isItalic = true italicangle = 10 tbalance = 50 -jhook = 90 +jhook = 120 [s-italic.adds] style = " Italic"