Merge branch 'master' into releases

This commit is contained in:
be5invis 2016-01-13 18:16:20 +08:00
commit a789617a43
12 changed files with 103 additions and 46 deletions

View File

@ -139,6 +139,7 @@ define [includeGlyphPart cg gs nm] : begin
return : cg.include.apply cg [{gs.(nm)}.concat [{}.slice.call arguments 3]]
###### Canvas-based mechanism
define [$donothing$] nothing
define-macro sketch : syntax-rules
`[sketch @::steps] : begin
if [not externEnv.$nWFGlyphs$] : set externEnv.$nWFGlyphs$ 0
@ -149,7 +150,7 @@ define-macro sketch : syntax-rules
begin @::[steps.map formOf]
set dependencyProfile.(currentGlyph.name) : getDependencyProfile currentGlyph
return currentGlyph
]] [create-glyph @{".quote" (".WF" + externEnv.$nWFGlyphs$)} [lambda]]]
]] [create-glyph @{".quote" (".WF" + externEnv.$nWFGlyphs$)} $donothing$]]
define-macro branch : syntax-rules
`[branch @::steps] : begin
@ -169,12 +170,6 @@ define-macro save : syntax-rules
### COMMON FUNCTIONS
define [mix a b p] : a + (b - a) * p
define [linreg x0 y0 x1 y1 x] : y0 + (x - x0) * (y1 - y0) / (x1 - x0)
define [bilinear x0 x1 y0 y1 z00 z01 z10 z11 x y] : linreg
* y0
linreg x0 z00 x1 z10 x
* y1
linreg x0 z01 x1 z11 x
* y
define [clamp l h x] : if (x < l) l : if (x > h) h x
define [fallback] : begin
for [local j 0] (j < arguments.length) [inc j] : if (arguments.(j) !== nothing) : return arguments.(j)

View File

@ -35,7 +35,7 @@ if(argv.charmap) (function(){
return [
glyph.name,
glyph.unicode,
glyph.advanceWidth === 0 && hasv(glyph.anchors)
glyph.advanceWidth === 0 ? hasv(glyph.anchors) ? 1 : (glyph.contours && glyph.contours.length) ? 2 : 0 : 0
]
})), 'utf8')
})();

View File

@ -26,6 +26,7 @@ define [composite newid] : let [parts : {}.slice.call arguments 1] : begin
local first true
foreach [part : items-of parts] : begin
include part first
if first : set-width part.advanceWidth
set first false
define [into-unicode code] : glyph-construction
@ -35,6 +36,7 @@ define [into-unicode code] : glyph-construction
define [turned newid unicode id x y mark] : create-glyph [fallback newid : 'turn' + id] : glyph-construction
if unicode : assign-unicode unicode
include glyphs.(id) [if mark false AS_BASE]
set-width glyphs.(id).advanceWidth
if mark : include mark
include : FlipAround x y
# Dual derivatives

View File

@ -22,6 +22,8 @@ symbol-block 'alpha' : sketch
bezcontrols (1 - k3) 0 (1 - k1) (1 - k2) 6
g4 (RIGHTSB - OX * 2) 0 [widths.heading 0 fine DOWNWARD]
set-anchor 'overlay' BASE (middle - OX) (XH * OVERLAYPOS)
save 'alpha' 0x3B1
save 'latinalpha' 0xAB64
@ -1292,8 +1294,6 @@ symbol-block 'eszet'
widths.center (STROKE * 1.1)
corner tl (tm - STROKE) [heading UPWARD]
corner (RIGHTSB - HALFSTROKE * 1.2 - OX) t [heading UPWARD]
set this.italicHookAttachPoint {.x (l + HALFSTROKE) .y 0}
save 'eszet' 0xDF
sketch # Eszet

View File

@ -164,9 +164,7 @@ symbol-block "Numbers"
widths.rhs
g4.up.start (SB + OX) ymiddlea
quadcontrols 0 0.8
g4 (RIGHTSB - STROKE * 1.1) CAP
g4 ([mix SB RIGHTSB 0.85] - HALFSTROKE * HVCONTRAST) CAP
save 'six' '6'
sketch # seven

View File

@ -23,7 +23,7 @@ local commaAboveRadius : 0.85 * DOTRADIUS * markHalfStroke / HALFSTROKE
local asciiMarkZoom : (RIGHTSB - SB) / (markExtend * 3)
### Above marks
symbol-block 'Above marks'
define {TildeShape} : symbol-block 'Above marks'
sketch # dotAbove
set-width 0
currentGlyph.shortName = 'dot'
@ -145,10 +145,12 @@ symbol-block 'Above marks'
define [TildeShape] : params [ttop tbot leftEnd rightEnd hs] : glyph-construction
local fine : hs * 8 / 9
local hsvh : hs * 2 / (ttop - tbot)
local hvc : (rightEnd - leftEnd) / (ttop - tbot)
local defaultHvc : markExtend * 3 / (aboveMarkTop - aboveMarkBot - markFine / 2)
local hsvhThin 0.116
local hsvhHeav 0.732
local tildeWave [linreg hsvhThin 2.925 hsvhHeav 2.375 hsvh]
local tildeWave : [linreg hsvhThin 2.925 hsvhHeav 2.375 hsvh] * [linreg defaultHvc 1 4.35 1.1 hvc]
local tildeWaveX 0.51
include : dispiro
@ -465,9 +467,10 @@ symbol-block 'Above marks'
apply-transform : Translate 0 (fine * 0.5)
apply-transform : Italify
set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop
save 'candrabinduAbove' 0x310
include : FlipAround markMiddle (XH + ACCENT)
save 'turncandrabinduAbove' 0x352
sketch # variaAbove
set-width 0
@ -530,6 +533,9 @@ symbol-block 'Above marks'
include : FlipAround markMiddle [mix top bot 0.5]
save 'greaterAbove' 0x350
list
* TildeShape
### Below marks
symbol-block 'Below marks'
@ -1109,15 +1115,17 @@ symbol-block 'Overlay Marks'
# Double-character arcs
symbol-block 'Tie marks'
local tieLeft [mix 0 markMiddle 1.25]
local tieRight (-tieLeft)
sketch # tieAbove
set-width 0
include : dispiro
widths.rhs (markHalfStroke * 2)
g4 [mix 0 markMiddle 1.25] aboveMarkBot
g4 tieLeft aboveMarkBot
quadcontrols 0.5 1
g4.right.mid 0 aboveMarkTop [heading RIGHTWARD]
quadcontrols 0.5 0
g4 [mix 0 markMiddle (-1.25)] aboveMarkBot
g4 tieRight aboveMarkBot
apply-transform : Upright
apply-transform : Translate 0 (CAP - XH)
apply-transform : Italify
@ -1127,11 +1135,11 @@ symbol-block 'Tie marks'
set-width 0
include : dispiro
widths.lhs (markHalfStroke * 2)
g4 [mix 0 markMiddle 1.25] aboveMarkTop
g4 tieLeft aboveMarkTop
quadcontrols 0.5 1
g4.right.mid 0 aboveMarkBot [heading RIGHTWARD]
quadcontrols 0.5 0
g4 [mix 0 markMiddle (-1.25)] aboveMarkTop
g4 tieRight aboveMarkTop
apply-transform : Upright
apply-transform : Translate 0 (CAP - XH)
apply-transform : Italify
@ -1142,14 +1150,48 @@ symbol-block 'Tie marks'
set-width 0
include : dispiro
widths.center (markHalfStroke * 2)
flat [mix 0 markMiddle 1.25] (XH + ACCENT)
curl [mix 0 markMiddle (-1.25)] (XH + ACCENT)
flat tieLeft (XH + ACCENT)
curl tieRight (XH + ACCENT)
apply-transform : Upright
apply-transform : Translate 0 (CAP - XH)
apply-transform : Italify
save 'overlineTieAbove' 0x35E
composite 'underlineTieBelow' glyphs.overlineTieAbove [FlipAround 0 (XH / 2)] [into-unicode 0x35F]
sketch # arrowTieBelow
set-width 0
local fine markFine
local h : branch
local top (DESCENDER - ACCENT + (belowMarkTop - belowMarkBot) / 2 * 1.5)
local bot (DESCENDER - ACCENT - (belowMarkTop - belowMarkBot) / 2 * 1.5)
local left : tieRight - markExtend * 1.5
local right tieRight
local exp : Math.sqrt : 1 + (top - bot) / (2 * (right - left)) * (top - bot) / (2 * (right - left))
include : dispiro
widths.center : fine * 2
flat left top
curl right [mix top bot 0.5] [widths.heading (fine * exp) (fine * exp) DOWNWARD]
include : dispiro
widths.center : fine * 2
flat left bot
curl right [mix top bot 0.5] [widths.heading (fine * exp) (fine * exp) UPWARD]
include h
include : HBar tieLeft tieRight (DESCENDER - ACCENT) (fine * 2)
save 'arrowTieBelow' 0x362
sketch # tildeTieAbove
set-width 0
include : TildeShape
ttop -- aboveMarkTop + (CAP - XH)
tbot -- aboveMarkBot + (CAP - XH)
leftEnd -- tieLeft
rightEnd -- tieRight
hs -- markHalfStroke
set currentGlyph.dense true
save 'tildeTieAbove' 0x360
symbol-block 'Greek Polytonic Marks'
define [GreekLRDoubleMark id unicode leftGlyph rightGlyph] : begin
sketch # Combining double mark

View File

@ -233,6 +233,22 @@ symbol-block 'Geometric'
hollow 'smallwhitetriangledown' 0x25BF 'smallblacktriangledown' ss nothing MIDDLE (parenMid + squareRadius / 3 * sts)
hollow 'smallwhitetriangleleft' 0x25C3 'smallblacktriangleleft' ss nothing [mix MIDDLE right (sts / 3)] parenMid
hollow 'smallwhitetriangleright' 0x25B9 'smallblacktriangleright' ss nothing [mix MIDDLE left (sts / 3)] parenMid
# Mark sampler
sketch
include eMarks
include : spiro-outline
g4 MIDDLE XH
g4 (MIDDLE - XH / 2) (XH / 2)
g4 MIDDLE 0
close
include : spiro-outline
g4 MIDDLE (XH * 0.9)
g4 (MIDDLE + XH * 0.4) (XH * 0.5)
g4 MIDDLE (XH * 0.1)
close
save 'marksampler' 0xE09E
### Blocks
symbol-block 'Block Shapes'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 KiB

After

Width:  |  Height:  |  Size: 350 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 KiB

After

Width:  |  Height:  |  Size: 302 KiB

View File

@ -73,27 +73,27 @@ releasepack-zshaped : fonts-zshaped
release-all : releasepack-default releasepack-fw releasepack-cc releasepack-hooky releasepack-zshaped
fw : fonts-fw fonts-cc
images/weights.png : fonts
images/weights.png : fonts-default fonts-slab
convert -size 4800x1700 xc:white -pointsize 125 \
-fill black \
-font dist/iosevka-thin.ttf -draw "text 0,121 ' thin float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-font dist/iosevka-extralight.ttf -draw "text 0,299 'extralight float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-font dist/iosevka-light.ttf -draw "text 0,478 ' light float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-font dist/iosevka-regular.ttf -draw "text 0,656 ' retular float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-font dist/iosevka-medium.ttf -draw "text 0,835 ' medium float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-font dist/iosevka-bold.ttf -draw "text 0,1013 ' bold float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-font dist/iosevka-heavy.ttf -draw "text 0,1192 ' heavy float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-font dist/iosevka/iosevka-thin.ttf -draw "text 0,121 ' thin float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-font dist/iosevka/iosevka-extralight.ttf -draw "text 0,299 'extralight float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-font dist/iosevka/iosevka-light.ttf -draw "text 0,478 ' light float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-font dist/iosevka/iosevka-regular.ttf -draw "text 0,656 ' regular float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-font dist/iosevka/iosevka-medium.ttf -draw "text 0,835 ' medium float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-font dist/iosevka/iosevka-bold.ttf -draw "text 0,1013 ' bold float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-font dist/iosevka/iosevka-heavy.ttf -draw "text 0,1192 ' heavy float Fox.quick(h){ is_brown && it_jumps_over(doges.lazy) }'" \
-trim images/weights.png
imges/variants.png : fonts fonts-hooky fonts-zshaped
images/variants.png : fonts-default fonts-slab fonts-hooky fonts-zshaped
convert -size 6800x1700 xc:white -pointsize 125 \
-fill black \
-font dist/iosevka-italic.ttf -draw "text 0,121 'default: '" \
-font dist/iosevka-regular.ttf -draw "fill blue text 750,121 'set ' fill black text 1000,121 'font.name.uniqueSubFamily ' fill green text 2625,121 '\"\\(para.family) \\(para.style) \\(para.version) (\\(para.codename))\"'" \
-font dist/hooky-iosevka-italic.ttf -draw "text 0,308 ' hooky: '" \
-font dist/hooky-iosevka-regular.ttf -draw "fill blue text 750,308 'set ' fill black text 1000,308 'font.name.uniqueSubFamily ' fill green text 2625,308 '\"\\(para.family) \\(para.style) \\(para.version) (\\(para.codename))\"'" \
-font dist/zshaped-iosevka-italic.ttf -draw "text 0,496 'zshaped: '" \
-font dist/zshaped-iosevka-regular.ttf -draw "fill blue text 750,496 'set ' fill black text 1000,496 'font.name.uniqueSubFamily ' fill green text 2625,496 '\"\\(para.family) \\(para.style) \\(para.version) (\\(para.codename))\"'" \
-font dist/iosevka/iosevka-italic.ttf -draw "text 0,121 'default: '" \
-font dist/iosevka/iosevka-regular.ttf -draw "fill blue text 750,121 'set ' fill black text 1000,121 'font.name.uniqueSubFamily ' fill green text 2625,121 '\"\\(para.family) \\(para.style) \\(para.version) (\\(para.codename))\"'" \
-font dist/variant-hooky-iosevka/hooky-iosevka-italic.ttf -draw "text 0,308 ' hooky: '" \
-font dist/variant-hooky-iosevka/hooky-iosevka-regular.ttf -draw "fill blue text 750,308 'set ' fill black text 1000,308 'font.name.uniqueSubFamily ' fill green text 2625,308 '\"\\(para.family) \\(para.style) \\(para.version) (\\(para.codename))\"'" \
-font dist/variant-zshaped-iosevka/zshaped-iosevka-italic.ttf -draw "text 0,496 'zshaped: '" \
-font dist/variant-zshaped-iosevka/zshaped-iosevka-regular.ttf -draw "fill blue text 750,496 'set ' fill black text 1000,496 'font.name.uniqueSubFamily ' fill green text 2625,496 '\"\\(para.family) \\(para.style) \\(para.version) (\\(para.codename))\"'" \
-trim images/variants.png
sampleimages: images/weights.png images/variants.png

View File

@ -3,7 +3,7 @@
"version": "1.6.2",
"main": "./generate.js",
"dependencies": {
"patel": ">=0.26.0",
"patel": ">=0.26.3",
"node-sfnt": ">=0.0.20",
"bezier-js": "*",
"yargs": "*",

View File

@ -78,11 +78,14 @@
text-overflow: ellipsis;
z-index: -1;
}
.show table.block td > d {
position: absolute;
z-index: -1;
.show table.block td > d.mark:before {
content:"\E09E";
color: #ddd;
margin-right: -0.5em;
}
.show table.block td > d.tie:before, .show table.block td > d.tie:after {
content:"\E09E";
color: #ddd;
text-shadow: 0 0 2px white;
}
.show table.block td.indicator > n {
display: block;
@ -205,7 +208,7 @@
<tr class="row" v-for="row in sampleRows">
<td class="indicator"><s>x</s><n>U+{{row.startIndex}}</n></td>
<template v-for="char in row.chars">
<td class="{{char.name ? 'present' : 'missing'}}" title="{{char.name}}"><d v-if="char.isMark">x</d>{{char.char}}</td>
<td class="{{char.name ? 'present' : 'missing'}}" title="{{char.name}}"><d class="{{(char.isMark ? 'mark' : char.isTie ? 'tie' : 'simple')}}">{{char.char}}</d></td>
</template>
</tr>
</table>
@ -320,8 +323,9 @@
};
row.chars.push({
name: uhash[j],
char: (whash[j] ? '\u00a0' : '') + String.fromCharCode(j),
isMark: whash[j]
char: (whash[j] === 1 ? '\u00A0' : '') + String.fromCharCode(j),
isMark: whash[j] === 1,
isTie: whash[j] === 2
});
}
}