From 68f29a77252ef61b98dada196c3c33d3abe812f8 Mon Sep 17 00:00:00 2001 From: be5invis Date: Wed, 12 Aug 2015 03:39:49 +0800 Subject: [PATCH] Added /venus, /earth, /mars and /quaver. It's almost there! --- buildglyphs.patel | 1 + glyphs/autobuilds.patel | 23 ++++++++++++----------- glyphs/latin-basic-lower.patel | 2 +- glyphs/symbol-geometric.patel | 15 +++++++++------ glyphs/symbol-other.patel | 31 +++++++++++++++++++++++++++++++ parameters.patel | 1 + 6 files changed, 55 insertions(+), 18 deletions(-) diff --git a/buildglyphs.patel b/buildglyphs.patel index f82a788..9958e69 100644 --- a/buildglyphs.patel +++ b/buildglyphs.patel @@ -45,6 +45,7 @@ define [buildFont para recursive] : begin { define AHOOK para.ahook define SHOOK para.shook define RHOOK para.rhook + define HOOKX para.hookx define SMOOTH para.smooth define SMALLSMOOTH para.smallsmooth define STROKE para.stroke diff --git a/glyphs/autobuilds.patel b/glyphs/autobuilds.patel index 119a0ee..a265929 100644 --- a/glyphs/autobuilds.patel +++ b/glyphs/autobuilds.patel @@ -26,7 +26,7 @@ define [createCircledGlyphs records] : if [not recursive] : begin { define [createSuperscripts records] : if [not recursive] : begin { local pendingGlyphs : records.map : [record] -> record.1 local miniatureFont : Miniature pendingGlyphs 3.7 0.7 - foreach (unicode glyphid) [items-of records] : create-glyph ['superscript_' + glyphid] : glyph-construction { + foreach (unicode glyphid) [items-of records] : create-glyph ['superscript' + glyphid] : glyph-construction { if unicode : assign-unicode unicode include : create-glyph : glyph-construction { include miniatureFont.(glyphid) @@ -41,7 +41,7 @@ define [createSuperscripts records] : if [not recursive] : begin { define [createSubscripts records] : if [not recursive] : begin { local pendingGlyphs : records.map : [record] -> record.1 local miniatureFont : Miniature pendingGlyphs 3.7 0.7 - foreach (unicode glyphid) [items-of records] : create-glyph ['subscript_' + glyphid] : glyph-construction { + foreach (unicode glyphid) [items-of records] : create-glyph ['subscript' + glyphid] : glyph-construction { if unicode : assign-unicode unicode include : create-glyph : glyph-construction { include miniatureFont.(glyphid) @@ -56,10 +56,11 @@ define [createSubscripts records] : if [not recursive] : begin { define [createFractions records] : if [not recursive] : begin { local pendingGlyphs : [records.map : [record] -> record.1].concat : records.map : [record] -> record.2 - local miniatureFont : Miniature pendingGlyphs 4 0.7 - foreach (unicode numid denid height) [items-of records] : create-glyph ['fraction_' + numid + '_' + denid] : glyph-construction { + local miniatureFont : Miniature pendingGlyphs 4 0.6 + foreach (unicode numid denid height) [items-of records] : create-glyph [numid + 'over' + denid] : glyph-construction { if unicode : assign-unicode unicode local fine : adviceBlackness 3.7 + local dist : XH * 0.4 include : create-glyph : glyph-construction { include : create-glyph : glyph-construction { include miniatureFont.(numid) @@ -70,7 +71,7 @@ define [createFractions records] : if [not recursive] : begin { apply-transform : Italify } apply-transform : Upright - apply-transform : Translate 0 [CAP + fine * 4] + apply-transform : Translate 0 [CAP + dist] apply-transform : Italify include : create-glyph : glyph-construction { include miniatureFont.(denid) @@ -81,8 +82,8 @@ define [createFractions records] : if [not recursive] : begin { apply-transform : Italify } apply-transform : Upright - apply-transform : Translate [-MIDDLE] [-CAP - fine * 2] - apply-transform : Scale 0.5 + apply-transform : Translate [-MIDDLE] [-CAP - dist / 2] + apply-transform : Scale 0.55 apply-transform : Translate MIDDLE parenMid apply-transform : Italify } @@ -274,8 +275,8 @@ createFractions : list { list 0x215E 'seven' 'eight' list 0x2189 'zero' 'three' # care-of - list 0x2105 'c' 'o' XH - list 0x2106 'c' 'u' XH + list 0x2105 'C' 'O' + list 0x2106 'C' 'U' # Powerline LN symbol list 0xE0A1 'L' 'N' } @@ -293,11 +294,11 @@ define [doubleSuperscript a b] : glyph-construction { } create-glyph 'trademark' : glyph-construction { assign-unicode 0x2122 - include : doubleSuperscript glyphs.superscript_T glyphs.superscript_M + include : doubleSuperscript glyphs.superscriptT glyphs.superscriptM } create-glyph 'servicemark' : glyph-construction { assign-unicode 0x2120 - include : doubleSuperscript glyphs.superscript_S glyphs.superscript_M + include : doubleSuperscript glyphs.superscriptS glyphs.superscriptM } # Build accented glyphs diff --git a/glyphs/latin-basic-lower.patel b/glyphs/latin-basic-lower.patel index 0968637..4e2fcac 100644 --- a/glyphs/latin-basic-lower.patel +++ b/glyphs/latin-basic-lower.patel @@ -660,7 +660,7 @@ create-glyph 'longs.upright' : glyph-construction { :.heads-to UPWARD :.set-width HALFSTROKE HALFSTROKE :.line-to MIDDLE [CAP - SHOOK * 1.4] - :.arc-vh-to [MIDDLE + SHOOK * 2] [CAP - HALFSTROKE - O * 6] + :.arc-vh-to [MIDDLE + HOOKX * 2] [CAP - HALFSTROKE - O * 6] :.heads-to RIGHTWARD } define [eshHook attach] : glyph-construction { diff --git a/glyphs/symbol-geometric.patel b/glyphs/symbol-geometric.patel index 1af5dee..956274c 100644 --- a/glyphs/symbol-geometric.patel +++ b/glyphs/symbol-geometric.patel @@ -1,21 +1,22 @@ ###### GEOMETRIC SHAPES ### Arrowheads -let [arrowSize : [RIGHTSB - SB] / 3] [halfstroke : [adviceBlackness 4] / 2] [fine : adviceBlackness 4.5] [arrowTop : mix parenMid parenTop 0.75] [arrowBot : mix parenMid parenBot 0.75] : begin { - define [ArrowHead x1 y1 x2 y2] : create-glyph : glyph-construction { +define (ArrowHead ArrowShape) : let [arrowSize : [RIGHTSB - SB] / 3] [halfstroke : [adviceBlackness 4] / 2] [fine : adviceBlackness 4.5] [arrowTop : mix parenMid parenTop 0.75] [arrowBot : mix parenMid parenBot 0.75] : 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 [arrowSize * 1] arrowSize + :.line-to [size * 1] size :.set-width 0 fine :.set-samples 1 include : create-stroke :.start-from 0 0 :.heads-to DOWNWARD :.set-width fine 0 - :.line-to [arrowSize * 1] [-arrowSize] + :.line-to [size * 1] [-size] :.set-width fine 0 :.set-samples 1 apply-transform : Translate O 0 @@ -24,10 +25,10 @@ let [arrowSize : [RIGHTSB - SB] / 3] [halfstroke : [adviceBlackness 4] / 2] [fin apply-transform : Rotate : Math.atan2 [yo - yt] [xo - xt] apply-transform : Translate xt yt } - define [ArrowShape x1 y1 x2 y2] : glyph-construction { + 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 + include : ArrowHead x1 y1 x2 y2 size include : create-stroke :.start-from x1 y1 :.set-width halfstroke halfstroke @@ -54,6 +55,8 @@ let [arrowSize : [RIGHTSB - SB] / 3] [halfstroke : [adviceBlackness 4] / 2] [fin arrow 'arrowupright' 0x2197 SB arrowBot RIGHTSB arrowTop arrow 'arrowdownright' 0x2198 SB arrowTop RIGHTSB arrowBot arrow 'arrowdownleft' 0x2199 RIGHTSB arrowTop SB arrowBot + + * (ArrowHead ArrowShape) } ### Standard geometric shapes let : begin { diff --git a/glyphs/symbol-other.patel b/glyphs/symbol-other.patel index 2daff02..8ef1613 100644 --- a/glyphs/symbol-other.patel +++ b/glyphs/symbol-other.patel @@ -50,4 +50,35 @@ let : begin { line-to MIDDLE heartBot line-to SB parenMid } +} +# planets +create-glyph 'venus' : glyph-construction { # also female + assign-unicode 0x2640 + local obot : operTop - RIGHTSB + SB + include : smallo operTop obot SB RIGHTSB OPERATORSTROKE + include : VBar MIDDLE operBot obot OPERATORSTROKE + include : HBar SB RIGHTSB [mix operBot [obot + OPERATORSTROKE] 0.5] OPERATORSTROKE +} +turned 'earth' 0x2641 'venus' MIDDLE parenMid +create-glyph 'mars' : glyph-construction { # also female + assign-unicode 0x2642 + local otop : operBot + RIGHTSB - SB + include : smallo otop operBot SB RIGHTSB OPERATORSTROKE + include : ArrowShape MIDDLE [otop - OPERATORSTROKE / 3] MIDDLE operTop [[RIGHTSB - SB] * 0.4] +} +# music notes +create-glyph 'quaver' : glyph-construction { + assign-unicode 0x266A + local fine : adviceBlackness 5 + local noteSize : MIDDLE + fine / 2 - SB + local y1 : mix operBot operTop 0.8 + local y2 : mix operBot operTop 0.4 + local x3 : mix SB RIGHTSB 0.7 + local y3 : mix operBot operTop 0.25 + include : list : Ring [operBot + 0.8 * noteSize] operBot SB [SB + noteSize] + include : VBarRight [SB + noteSize] [operBot + 0.4 * noteSize] operTop fine + include : create-stroke + :.start-from [SB + noteSize] operTop + :.set-width 0 fine + :.cubic-to RIGHTSB y1 RIGHTSB y2 x3 y3 } \ No newline at end of file diff --git a/parameters.patel b/parameters.patel index b5e41a5..265f1f3 100644 --- a/parameters.patel +++ b/parameters.patel @@ -18,6 +18,7 @@ define regular ( .ahook 130 .shook 100 .rhook 100 + .hookx 100 .smooth 192 .smallsmooth 242