From f31a7fb240d87260fb9f0ef1a375eae09cdcbfe4 Mon Sep 17 00:00:00 2001 From: be5invis Date: Wed, 16 Dec 2015 10:11:28 +0800 Subject: [PATCH] Minor touches. --- buildglyphs.aki | 2 +- extract.js | 2 +- glyphs/autobuilds.aki | 2 +- glyphs/common-shapes.aki | 8 +- glyphs/letters-unified-basic.aki | 20 +--- glyphs/letters-unified-extended.aki | 8 +- glyphs/symbol-geometric.aki | 14 +-- glyphs/symbol-letter.aki | 14 +-- parameters.toml | 23 ++--- testdrive/index.html | 150 ---------------------------- 10 files changed, 41 insertions(+), 202 deletions(-) diff --git a/buildglyphs.aki b/buildglyphs.aki index 08ba8c7..64a4326 100644 --- a/buildglyphs.aki +++ b/buildglyphs.aki @@ -222,7 +222,7 @@ export as build : define [buildFont para recursive recursiveCodes] : begin define CORRECTION_VX globalTransform.yx define CORRECTION_VS : STROKE * globalTransform.yx - define CORRECTION_OMIDX : globalTransform.yx * 1.3 + define CORRECTION_OMIDX : globalTransform.yx * [linreg 18 1.3 120 1 STROKE] define CORRECTION_OMIDS : STROKE * CORRECTION_OMIDX # Blackness parameters diff --git a/extract.js b/extract.js index 8dcb75d..66bc036 100644 --- a/extract.js +++ b/extract.js @@ -93,7 +93,7 @@ if(argv.feature) { };*/ if(argv.svg) { - function cov(x){ return x.toFixed(4) } + function cov(x){ return Math.round(x * 10000) / 10000 } function toSVGPath(glyph){ var buf = ''; if(glyph.contours) for(var j = 0; j < glyph.contours.length; j++) { diff --git a/glyphs/autobuilds.aki b/glyphs/autobuilds.aki index 3ad5336..2692317 100644 --- a/glyphs/autobuilds.aki +++ b/glyphs/autobuilds.aki @@ -226,7 +226,7 @@ define [suggestName name] : begin define [createCircledGlyphs records] : if [not recursive] : begin local dscale 0.55 local pendingGlyphs : records.map : [record] -> record.1 - local miniatureFont : Miniature pendingGlyphs [fallback para.smallCrowd 3.5] 0.65 + local miniatureFont : Miniature pendingGlyphs [fallback para.smallCrowd 3.75] 0.65 foreach {unicode glyphid w} [items-of records] : create-glyph [suggestName : 'circle' + glyphid] : glyph-construction local width : fallback w WIDTH diff --git a/glyphs/common-shapes.aki b/glyphs/common-shapes.aki index e3a1b67..10376df 100644 --- a/glyphs/common-shapes.aki +++ b/glyphs/common-shapes.aki @@ -380,15 +380,17 @@ define [mShoulderSpiro left right top bottom width fine] : glyph-construction close define [HBar xleft xright y _fine] : glyph-construction - local fine : [fallback _fine STROKE] / 2 include : dispiro - widths.center (fine * 2) + widths.center [fallback _fine STROKE] flat xleft y [heading RIGHTWARD] curl xright y [heading RIGHTWARD] define [HBarTop xl xr y _fine] : HBar xl xr (y - [fallback _fine STROKE] * 0.5) _fine define [HBarBottom xl xr y _fine] : HBar xl xr (y + [fallback _fine STROKE] * 0.5) _fine -define [HOverlayBar xleft xright y s] : HBar xleft xright y [fallback s OVERLAYSTROKE] +define [HOverlayBar xleft xright y s] : dispiro + widths.center [fallback s OVERLAYSTROKE] + flat xleft y + curl xright y define [VBar x ydown yup _fine] : glyph-construction local fine : fallback _fine STROKE include : dispiro diff --git a/glyphs/letters-unified-basic.aki b/glyphs/letters-unified-basic.aki index 49ed02d..5d9a796 100644 --- a/glyphs/letters-unified-basic.aki +++ b/glyphs/letters-unified-basic.aki @@ -9,17 +9,9 @@ symbol-block 'I' include : VBar MIDDLE 0 CAP define [ISerifShape top] : glyph-construction - include : dispiro - widths.rhs - flat (MIDDLE - WIDTH * 0.26 - STROKE * globalTransform.yx) top - curl (MIDDLE + WIDTH * 0.26 - STROKE * globalTransform.yx) top - # Bar include : VBar MIDDLE 0 top - # Bottom serif - include : dispiro - widths.lhs - flat (MIDDLE - WIDTH * 0.26 + STROKE * globalTransform.yx) 0 - curl (MIDDLE + WIDTH * 0.26 + STROKE * globalTransform.yx) 0 + include : CenterBottomSerif MIDDLE 0 (LONGJUT * 0.8) + include : CenterTopSerif MIDDLE top (LONGJUT * 0.8) create-glyph 'I.serifed' : glyph-construction include capitalMarks @@ -483,8 +475,6 @@ define VShape : symbol-block 'V, v and nu' curl RIGHTSB (XH * 0.9) [heading DOWNWARD] quadcontrols 0 0.3 6 g4 xmid 0 - if SLAB : begin - include : LeftwardTopSerif SB XH SIDEJUT * VShape @@ -1709,13 +1699,13 @@ symbol-block 'O' create-glyph 'Obar' : glyph-construction assign-unicode 0x19F include glyphs.O AS_BASE - include : HOverlayBar (SB + OX + 1) (RIGHTSB - OX - 1) (CAP * 0.5) + include : HBar (SB + OX + 1) (RIGHTSB - OX - 1) (CAP * 0.5) OVERLAYSTROKE alias 'cyrOe' 0x4E8 'Obar' create-glyph 'obar' : glyph-construction assign-unicode 0x275 include glyphs.o AS_BASE - include : HOverlayBar (SB + OX + 1) (RIGHTSB - OX - 1) (XH * 0.5) + include : HBar (SB + OX + 1) (RIGHTSB - OX - 1) (XH * 0.5) OVERLAYSTROKE alias 'cyroe' 0x4E9 'obar' create-glyph 'bulleye' : glyph-construction @@ -2674,7 +2664,7 @@ symbol-block 'S' set-width WIDTH assign-unicode 's' include eMarks - define smooth : adviceSSmooth XH (-1 - globalTransform.yx * (8.5 - (WIDTH / 500) * 5.5)) + define smooth : adviceSSmooth XH (-1 - globalTransform.yx * (8.5 - (WIDTH / 500) * 5.5) * [clamp 0 1 : linreg 120 1 130 0.5 STROKE]) include : dispiro widths.lhs g4 RIGHTSB (XH - SHOOK) diff --git a/glyphs/letters-unified-extended.aki b/glyphs/letters-unified-extended.aki index 43acf1c..9220894 100644 --- a/glyphs/letters-unified-extended.aki +++ b/glyphs/letters-unified-extended.aki @@ -355,10 +355,10 @@ define {PiShape} : symbol-block 'Pi' include : VBarRight (RIGHTSB - shrink) bottom (top - fine / 2) fine if SLAB : begin - include : CenterBottomSerif (SB + shrink + fine * 0.5 * CORRECTION_HX) bottom JUT - include : CenterBottomSerif (RIGHTSB - shrink - fine * 0.5 * CORRECTION_HX) bottom JUT - include : CenterTopSerif (SB + shrink + fine * 0.5 * CORRECTION_HX) top JUT - include : CenterTopSerif (RIGHTSB - shrink - fine * 0.5 * CORRECTION_HX) top JUT + include : CenterBottomSerif (SB + shrink + fine * 0.5 * CORRECTION_HX) bottom JUT fine + include : CenterBottomSerif (RIGHTSB - shrink - fine * 0.5 * CORRECTION_HX) bottom JUT fine + include : CenterTopSerif (SB + shrink + fine * 0.5 * CORRECTION_HX) top JUT fine + include : CenterTopSerif (RIGHTSB - shrink - fine * 0.5 * CORRECTION_HX) top JUT fine create-glyph 'Pi' : glyph-construction assign-unicode 0x3A0 diff --git a/glyphs/symbol-geometric.aki b/glyphs/symbol-geometric.aki index 33fc28a..95ea96b 100644 --- a/glyphs/symbol-geometric.aki +++ b/glyphs/symbol-geometric.aki @@ -286,7 +286,7 @@ symbol-block 'Block Shapes' ### Box drawing glyphs symbol-block 'Box-Drawing' local light : adviceBlackness 3.5 - local heavy : light * 2 + local heavy : Math.max (light * 2) (WIDTH * 0.15) local width FULLWIDTH local midx : FULLWIDTH / 2 local midy : mix font.hhea.descent font.hhea.ascent 0.5 @@ -302,10 +302,10 @@ symbol-block 'Box-Drawing' define [dlboxdraw unicode u d l r] : create-glyph ('bd' + [unicode.toString 16 :.toUpperCase]) : glyph-construction assign-unicode unicode set-width width - local stopH : ([Math.max u d] - light) / 2 - local stopV : ([Math.max l r] - light) / 2 - local capH : stopH * heavy / (heavy - light) - local capV : stopV * heavy / (heavy - light) + local stopH : [Math.max u d] - light * 1 - light * 0.5 * CORRECTION_HX + local stopV : [Math.max l r] - light * 1.5 + local capH : [Math.max u d] - light * 1 + local capV : [Math.max l r] - light * 1 if l : begin include : HBar 0 (midx - stopH) (midy + (l - light)) light if (l > light) : include : HBar 0 (midx - stopH) (midy - (l - light)) light @@ -318,8 +318,8 @@ symbol-block 'Box-Drawing' if u : begin include : VBar (midx + (u - light)) (midy + stopV) font.hhea.ascent light if (u > light) : include : VBar (midx - (u - light)) (midy + stopV) font.hhea.ascent light - if (stopH > 0 && [not u]) : include : HBar (midx - stopH - light) (midx + stopH + light) (midy + capV) light - if (stopH > 0 && [not d]) : include : HBar (midx - stopH - light) (midx + stopH + light) (midy - capV) light + if (stopH > 0 && [not u]) : include : HBar (midx - stopH - light * CORRECTION_HX) (midx + stopH + light * CORRECTION_HX) (midy + capV) light + if (stopH > 0 && [not d]) : include : HBar (midx - stopH - light * CORRECTION_HX) (midx + stopH + light * CORRECTION_HX) (midy - capV) light if (stopV > 0 && [not l]) : include : VBar (midx - capH) (midy - stopV - light) (midy + stopV + light) light if (stopV > 0 && [not r]) : include : VBar (midx + capH) (midy - stopV - light) (midy + stopV + light) light define [complexBoxDraw unicodeStart U D L R fn dl] : begin diff --git a/glyphs/symbol-letter.aki b/glyphs/symbol-letter.aki index 15cfef6..e5e0576 100644 --- a/glyphs/symbol-letter.aki +++ b/glyphs/symbol-letter.aki @@ -27,8 +27,8 @@ symbol-block 'Currency' create-glyph 'euro' : glyph-construction assign-unicode 0x20AC include glyphs.C - include : HBar (SB - HALFSTROKE) [mix SB RIGHTSB 0.7] (CAP * 0.4) OVERLAYSTROKE - include : HBar (SB - HALFSTROKE) [mix SB RIGHTSB 0.7] (CAP * 0.6) OVERLAYSTROKE + include : HOverlayBar (SB - HALFSTROKE) [mix SB RIGHTSB 0.7] (CAP * 0.4) + include : HOverlayBar (SB - HALFSTROKE) [mix SB RIGHTSB 0.7] (CAP * 0.6) create-glyph 'cent' : glyph-construction assign-unicode 0xA2 @@ -45,8 +45,8 @@ symbol-block 'Currency' create-glyph 'yen' : glyph-construction assign-unicode 0xA5 include glyphs.Y AS_BASE - include : HBar SB RIGHTSB (CAP * 0.45) OVERLAYSTROKE - include : HBar SB RIGHTSB (CAP * 0.25) OVERLAYSTROKE + include : HOverlayBar SB RIGHTSB (CAP * 0.45) + include : HOverlayBar SB RIGHTSB (CAP * 0.25) create-glyph 'sterlingbase' : glyph-construction @@ -62,13 +62,13 @@ symbol-block 'Currency' assign-unicode 0xA3 set-width WIDTH include glyphs.sterlingbase - include : HBar [mix SB RIGHTSB 0.05] [mix SB RIGHTSB 0.7] (CAP * 0.53) + include : HOverlayBar [mix SB RIGHTSB 0.05] [mix SB RIGHTSB 0.7] (CAP * 0.53) create-glyph 'liraSymbol' : glyph-construction assign-unicode 0x20A4 set-width WIDTH include glyphs.sterlingbase - include : HBar [mix SB RIGHTSB 0.05] [mix SB RIGHTSB 0.7] (CAP * 0.4) OVERLAYSTROKE - include : HBar [mix SB RIGHTSB 0.05] [mix SB RIGHTSB 0.7] (CAP * 0.63) OVERLAYSTROKE + include : HOverlayBar [mix SB RIGHTSB 0.05] [mix SB RIGHTSB 0.7] (CAP * 0.4) + include : HOverlayBar [mix SB RIGHTSB 0.05] [mix SB RIGHTSB 0.7] (CAP * 0.63) create-glyph 'frenchFranc' : glyph-construction assign-unicode 0x20A3 diff --git a/parameters.toml b/parameters.toml index 2c57898..98df61b 100644 --- a/parameters.toml +++ b/parameters.toml @@ -46,7 +46,7 @@ rhook = 90 hookx = 170 smooth = 195 -smallsmooth = 215 +smallsmooth = 220 smoothadjust = 120 tbalance = 50 @@ -94,7 +94,7 @@ weight = 200 style = 'Extralight' stroke = 36 -sb = 72 +sb = 73 dotsize = 70 periodsize = 77 @@ -105,10 +105,10 @@ cthinb = 0.75 weight = 300 style = 'Light' -stroke = 58 -sb = 63 -dotsize = 95 -periodsize = 103 +stroke = 56 +sb = 66 +dotsize = 100 +periodsize = 115 [w-book] isBold = false @@ -125,14 +125,14 @@ weith = 500 style = 'Medium' sb = 50 -stroke = 83 +stroke = 90 dotsize = 140 periodsize = 145 essx = 1.07 -rbalance = 58 -rbalance2 = 19 -smooth = 200 +rbalance = 55 +rbalance2 = 20 +smooth = 203 [w-bold] isBold = true @@ -176,9 +176,6 @@ rbalance2 = 25 rhook = 95 smooth = 215 -smallCrowd = 4 -smallCrowd2 = 4.25 - # Slants [s-upright] isItalic = false diff --git a/testdrive/index.html b/testdrive/index.html index 443a031..3a06cc7 100644 --- a/testdrive/index.html +++ b/testdrive/index.html @@ -6,156 +6,6 @@ html { font-size: 14px; } - @font-face { - font-family: IosevkaWEB; - font-weight: 100; - src: url('assets/iosevka-thin.woff') format('woff'), url('assets/iosevka-thin.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaWEB; - font-weight: 100; - font-style: italic; - src: url('assets/iosevka-thinitalic.woff') format('woff'), url('assets/iosevka-thinitalic.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaWEB; - font-weight: 200; - src: url('assets/iosevka-extralight.woff') format('woff'), url('assets/iosevka-extralight.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaWEB; - font-weight: 200; - font-style: italic; - src: url('assets/iosevka-extralightitalic.woff') format('woff'), url('assets/iosevka-extralightitalic.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaWEB; - font-weight: 300; - src: url('assets/iosevka-light.woff') format('woff'), url('assets/iosevka-light.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaWEB; - font-weight: 300; - font-style: italic; - src: url('assets/iosevka-lightitalic.woff') format('woff'), url('assets/iosevka-lightitalic.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaWEB; - src: url('assets/iosevka-regular.woff') format('woff'), url('assets/iosevka-regular.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaWEB; - font-style: italic; - src: url('assets/iosevka-italic.woff') format('woff'), url('assets/iosevka-italic.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaWEB; - font-weight: 500; - src: url('assets/iosevka-medium.woff') format('woff'), url('assets/iosevka-medium.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaWEB; - font-style: italic; - font-weight: 500; - src: url('assets/iosevka-mediumitalic.woff') format('woff'), url('assets/iosevka-mediumitalic.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaWEB; - font-weight: 700; - src: url('assets/iosevka-bold.woff') format('woff'), url('assets/iosevka-bold.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaWEB; - font-style: italic; - font-weight: 700; - src: url('assets/iosevka-bolditalic.woff') format('woff'), url('assets/iosevka-bolditalic.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaWEB; - font-weight: 900; - src: url('assets/iosevka-heavy.woff') format('woff'), url('assets/iosevka-heavy.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaWEB; - font-style: italic; - font-weight: 900; - src: url('assets/iosevka-heavyitalic.woff') format('woff'), url('assets/iosevka-heavyitalic.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - font-weight: 100; - src: url('assets/iosevka-slab-thin.woff') format('woff'), url('assets/iosevka-slab-thin.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - font-weight: 100; - font-style: italic; - src: url('assets/iosevka-slab-thinitalic.woff') format('woff'), url('assets/iosevka-slab-thinitalic.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - font-weight: 200; - src: url('assets/iosevka-slab-extralight.woff') format('woff'), url('assets/iosevka-slab-extralight.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - font-weight: 200; - font-style: italic; - src: url('assets/iosevka-slab-extralightitalic.woff') format('woff'), url('assets/iosevka-slab-extralightitalic.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - font-weight: 300; - src: url('assets/iosevka-slab-light.woff') format('woff'), url('assets/iosevka-slab-light.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - font-weight: 300; - font-style: italic; - src: url('assets/iosevka-slab-lightitalic.woff') format('woff'), url('assets/iosevka-slab-lightitalic.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - src: url('assets/iosevka-slab-regular.woff') format('woff'), url('assets/iosevka-slab-regular.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - font-style: italic; - src: url('assets/iosevka-slab-italic.woff') format('woff'), url('assets/iosevka-slab-italic.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - font-weight: 500; - src: url('assets/iosevka-slab-medium.woff') format('woff'), url('assets/iosevka-slab-medium.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - font-style: italic; - font-weight: 500; - src: url('assets/iosevka-slab-mediumitalic.woff') format('woff'), url('assets/iosevka-slab-mediumitalic.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - font-weight: 700; - src: url('assets/iosevka-slab-bold.woff') format('woff'), url('assets/iosevka-slab-bold.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - font-style: italic; - font-weight: 700; - src: url('assets/iosevka-slab-bolditalic.woff') format('woff'), url('assets/iosevka-slab-bolditalic.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - font-weight: 900; - src: url('assets/iosevka-slab-heavy.woff') format('woff'), url('assets/iosevka-slab-heavy.ttf') format('truetype'); - } - @font-face { - font-family: IosevkaSlabWEB; - font-style: italic; - font-weight: 900; - src: url('assets/iosevka-slab-heavyitalic.woff') format('woff'), url('assets/iosevka-slab-heavyitalic.ttf') format('truetype'); - } a { color: black; background-image: linear-gradient(white 50%, #888 50%);