Iosevka/glyphs/symbol-ascii.patel
2015-10-24 18:36:51 +08:00

439 lines
13 KiB
Plaintext

###### ASCII SYMBOLS
### Symbols with many strokes: $ & @
create-glyph 'dollar' : glyph-construction
set-width WIDTH; assign-unicode '$'
include glyphs.S
include : create-stroke
:.start-from MIDDLE (CAP - HALFSTROKE)
:.set-width HALFSTROKE HALFSTROKE
:.line-to MIDDLE (CAP - DESCENDER / 2)
include : create-stroke
:.start-from MIDDLE (DESCENDER / 2)
:.set-width HALFSTROKE HALFSTROKE
:.line-to MIDDLE HALFSTROKE
create-glyph 'ampersand' : glyph-construction
set-width WIDTH
assign-unicode '&'
local fine : adviceBlackness 3.5
local p 0.85
local l 0.05
local pr 0.9
local q 0.45
local r 1.1
local s 0
include : spiro
widths.lhs
flat (RIGHTSB - O - STROKE * CORRECTION_HX) CAPMIDDLE [heading DOWNWARD]
curl (RIGHTSB - O - STROKE * CORRECTION_HX) (SMOOTHA + CORRECTION_HX * CORRECTION_VS)
arcvh
g4 MIDDLE (O + fine) [widths fine 0]
archv
g4 (SB + O + fine * CORRECTION_HX) (SMOOTHB - CORRECTION_HX * CORRECTION_VS)
alsothru 0.5 0.5 [widths (fine / 2) (fine / 2)]
g4 ([mix SB RIGHTSB p] - fine * CORRECTION_HX) (CAP - SMOOTHB * pr + CORRECTION_HX * CORRECTION_VS * (fine / STROKE)) [widths 0 fine]
arcvh
g4 ([mix SB RIGHTSB [mix p l 0.5]] - CORRECTION_OMIDS + CORRECTION_VS) (CAPO - fine)
archv
g4 ([mix SB RIGHTSB l] + fine * CORRECTION_HX) (CAP - SMOOTHA * pr - CORRECTION_HX * CORRECTION_VS * (fine / STROKE))
alsothru 0.5 0.45 [lambda]
flat [mix SB RIGHTSB r] (SMOOTHA * s)
curl [mix SB RIGHTSB r] ((SMOOTHA * s) - 1)
create-glyph 'at' : glyph-construction
set-width WIDTH
assign-unicode '@'
local top parenTop
local bot parenBot
local otop : mix bot top 0.75
local obot : mix top bot 0.8
local sw : adviceBlackness 3.5
local m1 : [mix (SB + sw) (RIGHTSB - sw) 0.47] - sw / 2
local m2 : [mix m1 RIGHTSB 0.52] + globalTransform.yx * sw
local sma : SMOOTHA * ((RIGHTSB - m1) / (RIGHTSB - SB) * 1.1)
local smb : SMOOTHB * ((RIGHTSB - m1) / (RIGHTSB - SB) * 1.1)
include : spiro
widths.lhs sw
flat RIGHTSB (otop - O) [heading LEFTWARD]
curl m2 (otop - O)
archv
flat m1 (otop - sma)
curl m1 (obot + smb)
arcvh
g4 m2 (obot + O)
archv
flat RIGHTSB (obot + sma)
curl RIGHTSB (top - SMOOTHB)
arcvh
g4 (MIDDLE - CORRECTION_OMIDS) (top - O) [widths STROKE 0]
archv
flat SB (top - SMOOTHA) [widths sw 0]
curl SB (bot + SMOOTHB)
arcvh
flat (MIDDLE + CORRECTION_OMIDS) (bot + O) [widths STROKE 0 ]
curl (RIGHTSB - HALFSTROKE + globalTransform.yx * sw) (bot + O)
### Brackets
local parenOutside 0.15
local parenInside 0.65
local bracketOutside 0.15
local bracketInside 0.9
local braceOutside 0.1
local braceInside 0.9
create-glyph 'parenLeft' : glyph-construction
set-width WIDTH
assign-unicode '('
local p 0.6
include : spiro
widths.lhs
g4 [mix SB RIGHTSB parenInside] parenTop
quadcontrols 1 (1 - p)
g4 [mix SB RIGHTSB parenOutside] parenMid
quadcontrols 0 p
g4 [mix SB RIGHTSB parenInside] parenBot
create-glyph 'parenRight' : glyph-construction
set-width WIDTH
assign-unicode ')'
include glyphs.parenLeft
include : FlipAround MIDDLE parenMid
create-glyph 'bracketLeft' : glyph-construction
set-width WIDTH
assign-unicode '['
include : create-stroke
:.start-from [mix SB RIGHTSB bracketOutside] parenBot
:.set-width STROKE 0
:.heads-to RIGHTWARD
:.line-to [mix SB RIGHTSB bracketInside] parenBot
:.heads-to RIGHTWARD
include : create-stroke
:.start-from [mix SB RIGHTSB bracketOutside] parenTop
:.set-width 0 STROKE
:.heads-to RIGHTWARD
:.line-to [mix SB RIGHTSB bracketInside] parenTop
:.heads-to RIGHTWARD
include : create-stroke
:.start-from [mix SB RIGHTSB bracketOutside] parenBot
:.set-width 0 STROKE
:.heads-to UPWARD
:.line-to [mix SB RIGHTSB bracketOutside] parenTop
:.heads-to UPWARD
create-glyph 'bracketRight' : glyph-construction
set-width WIDTH
assign-unicode ']'
include glyphs.bracketLeft
include : FlipAround MIDDLE parenMid
create-glyph 'braceLeft' : glyph-construction
set-width WIDTH
assign-unicode '{'
local parenCenter [mix SB RIGHTSB [mix braceInside braceOutside 0.5]]
local radius : [mix SB RIGHTSB braceInside] - parenCenter
include : spiro
flat [mix SB RIGHTSB braceInside] (parenTop - HALFSTROKE) [widths.heading HALFSTROKE HALFSTROKE LEFTWARD]
curl ([mix SB RIGHTSB braceInside] - 0.01) (parenTop - HALFSTROKE) [widths.heading HALFSTROKE HALFSTROKE LEFTWARD]
archv
flat parenCenter (parenTop - radius) [heading DOWNWARD]
curl parenCenter (parenMid + radius) [heading DOWNWARD]
arcvh
flat ([mix SB RIGHTSB braceOutside] + 0.01) parenMid [heading LEFTWARD]
curl [mix SB RIGHTSB braceOutside] parenMid [heading LEFTWARD]
include : spiro
flat [mix SB RIGHTSB braceInside] (parenBot + HALFSTROKE) [widths.heading HALFSTROKE HALFSTROKE LEFTWARD]
curl ([mix SB RIGHTSB braceInside] - 0.01) (parenBot + HALFSTROKE) [widths.heading HALFSTROKE HALFSTROKE LEFTWARD]
archv
flat parenCenter (parenBot + radius) [heading UPWARD]
curl parenCenter (parenMid - radius) [heading UPWARD]
arcvh
flat ([mix SB RIGHTSB braceOutside] + 0.01) parenMid [heading LEFTWARD]
curl [mix SB RIGHTSB braceOutside] parenMid [heading LEFTWARD]
create-glyph 'braceRight' : glyph-construction
set-width WIDTH
assign-unicode '}'
include glyphs.braceLeft
include : FlipAround MIDDLE parenMid
### Symbols with dots: period, comma, colon, semicolon
create-glyph 'period' : glyph-construction
set-width WIDTH
assign-unicode '.'
include : list : Ring (PERIODSIZE - O) O (MIDDLE - PERIODRADIUS + O) (MIDDLE + PERIODRADIUS - O) true
create-glyph 'xhdot' : glyph-construction
set-width WIDTH
include : list : Ring (XH - O) (XH - PERIODSIZE + O) (MIDDLE - PERIODRADIUS + O) (MIDDLE + PERIODRADIUS - O) true
create-glyph 'comma' : glyph-construction
set-width WIDTH
assign-unicode ','
include glyphs.period
local sw : PERIODSIZE * 0.5
include : create-stroke
:.start-from (MIDDLE + PERIODRADIUS - O) [mix O (PERIODSIZE - O) 0.5]
:.set-width 0 sw
:.curve-to (MIDDLE + PERIODRADIUS - O) [mix [mix O (PERIODSIZE - O) 0.5] DESCENDER 0.5] [mix MIDDLE (MIDDLE - PERIODRADIUS) 0.3] DESCENDER
create-glyph 'invertComma' : glyph-construction
set-width WIDTH
include glyphs.period
local sw : PERIODSIZE * 0.5
include : create-stroke
:.start-from (MIDDLE - PERIODRADIUS + O) [mix O (PERIODSIZE - O) 0.5]
:.set-width sw 0
:.curve-to (MIDDLE - PERIODRADIUS + O) [mix [mix O (PERIODSIZE - O) 0.5] DESCENDER 0.5] [mix MIDDLE (MIDDLE + PERIODRADIUS) 0.3] DESCENDER
create-glyph 'colon' : glyph-construction
set-width WIDTH
assign-unicode ':'
include glyphs.period
include glyphs.xhdot
create-glyph 'semicolon' : glyph-construction
set-width WIDTH
assign-unicode ';'
include glyphs.comma
include glyphs.xhdot
create-glyph 'question' : glyph-construction
set-width WIDTH
assign-unicode '?'
include : list : Ring (DOTSIZE - O) O (MIDDLE - DOTRADIUS + O) (MIDDLE + DOTRADIUS - O) true
include : spiro
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)
create-glyph 'exclam' : glyph-construction
set-width WIDTH
include capitalMarks
assign-unicode '!'
include : create-stroke
:.start-from MIDDLE CAP
:.set-width HALFSTROKE HALFSTROKE
:.heads-to DOWNWARD
:.line-to MIDDLE [mix (DOTSIZE + STROKE) (XH / 2) 0.5]
:.heads-to DOWNWARD
include : list : Ring (DOTSIZE - O) O (MIDDLE - DOTRADIUS + O) (MIDDLE + DOTRADIUS - O) true
### Symbols with bars
create-glyph 'underscore' : glyph-construction
set-width WIDTH
assign-unicode '_'
include : create-stroke
:.start-from SB 0
:.heads-to RIGHTWARD
:.set-width STROKE 0
:.line-to RIGHTSB 0
:.heads-to RIGHTWARD
create-glyph 'hyphen' : glyph-construction
set-width WIDTH
assign-unicode '-'
include : HBar SB RIGHTSB parenMid
create-glyph 'plus' : glyph-construction
set-width WIDTH
assign-unicode '+'
include : HBar SB RIGHTSB parenMid OPERATORSTROKE
include : VBar MIDDLE (parenMid - (RIGHTSB - SB) * 0.55) (parenMid + (RIGHTSB - SB) * 0.55) OPERATORSTROKE
local equalHalfSpace : (parenTop - parenBot) * 0.11
create-glyph 'equal' : glyph-construction
set-width WIDTH
assign-unicode '='
include : HBar SB RIGHTSB (parenMid + equalHalfSpace) OPERATORSTROKE
include : HBar SB RIGHTSB (parenMid - equalHalfSpace) OPERATORSTROKE
create-glyph 'bar' : glyph-construction
set-width WIDTH
set this.anchors.above {.type BASE .x MIDDLE .y parenTop}
set this.anchors.below {.type BASE .x MIDDLE .y parenBot}
assign-unicode '|'
include : create-stroke
:.start-from MIDDLE parenTop
:.heads-to DOWNWARD
:.set-width (STROKE / 2) (STROKE / 2)
:.line-to MIDDLE parenBot
:.heads-to DOWNWARD
create-glyph 'slash' : glyph-construction
set-width WIDTH
assign-unicode '/'
local cor : CORRECTION_HX / [Math.sqrt (1 - [Math.pow ((RIGHTSB - SB - STROKE) / (parenTop - parenBot)) 2])]
start-from SB parenBot
line-to (SB + STROKE * cor) parenBot
line-to RIGHTSB parenTop
line-to (RIGHTSB - STROKE * cor) parenTop
reverse-last
create-glyph 'backslash' : glyph-construction
set-width WIDTH
assign-unicode "\\"
local cor : CORRECTION_HX / [Math.sqrt (1 - [Math.pow ((RIGHTSB - SB - STROKE) / (parenTop - parenBot)) 2])]
start-from SB parenTop
line-to (SB + STROKE * cor) parenTop
line-to RIGHTSB parenBot
line-to (RIGHTSB - STROKE * cor) parenBot
reverse-last
create-glyph 'numbersign' : glyph-construction
set-width WIDTH
assign-unicode '#'
local fine : adviceBlackness 4
include : HBar SB RIGHTSB [mix parenTop parenBot 0.33]
include : HBar SB RIGHTSB [mix parenTop parenBot 0.67]
include : VBar [mix SB RIGHTSB 0.3] (parenBot + fine) (parenTop - fine) fine
include : VBar [mix SB RIGHTSB 0.7] (parenBot + fine) (parenTop - fine) fine
create-glyph 'less' : glyph-construction
set-width WIDTH
assign-unicode '<'
local top : mix parenMid parenTop 0.5
local bot : mix parenMid parenBot 0.5
include : create-stroke
:.start-from RIGHTSB top
:.set-width (OPERATORSTROKE / 2) (OPERATORSTROKE / 2)
:.line-to SB [mix top bot 0.5]
:.heads-to LEFTWARD
:.max-samples 1
include : create-stroke
:.start-from SB [mix top bot 0.5]
:.set-width (OPERATORSTROKE / 2) (OPERATORSTROKE / 2)
:.heads-to RIGHTWARD
:.line-to RIGHTSB bot
:.max-samples 1
create-glyph 'greater' : glyph-construction
set-width WIDTH
assign-unicode '>'
local top : mix 0 CAP 0.75
local bot : mix 0 CAP 0.1
include glyphs.less
include : FlipAround MIDDLE parenMid
### Overmarks
local quoteTop (CAP * 1.05)
local quoteBottom (XH * 0.85)
create-glyph 'singleQuote' : glyph-construction
set-width WIDTH
assign-unicode 0x27
include : create-stroke
:.start-from MIDDLE quoteTop
:.heads-to DOWNWARD
:.set-width (HALFSTROKE * 1.2) (HALFSTROKE * 1.2)
:.line-to MIDDLE quoteBottom
:.set-width HALFSTROKE HALFSTROKE
:.heads-to DOWNWARD
create-glyph 'doubleQuote' : glyph-construction
set-width WIDTH
assign-unicode 0x22
local dist : 0.2 * WIDTH
include glyphs.singleQuote
apply-transform : Translate (-dist * 2) 0
include glyphs.singleQuote
apply-transform : Translate dist 0
### Asterisk
create-glyph 'asterisk' : glyph-construction
set-width WIDTH
assign-unicode '*'
local radius : LONGJUT * 1.2
local centery : parenTop - LONGJUT * 1.5
local fine : STROKE * 0.4
local final : 0.5 * [Math.min STROKE (radius * Math.PI * 2 / 10)]
foreach j [range 0 5] : begin
include : create-stroke
:.start-from MIDDLE centery
:.set-width fine fine
:.line-to (MIDDLE + radius * [Math.sin (j / 5 * Math.PI * 2)]) (centery + radius * [Math.cos (j / 5 * Math.PI * 2)])
:.set-width final final
:.max-samples 1
create-glyph 'percent' : glyph-construction
set-width WIDTH
assign-unicode '%'
local dotwidth ([adviceBlackness 4] * 1.5)
local cor : CORRECTION_HX / [Math.sqrt (1 - [Math.pow ((RIGHTSB - SB - STROKE) / (CAP - 0)) 2])]
start-from SB 0
line-to (SB + STROKE * cor) 0
line-to RIGHTSB CAP
line-to (RIGHTSB - STROKE * cor) CAP
include : VBarLeft SB [mix CAP 0 0.3] CAP dotwidth
include : VBarRight RIGHTSB 0 [mix 0 CAP 0.3] dotwidth