diff --git a/buildglyphs.patel b/buildglyphs.patel index 8c5d5adad..f82a788e4 100644 --- a/buildglyphs.patel +++ b/buildglyphs.patel @@ -98,6 +98,9 @@ define [buildFont para recursive] : begin { define SMALLSMOOTHB : SMALLSMOOTH + globalTransform.yx * para.smoothadjust define ITALICCORS : STROKE * globalTransform.yx + define OMIDCOR : globalTransform.yx * 1.2 + define OMIDCOR_S : STROKE * OMIDCOR + # style parameters define EBARPOS : para.ebarpos || BARPOS define KAPPA para.kappa diff --git a/glyphs/common-shapes.patel b/glyphs/common-shapes.patel index 48e7f4b31..2db1e60b3 100644 --- a/glyphs/common-shapes.patel +++ b/glyphs/common-shapes.patel @@ -20,19 +20,17 @@ define [Ring u d l r transformShiftOnly] : begin { return s.points } define [RingAt x y r] : Ring [y + r] [y - r] [x - r] [x + r] -define [ORing u d l r smooth] : begin { - local myu [u - smooth] - local myd [d + smooth] +define [ORing u d l r sma smb shift] : begin { local mx [[l + r] / 2] local s : new Stroke :.set-transform globalTransform - :.start-from mx d - :.cubic-to [mx + [l - mx] * CKAPPA] d l [myd + [d - myd] * CKAPPA] l myd - :.line-to l myu - :.cubic-to l [myu + [u - myu] * CKAPPA] [mx + [l - mx] * CKAPPA] u mx u - :.cubic-to [mx + [r - mx] * CKAPPA] u r [myu + [u - myu] * CKAPPA] r myu - :.line-to r myd - :.cubic-to r [myd + [d - myd] * CKAPPA] [mx + [r - mx] * CKAPPA] d mx d + :.start-from [mx + shift] d + :.arc-hv-to l [d + smb] + :.line-to l [u - sma] + :.arc-vh-to [mx - shift] u + :.arc-hv-to r [u - smb] + :.line-to r [d + sma] + :.arc-vh-to [mx + shift] d return s.points } define [leftwardTopSerif x y length] : begin { @@ -152,30 +150,29 @@ define [xStrand _leftx lefty _rightx righty turn straight tension] : begin { :.concat : halfXStrand _rightx righty middlex middley turn straight tension } -define [nBowl left middle right fine _top _bottom _sma _smb] : begin { +define [nShoulder left middle right fine _top _bottom _sma _smb] : begin { local top : fallback _top XH local bottom : fallback _bottom 0 local sma : fallback _sma SMALLSMOOTHA local smb : fallback _smb SMALLSMOOTHB - local bandLeft : new Stroke + local band : new Stroke :.set-transform globalTransform :.start-from right bottom - :.heads-to UPWARD - :.set-width STROKE 0 - :.line-to right [top - smb] - :.arc-vh-to middle [top - O] - :.heads-to LEFTWARD + :.heads-to UPWARD + :.set-width STROKE 0 + :.line-to right [top - smb] + :.arc-vh-to middle [top - O] + :.heads-to LEFTWARD + :.set-samples 12 :.to-outline - local bandRight : new Stroke + local shoulder : new Stroke :.set-transform globalTransform :.start-from middle [top - O - STROKE] - :.set-width 0 STROKE - :.heads-to LEFTWARD - :.arc-hv-to left [top - sma] - :.heads-to DOWNWARD - :.set-width 0 fine - :.to-outline - return : bandLeft.concat bandRight + :.arc-hv-to left [top - sma] + :.line-to [left - fine] [top - sma] + :.arc-vh-to middle [top - O] + + return : band.concat (shoulder.points) } define [XSHookUpper top left middle right smooth hook] : glyph-construction { @@ -183,8 +180,7 @@ define [XSHookUpper top left middle right smooth hook] : glyph-construction { :.set-transform globalTransform :.start-from [right - OXHOOK] [top - hook] :.set-width STROKE 0 - :.curve-to [mix middle right KAPPA_HOOK] [top - O] middle [top - O] - :.heads-to [if [left < right] LEFTWARD RIGHTWARD] + :.curve-to [mix middle right KAPPA_HOOK] [top - O] [middle - OMIDCOR_S] [top - O] :.arc-hv-to left [top - smooth] } define [sHookUpper top smooth hook _middle] : glyph-construction { @@ -196,8 +192,7 @@ define [twoHookUpper top smooth hook _middle] : glyph-construction { :.set-transform globalTransform :.start-from [SB + OXHOOK] [top - hook] :.set-width 0 STROKE - :.curve-to [mix middle SB KAPPA_HOOK] [top - O] middle [top - O] - :.heads-to RIGHTWARD + :.curve-to [mix middle SB KAPPA_HOOK] [top - O] [middle - OMIDCOR_S] [top - O] :.arc-hv-to RIGHTSB [top - smooth] } define [sHookLower bottom smooth hook _middle] : glyph-construction { @@ -208,8 +203,7 @@ define [XSHookLower bottom left middle right smooth hook] : glyph-construction { :.set-transform globalTransform :.start-from right [bottom + smooth] :.set-width [if [left < right] 0 STROKE] [if [left < right] STROKE 0] - :.arc-vh-to middle [bottom + O] - :.heads-to [if [left < right] LEFTWARD RIGHTWARD] + :.arc-vh-to [middle + OMIDCOR_S] [bottom + O] :.curve-to [mix middle left KAPPA_HOOK] [bottom + O] [left + OXHOOK] [bottom + hook] } @@ -218,36 +212,31 @@ define [smallo u d l r _width _sma _smb] : glyph-construction { local width : fallback _width STROKE local sma : fallback _sma SMALLSMOOTHA local smb : fallback _smb SMALLSMOOTHB + local mc : OMIDCOR * width if [u - d > sma + smb] { then : begin { include : create-stroke :.set-transform globalTransform - :.start-from middle [u - O] + :.start-from [middle - mc] [u - O] :.set-width width 0 - :.heads-to LEFTWARD :.arc-hv-to [l + O] [u - sma] :.line-to [l + O] [d + smb] - :.arc-vh-to middle [d + O] - :.heads-to RIGHTWARD + :.arc-vh-to [middle + mc] [d + O] :.arc-hv-to [r - O] [d + sma] :.line-to [r - O] [u - smb] - :.arc-vh-to middle [u - O] - :.heads-to LEFTWARD + :.arc-vh-to [middle - mc] [u - O] } else : begin { local ymiddlea : mix d u [smb / [sma + smb]] local ymiddleb : mix d u [sma / [sma + smb]] include : create-stroke :.set-transform globalTransform - :.start-from middle [u - O] + :.start-from [middle - mc] [u - O] :.set-width width 0 - :.heads-to LEFTWARD :.arc-hv-to [l + O] ymiddlea - :.arc-vh-to middle [d + O] - :.heads-to RIGHTWARD + :.arc-vh-to [middle + mc] [d + O] :.arc-hv-to [r - O] ymiddleb - :.arc-vh-to middle [u - O] - :.heads-to LEFTWARD + :.arc-vh-to [middle - mc] [u - O] } } } diff --git a/glyphs/cyrillic-basic.patel b/glyphs/cyrillic-basic.patel index 0c37dbe30..f0fa8dc34 100644 --- a/glyphs/cyrillic-basic.patel +++ b/glyphs/cyrillic-basic.patel @@ -139,12 +139,10 @@ create-glyph 'cyrve.italic' : glyph-construction { :.set-width STROKE 0 :.line-to MIDDLE [XH / 2 - HALFSTROKE] :.arc-hv-to [RIGHTSB + O] [XH - SMOOTHB * 0.87] KAPPA - :.arc-vh-to MIDDLE XO - :.heads-to LEFTWARD + :.arc-vh-to [MIDDLE - OMIDCOR_S] XO :.arc-hv-to [SB + O] [XH - SMALLSMOOTHA] :.line-to [SB + O] SMALLSMOOTHB - :.arc-vh-to MIDDLE O - :.heads-to RIGHTWARD + :.arc-vh-to [MIDDLE + OMIDCOR_S] O :.arc-hv-to [RIGHTSB - O] [SMOOTHA * 0.87] :.arc-vh-to MIDDLE [XH / 2 + HALFSTROKE] KAPPA :.line-to mid [XH / 2 + HALFSTROKE] diff --git a/glyphs/cyrillic-extended.patel b/glyphs/cyrillic-extended.patel index ea40db144..d45ff975f 100644 --- a/glyphs/cyrillic-extended.patel +++ b/glyphs/cyrillic-extended.patel @@ -68,7 +68,7 @@ create-glyph 'cyrTshe' : glyph-construction { local left : mix SB RIGHTSB 0.15 - include : nBowl [left + STROKE * ITALICCOR] [mix left RIGHTSB 0.5] RIGHTSB [STROKE * 0.4] + include : nShoulder [left + STROKE * ITALICCOR] [mix left RIGHTSB 0.5] RIGHTSB [STROKE * 0.4] include : VBarLeft left 0 CAP include : HBarTop SB [mix left RIGHTSB 0.5] CAP } @@ -80,7 +80,7 @@ create-glyph 'cyrDje' : glyph-construction { local left : mix SB RIGHTSB 0.15 - include : nBowl [left + STROKE * ITALICCOR] [mix left RIGHTSB 0.5] RIGHTSB [STROKE * 0.4] XH [HOOK + HALFSTROKE + O] SMOOTHA SMOOTHB + include : nShoulder [left + STROKE * ITALICCOR] [mix left RIGHTSB 0.5] RIGHTSB [STROKE * 0.4] XH [HOOK + HALFSTROKE + O] SMOOTHA SMOOTHB include : VBarLeft left 0 CAP include : HBarTop SB [mix left RIGHTSB 0.5] CAP include : VerticalHook [RIGHTSB - HALFSTROKE * ITALICCOR] [HOOK + HALFSTROKE + O] [Math.max [[left - RIGHTSB] / 2 + HALFSTROKE] [-HOOK * 1.2]] HOOK diff --git a/glyphs/greek.patel b/glyphs/greek.patel index f891e98fb..c648d37c2 100644 --- a/glyphs/greek.patel +++ b/glyphs/greek.patel @@ -147,13 +147,12 @@ create-glyph 'Omega' : glyph-construction { :.start-from [mix SB RIGHTSB 0.4] STROKE :.set-width fine 0 :.heads-to LEFTWARD - :.arc-hv-to [SB + STROKE * ITALICCOR] SMALLSMOOTHB + :.arc-hv-to [SB + STROKE * ITALICCOR] [SMALLSMOOTHB - ITALICCORS] :.set-width STROKE 0 - :.line-to [SB + STROKE * ITALICCOR] [CAP - SMOOTHA] - :.arc-vh-to MIDDLE [CAP - STROKE] - :.heads-to RIGHTWARD - :.arc-hv-to [RIGHTSB - STROKE * ITALICCOR] [CAP - SMOOTHB] - :.line-to [RIGHTSB - STROKE * ITALICCOR] SMALLSMOOTHA + :.line-to [SB + STROKE * ITALICCOR] [CAP - SMOOTHA - ITALICCORS] + :.arc-vh-to [MIDDLE - OMIDCOR_S + ITALICCORS][CAP - STROKE] + :.arc-hv-to [RIGHTSB - STROKE * ITALICCOR] [CAP - SMOOTHB + ITALICCORS] + :.line-to [RIGHTSB - STROKE * ITALICCOR] [SMALLSMOOTHA + ITALICCORS] :.arc-vh-to [mix RIGHTSB SB 0.4] STROKE :.set-width fine 0 :.heads-to LEFTWARD @@ -206,7 +205,7 @@ create-glyph 'eta' : glyph-construction { include pMarks set-anchor 'lf' BASE [SB + HALFSTROKE] 0 - include : nBowl [SB + STROKE] MIDDLE RIGHTSB [STROKE * 0.3] XH DESCENDER SMALLSMOOTHA SMALLSMOOTHB + include : nShoulder [SB + STROKE] MIDDLE RIGHTSB [STROKE * 0.3] XH DESCENDER SMALLSMOOTHA SMALLSMOOTHB include : VBar [SB + HALFSTROKE * ITALICCOR] 0 XH } create-glyph 'kappa' : glyph-construction { @@ -433,8 +432,7 @@ create-glyph 'upsilon' : glyph-construction { :.heads-to DOWNWARD :.set-width STROKE 0 :.line-to SB SMALLSMOOTHB - :.arc-vh-to MIDDLE O - :.heads-to RIGHTWARD + :.arc-vh-to [MIDDLE + OMIDCOR_S] O :.arc-hv-to RIGHTSB SMALLSMOOTHA :.line-to RIGHTSB XH :.heads-to UPWARD @@ -532,7 +530,7 @@ create-glyph 'phi' : glyph-construction { :.arc-vh-to [mix [WIDTH - x1] [MIDDLE + fine / 2] 0.5] [XH - fine - O] :.arc-hv-to [MIDDLE + fine / 2] y3 :.line-to [MIDDLE + fine / 2] 0 - include : VBar MIDDLE DESCENDER 0 + include : VBar MIDDLE DESCENDER [fine * 0.2] } create-glyph 'psi' : glyph-construction { diff --git a/glyphs/latin-basic-capital.patel b/glyphs/latin-basic-capital.patel index b878fc8bd..7713b8452 100644 --- a/glyphs/latin-basic-capital.patel +++ b/glyphs/latin-basic-capital.patel @@ -307,12 +307,10 @@ create-glyph 'C' : glyph-construction { include : create-stroke :.start-from [RIGHTSB - OXHOOK] [CAP - HOOK] :.set-width STROKE 0 - :.curve-to [MIDDLE + KAPPA_HOOK * [MIDDLE - para.sb]] CAPO MIDDLE CAPO - :.heads-to LEFTWARD + :.curve-to [MIDDLE + KAPPA_HOOK * [MIDDLE - para.sb]] CAPO [MIDDLE - OMIDCOR_S] CAPO :.arc-hv-to SB [CAP - SMOOTHA] :.line-to SB SMOOTHB - :.arc-vh-to MIDDLE O - :.heads-to RIGHTWARD + :.arc-vh-to [MIDDLE + OMIDCOR_S] O :.curve-to [MIDDLE + ITALICCORS + KAPPA_HOOK * [MIDDLE - SB]] O [RIGHTSB - OXHOOK] HOOK } @@ -324,12 +322,10 @@ create-glyph 'G' : glyph-construction { include : create-stroke :.start-from [RIGHTSB - OXHOOK] [CAP - HOOK] :.set-width STROKE 0 - :.curve-to [MIDDLE + KAPPA_HOOK * [MIDDLE - para.sb]] CAPO MIDDLE CAPO - :.heads-to LEFTWARD + :.curve-to [MIDDLE + KAPPA_HOOK * [MIDDLE - para.sb]] CAPO [MIDDLE - OMIDCOR_S] CAPO :.arc-hv-to SB [CAP - SMOOTHA] :.line-to SB SMOOTHB - :.arc-vh-to MIDDLE O - :.heads-to RIGHTWARD + :.arc-vh-to [MIDDLE + OMIDCOR_S] O :.arc-hv-to RIGHTSB SMOOTHA :.line-to RIGHTSB [CAP / 2 + STROKE / 2] :.heads-to UPWARD @@ -347,17 +343,14 @@ create-glyph 'O' : glyph-construction { include capitalMarks include : create-stroke - :.start-from MIDDLE CAPO - :.heads-to LEFTWARD + :.start-from [MIDDLE - OMIDCOR_S] CAPO :.set-width STROKE 0 :.arc-hv-to SB [CAP - SMOOTHA] :.line-to SB SMOOTHB - :.arc-vh-to MIDDLE O - :.heads-to RIGHTWARD + :.arc-vh-to [MIDDLE + OMIDCOR_S] O :.arc-hv-to RIGHTSB SMOOTHA :.line-to RIGHTSB [CAP - SMOOTHB] - :.arc-vh-to MIDDLE CAPO - :.heads-to LEFTWARD + :.arc-vh-to [MIDDLE - OMIDCOR_S] CAPO } create-glyph 'Q' : glyph-construction { @@ -379,8 +372,7 @@ define [UShape top bottom stroke] : glyph-construction { :.heads-to DOWNWARD :.set-width [fallback stroke STROKE] 0 :.line-to SB [bottom + SMOOTHB] - :.arc-vh-to MIDDLE [bottom + O] - :.heads-to RIGHTWARD + :.arc-vh-to [MIDDLE + OMIDCOR_S] [bottom + O] :.arc-hv-to RIGHTSB [bottom + SMOOTHA] :.line-to RIGHTSB top :.heads-to UPWARD diff --git a/glyphs/latin-basic-lower.patel b/glyphs/latin-basic-lower.patel index da931ab18..096863709 100644 --- a/glyphs/latin-basic-lower.patel +++ b/glyphs/latin-basic-lower.patel @@ -6,64 +6,18 @@ create-glyph 'o' : glyph-construction { assign-unicode 'o' include eMarks - include : create-stroke - :.start-from MIDDLE XO - :.set-width STROKE 0 - :.heads-to LEFTWARD - :.arc-hv-to [SB + O] [XH - SMALLSMOOTHA] - :.line-to [SB + O] SMALLSMOOTHB - :.arc-vh-to MIDDLE O - :.heads-to RIGHTWARD - :.arc-hv-to [RIGHTSB - O] SMALLSMOOTHA - :.line-to [RIGHTSB - O] [XH - SMALLSMOOTHB] - :.arc-vh-to MIDDLE XO - :.heads-to LEFTWARD + include : smallo XH 0 SB RIGHTSB } define [oLeft] : glyph-construction { - # right half - include : create-stroke - :.start-from MIDDLE XO - :.heads-to RIGHTWARD - :.set-width 0 STROKE - :.arc-hv-to [RIGHTSB - O] [XH - SMALLSMOOTHB] - :.line-to [RIGHTSB - O] SMALLSMOOTHA - :.arc-vh-to MIDDLE O - :.heads-to LEFTWARD - # left half - include : create-stroke - :.start-from MIDDLE [O + STROKE] - :.heads-to LEFTWARD - :.set-width STROKE 0 - :.arc-hv-to [SB + STROKE * ITALICCOR] [SMALLSMOOTHB - STROKE * 0.05] - :.set-width [STROKE * 0.25] 0 - :.line-to [SB + STROKE * ITALICCOR] [XH - SMALLSMOOTHA + STROKE * 0.05] - :.set-width [STROKE * 0.25] 0 - :.arc-vh-to MIDDLE [XO - STROKE] - :.set-width STROKE 0 - :.heads-to RIGHTWARD + include : list { + ORing XO O [SB + HALFSTROKE] [RIGHTSB - O] SMALLSMOOTHA SMALLSMOOTHB 0 + ORing [XO - STROKE] [O + STROKE] [SB + STROKE * ITALICCOR] [RIGHTSB - STROKE * ITALICCOR - O] [SMALLSMOOTHA - STROKE] [SMALLSMOOTHB - STROKE] 0 + } + reverse-last } define [oRight] : glyph-construction { - # left half - include : create-stroke - :.start-from MIDDLE XO - :.heads-to LEFTWARD - :.set-width STROKE 0 - :.arc-hv-to [SB + O] [XH - SMALLSMOOTHA] - :.line-to [SB + O] SMALLSMOOTHB - :.arc-vh-to MIDDLE O - :.heads-to RIGHTWARD - # right half - include : create-stroke - :.start-from MIDDLE [O + STROKE] - :.heads-to RIGHTWARD - :.set-width 0 STROKE - :.arc-hv-to [RIGHTSB - STROKE * ITALICCOR] [SMALLSMOOTHA - STROKE * 0.05] - :.set-width 0 [STROKE * 0.25] - :.line-to [RIGHTSB - STROKE * ITALICCOR] [XH - SMALLSMOOTHB + STROKE * 0.05] - :.set-width 0 [STROKE * 0.25] - :.arc-vh-to MIDDLE [XO - STROKE] - :.set-width 0 STROKE - :.heads-to LEFTWARD + include : create-glyph [oLeft] + include : FlipAround MIDDLE [XH / 2] } create-glyph 'p' : glyph-construction { set-width WIDTH @@ -156,18 +110,16 @@ create-glyph 'c' : glyph-construction { include : create-stroke :.start-from [RIGHTSB - OXHOOK] [XH - HOOK] :.set-width STROKE 0 - :.curve-to [MIDDLE + KAPPA_HOOK * [MIDDLE - para.sb]] XO MIDDLE XO - :.heads-to LEFTWARD + :.curve-to [MIDDLE + KAPPA_HOOK * [MIDDLE - para.sb]] XO [MIDDLE - OMIDCOR_S] XO :.arc-hv-to [SB + O] [XH - SMALLSMOOTHA] :.line-to [SB + O] SMALLSMOOTHB - :.arc-vh-to MIDDLE O - :.heads-to RIGHTWARD + :.arc-vh-to [MIDDLE + OMIDCOR_S] O :.curve-to [MIDDLE + [KAPPA_HOOK + TAILADJKAPPA * globalTransform.yx] * [MIDDLE - SB]] O [RIGHTSB - OXHOOK + TAILADJX * globalTransform.yx] [HOOK - TAILADJY * globalTransform.yx] } define [SmallEShape top stroke barpos] : glyph-construction { local barbottom [top * [fallback barpos EBARPOS]] local hookx [RIGHTSB - OXHOOK + TAILADJX * globalTransform.yx] - local hookmiddle [mix [SB + O] hookx 0.55] + local hookmiddle : [mix [SB + O] hookx 0.55] + OMIDCOR_S include : create-stroke :.start-from [RIGHTSB - O] barbottom @@ -175,11 +127,9 @@ define [SmallEShape top stroke barpos] : glyph-construction { :.set-width stroke 0 :.line-to [RIGHTSB - O] [top - SMALLSMOOTHB] :.arc-vh-to MIDDLE [top - O] - :.heads-to LEFTWARD :.arc-hv-to [SB + O] [top - SMALLSMOOTHA] :.line-to [SB + O] SMALLSMOOTHB :.arc-vh-to hookmiddle O - :.heads-to RIGHTWARD :.curve-to [mix hookmiddle hookx KAPPA_HOOK] O hookx [SHOOK - TAILADJY * globalTransform.yx] include : create-stroke :.start-from [SB + [stroke / 2]] barbottom @@ -204,12 +154,10 @@ create-glyph 'e.italic' : glyph-construction { :.start-from [SB + O + STROKE] barbottom :.set-width STROKE 0 :.arc-hv-to [RIGHTSB - O] [XH - SMALLSMOOTHB * 0.95] - :.arc-vh-to MIDDLE XO - :.heads-to LEFTWARD + :.arc-vh-to [MIDDLE - OMIDCOR_S] XO :.arc-hv-to [SB + O] [XH - SMALLSMOOTHA] :.line-to [SB + O] SMALLSMOOTHB - :.arc-vh-to MIDDLE O - :.heads-to RIGHTWARD + :.arc-vh-to [MIDDLE + OMIDCOR_S] O :.curve-to [MIDDLE + [KAPPA_HOOK + TAILADJKAPPA * globalTransform.yx] * [MIDDLE - SB]] O [RIGHTSB - OXHOOK + TAILADJX * globalTransform.yx] [HOOK - TAILADJY * globalTransform.yx] :.set-samples 4 } @@ -264,19 +212,17 @@ create-glyph 'a.upright' : glyph-construction { :.heads-to UPWARD :.set-width STROKE 0 :.line-to RIGHTSB [XH - SMOOTHA] - :.arc-vh-to MIDDLE XO - :.heads-to LEFTWARD + :.arc-vh-to [MIDDLE - OMIDCOR_S] XO :.curve-to [MIDDLE - KAPPA_HOOK * [MIDDLE - SB]] XO [SB + OXHOOK] [XH - AHOOK] include : create-stroke - :.start-from lowmiddle O + :.start-from [lowmiddle + OMIDCOR_S] O :.set-width 0 STROKE - :.heads-to LEFTWARD :.arc-hv-to [SB + O] [bartop * 0.45] :.arc-vh-to barsmooth bartop :.line-to RIGHTSB bartop :.heads-to RIGHTWARD include : create-stroke - :.start-from lowmiddle [O + STROKE] + :.start-from [lowmiddle + OMIDCOR_S - ITALICCORS] [O + STROKE] :.set-width 0 STROKE :.heads-to RIGHTWARD :.arc-hv-to [RIGHTSB - STROKE] [SMALLSMOOTHB * 0.65] @@ -306,40 +252,14 @@ create-glyph 'a' : glyph-construction { else : include glyphs.'a.upright' AS_BASE } } -create-glyph 'u' : glyph-construction { - set-width WIDTH - assign-unicode 'u' - include eMarks - set-anchor 'trailing' BASE [RIGHTSB - markHalfStroke] 0 - include : create-stroke - :.start-from SB XH - :.heads-to DOWNWARD - :.set-width STROKE 0 - :.line-to SB SMALLSMOOTHA - :.arc-vh-to MIDDLE O - :.heads-to RIGHTWARD - include : create-stroke - :.start-from MIDDLE [O + STROKE] - :.set-width 0 STROKE - :.heads-to RIGHTWARD - :.arc-hv-to [RIGHTSB - STROKE * ITALICCOR] SMALLSMOOTHA - :.heads-to UPWARD - :.set-width 0 [STROKE * 0.4] - include : create-stroke - :.start-from RIGHTSB 0 - :.heads-to UPWARD - :.set-width STROKE 0 - :.line-to RIGHTSB XH - :.heads-to UPWARD -} -### n h m +### n u h m create-glyph 'n' : glyph-construction { set-width WIDTH assign-unicode 'n' include eMarks - include : nBowl [SB + STROKE * ITALICCOR] MIDDLE RIGHTSB [STROKE * 0.4] + include : nShoulder [SB + STROKE * ITALICCOR] MIDDLE RIGHTSB [STROKE * 0.4] include : create-stroke :.start-from SB 0 :.heads-to UPWARD @@ -347,12 +267,20 @@ create-glyph 'n' : glyph-construction { :.line-to SB XH :.heads-to UPWARD } +create-glyph 'u' : glyph-construction { + set-width WIDTH + assign-unicode 'u' + include eMarks + set-anchor 'trailing' BASE [RIGHTSB - markHalfStroke] 0 + include glyphs.n + include : FlipAround MIDDLE [XH / 2] +} create-glyph 'h' : glyph-construction { set-width WIDTH assign-unicode 'h' include bMarks - include : nBowl [SB + STROKE * ITALICCOR] MIDDLE RIGHTSB [STROKE * 0.4] + include : nShoulder [SB + STROKE * ITALICCOR] MIDDLE RIGHTSB [STROKE * 0.4] include : create-stroke :.start-from SB 0 :.heads-to UPWARD @@ -694,17 +622,15 @@ create-glyph 'r' : glyph-construction { local coexpand [[1 - expand] / 2] local rhookx : RIGHTSB + JBALANCE / 2 - local rmiddle : mix [SB + RBALANCE + STROKE] [rhookx - HALFSTROKE] 0.5 + local rmiddle : [mix [SB + RBALANCE + STROKE] [rhookx - HALFSTROKE] 0.5] - OMIDCOR_S include : create-stroke :.start-from rhookx [XH - RHOOK] :.set-width STROKE 0 :.curve-to [mix rmiddle rhookx KAPPA_AHOOK] XO rmiddle XO - :.heads-to LEFTWARD include : create-stroke - :.start-from rmiddle [XO - STROKE] + :.start-from [rmiddle + ITALICCORS] [XO - STROKE] :.set-width 0 STROKE - :.heads-to LEFTWARD :.arc-hv-to [SB + STROKE * ITALICCOR + RBALANCE] [XH - SMALLSMOOTHA] :.heads-to DOWNWARD :.set-width 0 [STROKE * 0.3] diff --git a/glyphs/latin-extend.patel b/glyphs/latin-extend.patel index 972575a46..1b0180bea 100644 --- a/glyphs/latin-extend.patel +++ b/glyphs/latin-extend.patel @@ -116,7 +116,7 @@ create-glyph 'ae-apart' : glyph-construction { local smb : SMALLSMOOTHB * 0.6 include : create-stroke - :.start-from abarRight [XH - sma] + :.start-from abarRight [XH - smb] :.set-width sw 0 :.arc-vh-to m1 XO :.curve-to [mix m1 SB KAPPA_HOOK] XO [SB + OXHOOK] [XH - SHOOK] @@ -403,7 +403,7 @@ create-glyph 'Eng' : glyph-construction { assign-unicode 0x14A include capitalMarks - include : nBowl [SB + STROKE] MIDDLE RIGHTSB [STROKE * 0.3] CAP [HOOK + HALFSTROKE + O] SMOOTHA SMOOTHB + include : nShoulder [SB + STROKE] MIDDLE RIGHTSB [STROKE * 0.3] CAP [HOOK + HALFSTROKE + O] SMOOTHA SMOOTHB include : VerticalHook [RIGHTSB - HALFSTROKE * ITALICCOR] [HOOK + HALFSTROKE + O] [Math.max [[SB - RIGHTSB] / 2 + HALFSTROKE] [-HOOK * 1.2]] HOOK include : VBar [SB + HALFSTROKE * ITALICCOR] 0 CAP } diff --git a/glyphs/numbers.patel b/glyphs/numbers.patel index d1aeca8a1..4e7a5199e 100644 --- a/glyphs/numbers.patel +++ b/glyphs/numbers.patel @@ -111,25 +111,18 @@ create-glyph 'five' : glyph-construction { set-width WIDTH assign-unicode '5' - include : sHookLower 0 [[CAP * FIVEBARPOS + STROKE] / 2] HOOK + local ycurly : [CAP * FIVEBARPOS + STROKE] / 2 - HALFSTROKE * globalTransform.yx + local xleft : SB + TBALANCE * [0.6 - globalTransform.yx * 2] + + include : sHookLower 0 ycurly HOOK include : create-stroke - :.start-from RIGHTSB [[CAP * FIVEBARPOS + STROKE] / 2] + :.start-from RIGHTSB ycurly :.set-width STROKE 0 - :.arc-vh-to MIDDLE [CAP * FIVEBARPOS + STROKE] - :.line-to [SB + TBALANCE * [0.6 - globalTransform.yx * 2]] [CAP * FIVEBARPOS + STROKE] - :.heads-to LEFTWARD - include : create-stroke - :.start-from [SB + TBALANCE * [0.6 - globalTransform.yx * 2]] CAP - :.set-width 0 STROKE - :.heads-to RIGHTWARD - :.line-to [RIGHTSB - TBALANCE / 2] CAP - :.heads-to RIGHTWARD - include : create-stroke - :.start-from [SB + TBALANCE * [0.6 - globalTransform.yx * 2]] [CAP * FIVEBARPOS + STROKE] - :.set-width 0 STROKE - :.heads-to UPWARD - :.line-to [SB + TBALANCE * [0.6 - globalTransform.yx * 2]] CAP - :.heads-to UPWARD + :.arc-vh-to [MIDDLE - OMIDCOR_S] [CAP * FIVEBARPOS + STROKE] + :.line-to xleft [CAP * FIVEBARPOS + STROKE] + :.heads-to LEFTWARD + include : VBarLeft xleft [CAP * FIVEBARPOS + STROKE] CAP + include : HBarTop xleft [RIGHTSB - TBALANCE / 2] CAP } create-glyph 'six' : glyph-construction { @@ -177,13 +170,13 @@ create-glyph 'eight' : glyph-construction { include : create-stroke :.start-from [mix SB RIGHTSB p] [CAP - smb * p] :.set-width STROKE 0 - :.arc-vh-to [MIDDLE - STROKE * globalTransform.yx] [CAP - O] + :.arc-vh-to [MIDDLE - OMIDCOR_S] [CAP - O] :.arc-hv-to [mix RIGHTSB SB p] [CAP - sma * p] include : create-stroke :.start-from SB smb :.set-width STROKE 0 - :.arc-vh-to [MIDDLE + STROKE * globalTransform.yx] O + :.arc-vh-to [MIDDLE + OMIDCOR_S] O :.arc-hv-to RIGHTSB sma } diff --git a/glyphs/symbol-ascii.patel b/glyphs/symbol-ascii.patel index 477c03ce2..c1cc4e375 100644 --- a/glyphs/symbol-ascii.patel +++ b/glyphs/symbol-ascii.patel @@ -86,7 +86,6 @@ create-glyph 'at' : glyph-construction { :.set-width STROKE 0 :.heads-to RIGHTWARD :.line-to [RIGHTSB - HALFSTROKE + globalTransform.yx * sw] [bot + O] - :.set-samples 6 } ### Brackets diff --git a/glyphs/symbol-math.patel b/glyphs/symbol-math.patel index 6919766ec..09f93cc02 100644 --- a/glyphs/symbol-math.patel +++ b/glyphs/symbol-math.patel @@ -57,6 +57,7 @@ create-glyph 'propto' : glyph-construction { local s : [RIGHTSB - SB - O * 2] / [CAP - SMOOTH] include [Miniature ('eight') 5 s].eight this.contours.pop + this.contours.pop apply-transform : Upright apply-transform : Translate [-MIDDLE] [-CAP / 2] apply-transform : Rotate [Math.PI / 2] diff --git a/makefile b/makefile index 1d28df9c9..c4e15f80e 100644 --- a/makefile +++ b/makefile @@ -9,7 +9,7 @@ MAPS = $(subst .ttf,.charmap,$(TARGETS)) PASS0 = $(subst $(OBJDIR)/,$(OBJDIR)/.pass0-,$(TARGETS)) ABFEAT = $(subst .ttf,.ab.fea,$(subst $(OBJDIR)/,$(OBJDIR)/.pass0-,$(TARGETS))) FEATURE = $(subst .ttf,.fea,$(subst $(OBJDIR)/,$(OBJDIR)/.pass0-,$(TARGETS))) -PASS1 = $(subst .ttf,.otf,$(subst $(OBJDIR)/,$(OBJDIR)/.pass1-,$(TARGETS))) +PASS1 = $(subst $(OBJDIR)/,$(OBJDIR)/.pass1-,$(TARGETS)) PASS2 = $(subst $(OBJDIR)/,$(OBJDIR)/.pass2-,$(TARGETS)) FILES = $(SUPPORT_FILES) buildglyphs.js @@ -33,9 +33,10 @@ $(FEATURE) : $(OBJDIR)/.pass0-%.fea : $(OBJDIR)/.pass0-%.ab.fea features/common. cat $^ > $@ # Pass 1 : Outline cleanup and merge -$(PASS1) : $(OBJDIR)/.pass1-%.otf : $(OBJDIR)/.pass0-%.ttf $(OBJDIR)/.pass0-%.fea +$(PASS1) : $(OBJDIR)/.pass1-%.ttf : $(OBJDIR)/.pass0-%.ttf $(OBJDIR)/.pass0-%.fea fontforge -script pass1-cleanup.py $^ $@ $(SUPPRESS_ERRORS) -$(PASS2) : $(OBJDIR)/.pass2-%.ttf : $(OBJDIR)/.pass1-%.otf +# Pass 2 : Curve simplification +$(PASS2) : $(OBJDIR)/.pass2-%.ttf : $(OBJDIR)/.pass1-%.ttf fontforge -script pass2-finalize.py $^ $@ # Pass 3 : Simplify and output $(TARGETS) : $(OBJDIR)/%.ttf : $(OBJDIR)/.pass2-%.ttf diff --git a/parameters.patel b/parameters.patel index 84aae6762..b5e41a5d7 100644 --- a/parameters.patel +++ b/parameters.patel @@ -1,5 +1,5 @@ define regular ( - .upmscale 2.048 + .upmscale 4 .width 500 @@ -21,7 +21,7 @@ define regular ( .smooth 192 .smallsmooth 242 - .smoothadjust 100 + .smoothadjust 180 .o [-8] .oxhook 0 @@ -54,8 +54,7 @@ bold.dotsize = 160 bold.periodsize = 180 bold.ebarpos = 0.4 bold.barpos = 0.42 -bold.hook = 135 -bold.ahook = 100 +bold.shook = 120 bold.smooth = 200 bold.oxhook = [-8] bold.kappa_hook = 0.7 @@ -65,7 +64,6 @@ bold.tbalance = 50 bold.rbalance = 18 bold.weight = 700 bold.bkappa = 0.5 -bold.smoothadjust = 130 define italic : Object.create regular italic.italicangle = 10 diff --git a/pass1-cleanup.py b/pass1-cleanup.py index 8450a892f..7b5190387 100644 --- a/pass1-cleanup.py +++ b/pass1-cleanup.py @@ -4,13 +4,23 @@ import sys source = sys.argv[1] font = fontforge.open(source) font.mergeFeature(sys.argv[2]) -font.selection.all() +# Replace accented characters into references +font.selection.select(("ranges", "unicode", None), 0x1FCD, 0x1FCF, 0x1FDD, 0x1FDF) font.replaceWithReference(4) +font.selection.none() +font.selection.select(("ranges", "unicode", None), 0x0300, 0x036F) +font.replaceWithReference(4) +font.selection.none() +font.selection.select(("ranges", "unicode", None), 0x0000, 0xFFFF) +font.replaceWithReference(4) +font.selection.none() +font.selection.all() font.removeOverlap() font.round() font.removeOverlap() -font.unlinkReferences() -font.removeOverlap() +font.simplify(1) +font.layers["Fore"].is_quadratic = False +font.simplify(4, ("smoothcurves", "removesingletonpoints", "setstarttoextremum"), 0.2) font.canonicalContours() font.canonicalStart() font.generate(sys.argv[3], flags = ("short-post", "opentype")) \ No newline at end of file diff --git a/pass2-finalize.py b/pass2-finalize.py index 334714d9a..d58fb58aa 100644 --- a/pass2-finalize.py +++ b/pass2-finalize.py @@ -3,7 +3,11 @@ import sys source = sys.argv[1] font = fontforge.open(source) + font.selection.all() -font.replaceWithReference(4) -font.simplify(4, ("smoothcurves", "removesingletonpoints", "setstarttoextremum"), 0.2) +font.removeOverlap() +font.em = 1024 +font.simplify(1) +font.canonicalContours() +font.canonicalStart() font.generate(sys.argv[2], flags = ("short-post", "opentype")) \ No newline at end of file