Added glyph /period, /comma, /colon, /semicolon, /question and /exclam; Rebalanced /t and /y.

This commit is contained in:
Belleve Invis 2015-07-23 03:03:49 +08:00
parent 3326d7ab37
commit 2bd39e02f0
10 changed files with 1295 additions and 1019 deletions

View File

@ -42,6 +42,7 @@ define SMOOTH para.smooth
define SMALLSMOOTH para.smallsmooth
define STROKE para.stroke
define DOTSIZE para.dotsize
define PERIODSIZE para.periodsize
define BARPOS para.barpos
define GBARPOS para.gbarpos
define FIVEBARPOS para.fivebarpos
@ -57,7 +58,8 @@ define RIGHTSB : WIDTH - SB
define MIDDLE : WIDTH / 2
define CAPMIDDLE : CAP / 2
define CAP_SMOOTH : CAP - SMOOTH
define DOTRADIUS : para.dotsize / 2
define DOTRADIUS : DOTSIZE / 2
define PERIODRADIUS : PERIODSIZE / 2
define SMOOTHA : SMOOTH - globalTransform.yx * para.smoothadjust
define SMOOTHB : SMOOTH + globalTransform.yx * para.smoothadjust

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,8 @@
###### ASCII SYMBOLS
### Symbols with many strokes: $ & @
create-glyph 'dollar' : glyph-construction {
set-width WIDTH; assign-unicode '$'
include glyphs.S
@ -52,10 +54,49 @@ create-glyph 'ampersand' : glyph-construction {
}
create-glyph 'at' : glyph-construction {
set-width WIDTH
assign-unicode '@'
local top [CAP + HALFSTROKE]
local bot [DESCENDER + HALFSTROKE]
local otop : mix bot top 0.75
local obot : mix top bot 0.8
local sw : Math.min STROKE [[WIDTH - SB * 2] * 0.25]
local m1 : [mix [SB + sw] [RIGHTSB - sw] 0.47] - sw / 2
local m2 : mix m1 RIGHTSB 0.5
local sma : SMOOTHA * [[RIGHTSB - m1] / [RIGHTSB - SB]]
local smb : SMOOTHB * [[RIGHTSB - m1] / [RIGHTSB - SB]]
put-shapes : create-stroke
:.start-from RIGHTSB [otop - O]
:.heads-to LEFTWARD
:.set-width sw 0
:.line-to m2 [otop - O]
:.arc-hv-to m1 [otop - sma]
:.line-to m1 [obot + smb]
:.arc-vh-to [m2 + STROKE * globalTransform.yx] [obot + O]
:.arc-hv-to RIGHTSB [obot + sma]
:.line-to RIGHTSB [top - SMOOTHB]
:.arc-vh-to MIDDLE [top - O]
:.set-width STROKE 0
:.arc-hv-to SB [top - SMOOTHA]
:.set-width sw 0
:.line-to SB [bot + SMOOTHB]
:.arc-vh-to MIDDLE [bot + O]
:.set-width STROKE 0
:.heads-to RIGHTWARD
:.line-to [RIGHTSB - HALFSTROKE] [bot + O]
:.heads-to RIGHTWARD
:.to-outline
}
### Brackets
local parenTop [CAP - DESCENDER / 2]
local parenBot [DESCENDER / 2]
local parenBot DESCENDER
local parenMid [mix parenTop parenBot 0.5]
local parenOutside 0.15
@ -207,41 +248,73 @@ create-glyph 'braceright' : glyph-construction {
:.to-outline
}
create-glyph 'at' : glyph-construction {
set-width WIDTH
assign-unicode '@'
local top [CAP + HALFSTROKE]
local bot [DESCENDER + HALFSTROKE]
local otop : mix bot top 0.75
local obot : mix top bot 0.8
### Symbols with dots: period, comma, colon, semicolon
local sw : Math.min STROKE [[WIDTH - SB * 2] * 0.25]
local m1 : [mix [SB + sw] [RIGHTSB - sw] 0.47] - sw / 2
local m2 : mix m1 RIGHTSB 0.5
local sma : SMOOTHA * [[RIGHTSB - m1] / [RIGHTSB - SB]]
local smb : SMOOTHB * [[RIGHTSB - m1] / [RIGHTSB - SB]]
create-glyph 'period' : glyph-construction {
set-width WIDTH
assign-unicode '.'
put-shapes : list : Ring [PERIODSIZE - O] O [MIDDLE - PERIODRADIUS + O] [MIDDLE + PERIODRADIUS - O]
}
create-glyph 'xhdot' : glyph-construction {
set-width WIDTH
put-shapes : list : Ring [XH - O] [XH - PERIODSIZE + O] [MIDDLE - PERIODRADIUS + O] [MIDDLE + PERIODRADIUS - O]
}
create-glyph 'comma' : glyph-construction {
set-width WIDTH
assign-unicode ','
include glyphs.period
local sw : PERIODSIZE * 0.5
put-shapes : create-stroke
:.start-from RIGHTSB [otop - O]
:.heads-to LEFTWARD
:.set-width sw 0
:.line-to m2 [otop - O]
:.arc-hv-to m1 [otop - sma]
:.line-to m1 [obot + smb]
:.arc-vh-to m2 [obot + O]
:.arc-hv-to RIGHTSB [obot + sma]
:.line-to RIGHTSB [top - SMOOTHB]
:.arc-vh-to MIDDLE [top - O]
:.set-width STROKE 0
:.arc-hv-to SB [top - SMOOTHA]
:.set-width sw 0
:.line-to SB [bot + SMOOTHB]
:.arc-vh-to MIDDLE [bot + O]
:.set-width STROKE 0
:.heads-to RIGHTWARD
:.line-to [RIGHTSB - HALFSTROKE] [bot + O]
:.heads-to RIGHTWARD
:.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
:.to-outline
}
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 '?'
put-shapes : xsStrand [MIDDLE - HALFSTROKE] [mix [DOTSIZE + STROKE] [XH / 2] 0.5] RIGHTSB [CAP - SMOOTHB]
put-shapes : twoHookUpper CAP SMOOTHB HOOK
put-shapes : list : Ring [DOTSIZE - O] O [MIDDLE - DOTRADIUS + O] [MIDDLE + DOTRADIUS - O]
}
create-glyph 'exclam' : glyph-construction {
set-width WIDTH
assign-unicode '!'
put-shapes : 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
:.to-outline
put-shapes : list : Ring [DOTSIZE - O] O [MIDDLE - DOTRADIUS + O] [MIDDLE + DOTRADIUS - O]
}
### Symbols with bars: underscore, hyphen
create-glyph 'underscore' : glyph-construction {
set-width WIDTH
assign-unicode '_'
put-shapes : create-stroke :.start-from SB 0 :.heads-to RIGHTWARD :.set-width STROKE 0
:.line-to RIGHTSB 0 :.heads-to RIGHTWARD :.to-outline
}

View File

@ -99,11 +99,41 @@ define [xsStrand _xleft yleft _xright yright _halfstroke0 _halfstroke1 _ess _exp
:.set-width halfstroke1 halfstroke1
:.to-outline
}
define [sStrand yleft yright _expansion] : begin {
return : xsStrand SB yleft RIGHTSB yright HALFSTROKE HALFSTROKE HALFSTROKE _expansion [SMOOTHA * 0.4]
}
define [halfXStrand _leftx lefty rightx righty turn straight tension _fine] : begin {
local leftx : _leftx + [HALFSTROKE * [if [rightx > _leftx] 1 [-1]]]
local fine : [_fine || STROKE] * 0.5
local turnyleft : mix lefty righty turn
local cyleft : mix turnyleft righty tension
local straightxleft : mix leftx rightx straight
local straightyleft : mix cyleft righty straight
return : new Stroke
:.set-transform globalTransform
:.start-from leftx lefty
:.set-width HALFSTROKE HALFSTROKE
:.heads-to [if [lefty < righty] UPWARD DOWNWARD]
:.line-to leftx turnyleft
:.heads-to [if [lefty < righty] UPWARD DOWNWARD]
:.curve-to leftx cyleft straightxleft straightyleft
:.set-width fine fine
:.line-to rightx righty
:.to-outline
}
define [xStrand _leftx lefty _rightx righty turn straight tension] : begin {
local middlex : mix _leftx _rightx 0.5
local middley : mix lefty righty 0.5
return : halfXStrand _leftx lefty middlex middley turn straight tension
:.concat : halfXStrand _rightx righty middlex middley turn straight tension
}
define [nBowl left middle right fine] : begin {
local bandLeft : new Stroke
:.set-transform globalTransform

View File

@ -141,69 +141,23 @@ create-glyph 'X' : glyph-construction {
assign-unicode 'X'
include capitalMarks
local TURN [XH * 0.05]
local straight 0.6
local strench 0.125
local barone : create-stroke
:.start-from [SB + HALFSTROKE] 0
:.set-width HALFSTROKE HALFSTROKE
:.heads-to UPWARD
:.line-to [SB + HALFSTROKE] TURN
:.curve-to [SB + HALFSTROKE] [TURN + strench * [CAP - TURN]] [MIDDLE + straight * [SB + HALFSTROKE - MIDDLE]] [CAPMIDDLE + straight * [TURN + strench * [CAP - TURN] - CAPMIDDLE]]
:.line-to [MIDDLE + straight * [RIGHTSB - HALFSTROKE - MIDDLE]] [CAPMIDDLE + straight * [CAP - TURN - strench * [CAP - TURN] - CAPMIDDLE]]
:.curve-to [RIGHTSB - HALFSTROKE] [CAP - TURN - strench * [CAP - TURN]] [RIGHTSB - HALFSTROKE] [CAP - TURN]
:.line-to [RIGHTSB - HALFSTROKE] CAP
:.heads-to UPWARD
local bartwo : create-stroke
:.start-from [RIGHTSB - HALFSTROKE] 0
:.set-width HALFSTROKE HALFSTROKE
:.heads-to UPWARD
:.line-to [RIGHTSB - HALFSTROKE] TURN
:.curve-to [RIGHTSB - HALFSTROKE] [TURN + strench * [CAP - TURN]] [MIDDLE + straight * [RIGHTSB - HALFSTROKE - MIDDLE]] [CAPMIDDLE + straight * [TURN + strench * [CAP - TURN] - CAPMIDDLE]]
:.line-to [MIDDLE + straight * [SB + HALFSTROKE - MIDDLE]] [CAPMIDDLE + straight * [CAP - TURN - strench * [CAP - TURN] - CAPMIDDLE]]
:.curve-to [SB + HALFSTROKE] [CAP - TURN - strench * [CAP - TURN]] [SB + HALFSTROKE] [CAP - TURN]
:.line-to [SB + HALFSTROKE] CAP
:.heads-to UPWARD
put-shapes : barone.to-outline
put-shapes : bartwo.to-outline
put-shapes : xStrand SB 0 RIGHTSB CAP 0.1 0.4 0.28
put-shapes : xStrand SB CAP RIGHTSB 0 0.1 0.4 0.28
}
create-glyph 'Y' : glyph-construction {
set-width WIDTH
assign-unicode 'Y'
include capitalMarks
local TURN [XH * 0.05]
local straight 0.6
local strench 0.15
local cross [CAP * 0.4]
local barone : create-stroke
:.start-from MIDDLE cross
:.set-width HALFSTROKE HALFSTROKE
:.line-to [MIDDLE + straight * [RIGHTSB - HALFSTROKE - MIDDLE]] [cross + straight * [CAP - TURN - strench * [CAP - TURN] - cross]]
:.curve-to [RIGHTSB - HALFSTROKE] [CAP - TURN - strench * [CAP - TURN]] [RIGHTSB - HALFSTROKE] [CAP - TURN]
:.line-to [RIGHTSB - HALFSTROKE] CAP
:.heads-to UPWARD
local bartwo : create-stroke
:.start-from MIDDLE cross
:.set-width HALFSTROKE HALFSTROKE
:.line-to [MIDDLE + straight * [SB + HALFSTROKE - MIDDLE]] [cross + straight * [CAP - TURN - strench * [CAP - TURN] - cross]]
:.curve-to [SB + HALFSTROKE] [CAP - TURN - strench * [CAP - TURN]] [SB + HALFSTROKE] [CAP - TURN]
:.line-to [SB + HALFSTROKE] CAP
:.heads-to UPWARD
put-shapes : barone.to-outline
put-shapes : bartwo.to-outline
put-shapes : create-stroke
:.start-from MIDDLE 0
put-shapes : halfXStrand SB CAP MIDDLE cross 0.1 0.4 0.28
put-shapes : halfXStrand RIGHTSB CAP MIDDLE cross 0.1 0.4 0.28
put-shapes : create-stroke
:.start-from MIDDLE 0
:.set-width HALFSTROKE HALFSTROKE
:.heads-to UPWARD
:.heads-to UPWARD
:.line-to MIDDLE [cross + HALFSTROKE]
:.heads-to UPWARD
:.heads-to UPWARD
:.to-outline
}

View File

@ -249,14 +249,15 @@ create-glyph 't' : glyph-construction {
include bMarks
local center [MIDDLE - TBALANCE - HALFSTROKE]
local hookx [center + [WIDTH - SB * 2] * 0.82 - OXHOOK + TAILADJX * globalTransform.yx]
local turn [center + [hookx - center] * [0.5 + globalTransform.yx * 0.5]]
local hookx [center + [WIDTH - SB * 2] * 0.78 - OXHOOK + TAILADJX * globalTransform.yx]
local turn : mix center hookx [0.5 + globalTransform.yx * 0.5]
local smb : turn - center
put-shapes : create-stroke
:.start-from center CAP
:.set-width STROKE 0
:.heads-to DOWNWARD
:.line-to center SMOOTHB
:.line-to center smb
:.arc-vh-to turn O
:.curve-to [turn + [KAPPA_HOOK + TAILADJKAPPA * globalTransform.yx + 0.1] * [hookx - turn]] O hookx [HOOK - TAILADJY * globalTransform.yx]
:.to-outline
@ -677,25 +678,13 @@ create-glyph 'y.upright' : glyph-construction {
set-width WIDTH
include pMarks
local turn1 [DESCENDER + [XH - DESCENDER] * 0.1]
local turn2 [XH * 0.1]
local cross [XH * 0.15]
local xbottom [WIDTH * 0.4]
local xbottom : mix SB RIGHTSB 0.28
local turnp : XH / [XH - DESCENDER]
local xb : mix SB RIGHTSB 0.51
local yb : mix 0 XH [0.1 * turnp]
local barone : create-stroke
:.start-from xbottom DESCENDER
:.set-width HALFSTROKE HALFSTROKE
:.cubic-to xbottom [turn1 + 0.3 * [XH - turn1]] [RIGHTSB - HALFSTROKE - O] [XH - turn1 - 0.65 * [XH - turn1]] [RIGHTSB - HALFSTROKE - O] XH
:.heads-to UPWARD
local bartwo : create-stroke
:.start-from MIDDLE cross
:.set-width HALFSTROKE HALFSTROKE
:.curve-to [SB + HALFSTROKE + O] [XH - turn2 - 0.35 * [XH - turn2]] [SB + HALFSTROKE + O] XH
:.heads-to UPWARD
put-shapes : barone.to-outline
put-shapes : bartwo.to-outline
put-shapes : xStrand xbottom DESCENDER RIGHTSB XH 0.1 0.6 0.14
put-shapes : halfXStrand SB XH xb yb [0.1 * turnp] 0.4 [0.14 * turnp]
}
create-glyph 'y.italic' : glyph-construction {
set-width WIDTH

View File

@ -4,6 +4,7 @@
'width': 500,
'stroke': 80,
'dotsize': 125,
'periodsize': 150,
'sb': 60,
'cap': 771,
'descender': -178,
@ -27,7 +28,7 @@
'tbalance': 70,
'tbalance2': 30,
'rbalance': 25,
'family': 'Codex HW',
'family': 'Iosevka',
'style': 'Regular',
'weight': 400,
'version': 'r0.0.1',
@ -38,6 +39,7 @@
r0_bold['sb'] = 50;
r0_bold['stroke'] = 120;
r0_bold['dotsize'] = 160;
r0_bold['periodsize'] = 180;
r0_bold['barpos'] = 0.42;
r0_bold['hook'] = 150;
r0_bold['ahook'] = 100;
@ -51,16 +53,18 @@
r0_bold['style'] = 'Bold';
r0_bold['weight'] = 600;
r0_bold['bkappa'] = 0.5;
r0_bold['ckappa'] = 0.528;
r0_bold['smoothadjust'] = 130;
r0_italic = Object['create'](r0_regular);
r0_italic['italicangle'] = 10;
r0_italic['tbalance'] = 70;
r0_italic['rbalance'] = 30;
r0_italic['style'] = 'Italic';
r0_italic['ckappa'] = 0.618;
r0_bolditalic = Object['create'](r0_bold);
r0_bolditalic['italicangle'] = 10;
r0_bolditalic['tbalance'] = 90;
r0_bolditalic['style'] = 'BoldItalic';
r0_bolditalic['ckappa'] = 0.618;
exports['regular'] = r0_regular;
exports['bold'] = r0_bold;
exports['italic'] = r0_italic;

View File

@ -2,6 +2,7 @@ define regular (
.width 500
.stroke 80
.dotsize 125
.periodsize 150
.sb 60
.cap 771
.descender [-178]
@ -29,7 +30,7 @@ define regular (
.tbalance2 30
.rbalance 25
.family 'Codex HW'
.family 'Iosevka'
.style 'Regular'
.weight 400
.version 'r0.0.1'
@ -41,6 +42,7 @@ define bold : Object.create regular
bold.sb = 50
bold.stroke = 120
bold.dotsize = 160
bold.periodsize = 180
bold.barpos = 0.42
bold.hook = 150
bold.ahook = 100
@ -54,18 +56,20 @@ bold.rbalance = 18
bold.style = 'Bold'
bold.weight = 600
bold.bkappa = 0.5
bold.ckappa = 0.528
bold.smoothadjust = 130
define italic : Object.create regular
italic.italicangle = 10
italic.tbalance = 70
italic.rbalance = 30
italic.style = 'Italic'
italic.ckappa = 0.618
define bolditalic : Object.create bold
bolditalic.italicangle = 10
bolditalic.tbalance = 90
bolditalic.style = 'BoldItalic'
bolditalic.ckappa = 0.618
exports.regular = regular

View File

@ -18,7 +18,7 @@
var r2_a;
return [r2_a[0]]['concat'](r2_a['concat']([r2_a[r2_a['length'] - 1]]));
};
r0_SAMPLES = 4;
r0_SAMPLES = 6;
r0_TINY = 0.0001;
r0_LITTLE = 0.01;
r0_CUTOFF = 10000;

View File

@ -11,7 +11,7 @@ define [xs-array low high] : begin {
}
define [ys-array a] (a.0 :: [a.concat (a`[a.length - 1])])
define SAMPLES 4
define SAMPLES 6
define TINY 0.0001
define LITTLE 0.01
define CUTOFF 10000