LATIN-1 COMPLETE!

This commit is contained in:
Belleve Invis 2015-07-27 00:49:00 +08:00
parent 079a05e953
commit f87c454933
10 changed files with 255 additions and 111 deletions

View file

@ -178,6 +178,8 @@ define-macro glyph-construction : syntax-rules {
local line-to : this.line-to.bind this local line-to : this.line-to.bind this
local curve-to : this.curve-to.bind this local curve-to : this.curve-to.bind this
local cubic-to : this.cubic-to.bind this local cubic-to : this.cubic-to.bind this
local arc-hv-to : this.arc-hv-to.bind this
local arc-vh-to : this.arc-vh-to.bind this
local put-shapes : this.put-shapes.bind this local put-shapes : this.put-shapes.bind this
local reverse-last : this.reverse-last.bind this local reverse-last : this.reverse-last.bind this
local include : this.include.bind this local include : this.include.bind this

View file

@ -40,7 +40,7 @@ define [createSuperscripts records] : if [not recursive] : begin {
include miniatureFont.(glyphid) include miniatureFont.(glyphid)
apply-transform : Upright apply-transform : Upright
apply-transform : Translate [-MIDDLE] [-CAP] apply-transform : Translate [-MIDDLE] [-CAP]
apply-transform : Scale 0.6 apply-transform : Scale 0.7
apply-transform : Translate MIDDLE CAP apply-transform : Translate MIDDLE CAP
apply-transform : Italify apply-transform : Italify
} }
@ -55,13 +55,41 @@ define [createSubscripts records] : if [not recursive] : begin {
include miniatureFont.(glyphid) include miniatureFont.(glyphid)
apply-transform : Upright apply-transform : Upright
apply-transform : Translate [-MIDDLE] 0 apply-transform : Translate [-MIDDLE] 0
apply-transform : Scale 0.6 apply-transform : Scale 0.7
apply-transform : Translate MIDDLE [-DESCENDER / 2] apply-transform : Translate MIDDLE [DESCENDER / 2]
apply-transform : Italify apply-transform : Italify
} }
} }
} }
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.6
foreach (unicode numid denid) [items-of records] : create-glyph ['fraction_' + numid + '_' + denid] : glyph-construction {
if unicode : assign-unicode unicode
local fine : adviceBlackness 4.2
include : create-glyph : glyph-construction {
include : create-glyph : glyph-construction {
include miniatureFont.(numid)
apply-transform : Translate [MIDDLE - miniatureFont.(numid).advanceWidth / 2] 0
}
apply-transform : Upright
apply-transform : Translate 0 [CAP + fine * 4]
apply-transform : Italify
include : create-glyph : glyph-construction {
include miniatureFont.(denid)
apply-transform : Translate [MIDDLE - miniatureFont.(denid).advanceWidth / 2] 0
}
apply-transform : Upright
apply-transform : Translate [-MIDDLE] [-CAP - fine * 2]
apply-transform : Scale 0.5
apply-transform : Translate MIDDLE parenMid
apply-transform : Italify
}
include : hbar SB RIGHTSB parenMid fine
}
}
createCircledGlyphs : list { createCircledGlyphs : list {
list 0xA9 'C' list 0xA9 'C'
list 0xAE 'R' list 0xAE 'R'
@ -70,7 +98,7 @@ createCircledGlyphs : list {
create-glyph 'ordfeminine' : glyph-construction { create-glyph 'ordfeminine' : glyph-construction {
assign-unicode 0xAA assign-unicode 0xAA
include : Miniature ('a') 4.2 0.6 include [Miniature ('a') 4.2 0.6].a
include : create-stroke include : create-stroke
:.start-from SB DESCENDER :.start-from SB DESCENDER
:.set-width STROKE 0 :.set-width STROKE 0
@ -80,13 +108,13 @@ create-glyph 'ordfeminine' : glyph-construction {
apply-transform : Upright apply-transform : Upright
apply-transform : Translate [-MIDDLE] [-XH] apply-transform : Translate [-MIDDLE] [-XH]
apply-transform : Scale 0.6 apply-transform : Scale 0.7
apply-transform : Translate MIDDLE CAP apply-transform : Translate MIDDLE CAP
apply-transform : Italify apply-transform : Italify
} }
create-glyph 'ordmasculine' : glyph-construction { create-glyph 'ordmasculine' : glyph-construction {
assign-unicode 0xBA assign-unicode 0xBA
include : Miniature ('o') 4.2 0.6 include [Miniature ('o') 4.2 0.6].o
include : create-stroke include : create-stroke
:.start-from SB DESCENDER :.start-from SB DESCENDER
:.set-width STROKE 0 :.set-width STROKE 0
@ -96,7 +124,7 @@ create-glyph 'ordmasculine' : glyph-construction {
apply-transform : Upright apply-transform : Upright
apply-transform : Translate [-MIDDLE] [-XH] apply-transform : Translate [-MIDDLE] [-XH]
apply-transform : Scale 0.6 apply-transform : Scale 0.7
apply-transform : Translate MIDDLE CAP apply-transform : Translate MIDDLE CAP
apply-transform : Italify apply-transform : Italify
} }
@ -188,6 +216,27 @@ createSubscripts : list {
list 0x1D65 'v' list 0x1D65 'v'
} }
createFractions : list {
list 0x00BC 'one' 'four'
list 0x00BD 'one' 'two'
list 0x00BE 'three' 'four'
list 0x2150 'one' 'seven'
list 0x2151 'one' 'nine'
list 0x2152 'one' 'ten'
list 0x2153 'one' 'three'
list 0x2154 'two' 'three'
list 0x2155 'one' 'five'
list 0x2156 'two' 'five'
list 0x2157 'three' 'five'
list 0x2158 'four' 'five'
list 0x2159 'one' 'six'
list 0x215A 'five' 'six'
list 0x215B 'one' 'eight'
list 0x215C 'three' 'eight'
list 0x215D 'five' 'eight'
list 0x215E 'seven' 'eight'
}
# Composite superscripts and subscripts # Composite superscripts and subscripts
define [doubleSuperscript a b] : glyph-construction { define [doubleSuperscript a b] : glyph-construction {
include a include a

View file

@ -259,3 +259,13 @@ define [vbar x ydown yup _fine] : glyph-construction {
:.line-to x yup :.line-to x yup
:.heads-to [if [ydown < yup] UPWARD DOWNWARD] :.heads-to [if [ydown < yup] UPWARD DOWNWARD]
} }
# Common transformations
define [FlipAround x y] : glyph-construction {
apply-transform : Upright
apply-transform : Translate [-x] [-y]
apply-transform : Scale [-1]
apply-transform : Translate x y
apply-transform : Italify
}

View file

@ -34,10 +34,10 @@ define [oLeft] : glyph-construction {
:.start-from MIDDLE [O + STROKE] :.start-from MIDDLE [O + STROKE]
:.heads-to LEFTWARD :.heads-to LEFTWARD
:.set-width STROKE 0 :.set-width STROKE 0
:.arc-hv-to [SB + STROKE] [SMALLSMOOTHB - STROKE * 0.05] :.arc-hv-to [SB + STROKE * ITALICCOR] [SMALLSMOOTHB - STROKE * 0.05]
:.set-width HALFSTROKE 0 :.set-width [STROKE * 0.25] 0
:.line-to [SB + STROKE] [XH - SMALLSMOOTHA + STROKE * 0.05] :.line-to [SB + STROKE * ITALICCOR] [XH - SMALLSMOOTHA + STROKE * 0.05]
:.set-width HALFSTROKE 0 :.set-width [STROKE * 0.25] 0
:.arc-vh-to MIDDLE [XO - STROKE] :.arc-vh-to MIDDLE [XO - STROKE]
:.set-width STROKE 0 :.set-width STROKE 0
:.heads-to RIGHTWARD :.heads-to RIGHTWARD
@ -57,10 +57,10 @@ define [oRight] : glyph-construction {
:.start-from MIDDLE [O + STROKE] :.start-from MIDDLE [O + STROKE]
:.heads-to RIGHTWARD :.heads-to RIGHTWARD
:.set-width 0 STROKE :.set-width 0 STROKE
:.arc-hv-to [RIGHTSB - STROKE] [SMALLSMOOTHA - STROKE * 0.05] :.arc-hv-to [RIGHTSB - STROKE * ITALICCOR] [SMALLSMOOTHA - STROKE * 0.05]
:.set-width 0 HALFSTROKE :.set-width 0 [STROKE * 0.25]
:.line-to [RIGHTSB - STROKE] [XH - SMALLSMOOTHB + STROKE * 0.05] :.line-to [RIGHTSB - STROKE * ITALICCOR] [XH - SMALLSMOOTHB + STROKE * 0.05]
:.set-width 0 HALFSTROKE :.set-width 0 [STROKE * 0.25]
:.arc-vh-to MIDDLE [XO - STROKE] :.arc-vh-to MIDDLE [XO - STROKE]
:.set-width 0 STROKE :.set-width 0 STROKE
:.heads-to LEFTWARD :.heads-to LEFTWARD
@ -212,6 +212,7 @@ create-glyph 'e.italic' : glyph-construction {
:.arc-vh-to MIDDLE O :.arc-vh-to MIDDLE O
:.heads-to RIGHTWARD :.heads-to RIGHTWARD
:.curve-to [MIDDLE + [KAPPA_HOOK + TAILADJKAPPA * globalTransform.yx] * [MIDDLE - SB]] O [RIGHTSB - OXHOOK + TAILADJX * globalTransform.yx] [HOOK - TAILADJY * globalTransform.yx] :.curve-to [MIDDLE + [KAPPA_HOOK + TAILADJKAPPA * globalTransform.yx] * [MIDDLE - SB]] O [RIGHTSB - OXHOOK + TAILADJX * globalTransform.yx] [HOOK - TAILADJY * globalTransform.yx]
:.set-samples 4
} }
create-glyph 'e' : glyph-construction { create-glyph 'e' : glyph-construction {
set-width WIDTH set-width WIDTH
@ -708,6 +709,7 @@ create-glyph 'r' : glyph-construction {
:.heads-to UPWARD :.heads-to UPWARD
:.set-width 0 STROKE :.set-width 0 STROKE
:.line-to [SB + RBALANCE] XH :.line-to [SB + RBALANCE] XH
:.heads-to UPWARD
} }
### f ### f

View file

@ -33,13 +33,13 @@ create-glyph 'one' : glyph-construction {
assign-unicode '1' assign-unicode '1'
include : create-stroke include : create-stroke
:.start-from [MIDDLE + JBALANCE * 0.6] 0 :.start-from [MIDDLE + JBALANCE * 0.5] 0
:.set-width HALFSTROKE HALFSTROKE :.set-width HALFSTROKE HALFSTROKE
:.heads-to UPWARD :.heads-to UPWARD
:.line-to [MIDDLE + JBALANCE * 0.6] CAP :.line-to [MIDDLE + JBALANCE * 0.5] CAP
:.heads-to UPWARD :.heads-to UPWARD
include : create-stroke include : create-stroke
:.start-from [MIDDLE - HALFSTROKE + JBALANCE * 0.6] CAP :.start-from [MIDDLE - HALFSTROKE + JBALANCE * 0.5] CAP
:.set-width STROKE 0 :.set-width STROKE 0
:.line-to [MIDDLE - HOOK * 1.5 + JBALANCE * 0.5] [CAP - HOOK * 0.75] :.line-to [MIDDLE - HOOK * 1.5 + JBALANCE * 0.5] [CAP - HOOK * 0.75]
} }
@ -199,3 +199,11 @@ create-glyph 'nine' : glyph-construction {
:.line-to RIGHTSB [CAP * 0.4] :.line-to RIGHTSB [CAP * 0.4]
include : sHookLower 0 [CAP * 0.4] HOOK [mix SB RIGHTSB 0.48] include : sHookLower 0 [CAP * 0.4] HOOK [mix SB RIGHTSB 0.48]
} }
create-glyph 'ten' : glyph-construction {
set-width : WIDTH * 2
include glyphs.one
apply-transform : Translate [-WIDTH] 0
include glyphs.zero
apply-transform : Translate WIDTH 0
}

View file

@ -203,8 +203,8 @@ create-glyph 'doubleGraveAbove' : glyph-construction {
assign-unicode 0x30F assign-unicode 0x30F
set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop
local m1 : markMiddle - markExtend * 0.75 local m1 : markMiddle - markExtend * 0.85
local m2 : markMiddle + markExtend * 0.75 local m2 : markMiddle + markExtend * 0.85
include : create-stroke include : create-stroke
:.start-from [m1 + markStress] aboveMarkBot :.start-from [m1 + markStress] aboveMarkBot
:.set-width markFine markFine :.set-width markFine markFine
@ -223,8 +223,8 @@ create-glyph 'doubleAcuteAbove' : glyph-construction {
assign-unicode 0x30B assign-unicode 0x30B
set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop
local m1 : markMiddle - markExtend * 0.75 local m1 : markMiddle - markExtend * 0.85
local m2 : markMiddle + markExtend * 0.75 local m2 : markMiddle + markExtend * 0.85
include : create-stroke include : create-stroke
:.start-from [m1 - markStress] aboveMarkBot :.start-from [m1 - markStress] aboveMarkBot
:.set-width markFine markFine :.set-width markFine markFine

View file

@ -121,13 +121,8 @@ create-glyph 'parenright' : glyph-construction {
set-width WIDTH set-width WIDTH
assign-unicode ')' assign-unicode ')'
local p 0.6 include glyphs.parenleft
include : FlipAround MIDDLE parenMid
include : create-stroke
:.start-from [mix RIGHTSB SB parenInside] parenTop
:.set-width 0 STROKE
:.curve-to [mix RIGHTSB SB parenOutside] [mix parenMid parenTop p] [mix RIGHTSB SB parenOutside] parenMid
:.curve-to [mix RIGHTSB SB parenOutside] [mix parenMid parenBot p] [mix RIGHTSB SB parenInside] parenBot
} }
create-glyph 'bracketleft' : glyph-construction { create-glyph 'bracketleft' : glyph-construction {
@ -156,30 +151,12 @@ create-glyph 'bracketleft' : glyph-construction {
:.heads-to UPWARD :.heads-to UPWARD
} }
create-glyph 'parenright' : glyph-construction { create-glyph 'bracketright' : glyph-construction {
set-width WIDTH set-width WIDTH
assign-unicode ']' assign-unicode ']'
include : create-stroke include glyphs.bracketleft
:.start-from [mix RIGHTSB SB bracketOutside] parenBot include : FlipAround MIDDLE parenMid
:.set-width 0 STROKE
:.heads-to LEFTWARD
:.line-to [mix RIGHTSB SB bracketInside] parenBot
:.heads-to LEFTWARD
include : create-stroke
:.start-from [mix RIGHTSB SB bracketOutside] parenTop
:.set-width STROKE 0
:.heads-to LEFTWARD
:.line-to [mix RIGHTSB SB bracketInside] parenTop
:.heads-to LEFTWARD
include : create-stroke
:.start-from [mix RIGHTSB SB bracketOutside] parenBot
:.set-width STROKE 0
:.heads-to UPWARD
:.line-to [mix RIGHTSB SB bracketOutside] parenTop
:.heads-to UPWARD
} }
create-glyph 'braceleft' : glyph-construction { create-glyph 'braceleft' : glyph-construction {
@ -212,26 +189,8 @@ create-glyph 'braceright' : glyph-construction {
set-width WIDTH set-width WIDTH
assign-unicode '}' assign-unicode '}'
local parenCenter [mix RIGHTSB SB [mix braceInside braceOutside 0.5]] include glyphs.braceleft
local radius : [mix RIGHTSB SB braceOutside] - parenCenter include : FlipAround MIDDLE parenMid
include : create-stroke
:.start-from [mix RIGHTSB SB braceInside] [parenTop - HALFSTROKE]
:.set-width HALFSTROKE HALFSTROKE
:.heads-to RIGHTWARD
:.arc-hv-to parenCenter [parenTop - radius]
:.line-to parenCenter [parenMid + radius]
:.arc-vh-to [mix RIGHTSB SB braceOutside] parenMid
:.heads-to RIGHTWARD
include : create-stroke
:.start-from [mix RIGHTSB SB braceInside] [parenBot + HALFSTROKE]
:.set-width HALFSTROKE HALFSTROKE
:.heads-to RIGHTWARD
:.arc-hv-to parenCenter [parenBot + radius]
:.line-to parenCenter [parenMid - radius]
:.arc-vh-to [mix RIGHTSB SB braceOutside] parenMid
:.heads-to RIGHTWARD
} }
### Symbols with dots: period, comma, colon, semicolon ### Symbols with dots: period, comma, colon, semicolon
@ -298,8 +257,12 @@ create-glyph 'underscore' : glyph-construction {
set-width WIDTH set-width WIDTH
assign-unicode '_' assign-unicode '_'
include : create-stroke :.start-from SB 0 :.heads-to RIGHTWARD :.set-width STROKE 0 include : create-stroke
:.line-to RIGHTSB 0 :.heads-to RIGHTWARD :.start-from SB 0
:.heads-to RIGHTWARD
:.set-width STROKE 0
:.line-to RIGHTSB 0
:.heads-to RIGHTWARD
} }
create-glyph 'hyphen' : glyph-construction { create-glyph 'hyphen' : glyph-construction {
@ -350,13 +313,8 @@ create-glyph 'backslash' : glyph-construction {
set-width WIDTH set-width WIDTH
assign-unicode "\\" assign-unicode "\\"
local cor : 1 / [Math.sqrt [1 - [Math.pow [[RIGHTSB - SB - STROKE] / [parenTop - parenBot]] 2]]] include glyphs.slash
include : FlipAround MIDDLE parenMid
start-from RIGHTSB parenBot
line-to [RIGHTSB - STROKE * cor] parenBot
line-to SB parenTop
line-to [SB + STROKE * cor] parenTop
reverse-last
} }
create-glyph 'numbersign' : glyph-construction { create-glyph 'numbersign' : glyph-construction {
set-width WIDTH set-width WIDTH
@ -374,8 +332,8 @@ create-glyph 'less' : glyph-construction {
set-width WIDTH set-width WIDTH
assign-unicode '<' assign-unicode '<'
local top : mix 0 CAP 0.75 local top : mix parenMid parenTop 0.5
local bot : mix 0 CAP 0.1 local bot : mix parenMid parenBot 0.5
include : create-stroke include : create-stroke
:.start-from RIGHTSB top :.start-from RIGHTSB top
@ -399,19 +357,8 @@ create-glyph 'greater' : glyph-construction {
local top : mix 0 CAP 0.75 local top : mix 0 CAP 0.75
local bot : mix 0 CAP 0.1 local bot : mix 0 CAP 0.1
include : create-stroke include glyphs.less
:.start-from SB top include : FlipAround MIDDLE parenMid
:.set-width HALFSTROKE HALFSTROKE
:.line-to RIGHTSB [mix top bot 0.5]
:.heads-to RIGHTWARD
:.set-samples 1
include : create-stroke
:.start-from RIGHTSB [mix top bot 0.5]
:.set-width HALFSTROKE HALFSTROKE
:.heads-to LEFTWARD
:.line-to SB bot
:.set-samples 1
} }
### Overmarks ### Overmarks

View file

@ -1,5 +1,10 @@
### Extended symbols ### Extended symbols
create-glyph 'nbsp' : glyph-construction {
assign-unicode 0xA0
include glyphs.space
}
create-glyph 'cent' : glyph-construction { create-glyph 'cent' : glyph-construction {
assign-unicode 0xA2 assign-unicode 0xA2
include glyphs.c AS_BASE include glyphs.c AS_BASE
@ -79,11 +84,10 @@ create-glyph 'sterling' : glyph-construction {
assign-unicode 0xA3 assign-unicode 0xA3
set-width WIDTH set-width WIDTH
include glyphs.'longs.upright' include glyphs.'longs.upright'
apply-transform : Translate [-WIDTH * 0.15] 0 apply-transform : Translate [-WIDTH * 0.125] 0
include : fBar [mix SB RIGHTSB 0.05] [[mix SB RIGHTSB 0.65] + HALFSTROKE] [CAP * 0.5 + STROKE] include : fBar [mix SB RIGHTSB 0.05] [mix SB RIGHTSB 0.7] [CAP * 0.5 + STROKE]
include glyphs.underscore include glyphs.underscore
} }
create-glyph 'micro' : glyph-construction { create-glyph 'micro' : glyph-construction {
set-width WIDTH set-width WIDTH
assign-unicode 0xB5 assign-unicode 0xB5
@ -109,7 +113,7 @@ create-glyph 'bullet' : glyph-construction {
} }
create-glyph 'currency' : glyph-construction { create-glyph 'currency' : glyph-construction {
assign-unicode 0xA4 assign-unicode 0xA4
local sw : adviceBlackness 5 local sw : adviceBlackness 3.5
local radius : [RIGHTSB - SB] / 2 local radius : [RIGHTSB - SB] / 2
include : smallo [parenMid + radius * 0.9] [parenMid - radius * 0.9] [MIDDLE - radius * 0.9] [MIDDLE + radius * 0.9] sw include : smallo [parenMid + radius * 0.9] [parenMid - radius * 0.9] [MIDDLE - radius * 0.9] [MIDDLE + radius * 0.9] sw
foreach j [range 0 4] : begin { foreach j [range 0 4] : begin {
@ -126,3 +130,109 @@ create-glyph 'euro' : glyph-construction {
include : hbar [SB - HALFSTROKE] [mix SB RIGHTSB 0.7] [CAP * 0.4] [adviceBlackness 4] include : hbar [SB - HALFSTROKE] [mix SB RIGHTSB 0.7] [CAP * 0.4] [adviceBlackness 4]
include : hbar [SB - HALFSTROKE] [mix SB RIGHTSB 0.7] [CAP * 0.6] [adviceBlackness 4] include : hbar [SB - HALFSTROKE] [mix SB RIGHTSB 0.7] [CAP * 0.6] [adviceBlackness 4]
} }
create-glyph 'multiply' : glyph-construction {
assign-unicode 0xD7
local radius : [RIGHTSB - SB] / 2
include : create-stroke
:.start-from [MIDDLE - radius] [parenMid - radius]
:.set-width HALFSTROKE HALFSTROKE
:.line-to [MIDDLE + radius] [parenMid + radius]
include : create-stroke
:.start-from [MIDDLE + radius] [parenMid - radius]
:.set-width HALFSTROKE HALFSTROKE
:.line-to [MIDDLE - radius] [parenMid + radius]
}
create-glyph 'divide' : glyph-construction {
assign-unicode 0xF7
include glyphs.hyphen
local radius : [RIGHTSB - SB] / 2
include : list {
Ring [parenMid + radius + DOTRADIUS] [parenMid + radius - DOTRADIUS] [MIDDLE - DOTRADIUS + O] [MIDDLE + DOTRADIUS - O]
Ring [parenMid - radius + DOTRADIUS] [parenMid - radius - DOTRADIUS] [MIDDLE - DOTRADIUS + O] [MIDDLE + DOTRADIUS - O]
}
}
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
:.set-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
:.set-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
}
create-glyph 'negate' : glyph-construction {
assign-unicode 0xAC
include glyphs.hyphen
include : vbar [RIGHTSB - HALFSTROKE] [hyphenCenter - [RIGHTSB - SB] * 0.55] [hyphenCenter + HALFSTROKE]
}

View file

@ -10,13 +10,13 @@ ClearTable('maxp');
Print("Outline Cleanup..."); Print("Outline Cleanup...");
Simplify(-1, 0); Simplify(-1, 0);
ReplaceWithReference(2, 1); ReplaceWithReference();
RemoveOverlap(); RemoveOverlap();
RoundToInt() RoundToInt()
RemoveOverlap(); RemoveOverlap();
UnlinkReference(); UnlinkReference();
RemoveOverlap(); RemoveOverlap();
ReplaceWithReference(5, 1); ReplaceWithReference(4, 1);
CorrectDirection(); CorrectDirection();
CanonicalContours(); CanonicalContours();
CanonicalStart(); CanonicalStart();

View file

@ -1,5 +1,6 @@
define bezierCubic2Q2 [require 'node-sfnt/lib/math/bezierCubic2Q2'] define bezierCubic2Q2 [require 'node-sfnt/lib/math/bezierCubic2Q2']
define tp [require './transform'].transformPoint define tp [require './transform'].transformPoint
define utp [require './transform'].untransform
define Stroke [require './stroke'].Stroke define Stroke [require './stroke'].Stroke
define id ( define id (
@ -59,10 +60,25 @@ define [Glyph.prototype.curve-to xc yc x y] : begin {
this.contours`[this.contours.length - 1].push [tp this.gizmo (.x xc .y yc .onCurve false)] [tp this.gizmo (.x x .y y .onCurve true)] this.contours`[this.contours.length - 1].push [tp this.gizmo (.x xc .y yc .onCurve false)] [tp this.gizmo (.x x .y y .onCurve true)]
return this return this
} }
define [Glyph.prototype.arc-vh-to x y kappa] : begin {
local lastContour this.contours`[this.contours.length - 1]
local lastPoint lastContour`[lastContour.length - 1]
local last : utp this.gizmo lastPoint
this.cubic-to last.x [last.y + [fallback kappa 0.618] * [y - last.y]] [x + [fallback kappa 0.618] * [last.x - x]] y x y
return this
}
define [Glyph.prototype.arc-hv-to x y kappa] : begin {
local lastContour this.contours`[this.contours.length - 1]
local lastPoint lastContour`[lastContour.length - 1]
local last : utp this.gizmo lastPoint
this.cubic-to [last.x + [fallback kappa 0.618] * [x - last.x]] last.y x [y + [fallback kappa 0.618] * [last.y - y]] x y
return this
}
define [Glyph.prototype.cubic-to x1 y1 x2 y2 x y] : begin { define [Glyph.prototype.cubic-to x1 y1 x2 y2 x y] : begin {
local lastContour this.contours`[this.contours.length - 1] local lastContour this.contours`[this.contours.length - 1]
local lastPoint lastContour`[lastContour.length - 1] local lastPoint lastContour`[lastContour.length - 1]
local segments [bezierCubic2Q2 lastPoint (.x x1 .y y1) (.x x2 .y y2) (.x x .y y)] local last : utp this.gizmo lastPoint
local segments [bezierCubic2Q2 last (.x x1 .y y1) (.x x2 .y y2) (.x x .y y)]
foreach (p0 (.x xc .y yc) (.x xf .y yf)) [items-of segments] : this.curve-to xc yc xf yf foreach (p0 (.x xc .y yc) (.x xf .y yf)) [items-of segments] : this.curve-to xc yc xf yf
return this return this
} }