Iosevka/glyphs/symbol-punctuation.patel

442 lines
15 KiB
Plaintext

### Extended symbols
# Aliases
alias 'greeksemicolon' 0x37E 'semicolon'
# Latin-1
create-glyph 'nbsp' : glyph-construction {
assign-unicode 0xA0
include glyphs.space
}
create-glyph 'section' : glyph-construction {
assign-unicode 0xA7
local top parenTop
local bot parenBot
local sma [SMOOTHA * 0.85]
local extension1 0.5
local extension2 0.625
local extension3x 0.5
local extension3y : mix extension1 [1 - sma / [top - bot]] 0.5
include : XSHookUpper top SB MIDDLE RIGHTSB sma HOOK
include : sStrand [top - sma] [mix bot top extension1]
include : sStrand [mix top bot extension1] [bot + sma]
include : XSHookLower bot SB MIDDLE RIGHTSB sma HOOK
include : create-stroke
:.start-from [SB + HALFSTROKE] [[mix top bot extension1] - HALFSTROKE * [globalTransform.yx * 0.985]]
:.set-width HALFSTROKE HALFSTROKE
:.curve-to [SB + HALFSTROKE] [mix bot top extension2] [mix [SB + HALFSTROKE] [RIGHTSB - HALFSTROKE] extension3x] [mix bot top extension3y]
include : create-stroke
:.start-from [RIGHTSB - HALFSTROKE] [[mix bot top extension1] + HALFSTROKE * [globalTransform.yx * 0.985]]
:.set-width HALFSTROKE HALFSTROKE
:.curve-to [RIGHTSB - HALFSTROKE] [mix top bot extension2] [mix [RIGHTSB - HALFSTROKE] [SB + HALFSTROKE] extension3x] [mix top bot extension3y]
}
create-glyph 'exclamDown' : glyph-construction {
assign-unicode 0xA1
set-width WIDTH
include glyphs.exclam
include : FlipAround MIDDLE [XH / 2]
}
create-glyph 'questionDown' : glyph-construction {
assign-unicode 0xBF
set-width WIDTH
include glyphs.question
include : FlipAround MIDDLE [XH / 2]
}
create-glyph 'softhyphen' : glyph-construction {
assign-unicode 0xAD
include glyphs.hyphen AS_BASE
}
create-glyph 'interpunct' : glyph-construction {
assign-unicode 0xB7
set-width FULLWIDTH
include : list : Ring [parenMid + PERIODRADIUS - O] [parenMid - PERIODRADIUS + O] [FWMIDDLE - PERIODRADIUS + O] [FWMIDDLE + PERIODRADIUS - O] true
}
create-glyph 'brokenbar' : glyph-construction {
assign-unicode 0xA6
include : VBar MIDDLE [parenMid + HALFSTROKE] parenTop
include : VBar MIDDLE parenBot [parenMid - HALFSTROKE]
}
create-glyph 'singleGuillemetLeft' : glyph-construction {
set-width WIDTH
assign-unicode 0x2039
local top : mix parenMid parenTop 0.5
local bot : mix parenMid parenBot 0.5
local extension 0.55
local extension2x [-0.2]
local extension2y 0.375
local cor 1
local halfsw : 0.5 * [adviceBlackness 3.5]
include : create-stroke
:.start-from [mix MIDDLE RIGHTSB extension] top
:.set-width halfsw halfsw
:.curve-to [mix MIDDLE SB extension2x] [mix top bot extension2y] [mix MIDDLE SB extension] [mix top bot 0.5]
:.set-width [halfsw * cor] [halfsw * cor]
:.heads-to LEFTWARD
:.max-samples 1
include : create-stroke
:.start-from [mix MIDDLE SB extension] [mix top bot 0.5]
:.set-width [halfsw * cor] [halfsw * cor]
:.heads-to RIGHTWARD
:.curve-to [mix MIDDLE SB extension2x] [mix bot top extension2y] [mix MIDDLE RIGHTSB extension] bot
:.set-width halfsw halfsw
:.max-samples 1
apply-transform : Translate [-[RIGHTSB - SB] * 0.05] 0
}
create-glyph 'guillemetLeft' : glyph-construction {
set-width WIDTH
assign-unicode 0xAB
include glyphs.singleGuillemetLeft
apply-transform : Translate [[RIGHTSB - SB] * 0.5] 0
include glyphs.singleGuillemetLeft
apply-transform : Translate [-[RIGHTSB - SB] * 0.25] 0
}
create-glyph 'singleGuillemetRight' : glyph-construction {
set-width WIDTH
assign-unicode 0x203A
include glyphs.singleGuillemetLeft
include : FlipAround MIDDLE parenMid
}
create-glyph 'guillemetRight' : glyph-construction {
set-width WIDTH
assign-unicode 0xBB
include glyphs.guillemetLeft
include : FlipAround MIDDLE parenMid
}
create-glyph 'paragraph' : glyph-construction {
set-width WIDTH
assign-unicode 0xB6
local sw : adviceBlackness 3.6
include : VBar [MIDDLE + sw / 4] 0 CAP sw
include : VBar [RIGHTSB - sw / 2] 0 CAP sw
include : create-stroke
:.start-from [MIDDLE - sw / 4] [CAP - sw / 2]
:.set-width [sw / 2] [sw / 2]
:.heads-to LEFTWARD
:.arc-hv-to [SB + sw / 2] [mix [CAP * 0.5] [CAP - sw / 2] 0.5]
:.heads-to DOWNWARD
:.arc-vh-to [MIDDLE - sw / 4] [CAP * 0.5]
:.heads-to RIGHTWARD
}
### Phonetic symbols
create-glyph 'trianglecolon' : glyph-construction {
assign-unicode 0x2D0
start-from [MIDDLE - PERIODRADIUS * 1.35] XH
line-to MIDDLE [XH - PERIODRADIUS * 2.75]
line-to [MIDDLE + PERIODRADIUS * 1.35] XH
start-from [MIDDLE - PERIODRADIUS * 1.35] 0
line-to MIDDLE [0 + PERIODRADIUS * 2.75]
line-to [MIDDLE + PERIODRADIUS * 1.35] 0
}
create-glyph 'halftrianglecolon' : glyph-construction {
assign-unicode 0x2D1
start-from [MIDDLE - PERIODRADIUS * 1.35] XH
line-to MIDDLE [XH - PERIODRADIUS * 2.75]
line-to [MIDDLE + PERIODRADIUS * 1.35] XH
}
### General punctuation segment
# spaces
# we set the width of emquad to 1000mem (1em) and the width of emspace to WIDTH (0.5em)
alias 'enquad' 0x2000 'space'
alias 'emquad' 0x2001 'space'
alias 'ensp' 0x2002 'space'
alias 'emsp' 0x2003 'space'
alias 'threePerEmsp' 0x2004 'space'
alias 'fourPerEmsp' 0x2005 'space'
alias 'sixPerEmsp' 0x2006 'space'
alias 'fgsp' 0x2007 'space'
create-glyph 'zwsp' : glyph-construction { assign-unicode 0x200B; set-width 0 }
alias 'gpHyphen' 0x2010 'hyphen'
alias 'nbHyphen' 0x2011 'hyphen'
alias 'figureDash' 0x2012 'hyphen'
alias 'enDash' 0x2013 'hyphen'
create-glyph 'emDash' : glyph-construction {
assign-unicode 0x2014
set-width FULLWIDTH
include : HBar 0 FULLWIDTH parenMid
}
alias 'horizontalBar' 0x2015 'emDash'
# quotation marks
local yCurlyQuotes [mix quoteBottom quoteTop 0.5]
local commaLow [DESCENDER * 0.9]
create-glyph 'lowSingleQuote' : glyph-construction {
include glyphs.comma
local ratio : [quoteTop - quoteBottom] / [PERIODSIZE - commaLow]
include : FlipAround MIDDLE 0 ratio ratio
}
create-glyph 'openSingleQuote' : glyph-construction {
include glyphs.lowSingleQuote
include : FlipAround MIDDLE [mix [mix PERIODSIZE commaLow 0.5] yCurlyQuotes 0.5]
}
create-glyph 'closeSingleQuote' : glyph-construction {
include glyphs.openSingleQuote
include : FlipAround MIDDLE yCurlyQuotes
}
create-glyph 'revertSingleQuote' : glyph-construction {
include glyphs.invertComma
local ratio : [quoteTop - quoteBottom] / [PERIODSIZE - commaLow]
include : FlipAround MIDDLE 0 ratio ratio
include : FlipAround MIDDLE [mix [mix PERIODSIZE commaLow 0.5] yCurlyQuotes 0.5]
include : FlipAround MIDDLE yCurlyQuotes
}
create-glyph 'lowDoubleQuote' : glyph-construction {
local dist : WIDTH * 0.225
include glyphs.lowSingleQuote
apply-transform : Translate [-dist * 2] 0
include glyphs.lowSingleQuote
apply-transform : Translate dist 0
}
create-glyph 'openDoubleQuote' : glyph-construction {
include glyphs.lowDoubleQuote
include : FlipAround MIDDLE [mix [mix PERIODSIZE commaLow 0.5] yCurlyQuotes 0.5]
}
create-glyph 'closeDoubleQuote' : glyph-construction {
include glyphs.openDoubleQuote
include : FlipAround MIDDLE yCurlyQuotes
}
create-glyph 'revertDoubleQuote' : glyph-construction {
local dist : WIDTH * 0.225
include glyphs.revertSingleQuote
apply-transform : Translate [-dist * 2] 0
include glyphs.revertSingleQuote
apply-transform : Translate dist 0
}
fwr nothing 0x201A 'lowSingleQuote'
fwr nothing 0x2018 'openSingleQuote'
fwl nothing 0x2019 'closeSingleQuote'
fwr nothing 0x201B 'revertSingleQuote'
fwr nothing 0x201E 'lowDoubleQuote'
fwr nothing 0x201C 'openDoubleQuote'
fwl nothing 0x201D 'closeDoubleQuote'
fwr nothing 0x201F 'revertDoubleQuote'
# Daggers
create-glyph 'dagger' : glyph-construction {
assign-unicode 0x2020
include : HBar SB RIGHTSB [mix parenTop parenBot 0.33]
include : VBar MIDDLE parenBot parenTop
}
create-glyph 'doubledagger' : glyph-construction {
assign-unicode 0x2021
include glyphs.dagger
include : HBar SB RIGHTSB [mix parenTop parenBot 0.67]
}
# Ellipsis
create-glyph 'onedotLeader' : glyph-construction {
set-width FULLWIDTH
assign-unicode 0x2024
local radius : linreg WIDTH [0.5 * [adviceBlackness 3.25] * PERIODSIZE / DOTSIZE] UPM PERIODRADIUS FULLWIDTH
include : list {
Ring [radius * 2 - O] O [FULLWIDTH / 2 - radius + O] [FULLWIDTH / 2 + radius - O] true
}
}
create-glyph 'twodotsLEader' : glyph-construction {
set-width FULLWIDTH
assign-unicode 0x2025
local radius : linreg WIDTH [0.5 * [adviceBlackness 3.25] * PERIODSIZE / DOTSIZE] UPM PERIODRADIUS FULLWIDTH
local left : mix 0 FULLWIDTH [1 / 4]
local right : mix 0 FULLWIDTH [3 / 4]
include : list {
Ring [radius * 2 - O] O [left - radius + O] [left + radius - O] true
Ring [radius * 2 - O] O [right - radius + O] [right + radius - O] true
}
}
create-glyph 'ellipsis' : glyph-construction {
set-width FULLWIDTH
assign-unicode 0x2026
local radius : linreg WIDTH [0.5 * [adviceBlackness 3.25] * PERIODSIZE / DOTSIZE] UPM PERIODRADIUS FULLWIDTH
local left : mix 0 FULLWIDTH [1 / 6]
local right : mix 0 FULLWIDTH [5 / 6]
include : list {
Ring [radius * 2 - O] O [left - radius + O] [left + radius - O] true
Ring [radius * 2 - O] O [FULLWIDTH / 2 - radius + O] [FULLWIDTH / 2 + radius - O] true
Ring [radius * 2 - O] O [right - radius + O] [right + radius - O] true
}
}
alias 'bullet' 0x2022 'interpunct'
alias 'hyphenpoint' 0x2027 'interpunct'
alias 'greekbullet' 0x387 'interpunct'
create-glyph 'permille' : glyph-construction {
assign-unicode 0x2030
local dotwidth [[adviceBlackness 4] * 1.5]
include : create-stroke
:.start-from SB [CAP * 0.2]
:.set-width HALFSTROKE HALFSTROKE
:.line-to [mix SB RIGHTSB 0.85] [CAP * 0.9]
include : VBarLeft [mix SB RIGHTSB 0.075] [mix CAP 0 0.3] CAP dotwidth
include : VBarRight RIGHTSB 0 [mix 0 CAP 0.3] dotwidth
include : VBarRight [RIGHTSB - dotwidth * 1.5] 0 [mix 0 CAP 0.3] dotwidth
}
create-glyph 'basepoint' : glyph-construction {
assign-unicode 0x2031
local dotwidth [[adviceBlackness 4] * 1.5]
local dotfine [adviceBlackness 3.5]
include : create-stroke
:.start-from SB [CAP * 0.2]
:.set-width HALFSTROKE HALFSTROKE
:.line-to [mix SB RIGHTSB 0.85] [CAP * 0.9]
include : VBarLeft SB [mix CAP 0 0.3] CAP dotwidth
include : VBarRight RIGHTSB 0 [mix 0 CAP 0.3] dotfine
include : VBar [mix [mix SB RIGHTSB 0.1] RIGHTSB 0.5] 0 [mix 0 CAP 0.3] dotfine
include : VBarLeft [mix SB RIGHTSB 0.1] 0 [mix 0 CAP 0.3] dotfine
}
create-glyph 'doubleexclam' : glyph-construction {
assign-unicode 0x203C
local d : 0.25 * WIDTH
include glyphs.exclam
apply-transform : Translate [-d * 2] 0
include glyphs.exclam
apply-transform : Translate d 0
}
create-glyph 'overline' : glyph-construction {
assign-unicode 0x203E
include : HBarTop SB RIGHTSB CAP
}
alias 'solidus' 0x2044 'slash'
create-glyph 'prime' : glyph-construction {
assign-unicode 0x2032
local wide : WIDTH * 0.1
include : create-stroke
:.start-from [MIDDLE + wide] quoteTop
:.heads-to DOWNWARD
:.set-width [HALFSTROKE * 1.2] [HALFSTROKE * 1.2]
:.line-to [MIDDLE - wide] quoteBottom
:.set-width HALFSTROKE HALFSTROKE
:.heads-to DOWNWARD
}
create-glyph 'doubleprime' : glyph-construction {
assign-unicode 0x2033
local d : 0.25 * [RIGHTSB - SB]
include glyphs.prime
apply-transform : Translate [-d * 2] 0
include glyphs.prime
apply-transform : Translate d 0
}
create-glyph 'tripleprime' : glyph-construction {
assign-unicode 0x2034
local wide : WIDTH * 0.1
local d : WIDTH * 0.3
local fine : 0.5 * [adviceBlackness 3.5]
include : create-stroke
:.start-from [MIDDLE + wide] quoteTop
:.heads-to DOWNWARD
:.set-width [fine * 1.2] [fine * 1.2]
:.line-to [MIDDLE - wide] quoteBottom
:.set-width fine fine
:.heads-to DOWNWARD
include : create-stroke
:.start-from [MIDDLE - d + wide] quoteTop
:.heads-to DOWNWARD
:.set-width [fine * 1.2] [fine * 1.2]
:.line-to [MIDDLE - d - wide] quoteBottom
:.set-width fine fine
:.heads-to DOWNWARD
include : create-stroke
:.start-from [MIDDLE + d + wide] quoteTop
:.heads-to DOWNWARD
:.set-width [fine * 1.2] [fine * 1.2]
:.line-to [MIDDLE + d - wide] quoteBottom
:.set-width fine fine
:.heads-to DOWNWARD
}
create-glyph 'revprime' : glyph-construction {
assign-unicode 0x2035
local wide : -WIDTH * 0.1
include : create-stroke
:.start-from [MIDDLE + wide] quoteTop
:.heads-to DOWNWARD
:.set-width [HALFSTROKE * 1.2] [HALFSTROKE * 1.2]
:.line-to [MIDDLE - wide] quoteBottom
:.set-width HALFSTROKE HALFSTROKE
:.heads-to DOWNWARD
}
create-glyph 'revdoubleprime' : glyph-construction {
assign-unicode 0x2036
local d : 0.25 * [RIGHTSB - SB]
include glyphs.revprime
apply-transform : Translate [-d * 2] 0
include glyphs.revprime
apply-transform : Translate d 0
}
create-glyph 'revtripleprime' : glyph-construction {
assign-unicode 0x2037
local wide : -WIDTH * 0.1
local d : WIDTH * 0.3
local fine : 0.5 * [adviceBlackness 3.5]
include : create-stroke
:.start-from [MIDDLE + wide] quoteTop
:.heads-to DOWNWARD
:.set-width [fine * 1.2] [fine * 1.2]
:.line-to [MIDDLE - wide] quoteBottom
:.set-width fine fine
:.heads-to DOWNWARD
include : create-stroke
:.start-from [MIDDLE - d + wide] quoteTop
:.heads-to DOWNWARD
:.set-width [fine * 1.2] [fine * 1.2]
:.line-to [MIDDLE - d - wide] quoteBottom
:.set-width fine fine
:.heads-to DOWNWARD
include : create-stroke
:.start-from [MIDDLE + d + wide] quoteTop
:.heads-to DOWNWARD
:.set-width [fine * 1.2] [fine * 1.2]
:.line-to [MIDDLE + d - wide] quoteBottom
:.set-width fine fine
:.heads-to DOWNWARD
}
### Aliased modifer letters
alias 'mdfPrime' 0x2B9 'prime'
alias 'mdfDoublePrime' 0x2BA 'doubleprime'
alias 'mdfTurncomma' 0x2BB 'openSingleQuote'
alias 'mdfApostrophe' 0x2BC 'closeSingleQuote'
alias 'mdfRevComma' 0x2BD 'revertSingleQuote'
alias 'mdfStress' 0x2C8 'singleQuote'
turned 'mdfSecondaryStress' 0x2CC 'singleQuote' MIDDLE [XH / 2]
dwc nothing 0xFF01 'exclam'
dwc nothing 0xFF1A 'colon'
dwc nothing 0xFF1B 'semicolon'
dwl nothing 0xFF0C 'comma'
dwl nothing 0xFF0E 'period'
dwr nothing 0xFF08 'parenLeft'
dwl nothing 0xFF09 'parenRight'
create-glyph 'dwquestion' : glyph-construction {
set-width UPM
assign-unicode 0xFF1F
include : list : Ring [DOTSIZE - O] O [UPM / 2 - DOTRADIUS + O] [UPM / 2 + DOTRADIUS - O] true
include : spiro {
widths.rhs
g4 [UPM * 0.25] [CAP - HOOK]
hookstart CAPO
g4 [UPM * 0.75] [CAP - SMOOTHB * 0.85]
alsothru 0.5 0.5 [widths HALFSTROKE HALFSTROKE]
flat [UPM / 2 - HALFSTROKE * CORRECTION_HX] [mix [DOTSIZE + STROKE] [XH / 2] 0.5] [widths STROKE 0]
curl [UPM / 2 - HALFSTROKE * CORRECTION_HX] [[mix [DOTSIZE + STROKE] [XH / 2] 0.5] - 1]
}
}