From cea639e3177a3edf5ff48a15e8ae2199f11ee5c3 Mon Sep 17 00:00:00 2001 From: be5invis Date: Tue, 27 Oct 2015 15:36:34 +0800 Subject: [PATCH] start working on fixing symbols, like /peseta. --- glyphs/autobuilds.patel | 2 +- glyphs/common-shapes.patel | 1 + glyphs/symbol-geometric.patel | 118 ++++++++++++++++++---------------- glyphs/symbol-letter.patel | 2 +- 4 files changed, 65 insertions(+), 58 deletions(-) diff --git a/glyphs/autobuilds.patel b/glyphs/autobuilds.patel index 57966d3..37102c9 100644 --- a/glyphs/autobuilds.patel +++ b/glyphs/autobuilds.patel @@ -279,7 +279,7 @@ define [createFractions records] : if [not recursive] : begin local miniatureFont : Miniature pendingGlyphs 4 0.6 foreach {unicode numid denid height} [items-of records] : create-glyph [suggestName : numid + 'over' + denid] : glyph-construction if unicode : assign-unicode unicode - local fine : adviceBlackness 3.7 + local fine : adviceBlackness 3 local dist : XH * 0.4 include : create-glyph : glyph-construction include : create-glyph [suggestName : 'num' + numid] : glyph-construction diff --git a/glyphs/common-shapes.patel b/glyphs/common-shapes.patel index 3797bd6..170a6af 100644 --- a/glyphs/common-shapes.patel +++ b/glyphs/common-shapes.patel @@ -351,6 +351,7 @@ define [Fork glyphs params] : begin define [Miniature glyphs fold scale] : begin local forkedPara : Object.create para forkedPara.stroke = [adviceBlackness fold] / scale + forkedPara.ess = para.ess * forkedPara.stroke / para.stroke forkedPara.sb = SB / 2 return : Fork glyphs forkedPara diff --git a/glyphs/symbol-geometric.patel b/glyphs/symbol-geometric.patel index 6817494..bab5de6 100644 --- a/glyphs/symbol-geometric.patel +++ b/glyphs/symbol-geometric.patel @@ -1,62 +1,68 @@ ###### GEOMETRIC SHAPES ### Arrowheads -define {ArrowHead ArrowShape} : let [arrowSize : (RIGHTSB - SB) / 3 * [Math.pow (FULLWIDTH / WIDTH) 0.4]] [halfstroke : [adviceBlackness 4] / 2] [fine : adviceBlackness 4.5] [arrowTop : mix parenMid parenTop 0.85] [arrowBot : mix parenMid parenBot 0.85] : begin - define [ArrowHead x1 y1 x2 y2 _size] : create-glyph : glyph-construction - local size : fallback _size arrowSize - set this.gizmo : Translate 0 0 - include : create-stroke - :.start-from 0 0 - :.heads-to UPWARD - :.set-width 0 fine - :.line-to (size * 1) size - :.set-width 0 fine - :.max-samples 1 - include : create-stroke - :.start-from 0 0 - :.heads-to DOWNWARD - :.set-width fine 0 - :.line-to (size * 1) (-size) - :.set-width fine 0 - :.max-samples 1 - apply-transform : Translate O 0 - local {.x xo .y yo} : tp globalTransform {.x x1 .y y1} - local {.x xt .y yt} : tp globalTransform {.x x2 .y y2} - apply-transform : Rotate : Math.atan2 (yo - yt) (xo - xt) - apply-transform : Translate xt yt - define [ArrowShape x1 y1 x2 y2 size] : glyph-construction - local mag : Math.hypot (y2 - y1) (x2 - x1) - local p : (mag - halfstroke * 1.1) / mag - include : ArrowHead x1 y1 x2 y2 size - include : create-stroke - :.start-from x1 y1 - :.set-width halfstroke halfstroke - :.line-to [mix x1 x2 p] [mix y1 y2 p] - define [arrow id unicode x1 y1 x2 y2] : create-glyph id : glyph-construction - set-width FULLWIDTH - set-anchor "slash" BASE FWMIDDLE parenMid - assign-unicode unicode - include : ArrowShape x1 y1 x2 y2 - define [doublearrow id unicode x1 y1 x2 y2] : create-glyph id : glyph-construction - set-width FULLWIDTH - set-anchor "slash" BASE FWMIDDLE parenMid - assign-unicode unicode - local xm : mix x1 x2 0.5 - local ym : mix y1 y2 0.5 - include : ArrowShape xm ym x1 y1 - include : ArrowShape xm ym x2 y2 - arrow 'arrowleft' 0x2190 FWRSB parenMid SB parenMid - arrow 'arrowright' 0x2192 SB parenMid FWRSB parenMid - arrow 'arrowup' 0x2191 FWMIDDLE arrowBot FWMIDDLE arrowTop - arrow 'arrowdown' 0x2193 FWMIDDLE arrowTop FWMIDDLE arrowBot - doublearrow 'arrowleftright' 0x2194 SB parenMid FWRSB parenMid - doublearrow 'arrowupdown' 0x2195 FWMIDDLE arrowTop FWMIDDLE arrowBot - arrow 'arrowupleft' 0x2196 FWRSB arrowBot SB arrowTop - arrow 'arrowupright' 0x2197 SB arrowBot FWRSB arrowTop - arrow 'arrowdownright' 0x2198 SB arrowTop FWRSB arrowBot - arrow 'arrowdownleft' 0x2199 FWRSB arrowTop SB arrowBot - - * {ArrowHead ArrowShape} +define {ArrowHead ArrowShape} : let + arrowSize : (RIGHTSB - SB) / 3 * [Math.pow (FULLWIDTH / WIDTH) 0.4] + halfstroke : OPERATORSTROKE / 2 + fine : adviceBlackness 4 + arrowTop : mix parenMid parenTop 0.85 + arrowBot : mix parenMid parenBot 0.85 + begin + define [ArrowHead x1 y1 x2 y2 _size] : create-glyph : glyph-construction + local size : fallback _size arrowSize + set this.gizmo : Translate 0 0 + include : create-stroke + :.start-from 0 0 + :.heads-to UPWARD + :.set-width 0 fine + :.line-to (size * 1) size + :.set-width 0 fine + :.max-samples 1 + include : create-stroke + :.start-from 0 0 + :.heads-to DOWNWARD + :.set-width fine 0 + :.line-to (size * 1) (-size) + :.set-width fine 0 + :.max-samples 1 + apply-transform : Translate O 0 + local {.x xo .y yo} : tp globalTransform {.x x1 .y y1} + local {.x xt .y yt} : tp globalTransform {.x x2 .y y2} + apply-transform : Rotate : Math.atan2 (yo - yt) (xo - xt) + apply-transform : Translate xt yt + define [ArrowShape x1 y1 x2 y2 size] : glyph-construction + local mag : Math.hypot (y2 - y1) (x2 - x1) + local p : (mag - halfstroke * 1.1) / mag + include : ArrowHead x1 y1 x2 y2 size + include : create-stroke + :.start-from x1 y1 + :.set-width halfstroke halfstroke + :.line-to [mix x1 x2 p] [mix y1 y2 p] + define [arrow id unicode x1 y1 x2 y2] : create-glyph id : glyph-construction + set-width FULLWIDTH + set-anchor "slash" BASE FWMIDDLE parenMid + assign-unicode unicode + include : ArrowShape x1 y1 x2 y2 + define [doublearrow id unicode x1 y1 x2 y2] : create-glyph id : glyph-construction + set-width FULLWIDTH + set-anchor "slash" BASE FWMIDDLE parenMid + assign-unicode unicode + local xm : mix x1 x2 0.5 + local ym : mix y1 y2 0.5 + include : ArrowShape xm ym x1 y1 + include : ArrowShape xm ym x2 y2 + arrow 'arrowleft' 0x2190 FWRSB parenMid SB parenMid + arrow 'arrowright' 0x2192 SB parenMid FWRSB parenMid + arrow 'arrowup' 0x2191 FWMIDDLE arrowBot FWMIDDLE arrowTop + arrow 'arrowdown' 0x2193 FWMIDDLE arrowTop FWMIDDLE arrowBot + doublearrow 'arrowleftright' 0x2194 SB parenMid FWRSB parenMid + doublearrow 'arrowupdown' 0x2195 FWMIDDLE arrowTop FWMIDDLE arrowBot + arrow 'arrowupleft' 0x2196 FWRSB arrowBot SB arrowTop + arrow 'arrowupright' 0x2197 SB arrowBot FWRSB arrowTop + arrow 'arrowdownright' 0x2198 SB arrowTop FWRSB arrowBot + arrow 'arrowdownleft' 0x2199 FWRSB arrowTop SB arrowBot + + * {ArrowHead ArrowShape} ### Standard geometric shapes let : begin diff --git a/glyphs/symbol-letter.patel b/glyphs/symbol-letter.patel index ad93e7a..7f570df 100644 --- a/glyphs/symbol-letter.patel +++ b/glyphs/symbol-letter.patel @@ -62,7 +62,7 @@ create-glyph 'frenchFranc' : glyph-construction create-glyph 'peseta' : glyph-construction assign-unicode 0x20A7 include glyphs.P - include : HOverlayBar [mix SB 0 0.7] [mix RIGHTSB WIDTH 0.7] [mix CAPMIDDLE CAP 0.45] + include : HOverlayBar [mix SB 0 0.7] [mix RIGHTSB WIDTH 0.7] [mix ((CAP - STROKE) * BARPOS - HALFSTROKE) CAP (SMOOTHB / (SMOOTHA + SMOOTHB))] ### Other