ver 0.0.17

This commit is contained in:
be5invis 2015-08-10 09:41:29 +08:00
parent 957e49caa4
commit 6ecbfe6f15
5 changed files with 217 additions and 158 deletions

View File

@ -33,24 +33,6 @@ define [buildFont para recursive] : begin {
define glyphs (.'.notdef' glyphList.0) define glyphs (.'.notdef' glyphList.0)
define unicodeGlyphs () define unicodeGlyphs ()
# Transform constructors
define [Italify angle] : begin {
local slope [Math.tan [[fallback angle para.italicangle] / 180 * Math.PI]]
return (.xx 1 .yx slope .xy 0 .yy 1 .x [-slope * 0.5 * para.xheight] .y 0)
}
define [Upright angle] [inverse : Italify angle]
define [Scale sx sy] (.xx sx .yx 0 .xy 0 .yy [fallback sy sx] .x 0 .y 0)
define [Translate x y] (.xx 1 .yx 0 .xy 0 .yy 1 .x x .y y)
define [Rotate angle] (.xx [Math.cos angle] .yx [-[Math.sin angle]] .xy [Math.sin angle] .yy [Math.cos angle] .x 0 .y 0)
define globalTransform : Italify para.italicAngle
define ITALICCOR : 1 / [Math.sqrt [1 - globalTransform.yx * globalTransform.yx]]
define UPWARD (.x [-ITALICCOR] .y 0)
define DOWNWARD (.x ITALICCOR .y 0)
define RIGHTWARD (.x globalTransform.yx .y 1)
define LEFTWARD (.x [- globalTransform.yx] .y [-1])
# metrics # metrics
define DESCENDER para.descender define DESCENDER para.descender
define WIDTH para.width define WIDTH para.width
@ -76,6 +58,28 @@ define [buildFont para recursive] : begin {
define ACCENT para.accent define ACCENT para.accent
define ACCENTX para.accentx define ACCENTX para.accentx
# Common metrics for symbols
local parenTop [[XH * 0.625] + [CAP - XH] * 2.5]
local parenBot [[XH * 0.625] - [CAP - XH] * 2.5]
local parenMid [mix parenTop parenBot 0.5]
# Transform constructors
define [Italify angle] : begin {
local slope [Math.tan [[fallback angle para.italicangle] / 180 * Math.PI]]
return (.xx 1 .yx slope .xy 0 .yy 1 .x [-slope * parenMid] .y 0)
}
define [Upright angle] [inverse : Italify angle]
define [Scale sx sy] (.xx sx .yx 0 .xy 0 .yy [fallback sy sx] .x 0 .y 0)
define [Translate x y] (.xx 1 .yx 0 .xy 0 .yy 1 .x x .y y)
define [Rotate angle] (.xx [Math.cos angle] .yx [-[Math.sin angle]] .xy [Math.sin angle] .yy [Math.cos angle] .x 0 .y 0)
define globalTransform : Italify para.italicAngle
define ITALICCOR : 1 / [Math.sqrt [1 - globalTransform.yx * globalTransform.yx]]
define UPWARD (.x [-ITALICCOR] .y 0)
define DOWNWARD (.x ITALICCOR .y 0)
define RIGHTWARD (.x globalTransform.yx .y 1)
define LEFTWARD (.x [- globalTransform.yx] .y [-1])
# derived metrics # derived metrics
define XO : XH - O define XO : XH - O
@ -308,6 +312,7 @@ define [buildFont para recursive] : begin {
$$include 'glyphs/symbol-math.patel' $$include 'glyphs/symbol-math.patel'
$$include 'glyphs/symbol-letter.patel' $$include 'glyphs/symbol-letter.patel'
$$include 'glyphs/symbol-geometric.patel' $$include 'glyphs/symbol-geometric.patel'
$$include 'glyphs/symbol-other.patel'
$$include 'glyphs/autobuilds.patel' $$include 'glyphs/autobuilds.patel'
### Zoom all glyphs by para.upmscale ### Zoom all glyphs by para.upmscale

View File

@ -91,10 +91,6 @@ create-glyph 'at' : glyph-construction {
### Brackets ### Brackets
local parenTop [[XH * 0.625] + [CAP - XH] * 2.5]
local parenBot [[XH * 0.625] - [CAP - XH] * 2.5]
local parenMid [mix parenTop parenBot 0.5]
local parenOutside 0.15 local parenOutside 0.15
local parenInside 0.65 local parenInside 0.65
local bracketOutside 0.15 local bracketOutside 0.15

View File

@ -1,6 +1,62 @@
###### GEOMETRIC SHAPES ###### GEOMETRIC SHAPES
### Arrowheads
let [arrowSize : [RIGHTSB - SB] / 3] [halfstroke : [adviceBlackness 4] / 2] [fine : adviceBlackness 4.5] [arrowTop : mix parenMid parenTop 0.75] [arrowBot : mix parenMid parenBot 0.75] : begin {
define [ArrowHead x1 y1 x2 y2] : create-glyph : glyph-construction {
set this.gizmo : Translate 0 0
include : create-stroke
:.start-from 0 0
:.heads-to UPWARD
:.set-width 0 fine
:.line-to [arrowSize * 1] arrowSize
:.set-width 0 fine
:.set-samples 1
include : create-stroke
:.start-from 0 0
:.heads-to DOWNWARD
:.set-width fine 0
:.line-to [arrowSize * 1] [-arrowSize]
:.set-width fine 0
:.set-samples 1
apply-transform : Translate O 0
local (.x xo .y yo) : tp globalTransform (.x x1 .y y1)
local (.x xt .y yt) : tp globalTransform (.x x2 .y y2)
apply-transform : Rotate : Math.atan2 [yo - yt] [xo - xt]
apply-transform : Translate xt yt
}
define [ArrowShape x1 y1 x2 y2] : glyph-construction {
local mag : Math.hypot [y2 - y1] [x2 - x1]
local p : [mag - halfstroke * 1.1] / mag
include : ArrowHead x1 y1 x2 y2
include : create-stroke
:.start-from x1 y1
:.set-width halfstroke halfstroke
:.line-to [mix x1 x2 p] [mix y1 y2 p]
}
define [arrow id unicode x1 y1 x2 y2] : create-glyph id : glyph-construction {
assign-unicode unicode
include : ArrowShape x1 y1 x2 y2
}
define [doublearrow id unicode x1 y1 x2 y2] : create-glyph id : glyph-construction {
assign-unicode unicode
local xm : mix x1 x2 0.5
local ym : mix y1 y2 0.5
include : ArrowShape xm ym x1 y1
include : ArrowShape xm ym x2 y2
}
arrow 'arrowleft' 0x2190 RIGHTSB parenMid SB parenMid
arrow 'arrowright' 0x2192 SB parenMid RIGHTSB parenMid
arrow 'arrowup' 0x2191 MIDDLE arrowBot MIDDLE arrowTop
arrow 'arrowdown' 0x2193 MIDDLE arrowTop MIDDLE arrowBot
doublearrow 'arrowleftright' 0x2194 SB parenMid RIGHTSB parenMid
doublearrow 'arrowupdown' 0x2195 MIDDLE arrowTop MIDDLE arrowBot
arrow 'arrowupleft' 0x2196 RIGHTSB arrowBot SB arrowTop
arrow 'arrowupright' 0x2197 SB arrowBot RIGHTSB arrowTop
arrow 'arrowdownright' 0x2198 SB arrowTop RIGHTSB arrowBot
arrow 'arrowdownleft' 0x2199 RIGHTSB arrowTop SB arrowBot
}
### Standard geometric shapes ### Standard geometric shapes
let : begin {
define squareRadius : [RIGHTSB - SB] / 2 define squareRadius : [RIGHTSB - SB] / 2
define [hollowScale w] : [w - [adviceBlackness 5]] / w define [hollowScale w] : [w - [adviceBlackness 5]] / w
define [hollow newid unicode oldid zx zy] : create-glyph newid : glyph-construction { define [hollow newid unicode oldid zx zy] : create-glyph newid : glyph-construction {
@ -82,8 +138,10 @@ hollow 'whitelongrectangle' 0x25AF 'blacklongrectangle' [hollowScale squareRadiu
hollow 'whitecircle' 0x25CB 'blackcircle' hollow 'whitecircle' 0x25CB 'blackcircle'
hollow 'whitebullet' 0x25E6 'bullet' [hollowScale [PERIODSIZE - O]] hollow 'whitebullet' 0x25E6 'bullet' [hollowScale [PERIODSIZE - O]]
hollow 'whitediamond' 0x25C7 'blackdiamond' hollow 'whitediamond' 0x25C7 'blackdiamond'
}
### Blocks ### Blocks
let : begin {
create-glyph 'fullblock' : glyph-construction { create-glyph 'fullblock' : glyph-construction {
assign-unicode 0x2588 assign-unicode 0x2588
start-from 0 font.hhea.ascent start-from 0 font.hhea.ascent
@ -145,7 +203,7 @@ create-glyph 'rightHalfBlock' : glyph-construction {
line-to WIDTH font.hhea.descent line-to WIDTH font.hhea.descent
line-to [WIDTH * 0.5] font.hhea.descent line-to [WIDTH * 0.5] font.hhea.descent
} }
}
### Box drawing glyphs ### Box drawing glyphs
let : begin { let : begin {
local light : adviceBlackness 3.5 local light : adviceBlackness 3.5

View File

@ -1,5 +1,5 @@
SUPPORT_FILES = support/glyph.js support/stroke.js parameters.js generate.js empty.json SUPPORT_FILES = support/glyph.js support/stroke.js parameters.js generate.js empty.json
GLYPH_SEGMENTS = glyphs/common-shapes.patel glyphs/overmarks.patel glyphs/latin-basic-capital.patel glyphs/latin-basic-lower.patel glyphs/greek.patel glyphs/cyrillic-basic.patel glyphs/latin-extend.patel glyphs/cyrillic-extended.patel glyphs/numbers.patel glyphs/symbol-ascii.patel glyphs/symbol-punctuation.patel glyphs/symbol-math.patel glyphs/symbol-geometric.patel glyphs/symbol-letter.patel glyphs/autobuilds.patel GLYPH_SEGMENTS = glyphs/common-shapes.patel glyphs/overmarks.patel glyphs/latin-basic-capital.patel glyphs/latin-basic-lower.patel glyphs/greek.patel glyphs/cyrillic-basic.patel glyphs/latin-extend.patel glyphs/cyrillic-extended.patel glyphs/numbers.patel glyphs/symbol-ascii.patel glyphs/symbol-punctuation.patel glyphs/symbol-math.patel glyphs/symbol-geometric.patel glyphs/symbol-other.patel glyphs/symbol-letter.patel glyphs/autobuilds.patel
OBJDIR = build OBJDIR = build
SUPPRESS_ERRORS = 2> /dev/null SUPPRESS_ERRORS = 2> /dev/null

View File

@ -40,7 +40,7 @@ define regular (
.family 'Iosevka' .family 'Iosevka'
.style 'Regular' .style 'Regular'
.weight 400 .weight 400
.version 'r0.0.16' .version 'r0.0.17'
.variantSelector (.) .variantSelector (.)
.copyright 'Copyright (c) 2015 Belleve Invis.' .copyright 'Copyright (c) 2015 Belleve Invis.'
) )