symbol-block-ified all glyph segments.

This commit is contained in:
be5invis 2015-12-13 05:52:13 +08:00
parent 3a53647cfd
commit 04e3b3cbc0
2 changed files with 236 additions and 237 deletions

View File

@ -399,7 +399,7 @@ export as build : define [buildFont para recursive recursiveCodes] : begin
$$include 'glyphs/letters-unified-extended.aki'
# Numbers
$$include 'glyphs/numbers.aki' ; progress 'Numbers'
$$include 'glyphs/numbers.aki'
# Symbols
$$include 'glyphs/symbol-punctuation.aki'

View File

@ -1,254 +1,253 @@
###### NUMBERS
create-glyph 'zero.unslashed' : glyph-construction
include capitalMarks
set-width WIDTH
include : OShape CAP 0 SB RIGHTSB
create-glyph 'zero.slashed' : glyph-construction
include capitalMarks
set-width WIDTH
include glyphs.'zero.unslashed'
local fine : 0.5 * OVERLAYSTROKE
include : dispiro
flat (SB + STROKE / 2) (CAP * (1 - 0.77)) [widths fine fine]
curl (RIGHTSB - STROKE / 2) (CAP * 0.77)
create-glyph 'zero.dotted' : glyph-construction
include capitalMarks
set-width WIDTH
include glyphs.'zero.unslashed'
local radius : Math.min DOTRADIUS ((RIGHTSB - SB - STROKE * 2) / 4)
include : Ring (CAPMIDDLE + radius) (CAPMIDDLE - radius) (MIDDLE + radius) (MIDDLE - radius)
select-variant 'zero' '0' 'slashed'
create-glyph 'one' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '1'
symbol-block "Numbers"
create-glyph 'zero.unslashed' : glyph-construction
include capitalMarks
set-width WIDTH
include : OShape CAP 0 SB RIGHTSB
include : VBar (MIDDLE + ONEBALANCE) 0 CAP
include : dispiro
flat (MIDDLE - HALFSTROKE * CORRECTION_HX + ONEBALANCE) CAP [widths STROKE 0]
curl (MIDDLE - HOOKX * 1.25 + ONEBALANCE) (CAP - HOOK * 0.75)
create-glyph 'zero.slashed' : glyph-construction
include capitalMarks
set-width WIDTH
include glyphs.'zero.unslashed'
local fine : 0.5 * OVERLAYSTROKE
include : dispiro
flat (SB + STROKE / 2) (CAP * (1 - 0.77)) [widths fine fine]
curl (RIGHTSB - STROKE / 2) (CAP * 0.77)
if SLAB : begin
include : CenterBottomSerif (MIDDLE + ONEBALANCE) 0 LONGJUT
create-glyph 'two' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '2'
create-glyph 'zero.dotted' : glyph-construction
include capitalMarks
set-width WIDTH
include glyphs.'zero.unslashed'
local radius : Math.min DOTRADIUS ((RIGHTSB - SB - STROKE * 2) / 4)
include : Ring (CAPMIDDLE + radius) (CAPMIDDLE - radius) (MIDDLE + radius) (MIDDLE - radius)
define smooth [adviceGlottalStopSmooth CAP 1]
include : dispiro
widths.rhs
g4 SB (CAP - HOOK)
hookstart (CAP - O)
g4 RIGHTSB (CAP - smooth)
alsothru 0.5 0.425 [widths (ESS / 2) (ESS / 2)]
flat SB 1 [widths.heading STROKE 0 DOWNWARD]
curl SB 0 [heading DOWNWARD]
select-variant 'zero' '0' 'slashed'
include : HBarBottom (SB + HALFSTROKE) RIGHTSB 0
if SLAB : begin
include : UpwardRightSerif RIGHTSB 0 VJUT
create-glyph 'three' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '3'
local barcenter : CAP * 0.51
local threeRadius : (CAPMIDDLE + HALFSTROKE - SMOOTH) * 1.25
local fine : STROKE * CTHIN
create-glyph 'one' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '1'
include : VBar (MIDDLE + ONEBALANCE) 0 CAP
include : dispiro
flat (MIDDLE - HALFSTROKE * CORRECTION_HX + ONEBALANCE) CAP [widths STROKE 0]
curl (MIDDLE - HOOKX * 1.25 + ONEBALANCE) (CAP - HOOK * 0.75)
if SLAB : begin
include : CenterBottomSerif (MIDDLE + ONEBALANCE) 0 LONGJUT
include : dispiro
widths.rhs
g4 SB (CAP - HOOK)
hookstart CAPO
g4 RIGHTSB (CAP - (SMOOTHB * (CAP - barcenter) / CAPMIDDLE))
flat (RIGHTSB - threeRadius + 0.01) (barcenter - (fine - HALFSTROKE)) [widths.heading 0 fine LEFTWARD]
curl (RIGHTSB - threeRadius) (barcenter - (fine - HALFSTROKE)) [heading LEFTWARD]
include : dispiro
widths.lhs
g4 SB HOOK
hookstart O
g4 RIGHTSB (SMOOTHA * barcenter / CAPMIDDLE)
flat (RIGHTSB - threeRadius + 0.01) (barcenter + (fine - HALFSTROKE)) [widths.heading fine 0 LEFTWARD]
curl (RIGHTSB - threeRadius) (barcenter + (fine - HALFSTROKE)) [heading LEFTWARD]
create-glyph 'four' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '4'
local bar (CAP * 0.4)
local vert : [mix SB RIGHTSB 0.825] - CORRECTION_HX * STROKE
local p 0.25
local fine (STROKE * 0.9)
create-glyph 'two' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '2'
define smooth [adviceGlottalStopSmooth CAP 1]
include : dispiro
widths.rhs
g4 SB (CAP - HOOK)
hookstart (CAP - O)
g4 RIGHTSB (CAP - smooth)
alsothru 0.5 0.425 [widths (ESS / 2) (ESS / 2)]
flat SB 1 [widths.heading STROKE 0 DOWNWARD]
curl SB 0 [heading DOWNWARD]
include : HBarBottom (SB + HALFSTROKE) RIGHTSB 0
if SLAB : begin
include : UpwardRightSerif RIGHTSB 0 VJUT
include : HBarTop (SB + OX) RIGHTSB bar
include : VBarLeft vert 0 CAP
local slope : (CAP - bar) / (vert - fine * p * CORRECTION_HX - (SB + OX))
include : dispiro
g4 (SB + OX) bar [widths 0 fine]
g4 (vert - fine * p * CORRECTION_HX) CAP [widths.heading 0 [Math.hypot fine (fine / slope)] UPWARD]
if SLAB : begin
include : CenterBottomSerif (vert + HALFSTROKE * CORRECTION_HX) 0 JUT
define [FiveShape top bp] : glyph-construction
local t1 : top * bp * 0.8
local t2 : top * bp
local ycurly : mix 0 t2 (SMOOTHA / (SMOOTHA + SMOOTHB))
local xleft : mix SB RIGHTSB 0.025
local xright : [mix RIGHTSB SB 0.05] - OXE
include : dispiro
widths.rhs
g4 (xleft - OXHOOK) (t2 - AHOOK * top / CAP)
hookstart (t2 - O)
g4 (RIGHTSB - OX) ycurly
hookend O
g4 SB HOOK
include : VBarLeft xleft (t2 - AHOOK * top / CAP) top
include : HBarTop xleft xright top
if SLAB : begin
include : DownwardRightSerif xright top VJUT
create-glyph 'five' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '5'
include : FiveShape CAP FIVEBARPOS
create-glyph 'three' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '3'
local barcenter : CAP * 0.51
local threeRadius : (CAPMIDDLE + HALFSTROKE - SMOOTH) * 1.25
local fine : STROKE * CTHIN
include : dispiro
widths.rhs
g4 SB (CAP - HOOK)
hookstart CAPO
g4 RIGHTSB (CAP - (SMOOTHB * (CAP - barcenter) / CAPMIDDLE))
flat (RIGHTSB - threeRadius + 0.01) (barcenter - (fine - HALFSTROKE)) [widths.heading 0 fine LEFTWARD]
curl (RIGHTSB - threeRadius) (barcenter - (fine - HALFSTROKE)) [heading LEFTWARD]
include : dispiro
widths.lhs
g4 SB HOOK
hookstart O
g4 RIGHTSB (SMOOTHA * barcenter / CAPMIDDLE)
flat (RIGHTSB - threeRadius + 0.01) (barcenter + (fine - HALFSTROKE)) [widths.heading fine 0 LEFTWARD]
curl (RIGHTSB - threeRadius) (barcenter + (fine - HALFSTROKE)) [heading LEFTWARD]
create-glyph 'zhuangToneFive' : glyph-construction
assign-unicode 0x1BC
include capitalMarks
include : FiveShape CAP FIVEBARPOS
create-glyph 'zhuangtonefive' : glyph-construction
assign-unicode 0x1BD
include eMarks
include : FiveShape XH FIVEBARPOS
create-glyph 'six' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '6'
include : OShape (CAP * 0.6) 0 SB RIGHTSB
local ymiddlea : (CAP * 0.6 - SMALLSMOOTHA + SMALLSMOOTHB) / 2
include : dispiro
widths.rhs
g4.up.start (SB + OX) ymiddlea
quadcontrols 0 0.8
g4 (RIGHTSB - STROKE * 1.1) CAP
create-glyph 'seven' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '7'
create-glyph 'four' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '4'
local bar (CAP * 0.4)
local vert : [mix SB RIGHTSB 0.825] - CORRECTION_HX * STROKE
local p 0.25
local fine (STROKE * 0.9)
include : HBarTop (SB + OX) RIGHTSB bar
include : VBarLeft vert 0 CAP
local slope : (CAP - bar) / (vert - fine * p * CORRECTION_HX - (SB + OX))
include : dispiro
g4 (SB + OX) bar [widths 0 fine]
g4 (vert - fine * p * CORRECTION_HX) CAP [widths.heading 0 [Math.hypot fine (fine / slope)] UPWARD]
if SLAB : begin
include : CenterBottomSerif (vert + HALFSTROKE * CORRECTION_HX) 0 JUT
include : HBarTop (SB + OXE) RIGHTSB CAP
local x : mix SB RIGHTSB 0.28
local cor : [Math.hypot 1 ((RIGHTSB - x - HALFSTROKE) / (CAP - STROKE))] * CORRECTION_HX
define [FiveShape top bp] : glyph-construction
local t1 : top * bp * 0.8
local t2 : top * bp
local ycurly : mix 0 t2 (SMOOTHA / (SMOOTHA + SMOOTHB))
local xleft : mix SB RIGHTSB 0.025
local xright : [mix RIGHTSB SB 0.05] - OXE
include : dispiro
widths.rhs
g4 (xleft - OXHOOK) (t2 - AHOOK * top / CAP)
hookstart (t2 - O)
g4 (RIGHTSB - OX) ycurly
hookend O
g4 SB HOOK
include : VBarLeft xleft (t2 - AHOOK * top / CAP) top
include : HBarTop xleft xright top
if SLAB : begin
include : DownwardRightSerif xright top VJUT
start-from (x - STROKE * cor / 2) 0
line-to (x + STROKE * cor / 2) 0
line-to RIGHTSB (CAP - STROKE)
line-to (RIGHTSB - STROKE * cor) (CAP - STROKE)
reverse-last
create-glyph 'five' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '5'
include : FiveShape CAP FIVEBARPOS
create-glyph 'zhuangToneFive' : glyph-construction
assign-unicode 0x1BC
include capitalMarks
include : FiveShape CAP FIVEBARPOS
if SLAB : begin
include : DownwardLeftSerif (SB + OXE) CAP VJUT
create-glyph 'eight' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '8'
create-glyph 'zhuangtonefive' : glyph-construction
assign-unicode 0x1BD
include eMarks
include : FiveShape XH FIVEBARPOS
local p 0.96
local l (SB + OX)
local r (RIGHTSB - OX)
create-glyph 'six' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '6'
include : OShape (CAP * 0.6) 0 SB RIGHTSB
local ymiddlea : (CAP * 0.6 - SMALLSMOOTHA + SMALLSMOOTHB) / 2
include : dispiro
widths.rhs
g4.up.start (SB + OX) ymiddlea
quadcontrols 0 0.8
g4 (RIGHTSB - STROKE * 1.1) CAP
include : dispiro
widths.rhs
g4.right.mid (MIDDLE - CORRECTION_OMIDS) (CAP - O)
archv
g4 [mix l r p] (CAP - SMOOTHB * p)
alsothru 0.5 0.5 [widths.center]
g4 (l) SMOOTHB [widths.lhs]
arcvh
g4.right.mid (MIDDLE + CORRECTION_OMIDS) (O)
archv
g4 (r) SMOOTHA [widths.lhs]
alsothru 0.5 0.5 [widths.center]
g4 [mix r l p] (CAP - SMOOTHA * p) [widths.rhs]
arcvh
close
# There is an "eight without lower contour" shape used for /propto
create-glyph 'rotetedpropto' : glyph-construction
local p 0.96
local py 0.4
local l (SB + OX)
local r (RIGHTSB - OX)
include : dispiro
widths.lhs
straight.up.start r 0 [heading UPWARD]
alsothru 0.5 (1 - py) [widths (STROKE * py) (STROKE * (1 - py))]
g4 [mix r l p] (CAP - SMOOTHA * p) [widths.rhs]
arcvh
g4 (MIDDLE - CORRECTION_OMIDS) (CAP - O)
archv
g4 [mix l r p] (CAP - SMOOTHB * p)
alsothru 0.5 py [widths (STROKE * py) (STROKE * (1 - py))]
straight.down.end l 0 [widths.heading STROKE 0 DOWNWARD]
create-glyph 'nine' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '9'
local u CAP
local d (CAP * 0.425 - HALFSTROKE)
local l (SB + OX)
local r (RIGHTSB - OX)
local ymiddlea : mix u d 0.5
local p 0.5
include : dispiro
widths.rhs (STROKE * p)
flat (r - STROKE * (1 - p) * CORRECTION_HX) ymiddlea
curl (r - STROKE * (1 - p) * CORRECTION_HX) (d + SMALLSMOOTHA)
arcvh
g4 ([mix l r 0.5] + CORRECTION_OMIDS) (d + O) [widths 0 STROKE]
archv
flat l (d + SMALLSMOOTHB)
curl l (u - SMALLSMOOTHA)
arcvh
g4 ([mix l r 0.5] - CORRECTION_OMIDS) (u - O)
archv
flat r ymiddlea
curl r (CAP * 0.35)
hookend O
g4 SB HOOK
create-glyph 'ten' : glyph-construction
include capitalMarks
set-width : WIDTH * 2
include glyphs.one
apply-transform : Translate (-WIDTH) 0
include glyphs.zero
apply-transform : Translate WIDTH 0
create-glyph 'seven' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '7'
include : HBarTop (SB + OXE) RIGHTSB CAP
local x : mix SB RIGHTSB 0.28
local cor : [Math.hypot 1 ((RIGHTSB - x - HALFSTROKE) / (CAP - STROKE))] * CORRECTION_HX
start-from (x - STROKE * cor / 2) 0
line-to (x + STROKE * cor / 2) 0
line-to RIGHTSB (CAP - STROKE)
line-to (RIGHTSB - STROKE * cor) (CAP - STROKE)
reverse-last
if SLAB : begin
include : DownwardLeftSerif (SB + OXE) CAP VJUT
create-glyph 'eight' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '8'
local p 0.96
local l (SB + OX)
local r (RIGHTSB - OX)
include : dispiro
widths.rhs
g4.right.mid (MIDDLE - CORRECTION_OMIDS) (CAP - O)
archv
g4 [mix l r p] (CAP - SMOOTHB * p)
alsothru 0.5 0.5 [widths.center]
g4 (l) SMOOTHB [widths.lhs]
arcvh
g4.right.mid (MIDDLE + CORRECTION_OMIDS) (O)
archv
g4 (r) SMOOTHA [widths.lhs]
alsothru 0.5 0.5 [widths.center]
g4 [mix r l p] (CAP - SMOOTHA * p) [widths.rhs]
arcvh
close
# There is an "eight without lower contour" shape used for /propto
create-glyph 'rotetedpropto' : glyph-construction
local p 0.96
local py 0.4
local l (SB + OX)
local r (RIGHTSB - OX)
include : dispiro
widths.lhs
straight.up.start r 0 [heading UPWARD]
alsothru 0.5 (1 - py) [widths (STROKE * py) (STROKE * (1 - py))]
g4 [mix r l p] (CAP - SMOOTHA * p) [widths.rhs]
arcvh
g4 (MIDDLE - CORRECTION_OMIDS) (CAP - O)
archv
g4 [mix l r p] (CAP - SMOOTHB * p)
alsothru 0.5 py [widths (STROKE * py) (STROKE * (1 - py))]
straight.down.end l 0 [widths.heading STROKE 0 DOWNWARD]
create-glyph 'nine' : glyph-construction
include capitalMarks
set-width WIDTH
assign-unicode '9'
local u CAP
local d (CAP * 0.425 - HALFSTROKE)
local l (SB + OX)
local r (RIGHTSB - OX)
local ymiddlea : mix u d 0.5
local p 0.5
include : dispiro
widths.rhs (STROKE * p)
flat (r - STROKE * (1 - p) * CORRECTION_HX) ymiddlea
curl (r - STROKE * (1 - p) * CORRECTION_HX) (d + SMALLSMOOTHA)
arcvh
g4 ([mix l r 0.5] + CORRECTION_OMIDS) (d + O) [widths 0 STROKE]
archv
flat l (d + SMALLSMOOTHB)
curl l (u - SMALLSMOOTHA)
arcvh
g4 ([mix l r 0.5] - CORRECTION_OMIDS) (u - O)
archv
flat r ymiddlea
curl r (CAP * 0.35)
hookend O
g4 SB HOOK
create-glyph 'ten' : glyph-construction
include capitalMarks
set-width : WIDTH * 2
include glyphs.one
apply-transform : Translate (-WIDTH) 0
include glyphs.zero
apply-transform : Translate WIDTH 0