ASCII COMPLETE!!
This commit is contained in:
parent
5c0d9424a6
commit
b8783e22e7
14 changed files with 1777 additions and 1259 deletions
|
@ -48,6 +48,7 @@ define GBARPOS para.gbarpos
|
||||||
define FIVEBARPOS para.fivebarpos
|
define FIVEBARPOS para.fivebarpos
|
||||||
define LONGJUT para.longjut
|
define LONGJUT para.longjut
|
||||||
define ACCENT para.accent
|
define ACCENT para.accent
|
||||||
|
define ACCENTX para.accentx
|
||||||
|
|
||||||
|
|
||||||
# derived metrics
|
# derived metrics
|
||||||
|
@ -111,22 +112,35 @@ define ifMarks (.anchors (.above markAboveCap.anchors.above .below markBe
|
||||||
|
|
||||||
Stroke.bindParameters para
|
Stroke.bindParameters para
|
||||||
|
|
||||||
|
### Font names
|
||||||
set font.name.fontFamily para.family
|
set font.name.fontFamily para.family
|
||||||
set font.name.fontSubFamily para.style
|
set font.name.fontSubFamily para.style
|
||||||
set font.name.preferredFamily para.family
|
set font.name.preferredFamily para.family
|
||||||
set font.name.preferredSubFamily para.style
|
set font.name.preferredSubFamily para.style
|
||||||
set font.name.uniqueSubFamily : para.family + ' ' + para.style + ' ' + para.version
|
set font.name.uniqueSubFamily : para.family + ' ' + para.style + ' ' + para.version
|
||||||
set font.name.version para.version
|
set font.name.version para.version
|
||||||
set font.name.fullName : para.family + ' ' + para.style
|
set font.name.fullName : if [para.style != 'Regular'] [para.family + ' ' + para.style] para.family
|
||||||
set font.name.postScriptName : font.name.fullName.replace [regex ' ' 'g'] '-'
|
set font.name.postScriptName : font.name.fullName.replace [regex ' ' 'g'] '-'
|
||||||
set font.name.copyright para.copyright
|
set font.name.copyright para.copyright
|
||||||
set font.'OS/2'.usWeightClass para.weight
|
set font.'OS/2'.usWeightClass para.weight
|
||||||
set font.'OS/2'.bProportion 9 # Monospaced
|
set font.'OS/2'.bProportion 9 # Monospaced
|
||||||
|
set font.'OS/2'.bWeight : 1 + para.weight / 100
|
||||||
|
set font.'OS/2'.fsSelection : [if para.isBold 32 0] + [if para.isItalic 1 0] + [if [[not para.isBold] && [not para.isItalic]] 64 0] + 128
|
||||||
|
set font.head.macStyle : [if para.isBold 1 0] + [if para.isItalic 2 0]
|
||||||
|
|
||||||
### Font names
|
### Metric metadata
|
||||||
|
set font.hhea.ascent CAP
|
||||||
### Useful shapes
|
set font.'OS/2'.usWinAscent : CAP + CAP * 0.1
|
||||||
|
set font.'OS/2'.sTypoAscender CAP
|
||||||
|
set font.hhea.descent DESCENDER
|
||||||
|
set font.'OS/2'.usWinDescent : [Math.abs DESCENDER] + CAP * 0.1
|
||||||
|
set font.'OS/2'.sTypoDescender DESCENDER
|
||||||
|
set font.hhea.lineGap : CAP * 0.2
|
||||||
|
set font.'OS/2'.sTypoLineGap : CAP * 0.2
|
||||||
|
set font.'OS/2'.sxHeight XH
|
||||||
|
set font.post.italicAnvle : 0 - para.italicangle
|
||||||
|
|
||||||
|
### Necessary macros
|
||||||
define-macro glyph-construction : syntax-rules {
|
define-macro glyph-construction : syntax-rules {
|
||||||
@`[glyph-construction @::steps] ('.syntactic-closure' @`[lambda [] [begin {
|
@`[glyph-construction @::steps] ('.syntactic-closure' @`[lambda [] [begin {
|
||||||
local set-width : this.set-width.bind this
|
local set-width : this.set-width.bind this
|
||||||
|
@ -146,7 +160,6 @@ define-macro glyph-construction : syntax-rules {
|
||||||
return nothing
|
return nothing
|
||||||
}]] env)
|
}]] env)
|
||||||
}
|
}
|
||||||
|
|
||||||
define [create-glyph name actions] : begin {
|
define [create-glyph name actions] : begin {
|
||||||
define glyphObject [new Glyph name]
|
define glyphObject [new Glyph name]
|
||||||
glyphList.push glyphObject
|
glyphList.push glyphObject
|
||||||
|
@ -155,9 +168,17 @@ define [create-glyph name actions] : begin {
|
||||||
return glyphObject
|
return glyphObject
|
||||||
}
|
}
|
||||||
|
|
||||||
###### SYMBOLS
|
define [select-variant glyphid unicode default] : begin {
|
||||||
|
local variant : variantSelector`glyphid || default
|
||||||
|
local chosenGlyph glyphs`[glyphid + '.' + variant]
|
||||||
|
set glyphs`glyphid chosenGlyph
|
||||||
|
if unicode : chosenGlyph.assign-unicode unicode
|
||||||
|
}
|
||||||
|
|
||||||
|
###### HERE WE GO!
|
||||||
|
|
||||||
create-glyph 'space' : glyph-construction {
|
create-glyph 'space' : glyph-construction {
|
||||||
set-width WIDTH
|
set-width WIDTH
|
||||||
assign-unicode ' '
|
assign-unicode ' '
|
||||||
|
include eMarks
|
||||||
}
|
}
|
2636
buildglyphs.js
2636
buildglyphs.js
File diff suppressed because it is too large
Load diff
|
@ -18,6 +18,6 @@
|
||||||
"postScriptName": "node-sfnt"
|
"postScriptName": "node-sfnt"
|
||||||
},
|
},
|
||||||
"hhea":{"version":1,"ascent":812,"descent":-212,"lineGap":92,"advanceWidthMax":374,"minLeftSideBearing":34,"minRightSideBearing":68,"xMaxExtent":306,"caretSlopeRise":1,"caretSlopeRun":0,"caretOffset":0,"reserved0":0,"reserved1":0,"reserved2":0,"reserved3":0,"metricDataFormat":0,"numOfLongHorMetrics":1},
|
"hhea":{"version":1,"ascent":812,"descent":-212,"lineGap":92,"advanceWidthMax":374,"minLeftSideBearing":34,"minRightSideBearing":68,"xMaxExtent":306,"caretSlopeRise":1,"caretSlopeRun":0,"caretOffset":0,"reserved0":0,"reserved1":0,"reserved2":0,"reserved3":0,"metricDataFormat":0,"numOfLongHorMetrics":1},
|
||||||
"post":{"italicAngle":0,"postoints":65411,"underlinePosition":50,"underlineThickness":0,"isFixedPitch":0,"minMemType42":0,"maxMemType42":0,"minMemType1":0,"maxMemType1":1,"format":2},
|
"post":{"italicAngle":0,"postoints":65411,"underlinePosition":50,"underlineThickness":0,"isFixedPitch":0,"minMemType42":0,"maxMemType42":0,"minMemType1":0,"maxMemType1":1,"format":3},
|
||||||
"OS/2":{"version":4,"xAvgCharWidth":1031,"usWeightClass":400,"usWidthClass":5,"fsType":0,"ySubscriptXSize":665,"ySubscriptYSize":716,"ySubscriptXOffset":0,"ySubscriptYOffset":143,"ySuperscriptXSize":665,"ySuperscriptYSize":716,"ySuperscriptXOffset":0,"ySuperscriptYOffset":491,"yStrikeoutSize":51,"yStrikeoutPosition":265,"sFamilyClass":0,"bFamilyType":2,"bSerifStyle":0,"bWeight":6,"bProportion":3,"bContrast":0,"bStrokeVariation":0,"bArmStyle":0,"bLetterform":0,"bMidline":0,"bXHeight":0,"ulUnicodeRange1":1,"ulUnicodeRange2":268435456,"ulUnicodeRange3":0,"ulUnicodeRange4":0,"achVendID":"PfEd","fsSelection":192,"usFirstCharIndex":0,"usLastCharIndex":0,"sTypoAscender":812,"sTypoDescender":-212,"sTypoLineGap":92,"usWinAscent":812,"usWinDescent":212,"ulCodePageRange1":1,"ulCodePageRange2":0,"sxHeight":792,"sCapHeight":0,"usDefaultChar":0,"usBreakChar":32,"usMaxContext":1}
|
"OS/2":{"version":4,"xAvgCharWidth":1031,"usWeightClass":400,"usWidthClass":5,"fsType":0,"ySubscriptXSize":665,"ySubscriptYSize":716,"ySubscriptXOffset":0,"ySubscriptYOffset":143,"ySuperscriptXSize":665,"ySuperscriptYSize":716,"ySuperscriptXOffset":0,"ySuperscriptYOffset":491,"yStrikeoutSize":51,"yStrikeoutPosition":265,"sFamilyClass":0,"bFamilyType":2,"bSerifStyle":0,"bWeight":6,"bProportion":3,"bContrast":0,"bStrokeVariation":0,"bArmStyle":0,"bLetterform":0,"bMidline":0,"bXHeight":0,"ulUnicodeRange1":1,"ulUnicodeRange2":268435456,"ulUnicodeRange3":0,"ulUnicodeRange4":0,"achVendID":"PfEd","fsSelection":192,"usFirstCharIndex":0,"usLastCharIndex":0,"sTypoAscender":812,"sTypoDescender":-212,"sTypoLineGap":92,"usWinAscent":812,"usWinDescent":212,"ulCodePageRange1":1,"ulCodePageRange2":0,"sxHeight":792,"sCapHeight":0,"usDefaultChar":0,"usBreakChar":32,"usMaxContext":1}
|
||||||
}
|
}
|
31
final.pe
Normal file
31
final.pe
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
Print("Reading Font...")
|
||||||
|
Open($1);
|
||||||
|
SelectAll();
|
||||||
|
ClearHints();
|
||||||
|
ClearInstrs();
|
||||||
|
ClearTable('fpgm');
|
||||||
|
ClearTable('prep');
|
||||||
|
ClearTable('cvt ');
|
||||||
|
ClearTable('maxp');
|
||||||
|
Print("Outline Cleanup...");
|
||||||
|
AddExtrema();
|
||||||
|
RemoveOverlap();
|
||||||
|
RoundToInt()
|
||||||
|
RemoveOverlap();
|
||||||
|
|
||||||
|
Print("Simplifying...");
|
||||||
|
SetFontOrder(3);
|
||||||
|
SelectAll();
|
||||||
|
AddExtrema();
|
||||||
|
Simplify(0, 1);
|
||||||
|
SetFontOrder(2);
|
||||||
|
SelectAll();
|
||||||
|
AddExtrema();
|
||||||
|
Simplify(0, 1);
|
||||||
|
CorrectDirection();
|
||||||
|
CanonicalContours();
|
||||||
|
CanonicalStart();
|
||||||
|
|
||||||
|
|
||||||
|
Print("Saving ttf...");
|
||||||
|
Generate($2);
|
32
generate.js
32
generate.js
|
@ -3,13 +3,6 @@ var buildGlyphs = require('./buildglyphs.js');
|
||||||
var parameters = require('./parameters');
|
var parameters = require('./parameters');
|
||||||
var TTFWriter = require('node-sfnt').TTFWriter;
|
var TTFWriter = require('node-sfnt').TTFWriter;
|
||||||
var TTF = require('node-sfnt').TTF;
|
var TTF = require('node-sfnt').TTF;
|
||||||
|
|
||||||
/**
|
|
||||||
* buffer转换成ArrayBuffer
|
|
||||||
*
|
|
||||||
* @param {Buffer} buffer 缓冲数组
|
|
||||||
* @return {ArrayBuffer}
|
|
||||||
*/
|
|
||||||
function toArrayBuffer(buffer) {
|
function toArrayBuffer(buffer) {
|
||||||
var length = buffer.length;
|
var length = buffer.length;
|
||||||
var view = new DataView(new ArrayBuffer(length), 0, length);
|
var view = new DataView(new ArrayBuffer(length), 0, length);
|
||||||
|
@ -18,13 +11,6 @@ function toArrayBuffer(buffer) {
|
||||||
}
|
}
|
||||||
return view.buffer;
|
return view.buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ArrayBuffer转换成Buffer
|
|
||||||
*
|
|
||||||
* @param {ArrayBuffer} arrayBuffer 缓冲数组
|
|
||||||
* @return {Buffer}
|
|
||||||
*/
|
|
||||||
function toBuffer(arrayBuffer) {
|
function toBuffer(arrayBuffer) {
|
||||||
var length = arrayBuffer.byteLength;
|
var length = arrayBuffer.byteLength;
|
||||||
var view = new DataView(arrayBuffer, 0, length);
|
var view = new DataView(arrayBuffer, 0, length);
|
||||||
|
@ -37,19 +23,9 @@ function toBuffer(arrayBuffer) {
|
||||||
|
|
||||||
var options = {preserveOS2Version: true}
|
var options = {preserveOS2Version: true}
|
||||||
|
|
||||||
function readttf(file) {
|
var variant = process.argv[2];
|
||||||
var data = fs.readFileSync(file);
|
var outputPath = process.argv[3];
|
||||||
var buffer = toArrayBuffer(data);
|
|
||||||
var ttf = (new OTFReader(options)).read(buffer);
|
|
||||||
return ttf;
|
|
||||||
}
|
|
||||||
|
|
||||||
function writettf(ttf, file){
|
var ttfFont = buildGlyphs.build(parameters[variant]);
|
||||||
var buffer = new TTFWriter(options).write(ttf);
|
|
||||||
fs.writeFileSync(file, toBuffer(buffer));
|
|
||||||
}
|
|
||||||
|
|
||||||
var variant = process.argv[2]
|
fs.writeFileSync(outputPath, toBuffer(new TTFWriter(options).write(ttfFont)));
|
||||||
var outputPath = process.argv[3]
|
|
||||||
|
|
||||||
fs.writeFileSync(outputPath, toBuffer(new TTFWriter(options).write(buildGlyphs.build(parameters[variant]))));
|
|
|
@ -432,6 +432,67 @@ create-glyph 'greater' : glyph-construction {
|
||||||
:.to-outline 0 0 1 true
|
:.to-outline 0 0 1 true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
### Overmarks
|
||||||
|
create-glyph 'quotesingle' : glyph-construction {
|
||||||
|
set-width WIDTH
|
||||||
|
assign-unicode 0x27
|
||||||
|
|
||||||
|
put-shapes : create-stroke
|
||||||
|
:.start-from MIDDLE CAP
|
||||||
|
:.heads-to DOWNWARD
|
||||||
|
:.set-width HALFSTROKE HALFSTROKE
|
||||||
|
:.line-to MIDDLE [XH - HALFSTROKE]
|
||||||
|
:.set-width [STROKE * 0.4] [STROKE * 0.4]
|
||||||
|
:.heads-to DOWNWARD
|
||||||
|
:.to-outline
|
||||||
|
}
|
||||||
|
|
||||||
|
create-glyph 'quotedouble' : glyph-construction {
|
||||||
|
set-width WIDTH
|
||||||
|
assign-unicode 0x22
|
||||||
|
|
||||||
|
put-shapes : create-stroke
|
||||||
|
:.start-from [mix SB RIGHTSB 0.25] CAP
|
||||||
|
:.heads-to DOWNWARD
|
||||||
|
:.set-width HALFSTROKE HALFSTROKE
|
||||||
|
:.line-to [mix SB RIGHTSB 0.25] [XH - HALFSTROKE]
|
||||||
|
:.set-width [STROKE * 0.4] [STROKE * 0.4]
|
||||||
|
:.heads-to DOWNWARD
|
||||||
|
:.to-outline
|
||||||
|
|
||||||
|
put-shapes : create-stroke
|
||||||
|
:.start-from [mix SB RIGHTSB 0.75] CAP
|
||||||
|
:.heads-to DOWNWARD
|
||||||
|
:.set-width HALFSTROKE HALFSTROKE
|
||||||
|
:.line-to [mix SB RIGHTSB 0.75] [XH - HALFSTROKE]
|
||||||
|
:.set-width [STROKE * 0.4] [STROKE * 0.4]
|
||||||
|
:.heads-to DOWNWARD
|
||||||
|
:.to-outline
|
||||||
|
}
|
||||||
|
|
||||||
|
create-glyph 'grave' : glyph-construction {
|
||||||
|
assign-unicode '`'
|
||||||
|
include glyphs.space BASE
|
||||||
|
include glyphs.graveAbove
|
||||||
|
}
|
||||||
|
create-glyph 'acute' : glyph-construction {
|
||||||
|
assign-unicode 0xB4
|
||||||
|
include glyphs.space BASE
|
||||||
|
include glyphs.acuteAbove
|
||||||
|
}
|
||||||
|
create-glyph 'asciicircum' : glyph-construction {
|
||||||
|
set-width WIDTH
|
||||||
|
assign-unicode 0x5E
|
||||||
|
include glyphs.space BASE
|
||||||
|
include glyphs.circumflexAbove
|
||||||
|
}
|
||||||
|
create-glyph 'asciicircum' : glyph-construction {
|
||||||
|
set-width WIDTH
|
||||||
|
assign-unicode '~'
|
||||||
|
include glyphs.space BASE
|
||||||
|
include glyphs.tildeAbove
|
||||||
|
}
|
||||||
|
|
||||||
### Asterisk
|
### Asterisk
|
||||||
create-glyph 'asterisk' : glyph-construction {
|
create-glyph 'asterisk' : glyph-construction {
|
||||||
set-width WIDTH
|
set-width WIDTH
|
||||||
|
@ -450,3 +511,53 @@ create-glyph 'asterisk' : glyph-construction {
|
||||||
:.to-outline 0 0 1 true
|
:.to-outline 0 0 1 true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create-glyph 'agrave' : glyph-construction {
|
||||||
|
assign-unicode 0xE0
|
||||||
|
include glyphs.a BASE
|
||||||
|
include glyphs.graveAbove
|
||||||
|
}
|
||||||
|
create-glyph 'aacute' : glyph-construction {
|
||||||
|
assign-unicode 0xE1
|
||||||
|
include glyphs.a BASE
|
||||||
|
include glyphs.acuteAbove
|
||||||
|
}
|
||||||
|
create-glyph 'acircumflex' : glyph-construction {
|
||||||
|
assign-unicode 0xE2
|
||||||
|
include glyphs.a BASE
|
||||||
|
include glyphs.circumflexAbove
|
||||||
|
}
|
||||||
|
create-glyph 'atilde' : glyph-construction {
|
||||||
|
assign-unicode 0xE3
|
||||||
|
include glyphs.a BASE
|
||||||
|
include glyphs.tildeAbove
|
||||||
|
}
|
||||||
|
|
||||||
|
create-glyph 'percent' : glyph-construction {
|
||||||
|
set-width WIDTH
|
||||||
|
assign-unicode '%'
|
||||||
|
local percentDotSize 0.3
|
||||||
|
|
||||||
|
local cor : 1 / [Math.sqrt [1 - [Math.pow [[RIGHTSB - SB - STROKE] / [CAP - 0]] 2]]]
|
||||||
|
|
||||||
|
start-from SB 0
|
||||||
|
line-to [SB + STROKE * cor] 0
|
||||||
|
line-to RIGHTSB CAP
|
||||||
|
line-to [RIGHTSB - STROKE * cor] CAP
|
||||||
|
|
||||||
|
put-shapes : create-stroke
|
||||||
|
:.start-from SB CAP
|
||||||
|
:.heads-to DOWNWARD
|
||||||
|
:.set-width [Math.min [[RIGHTSB - SB] * 0.33] [STROKE * 1.5]] 0
|
||||||
|
:.line-to SB [mix CAP 0 0.3]
|
||||||
|
:.heads-to DOWNWARD
|
||||||
|
:.to-outline
|
||||||
|
|
||||||
|
put-shapes : create-stroke
|
||||||
|
:.start-from RIGHTSB 0
|
||||||
|
:.heads-to UPWARD
|
||||||
|
:.set-width [Math.min [[RIGHTSB - SB] * 0.33] [STROKE * 1.5]] 0
|
||||||
|
:.line-to RIGHTSB [mix 0 CAP 0.3]
|
||||||
|
:.heads-to UPWARD
|
||||||
|
:.to-outline
|
||||||
|
}
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
define [mix a b p] : a + [b - a] * p
|
define [mix a b p] : a + [b - a] * p
|
||||||
define [xgrid p] : mix SB RIGHTSB p
|
define [xgrid p] : mix SB RIGHTSB p
|
||||||
|
define [linreg x0 y0 x1 y1 x] : y0 + [x - x0] * [y1 - y0] / [x1 - x0]
|
||||||
|
|
||||||
### COMMON SHAPES
|
### COMMON SHAPES
|
||||||
|
|
||||||
|
@ -75,7 +76,7 @@ define [xsStrand _xleft yleft _xright yright _halfstroke0 _halfstroke1 _ess _exp
|
||||||
local halfstroke0 : _halfstroke0 || HALFSTROKE
|
local halfstroke0 : _halfstroke0 || HALFSTROKE
|
||||||
local halfstroke1 : _halfstroke1 || HALFSTROKE
|
local halfstroke1 : _halfstroke1 || HALFSTROKE
|
||||||
local ess : _ess || [halfstroke0 + halfstroke1] / 2
|
local ess : _ess || [halfstroke0 + halfstroke1] / 2
|
||||||
local yItalicCorrection [globalTransform.yx * 0.98]
|
local yItalicCorrection [globalTransform.yx * 0.985]
|
||||||
local xItalicCorrection : 1 / [Math.sqrt [1 - yItalicCorrection * yItalicCorrection]]
|
local xItalicCorrection : 1 / [Math.sqrt [1 - yItalicCorrection * yItalicCorrection]]
|
||||||
|
|
||||||
local roundsize : [_roundp || SMOOTHA * 0.4] * [if [yleft < yright] [-1] 1]
|
local roundsize : [_roundp || SMOOTHA * 0.4] * [if [yleft < yright] [-1] 1]
|
||||||
|
|
|
@ -456,34 +456,17 @@ create-glyph 'dotlessi.serifed' : glyph-construction {
|
||||||
put-shapes : rightwardBottomSerif MIDDLE 0 LONGJUT
|
put-shapes : rightwardBottomSerif MIDDLE 0 LONGJUT
|
||||||
put-shapes : leftwardBottomSerif MIDDLE 0 LONGJUT
|
put-shapes : leftwardBottomSerif MIDDLE 0 LONGJUT
|
||||||
}
|
}
|
||||||
create-glyph 'dotlessi' : glyph-construction {
|
select-variant 'dotlessi' 0x131 'serifed'
|
||||||
set-width WIDTH
|
|
||||||
assign-unicode 0x131
|
|
||||||
|
|
||||||
include glyphs.[match variantSelector.zero {
|
|
||||||
'straight' 'dotlessi.straight'
|
|
||||||
'hooky' 'dotlessi.hooky'
|
|
||||||
'zshaped' 'dotlessi.zshaped'
|
|
||||||
'serifed' 'dotlessi.serifed'
|
|
||||||
otherwise 'dotlessi.serifed'
|
|
||||||
}] true
|
|
||||||
}
|
|
||||||
create-glyph 'dotaccent' : glyph-construction {
|
|
||||||
set-width WIDTH
|
|
||||||
set-anchor 'above' MARK MIDDLE XH MIDDLE [XH + ACCENT]
|
|
||||||
put-shapes : list {
|
|
||||||
Ring [XH + ACCENT + DOTRADIUS] [XH + ACCENT - DOTRADIUS] [MIDDLE - DOTRADIUS] [MIDDLE + DOTRADIUS]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
create-glyph 'i' : glyph-construction {
|
create-glyph 'i' : glyph-construction {
|
||||||
set-width WIDTH
|
set-width WIDTH
|
||||||
assign-unicode 'i'
|
assign-unicode 'i'
|
||||||
|
|
||||||
include glyphs.dotlessi BASE
|
include glyphs.dotlessi BASE
|
||||||
include glyphs.dotaccent
|
include glyphs.dotAbove
|
||||||
}
|
}
|
||||||
|
|
||||||
create-glyph 'dotlessj.straight' : glyph-construction {
|
create-glyph 'dotlessj.straight' : glyph-construction {
|
||||||
|
set-anchor 'above' BASE [MIDDLE + JBALANCE] XH
|
||||||
put-shapes : create-stroke
|
put-shapes : create-stroke
|
||||||
:.start-from [MIDDLE + JBALANCE] XH
|
:.start-from [MIDDLE + JBALANCE] XH
|
||||||
:.heads-to DOWNWARD
|
:.heads-to DOWNWARD
|
||||||
|
@ -493,25 +476,21 @@ create-glyph 'dotlessj.straight' : glyph-construction {
|
||||||
:.to-outline
|
:.to-outline
|
||||||
}
|
}
|
||||||
create-glyph 'dotlessj.serifed' : glyph-construction {
|
create-glyph 'dotlessj.serifed' : glyph-construction {
|
||||||
include glyphs.'dotlessj.straight'
|
include glyphs.'dotlessj.straight' BASE
|
||||||
put-shapes : leftwardTopSerif [MIDDLE + JBALANCE] XH LONGJUT
|
put-shapes : leftwardTopSerif [MIDDLE + JBALANCE] XH LONGJUT
|
||||||
}
|
}
|
||||||
|
|
||||||
create-glyph 'dotlessj' : glyph-construction {
|
select-variant 'dotlessj' 0x237 'serifed'
|
||||||
set-width WIDTH
|
|
||||||
set-anchor 'above' BASE [MIDDLE + JBALANCE] XH
|
|
||||||
assign-unicode 0x237
|
|
||||||
include glyphs.'dotlessj.serifed'
|
|
||||||
}
|
|
||||||
create-glyph 'j' : glyph-construction {
|
create-glyph 'j' : glyph-construction {
|
||||||
set-width WIDTH
|
set-width WIDTH
|
||||||
assign-unicode 'j'
|
assign-unicode 'j'
|
||||||
|
|
||||||
include glyphs.dotlessj BASE
|
include glyphs.dotlessj BASE
|
||||||
include glyphs.dotaccent
|
include glyphs.dotAbove
|
||||||
}
|
}
|
||||||
|
|
||||||
create-glyph 'l.straight' : glyph-construction {
|
create-glyph 'l.straight' : glyph-construction {
|
||||||
|
include bMarks
|
||||||
put-shapes : create-stroke
|
put-shapes : create-stroke
|
||||||
:.start-from MIDDLE 0
|
:.start-from MIDDLE 0
|
||||||
:.heads-to UPWARD
|
:.heads-to UPWARD
|
||||||
|
@ -521,14 +500,17 @@ create-glyph 'l.straight' : glyph-construction {
|
||||||
:.to-outline
|
:.to-outline
|
||||||
}
|
}
|
||||||
create-glyph 'l.hooky' : glyph-construction {
|
create-glyph 'l.hooky' : glyph-construction {
|
||||||
|
include bMarks
|
||||||
include glyphs.'l.straight'
|
include glyphs.'l.straight'
|
||||||
put-shapes : leftwardTopSerif MIDDLE CAP LONGJUT
|
put-shapes : leftwardTopSerif MIDDLE CAP LONGJUT
|
||||||
}
|
}
|
||||||
create-glyph 'l.zshaped' : glyph-construction {
|
create-glyph 'l.zshaped' : glyph-construction {
|
||||||
|
include bMarks
|
||||||
include glyphs.'l.hooky'
|
include glyphs.'l.hooky'
|
||||||
put-shapes : rightwardBottomSerif MIDDLE 0 LONGJUT
|
put-shapes : rightwardBottomSerif MIDDLE 0 LONGJUT
|
||||||
}
|
}
|
||||||
create-glyph 'l.serifed' : glyph-construction {
|
create-glyph 'l.serifed' : glyph-construction {
|
||||||
|
include bMarks
|
||||||
local balance ILBALANCE
|
local balance ILBALANCE
|
||||||
put-shapes : create-stroke
|
put-shapes : create-stroke
|
||||||
:.start-from [MIDDLE + balance] 0
|
:.start-from [MIDDLE + balance] 0
|
||||||
|
@ -541,19 +523,7 @@ create-glyph 'l.serifed' : glyph-construction {
|
||||||
put-shapes : rightwardBottomSerif MIDDLE 0 LONGJUT
|
put-shapes : rightwardBottomSerif MIDDLE 0 LONGJUT
|
||||||
put-shapes : leftwardBottomSerif MIDDLE 0 LONGJUT
|
put-shapes : leftwardBottomSerif MIDDLE 0 LONGJUT
|
||||||
}
|
}
|
||||||
create-glyph 'l' : glyph-construction {
|
select-variant 'l' 'l' 'serifed'
|
||||||
set-width WIDTH
|
|
||||||
assign-unicode 'l'
|
|
||||||
include bMarks
|
|
||||||
|
|
||||||
include glyphs.[match variantSelector.zero {
|
|
||||||
'straight' 'l.straight'
|
|
||||||
'hooky' 'l.hooky'
|
|
||||||
'zshaped' 'l.zshaped'
|
|
||||||
'serifed' 'l.serifed'
|
|
||||||
otherwise 'l.serifed'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
|
|
||||||
### x v w y z k
|
### x v w y z k
|
||||||
create-glyph 'x' : glyph-construction {
|
create-glyph 'x' : glyph-construction {
|
||||||
|
|
84
glyphs/overmarks.patel
Normal file
84
glyphs/overmarks.patel
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
|
||||||
|
### Combining marks
|
||||||
|
|
||||||
|
local aboveMarkTop [XH + ACCENT * 1.6 - HALFSTROKE]
|
||||||
|
local markExtend [ACCENTX * 0.5]
|
||||||
|
local aboveMarkBot [XH + ACCENT - STROKE]
|
||||||
|
local markHalfStroke : 0.5 * [Math.min STROKE [ACCENT * 0.6]]
|
||||||
|
local markFine : markHalfStroke * 0.8
|
||||||
|
local markMiddle [-MIDDLE]
|
||||||
|
|
||||||
|
create-glyph 'dotAbove' : glyph-construction {
|
||||||
|
set-width 0
|
||||||
|
assign-unicode 0x307
|
||||||
|
set-anchor 'above' MARK markMiddle XH markMiddle [XH + ACCENT]
|
||||||
|
put-shapes : list {
|
||||||
|
Ring [XH + ACCENT + DOTRADIUS] [XH + ACCENT - DOTRADIUS] [markMiddle - DOTRADIUS] [markMiddle + DOTRADIUS]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
create-glyph 'graveAbove' : glyph-construction {
|
||||||
|
set-width 0
|
||||||
|
assign-unicode 0x300
|
||||||
|
set-anchor 'above' MARK markMiddle XH markMiddle [XH + ACCENT]
|
||||||
|
|
||||||
|
put-shapes : create-stroke
|
||||||
|
:.start-from [markMiddle + markHalfStroke] aboveMarkBot
|
||||||
|
:.set-width markFine markFine
|
||||||
|
:.line-to [markMiddle - markExtend] aboveMarkTop
|
||||||
|
:.set-width markHalfStroke markHalfStroke
|
||||||
|
:.to-outline
|
||||||
|
}
|
||||||
|
create-glyph 'acuteAbove' : glyph-construction {
|
||||||
|
set-width 0
|
||||||
|
assign-unicode 0x301
|
||||||
|
set-anchor 'above' MARK markMiddle XH markMiddle [XH + ACCENT]
|
||||||
|
|
||||||
|
put-shapes : create-stroke
|
||||||
|
:.start-from [markMiddle - markHalfStroke] aboveMarkBot
|
||||||
|
:.set-width markFine markFine
|
||||||
|
:.line-to [markMiddle + markExtend] aboveMarkTop
|
||||||
|
:.set-width markHalfStroke markHalfStroke
|
||||||
|
:.to-outline
|
||||||
|
}
|
||||||
|
create-glyph 'circumflexAbove' : glyph-construction {
|
||||||
|
set-width 0
|
||||||
|
assign-unicode 0x302
|
||||||
|
set-anchor 'above' MARK markMiddle XH markMiddle [XH + ACCENT]
|
||||||
|
|
||||||
|
put-shapes : create-stroke
|
||||||
|
:.start-from [markMiddle - markExtend - markHalfStroke] aboveMarkBot
|
||||||
|
:.set-width markHalfStroke markHalfStroke
|
||||||
|
:.line-to markMiddle [aboveMarkTop + markFine * 0.7]
|
||||||
|
:.heads-to UPWARD
|
||||||
|
:.to-outline
|
||||||
|
|
||||||
|
put-shapes : create-stroke
|
||||||
|
:.start-from [markMiddle + markExtend + markHalfStroke] aboveMarkBot
|
||||||
|
:.set-width markHalfStroke markHalfStroke
|
||||||
|
:.line-to markMiddle [aboveMarkTop + markFine * 0.7]
|
||||||
|
:.heads-to UPWARD
|
||||||
|
:.to-outline
|
||||||
|
}
|
||||||
|
create-glyph 'tildeAbove' : glyph-construction {
|
||||||
|
set-width 0
|
||||||
|
assign-unicode 0x303
|
||||||
|
set-anchor 'above' MARK markMiddle XH markMiddle [XH + ACCENT]
|
||||||
|
|
||||||
|
local leftEnd [markMiddle - markExtend * 1.5]
|
||||||
|
local rightEnd [markMiddle + markExtend * 1.5]
|
||||||
|
|
||||||
|
local ttop aboveMarkTop
|
||||||
|
local tbot : aboveMarkBot + markFine / 2
|
||||||
|
local top : ttop + [markFine * 2]
|
||||||
|
local bot : tbot - [markFine * 2]
|
||||||
|
|
||||||
|
local tildeWave [linreg 40 1.45 52 1.33 markHalfStroke]
|
||||||
|
local tildeWaveX 0.52
|
||||||
|
local tildeWaveEnd 0
|
||||||
|
|
||||||
|
put-shapes : create-stroke
|
||||||
|
:.start-from leftEnd [mix tbot ttop tildeWaveEnd]
|
||||||
|
:.set-width markHalfStroke markHalfStroke
|
||||||
|
:.cubic-to [mix leftEnd rightEnd tildeWaveX] [mix bot top tildeWave] [mix leftEnd rightEnd [1 - tildeWaveX]] [mix bot top [1 - tildeWave]] rightEnd [mix tbot ttop [1 - tildeWaveEnd]]
|
||||||
|
:.to-outline 0 0 11
|
||||||
|
}
|
27
makefile
27
makefile
|
@ -1,21 +1,30 @@
|
||||||
SUPPORT_FILES = support/glyph.js support/stroke.js parameters.js
|
SUPPORT_FILES = support/glyph.js support/stroke.js parameters.js
|
||||||
GLYPH_SEGMENTS = glyphs/common-shapes.patel glyphs/latin-capital.patel glyphs/latin-lower.patel glyphs/numbers.patel glyphs/ascii-symbols.patel
|
GLYPH_SEGMENTS = glyphs/common-shapes.patel glyphs/overmarks.patel glyphs/latin-capital.patel glyphs/latin-lower.patel glyphs/numbers.patel glyphs/ascii-symbols.patel
|
||||||
OBJDIR = build
|
OBJDIR = build
|
||||||
|
|
||||||
|
TARGETS = $(OBJDIR)/iosevka-regular.ttf $(OBJDIR)/iosevka-bold.ttf $(OBJDIR)/iosevka-italic.ttf $(OBJDIR)/iosevka-bolditalic.ttf
|
||||||
|
STEP0 = $(subst .ttf,.0.ttf,$(TARGETS))
|
||||||
|
STEP1 = $(subst .ttf,.1.ttf,$(TARGETS))
|
||||||
|
|
||||||
FILES = $(SUPPORT_FILES) buildglyphs.js
|
FILES = $(SUPPORT_FILES) buildglyphs.js
|
||||||
|
|
||||||
fonts : update $(OBJDIR)/iosevka-regular.ttf $(OBJDIR)/iosevka-bold.ttf $(OBJDIR)/iosevka-italic.ttf $(OBJDIR)/iosevka-bolditalic.ttf
|
fonts : update $(TARGETS)
|
||||||
|
|
||||||
|
$(OBJDIR)/iosevka-regular.0.ttf : $(FILES) $(OBJDIR)
|
||||||
$(OBJDIR)/iosevka-regular.ttf : $(FILES) $(OBJDIR)
|
|
||||||
node generate regular $@
|
node generate regular $@
|
||||||
$(OBJDIR)/iosevka-bold.ttf : $(FILES) $(OBJDIR)
|
$(OBJDIR)/iosevka-bold.0.ttf : $(FILES) $(OBJDIR)
|
||||||
node generate bold $@
|
node generate bold $@
|
||||||
$(OBJDIR)/iosevka-italic.ttf : $(FILES) $(OBJDIR)
|
$(OBJDIR)/iosevka-italic.0.ttf : $(FILES) $(OBJDIR)
|
||||||
node generate italic $@
|
node generate italic $@
|
||||||
$(OBJDIR)/iosevka-bolditalic.ttf : $(FILES) $(OBJDIR)
|
$(OBJDIR)/iosevka-bolditalic.0.ttf : $(FILES) $(OBJDIR)
|
||||||
node generate bolditalic $@
|
node generate bolditalic $@
|
||||||
|
|
||||||
|
$(STEP1) : %.1.ttf : %.0.ttf
|
||||||
|
fontforge -script final.pe $< $@
|
||||||
|
|
||||||
|
$(TARGETS) : %.ttf : %.1.ttf
|
||||||
|
ttfautohint $< $@
|
||||||
|
|
||||||
update : $(FILES)
|
update : $(FILES)
|
||||||
|
|
||||||
$(SUPPORT_FILES) :
|
$(SUPPORT_FILES) :
|
||||||
|
@ -29,3 +38,7 @@ parameters.js : parameters.patel
|
||||||
|
|
||||||
$(OBJDIR) :
|
$(OBJDIR) :
|
||||||
@- mkdir $@
|
@- mkdir $@
|
||||||
|
|
||||||
|
cleartemps :
|
||||||
|
-rm $(STEP0)
|
||||||
|
-rm $(STEP1)
|
|
@ -25,6 +25,7 @@
|
||||||
'italicangle': 0,
|
'italicangle': 0,
|
||||||
'longjut': 175,
|
'longjut': 175,
|
||||||
'accent': 175,
|
'accent': 175,
|
||||||
|
'accentx': 200,
|
||||||
'tbalance': 70,
|
'tbalance': 70,
|
||||||
'tbalance2': 30,
|
'tbalance2': 30,
|
||||||
'rbalance': 25,
|
'rbalance': 25,
|
||||||
|
@ -51,20 +52,24 @@
|
||||||
r0_bold['tbalance'] = 60;
|
r0_bold['tbalance'] = 60;
|
||||||
r0_bold['rbalance'] = 18;
|
r0_bold['rbalance'] = 18;
|
||||||
r0_bold['style'] = 'Bold';
|
r0_bold['style'] = 'Bold';
|
||||||
r0_bold['weight'] = 600;
|
r0_bold['weight'] = 700;
|
||||||
r0_bold['bkappa'] = 0.5;
|
r0_bold['bkappa'] = 0.5;
|
||||||
r0_bold['smoothadjust'] = 130;
|
r0_bold['smoothadjust'] = 130;
|
||||||
|
r0_bold['isBold'] = true;
|
||||||
r0_italic = Object['create'](r0_regular);
|
r0_italic = Object['create'](r0_regular);
|
||||||
r0_italic['italicangle'] = 10;
|
r0_italic['italicangle'] = 10;
|
||||||
r0_italic['tbalance'] = 70;
|
r0_italic['tbalance'] = 70;
|
||||||
r0_italic['rbalance'] = 30;
|
r0_italic['rbalance'] = 30;
|
||||||
r0_italic['style'] = 'Italic';
|
r0_italic['style'] = 'Italic';
|
||||||
r0_italic['ckappa'] = 0.618;
|
r0_italic['ckappa'] = 0.618;
|
||||||
|
r0_italic['isItalic'] = true;
|
||||||
r0_bolditalic = Object['create'](r0_bold);
|
r0_bolditalic = Object['create'](r0_bold);
|
||||||
r0_bolditalic['italicangle'] = 10;
|
r0_bolditalic['italicangle'] = 10;
|
||||||
r0_bolditalic['tbalance'] = 90;
|
r0_bolditalic['tbalance'] = 90;
|
||||||
r0_bolditalic['style'] = 'Bold Italic';
|
r0_bolditalic['style'] = 'Bold Italic';
|
||||||
r0_bolditalic['ckappa'] = 0.618;
|
r0_bolditalic['ckappa'] = 0.618;
|
||||||
|
r0_bolditalic['isBold'] = true;
|
||||||
|
r0_bolditalic['isItalic'] = true;
|
||||||
exports['regular'] = r0_regular;
|
exports['regular'] = r0_regular;
|
||||||
exports['bold'] = r0_bold;
|
exports['bold'] = r0_bold;
|
||||||
exports['italic'] = r0_italic;
|
exports['italic'] = r0_italic;
|
||||||
|
|
|
@ -26,6 +26,7 @@ define regular (
|
||||||
.italicangle 0
|
.italicangle 0
|
||||||
.longjut 175
|
.longjut 175
|
||||||
.accent 175
|
.accent 175
|
||||||
|
.accentx 200
|
||||||
.tbalance 70
|
.tbalance 70
|
||||||
.tbalance2 30
|
.tbalance2 30
|
||||||
.rbalance 25
|
.rbalance 25
|
||||||
|
@ -53,10 +54,12 @@ bold.kappa_ahook = 0.60
|
||||||
bold.jbalance = 60
|
bold.jbalance = 60
|
||||||
bold.tbalance = 60
|
bold.tbalance = 60
|
||||||
bold.rbalance = 18
|
bold.rbalance = 18
|
||||||
|
|
||||||
bold.style = 'Bold'
|
bold.style = 'Bold'
|
||||||
bold.weight = 600
|
bold.weight = 700
|
||||||
bold.bkappa = 0.5
|
bold.bkappa = 0.5
|
||||||
bold.smoothadjust = 130
|
bold.smoothadjust = 130
|
||||||
|
bold.isBold = true
|
||||||
|
|
||||||
define italic : Object.create regular
|
define italic : Object.create regular
|
||||||
italic.italicangle = 10
|
italic.italicangle = 10
|
||||||
|
@ -64,12 +67,15 @@ italic.tbalance = 70
|
||||||
italic.rbalance = 30
|
italic.rbalance = 30
|
||||||
italic.style = 'Italic'
|
italic.style = 'Italic'
|
||||||
italic.ckappa = 0.618
|
italic.ckappa = 0.618
|
||||||
|
italic.isItalic = true
|
||||||
|
|
||||||
define bolditalic : Object.create bold
|
define bolditalic : Object.create bold
|
||||||
bolditalic.italicangle = 10
|
bolditalic.italicangle = 10
|
||||||
bolditalic.tbalance = 90
|
bolditalic.tbalance = 90
|
||||||
bolditalic.style = 'Bold Italic'
|
bolditalic.style = 'Bold Italic'
|
||||||
bolditalic.ckappa = 0.618
|
bolditalic.ckappa = 0.618
|
||||||
|
bolditalic.isBold = true
|
||||||
|
bolditalic.isItalic = true
|
||||||
|
|
||||||
|
|
||||||
exports.regular = regular
|
exports.regular = regular
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
r0_SAMPLES = 6;
|
r0_SAMPLES = 6;
|
||||||
r0_TINY = 0.0001;
|
r0_TINY = 0.0001;
|
||||||
r0_LITTLE = 0.01;
|
r0_LITTLE = 0.01;
|
||||||
r0_CUTOFF = 10000;
|
r0_CUTOFF = 2000;
|
||||||
r0_KAPPA = 0.51;
|
r0_KAPPA = 0.51;
|
||||||
r0_COKAPPA = 1 - r0_KAPPA;
|
r0_COKAPPA = 1 - r0_KAPPA;
|
||||||
r0_BKAPPA = r0_KAPPA + 0.1;
|
r0_BKAPPA = r0_KAPPA + 0.1;
|
||||||
|
|
|
@ -14,7 +14,7 @@ define [ys-array a] (a.0 :: [a.concat (a`[a.length - 1])])
|
||||||
define SAMPLES 6
|
define SAMPLES 6
|
||||||
define TINY 0.0001
|
define TINY 0.0001
|
||||||
define LITTLE 0.01
|
define LITTLE 0.01
|
||||||
define CUTOFF 10000
|
define CUTOFF 2000
|
||||||
define KAPPA 0.51
|
define KAPPA 0.51
|
||||||
define COKAPPA : 1 - KAPPA
|
define COKAPPA : 1 - KAPPA
|
||||||
define BKAPPA : KAPPA + 0.1
|
define BKAPPA : KAPPA + 0.1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue