Add FWID and HWID for arrows and geometrics

This commit is contained in:
Belleve Invis 2019-10-21 23:04:22 -07:00
parent 81e7f07a0d
commit b520562be9
11 changed files with 817 additions and 387 deletions

View file

@ -161,6 +161,8 @@ The current available styles for `design`/`upright`/`italic`/`oblique` options a
* `compressed`: Compress the width by 10%. * `compressed`: Compress the width by 10%.
* `menu-subfamily-condensed`: Add “Condensed” into font menu subfamily; * `menu-subfamily-condensed`: Add “Condensed” into font menu subfamily;
* NOTE: these styles are highly experimental. Handle with extreme care. * NOTE: these styles are highly experimental. Handle with extreme care.
* Symbol exclusion:
* `exclude-check-and-cross-symbol`: Exclude `✓✔✕✖✗✘` (U+2713 U+2718) from the font.
* Styles for individual characters. They are easy-to-understand names of the `cv##` styles, including: * Styles for individual characters. They are easy-to-understand names of the `cv##` styles, including:
* Styles for letter `l`: * Styles for letter `l`:
* `v-l-hooky` : Hooky `l`. * `v-l-hooky` : Hooky `l`.

374
gen/build-glyphs.js Normal file
View file

@ -0,0 +1,374 @@
'use strict';
var r1_buildFont, _r1_t0, _r1_t1, _r1_t2, _r1_t3, _r1_t4, _r1_t5, _r1_t6, _r1_t7, _r1_t13, _r1_t14, _r1_t15, _r1_t16, _r1_t17;
var r1_Glyph = require('../support/glyph');
var r1_Point = require('../support/point');
var r1_spirokit = require('../support/spirokit');
var _r1_t8 = require('../support/transform');
var r1_Transform = _r1_t8;
var r1_tp = _r1_t8.transformPoint;
var r1_utp = _r1_t8.untransform;
var r1_inverse = _r1_t8.inverse;
var r1_Anchor = require('../support/anchor');
var r1_smoothreg = require('../support/monotonic-interpolate');
var r1_fairify = require('../support/fairify');
var _r1_t9 = require('../support/utils');
var r1_mix = _r1_t9.mix;
var r1_linreg = _r1_t9.linreg;
var r1_clamp = _r1_t9.clamp;
var r1_fallback = _r1_t9.fallback;
var r1_TempFont = _r1_t9.TempFont;
var r1_includeGlyphPart = _r1_t9.includeGlyphPart;
var r1_compsiteMarkSet = _r1_t9.compsiteMarkSet;
var _r1_t10 = require('../meta/aesthetics');
var r1_calculateMetrics = _r1_t10.calculateMetrics;
var r1_setFontMetrics = _r1_t10.setFontMetrics;
var _r1_t11 = require('../meta/naming');
var r1_assignFontNames = _r1_t11.assignFontNames;
var r1_Features = require('../meta/features');
var _r1_class12 = function _r1_t13(r161_x, r161_y) {
var _r161_t0 = this;
_r161_t0.x = r161_x;
_r161_t0.y = r161_y;
return void 0;
};
var r1_xn$NamedParameterPair$2Lrc9b = function _r1_t14(r257_l, r257_r) {
var _r257_t0 = this;
_r257_t0.left = r257_l;
_r257_t0.right = r257_r;
return _r257_t0;
};
var r1_xn$donothing$2Lrc0b = function _r1_t15() {
return void 0;
};
var r1_tagged = function _r1_t16(r259_tag, r259_component) {
r259_component.tag = r259_tag;
return r259_component;
};
exports.build = r1_buildFont = function _r1_t17(r261_para, r261_recursive, r261_recursiveCodes) {
var _r261_t4, _r261_t11, _r261_t12;
var _r261_t5 = this;
var r261_variantSelector = r261_para.variantSelector;
var r261_font = _r261_t5;
var r261_glyphList = r261_font.glyf;
var r261_glyphs = {};
var r261_unicodeGlyphs = [];
var r261_metrics = r1_calculateMetrics(r261_para);
var _r261_t0 = r261_metrics;
var r261_globalTransform = _r261_t0.globalTransform;
var r261_UPM = _r261_t0.UPM;
var r261_MIDDLE = _r261_t0.MIDDLE;
var r261_CAP = _r261_t0.CAP;
var r261_XH = _r261_t0.XH;
var r261_SB = _r261_t0.SB;
var r261_RIGHTSB = _r261_t0.RIGHTSB;
var r261_CONTRAST = _r261_t0.CONTRAST;
var r261_STROKE = _r261_t0.STROKE;
var r261_SUPERNESS = _r261_t0.SUPERNESS;
var r261_WIDTH = _r261_t0.WIDTH;
var r261_TANSLANT = _r261_t0.TANSLANT;
var r261_OVERLAYPOS = _r261_t0.OVERLAYPOS;
var r261_DESCENDER = _r261_t0.DESCENDER;
var r261_MVERTSTROKE_D = _r261_t0.MVERTSTROKE_D;
var r261_symbolMid = _r261_t0.symbolMid;
var r261_parenTop = _r261_t0.parenTop;
var r261_parenBot = _r261_t0.parenBot;
var r261_operTop = _r261_t0.operTop;
var r261_operBot = _r261_t0.operBot;
var r261_plusTop = _r261_t0.plusTop;
var r261_plusBot = _r261_t0.plusBot;
var r261_tackTop = _r261_t0.tackTop;
var r261_tackBot = _r261_t0.tackBot;
var r261_adviceBlackness = _r261_t0.adviceBlackness;
var _r261_t1 = r1_Anchor;
var r261_MARK = _r261_t1.MARK;
var r261_BASE = _r261_t1.BASE;
var _r261_t2 = [
'AS-BASE',
'ALSO-METRICS'
];
var r261_AS_BASE = _r261_t2[0];
var r261_ALSO_METRICS = _r261_t2[1];
var r261_MarksetDiv = function _r261_t8(r263_p) {
var r263_middle = r263_p * r261_MIDDLE;
var r263_rightSB = r261_WIDTH * r263_p - r261_SB;
var r263_ta = function _r263_t2(r264_anchor) {
return new r1_Anchor(r264_anchor.x * r261_globalTransform.xx + r264_anchor.y * r261_TANSLANT + r261_globalTransform.x, r264_anchor.x * r261_globalTransform.xy + r264_anchor.y * r261_globalTransform.yy + r261_globalTransform.y, r264_anchor.type);
};
var r263_markAboveLower = { 'anchors': { 'above': r263_ta(new r1_Anchor(r263_middle, r261_XH, r261_BASE)) } };
var r263_markAboveOper = { 'anchors': { 'above': r263_ta(new r1_Anchor(r263_middle, r261_operTop, r261_BASE)) } };
var r263_markAboveTack = { 'anchors': { 'above': r263_ta(new r1_Anchor(r263_middle, r261_tackTop, r261_BASE)) } };
var r263_markAbovePlus = { 'anchors': { 'above': r263_ta(new r1_Anchor(r263_middle, r261_plusTop, r261_BASE)) } };
var r263_markAboveCap = { 'anchors': { 'above': r263_ta(new r1_Anchor(r263_middle, r261_CAP, r261_BASE)) } };
var r263_markBelowLower = { 'anchors': { 'below': r263_ta(new r1_Anchor(r263_middle, r261_DESCENDER, r261_BASE)) } };
var r263_markBelowTack = { 'anchors': { 'below': r263_ta(new r1_Anchor(r263_middle, r261_tackBot, r261_BASE)) } };
var r263_markBelowOper = { 'anchors': { 'below': r263_ta(new r1_Anchor(r263_middle, r261_operBot, r261_BASE)) } };
var r263_markBelowPlus = { 'anchors': { 'below': r263_ta(new r1_Anchor(r263_middle, r261_plusBot, r261_BASE)) } };
var r263_markBelowZero = { 'anchors': { 'below': r263_ta(new r1_Anchor(r263_middle, 0, r261_BASE)) } };
var r263_markToprightLower = { 'anchors': { 'topright': r263_ta(new r1_Anchor(r263_rightSB, r261_XH, r261_BASE)) } };
var r263_markToprightCap = { 'anchors': { 'topright': r263_ta(new r1_Anchor(r263_rightSB, r261_CAP, r261_BASE)) } };
var r263_markBottomrightLower = { 'anchors': { 'bottomright': r263_ta(new r1_Anchor(r263_rightSB, r261_DESCENDER, r261_BASE)) } };
var r263_markBottomrightZero = { 'anchors': { 'bottomright': r263_ta(new r1_Anchor(r263_rightSB, 0, r261_BASE)) } };
var r263_buildStandardMarkSet = function _r263_t3() {
var _r265_t1 = arguments;
var r265_a = r1_compsiteMarkSet.apply(null, _r265_t1);
r265_a.anchors.overlay = new r1_Anchor(r1_mix(r265_a.anchors.below.x, r265_a.anchors.above.x, r261_OVERLAYPOS), r1_mix(r265_a.anchors.below.y, r265_a.anchors.above.y, r261_OVERLAYPOS), r261_BASE);
r265_a.anchors.slash = new r1_Anchor(r1_mix(r265_a.anchors.below.x, r265_a.anchors.above.x, 0.5), r1_mix(r265_a.anchors.below.y, r265_a.anchors.above.y, 0.5), r261_BASE);
return r265_a;
};
return {
'capital': r263_buildStandardMarkSet(r263_markAboveCap, r263_markBelowZero, r263_markToprightCap, r263_markBottomrightZero),
'b': r263_buildStandardMarkSet(r263_markAboveCap, r263_markBelowZero, r263_markToprightCap, r263_markBottomrightZero),
'e': r263_buildStandardMarkSet(r263_markAboveLower, r263_markBelowZero, r263_markToprightLower, r263_markBottomrightZero),
'oper': r263_buildStandardMarkSet(r263_markAboveOper, r263_markBelowOper, r263_markToprightLower, r263_markBottomrightZero),
'tack': r263_buildStandardMarkSet(r263_markAboveTack, r263_markBelowTack, r263_markToprightLower, r263_markBottomrightZero),
'plus': r263_buildStandardMarkSet(r263_markAbovePlus, r263_markBelowPlus, r263_markToprightLower, r263_markBottomrightZero),
'p': r263_buildStandardMarkSet(r263_markAboveLower, r263_markBelowLower, r263_markToprightLower, r263_markBottomrightLower),
'if': r263_buildStandardMarkSet(r263_markAboveCap, r263_markBelowLower, r263_markToprightCap, r263_markBottomrightLower)
};
};
var r261_markset = r261_MarksetDiv(1);
var r261_DivFrame = function _r261_t9(r266__div, r266__hPack) {
var r266_div = r1_fallback(r266__div, 1);
var r266_hPack = Math.max(2, r1_fallback(r266__hPack, 0));
var r266_sbMul = Math.min(1, (r261_WIDTH * r266_div - r266_hPack * r261_adviceBlackness(r266_hPack, r266_div)) / (2 * r266_hPack * r261_SB));
return {
'div': r266_div,
'width': r261_WIDTH * r266_div,
'middle': r261_MIDDLE * r266_div,
'sb': r261_SB * r266_sbMul,
'leftSB': r261_SB * r266_sbMul,
'rightSB': r261_WIDTH * r266_div - r261_SB * r266_sbMul,
'mvs': r261_MVERTSTROKE_D(r266_div),
'markSet': r261_MarksetDiv(r266_div)
};
};
var r261_dependencyProfile = {};
var r261_nTemp = 0;
var r261_newtemp = function _r261_t10() {
return r261_nTemp = r261_nTemp + 1;
};
var r261_nPending = 0;
if (r261_recursive) {
_r261_t12 = {};
_r261_t11 = function (_r261_leti3) {
var r268_j;
var r268_h = _r261_leti3;
var _r268_t0 = r261_recursive;
var _r268_t1 = _r268_t0.length;
var _r268_t2 = 0;
for (; _r268_t2 < _r268_t1; _r268_t2 = _r268_t2 + 1) {
r268_j = _r268_t0[_r268_t2];
r268_h[r268_j] = r268_j;
}
r261_nPending = r261_recursive.length;
return r268_h;
}(_r261_t12);
} else
_r261_t11 = void 0;
var r261_pickHash = _r261_t11;
var r261_getDependencyProfile = function _r261_t15(r270_glyph) {
var r270_d, r270_k, _r270_t3, _r270_t4, _r270_t5;
var r270_dp = [];
var _r270_t0 = r270_glyph.dependencies;
var _r270_t1 = _r270_t0.length;
var _r270_t2 = 0;
for (; _r270_t2 < _r270_t1; _r270_t2 = _r270_t2 + 1) {
r270_d = _r270_t0[_r270_t2];
r270_dp.push(r270_d);
if (r261_dependencyProfile[r270_d]) {
_r270_t3 = r261_dependencyProfile[r270_d];
_r270_t4 = _r270_t3.length;
_r270_t5 = 0;
for (; _r270_t5 < _r270_t4; _r270_t5 = _r270_t5 + 1) {
r270_k = _r270_t3[_r270_t5];
r270_dp.push(r270_k);
}
}
}
return r270_dp;
};
var r261_xn$createglyph$7Hrq = function _r261_t16() {
var r274_actions, r274_glyphName, r274_glyphObject, r274_name;
var _r274_t2 = arguments;
var _r274_t0 = Array.prototype.slice.call(_r274_t2, 0);
if (Array.isArray(_r274_t0) && _r274_t0.length === 2) {
r274_name = _r274_t0[0];
r274_actions = _r274_t0[1];
if (r261_pickHash && !r261_pickHash[r274_name])
return void 0;
if (r261_para.verbose)
console.log(r274_name);
r274_glyphObject = new r1_Glyph(r274_name);
r261_glyphList.push(r274_glyphObject);
r261_glyphs[r274_name] = r274_glyphObject;
r274_glyphObject['set-width'](r261_WIDTH);
r274_glyphObject.gizmo = r261_globalTransform;
r274_actions.call(r274_glyphObject);
r261_dependencyProfile[r274_name] = r261_getDependencyProfile(r274_glyphObject);
r261_nPending = r261_nPending - 1;
return r274_glyphObject;
} else if (Array.isArray(_r274_t0) && _r274_t0.length === 1) {
r274_actions = _r274_t0[0];
r274_glyphName = '.temp-' + r261_newtemp();
if (r261_para.verbose)
console.log(r274_glyphName);
r274_glyphObject = new r1_Glyph(r274_glyphName);
r274_glyphObject['set-width'](r261_WIDTH);
r274_glyphObject.gizmo = r261_globalTransform;
r274_actions.call(r274_glyphObject);
return r274_glyphObject;
} else
return void 0;
};
var r261_xn$save$2Lrc5 = function _r261_t17(r275__name, r275_unicode) {
var _r275_t0 = this;
var r275_t = _r275_t0;
var r275_name = !r275__name ? '--autoname-' + r261_newtemp() : r275__name;
var r275_g = r261_xn$createglyph$7Hrq(r275_name, function _r275_t2() {
return void 0;
});
if (r275_g) {
r275_g.include(r275_t, r261_AS_BASE);
if (r275_t instanceof r1_Glyph) {
r275_g.advanceWidth = r275_t.advanceWidth;
r275_g.shortName = r275_t.shortName;
r275_g.cmpPriority = r275_t.cmpPriority;
r275_g.flatten = r275_t.flatten;
}
if (r275_name)
r261_dependencyProfile[r275_name] = r261_getDependencyProfile(r275_g);
}
if (r275_g && r275_unicode) {
r275_g['assign-unicode'](r275_unicode);
r261_unicodeGlyphs[r275_g.unicode[r275_g.unicode.length - 1]] = r275_g;
}
return r275_g;
};
var r261_xn$saveglyph$5sIl = function _r261_t18(r277_name, r277_unicode, r277_g) {
return r261_xn$save$2Lrc5.call(r277_g, r277_name, r277_unicode);
};
var r261_spirofns = r1_spirokit.SetupBuilders({
'globalTransform': r261_globalTransform,
'CONTRAST': r261_CONTRAST,
'STROKE': r261_STROKE,
'Glyph': r1_Glyph,
'para': r261_para,
'SUPERNESS': r261_SUPERNESS
});
r1_assignFontNames(r261_para, r261_metrics, r261_font);
r1_setFontMetrics(r261_para, r261_metrics, r261_font);
(function _r261_t19() {
var _r279_t0 = this;
var r279_currentGlyph = _r279_t0;
if (!r279_currentGlyph)
return void 0;
if (r261_glyphList[r261_glyphList.length - 1].name === '.WF.gen/build-glyphs.ptl.1')
r261_glyphList.pop();
r279_currentGlyph['start-from'](r261_SB, 0);
r279_currentGlyph['line-to'](r261_SB, r261_CAP);
r279_currentGlyph['line-to'](r261_RIGHTSB, r261_CAP);
r279_currentGlyph['line-to'](r261_RIGHTSB, 0);
r279_currentGlyph['start-from'](r261_SB + r261_STROKE, r261_STROKE);
r279_currentGlyph['line-to'](r261_RIGHTSB - r261_STROKE, r261_STROKE);
r279_currentGlyph['line-to'](r261_RIGHTSB - r261_STROKE, r261_CAP - r261_STROKE);
r279_currentGlyph['line-to'](r261_SB + r261_STROKE, r261_CAP - r261_STROKE);
r279_currentGlyph.cmpPriority = 9999;
r261_xn$save$2Lrc5.call(r279_currentGlyph, '.notdef');
r261_dependencyProfile[r279_currentGlyph.name] = r261_getDependencyProfile(r279_currentGlyph);
return r279_currentGlyph;
}.call(r261_xn$createglyph$7Hrq('.WF.gen/build-glyphs.ptl.1', r1_xn$donothing$2Lrc0b)));
(function _r261_t20() {
var _r290_t0 = this;
var r290_currentGlyph = _r290_t0;
if (!r290_currentGlyph)
return void 0;
if (r261_glyphList[r261_glyphList.length - 1].name === '.WF.gen/build-glyphs.ptl.2')
r261_glyphList.pop();
r290_currentGlyph['set-width'](0);
r290_currentGlyph.cmpPriority = 9998;
r261_xn$save$2Lrc5.call(r290_currentGlyph, '.null');
r261_dependencyProfile[r290_currentGlyph.name] = r261_getDependencyProfile(r290_currentGlyph);
return r290_currentGlyph;
}.call(r261_xn$createglyph$7Hrq('.WF.gen/build-glyphs.ptl.2', r1_xn$donothing$2Lrc0b)));
(function _r261_t21() {
var _r294_t0 = this;
var r294_currentGlyph = _r294_t0;
if (!r294_currentGlyph)
return void 0;
if (r261_glyphList[r261_glyphList.length - 1].name === '.WF.gen/build-glyphs.ptl.3')
r261_glyphList.pop();
r294_currentGlyph['set-width'](r261_WIDTH);
r294_currentGlyph.cmpPriority = -1;
r261_xn$save$2Lrc5.call(r294_currentGlyph, 'nonmarkingreturn', 13);
r261_dependencyProfile[r294_currentGlyph.name] = r261_getDependencyProfile(r294_currentGlyph);
return r294_currentGlyph;
}.call(r261_xn$createglyph$7Hrq('.WF.gen/build-glyphs.ptl.3', r1_xn$donothing$2Lrc0b)));
(function _r261_t22() {
var _r298_t0 = this;
var r298_currentGlyph = _r298_t0;
if (!r298_currentGlyph)
return void 0;
if (r261_glyphList[r261_glyphList.length - 1].name === '.WF.gen/build-glyphs.ptl.4')
r261_glyphList.pop();
var r298_df = r261_DivFrame(r261_para.diversityF);
r298_currentGlyph['set-width'](r298_df.width);
r298_currentGlyph.include(r298_df.markSet.e);
r261_xn$save$2Lrc5.call(r298_currentGlyph, 'space', ' ');
r261_dependencyProfile[r298_currentGlyph.name] = r261_getDependencyProfile(r298_currentGlyph);
return r298_currentGlyph;
}.call(r261_xn$createglyph$7Hrq('.WF.gen/build-glyphs.ptl.4', r1_xn$donothing$2Lrc0b)));
var r261_capture = {
'metrics': Object.create(r261_metrics),
'$NamedParameterPair$': r1_xn$NamedParameterPair$2Lrc9b,
'$donothing$': r1_xn$donothing$2Lrc0b,
'para': r261_para,
'recursive': r261_recursive,
'recursiveCodes': r261_recursiveCodes,
'variantSelector': r261_variantSelector,
'font': r261_font,
'glyphs': r261_glyphs,
'glyphList': r261_glyphList,
'unicodeGlyphs': r261_unicodeGlyphs,
'create-glyph': r261_xn$createglyph$7Hrq,
'$save$': r261_xn$save$2Lrc5,
'save-glyph': r261_xn$saveglyph$5sIl,
'spirofns': r261_spirofns,
'markset': r261_markset,
'MARK': r261_MARK,
'BASE': r261_BASE,
'AS_BASE': r261_AS_BASE,
'ALSO_METRICS': r261_ALSO_METRICS,
'pickHash': r261_pickHash,
'dependencyProfile': r261_dependencyProfile,
'getDependencyProfile': r261_getDependencyProfile,
'buildFont': r1_buildFont,
'newtemp': r261_newtemp,
'tagged': r1_tagged,
'TempFont': r1_TempFont,
'includeGlyphPart': r1_includeGlyphPart,
'compsiteMarkSet': r1_compsiteMarkSet,
'MarksetDiv': r261_MarksetDiv,
'DivFrame': r261_DivFrame
};
r261_capture.commonShapes = require('../glyphs/common-shapes.js').apply.call(r261_capture);
r261_capture.overmarks = require('../glyphs/overmarks.js').apply.call(r261_capture);
r261_capture.letterBasic = require('../glyphs/letters-unified-basic.js').apply.call(r261_capture);
r261_capture.letterExt = require('../glyphs/letters-unified-extended.js').apply.call(r261_capture);
require('../glyphs/numbers.js').apply.call(r261_capture);
require('../glyphs/symbol-punctuation.js').apply.call(r261_capture);
r261_capture.geometricSymbols = require('../glyphs/symbol-geometric.js').apply.call(r261_capture);
require('../glyphs/symbol-math.js').apply.call(r261_capture);
require('../glyphs/symbol-letter.js').apply.call(r261_capture);
require('../glyphs/symbol-braille.js').apply.call(r261_capture);
require('../glyphs/symbol-mosaic.js').apply.call(r261_capture);
require('../glyphs/symbol-other.js').apply.call(r261_capture);
require('../glyphs/autobuilds.js').apply.call(r261_capture);
if (!r261_recursive) {
_r261_t4 = r1_Features.apply(r261_para, r261_glyphs, r261_glyphList, r261_unicodeGlyphs);
r261_font.GSUB = _r261_t4.GSUB;
r261_font.GPOS = _r261_t4.GPOS;
r261_font.GDEF = _r261_t4.GDEF;
}
r261_font.glyfMap = r261_glyphs;
return r261_font;
};

View file

@ -3,97 +3,23 @@
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
// let TTFWriter = require('node-sfnt').TTFWriter;
const argv = require("yargs").argv; const argv = require("yargs").argv;
const buildGlyphs = require("./buildglyphs.js"); const buildGlyphs = require("./build-glyphs.js");
const parameters = require("../support/parameters"); const parameters = require("../support/parameters");
const formVariantData = require("../support/variant-data");
const regulateGlyphs = require("../support/regulate-glyph");
const toml = require("toml"); const toml = require("toml");
const Glyph = require("../support/glyph"); function objHashNonEmpty(obj) {
const autoref = require("../support/autoref");
const objectAssign = require("object-assign");
const caryllShapeOps = require("caryll-shapeops");
const c2q = require("megaminx").geometry.c2q;
function hasv(obj) {
if (!obj) return false; if (!obj) return false;
for (let k in obj) if (obj[k]) return true; for (let k in obj) if (obj[k]) return true;
return false; return false;
} }
function mergeVSHive(_target, source) {
if (!source) return _target;
let __cvmap = objectAssign({}, _target.__cvmap, source.__cvmap);
let target = objectAssign(_target, source);
target.__cvmap = __cvmap;
return target;
}
function produceComposite(vs, para, dflt, g) {
let sel = objectAssign({}, dflt);
if (g.design)
for (let h of g.design) {
sel = mergeVSHive(sel, vs[h]);
}
if (!para.isItalic && g.upright) {
for (let h of g.upright) {
sel = mergeVSHive(sel, vs[h]);
}
}
if (para.isItalic && g.italic) {
for (let h of g.italic) {
sel = mergeVSHive(sel, vs[h]);
}
}
sel.__isComposite = true;
return sel;
}
function formVariantData(data, para) {
const vs = {};
// simple selector
for (let k in data.simple) {
const hive = objectAssign({}, data.simple[k]);
const tag = hive.tag;
delete hive.tag;
if (tag) {
let __cvmap = {};
for (let k in hive) __cvmap[k] = tag;
hive.__cvmap = __cvmap;
}
vs[k] = hive;
if (tag) vs[tag] = hive;
}
// default selector
vs.default = produceComposite(vs, para, {}, data.default);
// ss## selector
for (let k in data.composite) {
vs[k] = produceComposite(vs, para, vs.default, data.composite[k]);
}
return vs;
}
function byGlyphPriority(a, b) {
const pri1 = a.cmpPriority || 0;
const pri2 = b.cmpPriority || 0;
if (pri1 > pri2) return -1;
if (pri1 < pri2) return 1;
if (a.contours && b.contours && a.contours.length < b.contours.length) return 1;
if (a.contours && b.contours && a.contours.length > b.contours.length) return -1;
if (a.advanceWidth < b.advanceWidth) return -1;
if (a.advanceWidth > b.advanceWidth) return 1;
if ((a.unicode && a.unicode[0] && !b.unicode) || !b.unicode[0]) return -1;
if ((b.unicode && b.unicode[0] && !a.unicode) || !a.unicode[0]) return +1;
if (a.unicode && a.unicode[0] && b.unicode && b.unicode[0] && a.unicode[0] < b.unicode[0])
return -1;
if (a.unicode && a.unicode[0] && b.unicode && b.unicode[0] && a.unicode[0] > b.unicode[0])
return +1;
return a.name < b.name ? -1 : a.name > b.name ? 1 : 0;
}
const PARAMETERS_TOML = path.resolve(__dirname, "../parameters.toml"); const PARAMETERS_TOML = path.resolve(__dirname, "../parameters.toml");
const PRIVATE_TOML = path.resolve(__dirname, "../private.toml"); const PRIVATE_TOML = path.resolve(__dirname, "../private.toml");
const VARIANTS_TOML = path.resolve(__dirname, "../variants.toml"); const VARIANTS_TOML = path.resolve(__dirname, "../variants.toml");
const EMPTYFONT_TOML = path.resolve(__dirname, "../emptyfont.toml"); const EMPTY_FONT_TOML = path.resolve(__dirname, "../empty-font.toml");
function getParameters(argv) { function getParameters(argv) {
const parametersData = Object.assign( const parametersData = Object.assign(
@ -121,17 +47,10 @@ function getParameters(argv) {
// Font building // Font building
const font = (function() { const font = (function() {
const emptyFont = toml.parse(fs.readFileSync(EMPTYFONT_TOML, "utf-8")); const emptyFont = toml.parse(fs.readFileSync(EMPTY_FONT_TOML, "utf-8"));
const para = getParameters(argv); const para = getParameters(argv);
const font = buildGlyphs.build.call(emptyFont, para); const font = buildGlyphs.build.call(emptyFont, para);
font.parameters = para; font.parameters = para;
font.glyf = font.glyf
.map(function(g, j) {
g.gord = j;
return g;
})
.sort(byGlyphPriority);
return font; return font;
})(); })();
@ -141,82 +60,34 @@ if (argv.charmap) {
return [ return [
glyph.name, glyph.name,
glyph.unicode, glyph.unicode,
glyph.advanceWidth === 0 ? (hasv(glyph.anchors) ? 1 : isSpace ? 2 : 0) : 0 glyph.advanceWidth === 0 ? (objHashNonEmpty(glyph.anchors) ? 1 : isSpace ? 2 : 0) : 0
]; ];
}); });
fs.writeFileSync(argv.charmap, JSON.stringify(charmap), "utf8"); fs.writeFileSync(argv.charmap, JSON.stringify(charmap), "utf8");
} }
function regulateGlyph(g, skew) {
if (!g.contours) return;
// Regulate
for (let k = 0; k < g.contours.length; k++) {
const contour = g.contours[k];
for (let p = 0; p < contour.length; p++) {
contour[p].x += contour[p].y * skew;
if (!contour[p].on) continue;
contour[p].x = Math.round(contour[p].x);
}
let offJ = null,
mx = null;
for (let p = 0; p < contour.length; p++) {
if (!contour[p].on) continue;
if (offJ) {
const origx = contour[p].x;
const rx = Math.round(contour[p].x * 4) / 4;
const origx0 = mx;
const rx0 = contour[offJ - 1].x;
if (origx === origx0) continue;
for (let poff = offJ; poff < p; poff++) {
contour[poff].x =
((contour[poff].x - origx0) / (origx - origx0)) * (rx - rx0) + rx0;
}
}
mx = contour[p].x;
contour[p].x = Math.round(contour[p].x * 4) / 4;
offJ = p + 1;
}
}
const c1 = [];
for (let k = 0; k < g.contours.length; k++) {
c1.push(Glyph.contourToStandardCubic(g.contours[k]));
}
// De-overlap
g.contours = caryllShapeOps.removeOverlap(c1, 1, 256, true);
// Finalize
g.contours = c2q.contours(g.contours);
for (let k = 0; k < g.contours.length; k++) {
const contour = g.contours[k];
for (let p = 0; p < contour.length; p++) {
contour[p].x -= contour[p].y * skew;
}
}
}
if (argv.o) { if (argv.o) {
const skew = const skew = Math.tan(((font.post.italicAngle || 0) / 180) * Math.PI);
(argv.uprightify ? 1 : 0) * Math.tan(((font.post.italicAngle || 0) / 180) * Math.PI);
const excludeUnicodes = new Set();
excludeUnicodes.add(0x80);
for (let c = 0x2500; c <= 0x259f; c++) excludeUnicodes.add(c);
// autoref
autoref(font.glyf, excludeUnicodes);
// regulate
for (let g of font.glyf) regulateGlyph(g, skew);
// reorder regulateGlyphs(font, skew);
font.glyf = font.glyf.sort((a, b) => a.gord - b.gord);
// finalize // finalize
const excludedCodePoints = new Set();
if (font.parameters.excludedCodePointRanges) {
for (const [start, end] of font.parameters.excludedCodePointRanges) {
for (let p = start; p <= end; p++) excludedCodePoints.add(p);
}
}
const o_glyf = {}; const o_glyf = {};
const o_cmap = {}; const o_cmap = {};
for (let g of font.glyf) { for (let g of font.glyf) {
o_glyf[g.name] = g; o_glyf[g.name] = g;
if (!g.unicode) continue; if (!g.unicode) continue;
for (let u of g.unicode) o_cmap[u] = g.name; for (let u of g.unicode) {
if (!excludedCodePoints.has(u - 0)) o_cmap[u] = g.name;
}
} }
// Prepare OTD // Prepare OTD

View file

@ -8,10 +8,18 @@ import [designParameters] from '../meta/aesthetics'
export : define [apply] : begin export : define [apply] : begin
glyph-module-entry commonShapes overmarks glyph-module-entry commonShapes overmarks
define WidthKinds {{'.hwid' WIDTH}}
if (para.spacing > 0) : WidthKinds.push {'.fwid' FULLWIDTH0}
local exportArrowShape nothing
### Arrowheads ### Arrowheads
define {ArrowShape} : do 'Arrows' foreach {suffix MosaicWidth} [items-of WidthKinds] : do 'Arrows'
define [MangleUnicode unicode] : if (MosaicWidth == FULLWIDTH2) unicode nothing
define [MangleName name] : name + suffix
define arrowHeight : operTop - operBot define arrowHeight : operTop - operBot
define arrowWidth : Math.min FULLWIDTH2 arrowHeight define arrowWidth : Math.min MosaicWidth arrowHeight
define arrowMidX : arrowWidth / 2 define arrowMidX : arrowWidth / 2
define arrowSB : SB / 2 define arrowSB : SB / 2
define arrowRSB : arrowWidth - arrowSB define arrowRSB : arrowWidth - arrowSB
@ -213,149 +221,144 @@ export : define [apply] : begin
include : bar x1 y1 x2 y2 include : bar x1 y1 x2 y2
save id unicode save id unicode
arrow ArrowShape 'arrowleft' 0x2190 arrowRSB symbolMid arrowSB symbolMid arrow ArrowShape [MangleName 'arrowleft'] [MangleUnicode 0x2190] arrowRSB symbolMid arrowSB symbolMid
arrow ArrowShape 'arrowup' 0x2191 arrowMidX arrowBot arrowMidX arrowTop arrow ArrowShape [MangleName 'arrowup'] [MangleUnicode 0x2191] arrowMidX arrowBot arrowMidX arrowTop
arrow ArrowShape 'arrowright' 0x2192 arrowSB symbolMid arrowRSB symbolMid arrow ArrowShape [MangleName 'arrowright'] [MangleUnicode 0x2192] arrowSB symbolMid arrowRSB symbolMid
arrow ArrowShape 'arrowdown' 0x2193 arrowMidX arrowTop arrowMidX arrowBot arrow ArrowShape [MangleName 'arrowdown'] [MangleUnicode 0x2193] arrowMidX arrowTop arrowMidX arrowBot
arrow DashArrowShape 'dasharrowleft' 0x21E0 arrowRSB symbolMid arrowSB symbolMid arrow DashArrowShape [MangleName 'dasharrowleft'] [MangleUnicode 0x21E0] arrowRSB symbolMid arrowSB symbolMid
arrow DashArrowShape 'dasharrowup' 0x21E1 arrowMidX arrowBot arrowMidX arrowTop arrow DashArrowShape [MangleName 'dasharrowup'] [MangleUnicode 0x21E1] arrowMidX arrowBot arrowMidX arrowTop
arrow DashArrowShape 'dasharrowright' 0x21E2 arrowSB symbolMid arrowRSB symbolMid arrow DashArrowShape [MangleName 'dasharrowright'] [MangleUnicode 0x21E2] arrowSB symbolMid arrowRSB symbolMid
arrow DashArrowShape 'dasharrowdown' 0x21E3 arrowMidX arrowTop arrowMidX arrowBot arrow DashArrowShape [MangleName 'dasharrowdown'] [MangleUnicode 0x21E3] arrowMidX arrowTop arrowMidX arrowBot
arrow [HookArrowShape 1] 'hookarrowleft' 0x21A9 arrowRSB symbolMid arrowSB symbolMid arrow [HookArrowShape 1] [MangleName 'hookarrowleft'] [MangleUnicode 0x21A9] arrowRSB symbolMid arrowSB symbolMid
arrow [HookArrowShape (-1)] 'hookarrowright' 0x21AA arrowSB symbolMid arrowRSB symbolMid arrow [HookArrowShape (-1)] [MangleName 'hookarrowright'] [MangleUnicode 0x21AA] arrowSB symbolMid arrowRSB symbolMid
arrow [HookArrowShape (-1)] 'hookarrowupleft' 0x2923 arrowRSB arrowBot arrowSB arrowTop arrow [HookArrowShape (-1)] [MangleName 'hookarrowupleft'] [MangleUnicode 0x2923] arrowRSB arrowBot arrowSB arrowTop
arrow [HookArrowShape 1] 'hookarrowupright' 0x2924 arrowSB arrowBot arrowRSB arrowTop arrow [HookArrowShape 1] [MangleName 'hookarrowupright'] [MangleUnicode 0x2924] arrowSB arrowBot arrowRSB arrowTop
arrow [HookArrowShape (-1)] 'hookarrowdownright' 0x2925 arrowSB arrowTop arrowRSB arrowBot arrow [HookArrowShape (-1)] [MangleName 'hookarrowdownright'] [MangleUnicode 0x2925] arrowSB arrowTop arrowRSB arrowBot
arrow [HookArrowShape 1] 'hookarrowdownleft' 0x2926 arrowRSB arrowTop arrowSB arrowBot arrow [HookArrowShape 1] [MangleName 'hookarrowdownleft'] [MangleUnicode 0x2926] arrowRSB arrowTop arrowSB arrowBot
anglearrow ArrowShape [lambda [x1 y1 x2 y2] : VBarLeft x1 y1 y2] 'arrow-up-angle-right' 0x21b1 arrowSB arrowBot arrowSB (arrowTop - arrowSize) arrowRSB (arrowTop - arrowSize) anglearrow ArrowShape [lambda [x1 y1 x2 y2] : VBarLeft x1 y1 y2] [MangleName 'arrow-up-angle-right'] [MangleUnicode 0x21b1] arrowSB arrowBot arrowSB (arrowTop - arrowSize) arrowRSB (arrowTop - arrowSize)
anglearrow ArrowShape [lambda [x1 y1 x2 y2] : VBarRight x1 y1 y2] 'arrow-up-angle-left' 0x21b0 arrowRSB arrowBot arrowRSB (arrowTop - arrowSize) arrowSB (arrowTop - arrowSize) anglearrow ArrowShape [lambda [x1 y1 x2 y2] : VBarRight x1 y1 y2] [MangleName 'arrow-up-angle-left'] [MangleUnicode 0x21b0] arrowRSB arrowBot arrowRSB (arrowTop - arrowSize) arrowSB (arrowTop - arrowSize)
anglearrow ArrowShape [lambda [x1 y1 x2 y2] : VBarLeft x1 y1 y2] 'arrow-down-angle-right' 0x21b3 arrowSB arrowTop arrowSB (arrowBot + arrowSize) arrowRSB (arrowBot + arrowSize) anglearrow ArrowShape [lambda [x1 y1 x2 y2] : VBarLeft x1 y1 y2] [MangleName 'arrow-down-angle-right'] [MangleUnicode 0x21b3] arrowSB arrowTop arrowSB (arrowBot + arrowSize) arrowRSB (arrowBot + arrowSize)
anglearrow ArrowShape [lambda [x1 y1 x2 y2] : VBarRight x1 y1 y2] 'arrow-down-angle-left' 0x21b2 arrowRSB arrowTop arrowRSB (arrowBot + arrowSize) arrowSB (arrowBot + arrowSize) anglearrow ArrowShape [lambda [x1 y1 x2 y2] : VBarRight x1 y1 y2] [MangleName 'arrow-down-angle-left'] [MangleUnicode 0x21b2] arrowRSB arrowTop arrowRSB (arrowBot + arrowSize) arrowSB (arrowBot + arrowSize)
arrow ArrowShape 'hwarrowleft' null hwArrowRSB symbolMid arrowSB symbolMid WIDTH arrow ArrowShape [MangleName 'arrowupleft'] [MangleUnicode 0x2196] arrowRSB arrowBot arrowSB arrowTop
arrow ArrowShape 'hwarrowright' null arrowSB symbolMid hwArrowRSB symbolMid WIDTH arrow ArrowShape [MangleName 'arrowupright'] [MangleUnicode 0x2197] arrowSB arrowBot arrowRSB arrowTop
arrow ArrowShape 'hwarrowup' null hwArrowMidX arrowBot hwArrowMidX arrowTop WIDTH arrow ArrowShape [MangleName 'arrowdownright'] [MangleUnicode 0x2198] arrowSB arrowTop arrowRSB arrowBot
arrow ArrowShape 'hwarrowdown' null hwArrowMidX arrowTop hwArrowMidX arrowBot WIDTH arrow ArrowShape [MangleName 'arrowdownleft'] [MangleUnicode 0x2199] arrowRSB arrowTop arrowSB arrowBot
arrow ArrowShape 'arrowupleft' 0x2196 arrowRSB arrowBot arrowSB arrowTop
arrow ArrowShape 'arrowupright' 0x2197 arrowSB arrowBot arrowRSB arrowTop
arrow ArrowShape 'arrowdownright' 0x2198 arrowSB arrowTop arrowRSB arrowBot
arrow ArrowShape 'arrowdownleft' 0x2199 arrowRSB arrowTop arrowSB arrowBot
arrow [HalfArrowShape RHSHalfArrowHead] 'arrowleftHR' 0x21BC arrowRSB symbolMid arrowSB symbolMid arrow [HalfArrowShape RHSHalfArrowHead] [MangleName 'arrowleftHR'] [MangleUnicode 0x21BC] arrowRSB symbolMid arrowSB symbolMid
arrow [HalfArrowShape LHSHalfArrowHead] 'arrowleftHL' 0x21BD arrowRSB symbolMid arrowSB symbolMid arrow [HalfArrowShape LHSHalfArrowHead] [MangleName 'arrowleftHL'] [MangleUnicode 0x21BD] arrowRSB symbolMid arrowSB symbolMid
arrow [HalfArrowShape RHSHalfArrowHead] 'arrowupHR' 0x21BE arrowMidX arrowBot arrowMidX arrowTop arrow [HalfArrowShape RHSHalfArrowHead] [MangleName 'arrowupHR'] [MangleUnicode 0x21BE] arrowMidX arrowBot arrowMidX arrowTop
arrow [HalfArrowShape LHSHalfArrowHead] 'arrowupHL' 0x21BF arrowMidX arrowBot arrowMidX arrowTop arrow [HalfArrowShape LHSHalfArrowHead] [MangleName 'arrowupHL'] [MangleUnicode 0x21BF] arrowMidX arrowBot arrowMidX arrowTop
arrow [HalfArrowShape LHSHalfArrowHead] 'arrowrightHL' 0x21C0 arrowSB symbolMid arrowRSB symbolMid arrow [HalfArrowShape LHSHalfArrowHead] [MangleName 'arrowrightHL'] [MangleUnicode 0x21C0] arrowSB symbolMid arrowRSB symbolMid
arrow [HalfArrowShape RHSHalfArrowHead] 'arrowrightHR' 0x21C1 arrowSB symbolMid arrowRSB symbolMid arrow [HalfArrowShape RHSHalfArrowHead] [MangleName 'arrowrightHR'] [MangleUnicode 0x21C1] arrowSB symbolMid arrowRSB symbolMid
arrow [HalfArrowShape LHSHalfArrowHead] 'arrowdownHL' 0x21C2 arrowMidX arrowTop arrowMidX arrowBot arrow [HalfArrowShape LHSHalfArrowHead] [MangleName 'arrowdownHL'] [MangleUnicode 0x21C2] arrowMidX arrowTop arrowMidX arrowBot
arrow [HalfArrowShape RHSHalfArrowHead] 'arrowdownHR' 0x21C3 arrowMidX arrowTop arrowMidX arrowBot arrow [HalfArrowShape RHSHalfArrowHead] [MangleName 'arrowdownHR'] [MangleUnicode 0x21C3] arrowMidX arrowTop arrowMidX arrowBot
arrow [ThickArrowShape 'white'] null 0x21E6 arrowRSB symbolMid arrowSB symbolMid arrow [ThickArrowShape 'white'] [MangleName 'uni21E6'] [MangleUnicode 0x21E6] arrowRSB symbolMid arrowSB symbolMid
arrow [ThickArrowShape 'white'] null 0x21E7 arrowMidX arrowBot arrowMidX arrowTop arrow [ThickArrowShape 'white'] [MangleName 'uni21E7'] [MangleUnicode 0x21E7] arrowMidX arrowBot arrowMidX arrowTop
arrow [ThickArrowShape 'white'] null 0x21E8 arrowSB symbolMid arrowRSB symbolMid arrow [ThickArrowShape 'white'] [MangleName 'uni21E8'] [MangleUnicode 0x21E8] arrowSB symbolMid arrowRSB symbolMid
arrow [ThickArrowShape 'white'] null 0x21E9 arrowMidX arrowTop arrowMidX arrowBot arrow [ThickArrowShape 'white'] [MangleName 'uni21E9'] [MangleUnicode 0x21E9] arrowMidX arrowTop arrowMidX arrowBot
arrow [ThickArrowShape 'white'] null 0x2B00 arrowSB arrowBot arrowRSB arrowTop arrow [ThickArrowShape 'white'] [MangleName 'uni2B00'] [MangleUnicode 0x2B00] arrowSB arrowBot arrowRSB arrowTop
arrow [ThickArrowShape 'white'] null 0x2B01 arrowRSB arrowBot arrowSB arrowTop arrow [ThickArrowShape 'white'] [MangleName 'uni2B01'] [MangleUnicode 0x2B01] arrowRSB arrowBot arrowSB arrowTop
arrow [ThickArrowShape 'white'] null 0x2B02 arrowSB arrowTop arrowRSB arrowBot arrow [ThickArrowShape 'white'] [MangleName 'uni2B02'] [MangleUnicode 0x2B02] arrowSB arrowTop arrowRSB arrowBot
arrow [ThickArrowShape 'white'] null 0x2B03 arrowRSB arrowTop arrowSB arrowBot arrow [ThickArrowShape 'white'] [MangleName 'uni2B03'] [MangleUnicode 0x2B03] arrowRSB arrowTop arrowSB arrowBot
arrow [ThickArrowShape 'black'] null 0x2B05 arrowRSB symbolMid arrowSB symbolMid arrow [ThickArrowShape 'black'] [MangleName 'uni2B05'] [MangleUnicode 0x2B05] arrowRSB symbolMid arrowSB symbolMid
arrow [ThickArrowShape 'black'] null 0x2B06 arrowMidX arrowBot arrowMidX arrowTop arrow [ThickArrowShape 'black'] [MangleName 'uni2B06'] [MangleUnicode 0x2B06] arrowMidX arrowBot arrowMidX arrowTop
arrow [ThickArrowShape 'black'] null 0x27A1 arrowSB symbolMid arrowRSB symbolMid arrow [ThickArrowShape 'black'] [MangleName 'uni27A1'] [MangleUnicode 0x27A1] arrowSB symbolMid arrowRSB symbolMid
arrow [ThickArrowShape 'black'] null 0x2B07 arrowMidX arrowTop arrowMidX arrowBot arrow [ThickArrowShape 'black'] [MangleName 'uni2B07'] [MangleUnicode 0x2B07] arrowMidX arrowTop arrowMidX arrowBot
arrow [ThickArrowShape 'black'] null 0x2B08 arrowSB arrowBot arrowRSB arrowTop arrow [ThickArrowShape 'black'] [MangleName 'uni2B08'] [MangleUnicode 0x2B08] arrowSB arrowBot arrowRSB arrowTop
arrow [ThickArrowShape 'black'] null 0x2B09 arrowRSB arrowBot arrowSB arrowTop arrow [ThickArrowShape 'black'] [MangleName 'uni2B09'] [MangleUnicode 0x2B09] arrowRSB arrowBot arrowSB arrowTop
arrow [ThickArrowShape 'black'] null 0x2B0A arrowSB arrowTop arrowRSB arrowBot arrow [ThickArrowShape 'black'] [MangleName 'uni2B0A'] [MangleUnicode 0x2B0A] arrowSB arrowTop arrowRSB arrowBot
arrow [ThickArrowShape 'black'] null 0x2B0B arrowRSB arrowTop arrowSB arrowBot arrow [ThickArrowShape 'black'] [MangleName 'uni2B0B'] [MangleUnicode 0x2B0B] arrowRSB arrowTop arrowSB arrowBot
arrow ArrowShape 'arrowleftK' null arrowRSB symbolMid (arrowSB + fine) symbolMid arrow ArrowShape [MangleName 'arrowleftK'] null arrowRSB symbolMid (arrowSB + fine) symbolMid
arrow ArrowShape 'arrowrightK' null arrowSB symbolMid (arrowRSB - fine) symbolMid arrow ArrowShape [MangleName 'arrowrightK'] null arrowSB symbolMid (arrowRSB - fine) symbolMid
arrow ArrowShape 'arrowupK' null arrowMidX arrowBot arrowMidX (arrowTop - fine) arrow ArrowShape [MangleName 'arrowupK'] null arrowMidX arrowBot arrowMidX (arrowTop - fine)
arrow ArrowShape 'arrowdownK' null arrowMidX arrowTop arrowMidX (arrowBot + fine) arrow ArrowShape [MangleName 'arrowdownK'] null arrowMidX arrowTop arrowMidX (arrowBot + fine)
arrow ArrowShape 'arrowleftSK' null (arrowRSB - fine / 2) symbolMid arrowSB symbolMid arrow ArrowShape [MangleName 'arrowleftSK'] null (arrowRSB - fine / 2) symbolMid arrowSB symbolMid
arrow ArrowShape 'arrowrightSK' null (arrowSB + fine / 2) symbolMid arrowRSB symbolMid arrow ArrowShape [MangleName 'arrowrightSK'] null (arrowSB + fine / 2) symbolMid arrowRSB symbolMid
arrow ArrowShape 'arrowupSK' null arrowMidX (arrowBot + fine / 2) arrowMidX arrowTop arrow ArrowShape [MangleName 'arrowupSK'] null arrowMidX (arrowBot + fine / 2) arrowMidX arrowTop
arrow ArrowShape 'arrowdownSK' null arrowMidX (arrowTop - fine / 2) arrowMidX arrowBot arrow ArrowShape [MangleName 'arrowdownSK'] null arrowMidX (arrowTop - fine / 2) arrowMidX arrowBot
arrow ArrowShape 'arrowupleftTK' null arrowRSB arrowBot arrowSB (arrowTop - [Math.max (arrowWidth / 8) (fine * 1.5)]) arrow ArrowShape [MangleName 'arrowupleftTK'] null arrowRSB arrowBot arrowSB (arrowTop - [Math.max (arrowWidth / 8) (fine * 1.5)])
composite 'arrowbarleft' glyphs.arrowleftK [VBar arrowSB (symbolMid - arrowSize) (symbolMid + arrowSize) fine] [into-unicode 0x21E4] composite [MangleName 'arrowbarleft'] glyphs.[MangleName 'arrowleftK'] [VBar arrowSB (symbolMid - arrowSize) (symbolMid + arrowSize) fine] [into-unicode : MangleUnicode 0x21E4]
composite 'arrowbarright' glyphs.arrowrightK [VBar arrowRSB (symbolMid - arrowSize) (symbolMid + arrowSize) fine] [into-unicode 0x21E5] composite [MangleName 'arrowbarright'] glyphs.[MangleName 'arrowrightK'] [VBar arrowRSB (symbolMid - arrowSize) (symbolMid + arrowSize) fine] [into-unicode : MangleUnicode 0x21E5]
composite 'arrowbarup' glyphs.arrowupK [HBar (arrowMidX - arrowSize) (arrowMidX + arrowSize) arrowTop fine] [into-unicode 0x2912] composite [MangleName 'arrowbarup'] glyphs.[MangleName 'arrowupK'] [HBar (arrowMidX - arrowSize) (arrowMidX + arrowSize) arrowTop fine] [into-unicode : MangleUnicode 0x2912]
composite 'arrowbardown' glyphs.arrowdownK [HBar (arrowMidX - arrowSize) (arrowMidX + arrowSize) arrowBot fine] [into-unicode 0x2913] composite [MangleName 'arrowbardown'] glyphs.[MangleName 'arrowdownK'] [HBar (arrowMidX - arrowSize) (arrowMidX + arrowSize) arrowBot fine] [into-unicode : MangleUnicode 0x2913]
composite 'bararrowleft' glyphs.arrowleftSK [VBar arrowRSB (symbolMid - arrowSize) (symbolMid + arrowSize) fine] [into-unicode 0x21A4] composite [MangleName 'bararrowleft'] glyphs.[MangleName 'arrowleftSK'] [VBar arrowRSB (symbolMid - arrowSize) (symbolMid + arrowSize) fine] [into-unicode : MangleUnicode 0x21A4]
composite 'bararrowright' glyphs.arrowrightSK [VBar arrowSB (symbolMid - arrowSize) (symbolMid + arrowSize) fine] [into-unicode 0x21A6] composite [MangleName 'bararrowright'] glyphs.[MangleName 'arrowrightSK'] [VBar arrowSB (symbolMid - arrowSize) (symbolMid + arrowSize) fine] [into-unicode : MangleUnicode 0x21A6]
composite 'bararrowup' glyphs.arrowupSK [HBar (arrowMidX - arrowSize) (arrowMidX + arrowSize) arrowBot fine] [into-unicode 0x21A5] composite [MangleName 'bararrowup'] glyphs.[MangleName 'arrowupSK'] [HBar (arrowMidX - arrowSize) (arrowMidX + arrowSize) arrowBot fine] [into-unicode : MangleUnicode 0x21A5]
composite 'bararrowdown' glyphs.arrowdownSK [HBar (arrowMidX - arrowSize) (arrowMidX + arrowSize) arrowTop fine] [into-unicode 0x21A7] composite [MangleName 'bararrowdown'] glyphs.[MangleName 'arrowdownSK'] [HBar (arrowMidX - arrowSize) (arrowMidX + arrowSize) arrowTop fine] [into-unicode : MangleUnicode 0x21A7]
composite glyphs.arrowupleftTK [HBar (arrowSB - arrowSize / 2) (arrowRSB + arrowSize / 2) arrowTop fine] [into-unicode 0x21B8] composite [MangleName 'uni21B8'] glyphs.[MangleName 'arrowupleftTK'] [HBar (arrowSB - arrowSize / 2) (arrowRSB + arrowSize / 2) arrowTop fine] [into-unicode : MangleUnicode 0x21B8]
let [dasw doubleArrowStemWidth] : do let [dasw doubleArrowStemWidth] : do
arrow [DoubleArrowShape dasw] 'dblarrowleft' 0x21D0 arrowRSB symbolMid arrowSB symbolMid arrow [DoubleArrowShape dasw] [MangleName 'dblarrowleft'] [MangleUnicode 0x21D0] arrowRSB symbolMid arrowSB symbolMid
arrow [DoubleArrowShape dasw] 'dblarrowright' 0x21D2 arrowSB symbolMid arrowRSB symbolMid arrow [DoubleArrowShape dasw] [MangleName 'dblarrowright'] [MangleUnicode 0x21D2] arrowSB symbolMid arrowRSB symbolMid
arrow [DoubleArrowShape dasw] 'dblarrowup' 0x21D1 arrowMidX arrowBot arrowMidX arrowTop arrow [DoubleArrowShape dasw] [MangleName 'dblarrowup'] [MangleUnicode 0x21D1] arrowMidX arrowBot arrowMidX arrowTop
arrow [DoubleArrowShape dasw] 'dblarrowdown' 0x21D3 arrowMidX arrowTop arrowMidX arrowBot arrow [DoubleArrowShape dasw] [MangleName 'dblarrowdown'] [MangleUnicode 0x21D3] arrowMidX arrowTop arrowMidX arrowBot
arrow [DoubleArrowShape dasw] 'dblhwarrowleft' null hwArrowRSB symbolMid arrowSB symbolMid WIDTH arrow [DoubleArrowShape dasw] [MangleName 'dblarrowupleft'] [MangleUnicode 0x21D6] arrowRSB arrowBot arrowSB arrowTop
arrow [DoubleArrowShape dasw] 'dblhwarrowright' null arrowSB symbolMid hwArrowRSB symbolMid WIDTH arrow [DoubleArrowShape dasw] [MangleName 'dblarrowupright'] [MangleUnicode 0x21D7] arrowSB arrowBot arrowRSB arrowTop
arrow [DoubleArrowShape dasw] 'dblhwarrowup' null hwArrowMidX arrowBot hwArrowMidX arrowTop WIDTH arrow [DoubleArrowShape dasw] [MangleName 'dblarrowdownright'] [MangleUnicode 0x21D8] arrowSB arrowTop arrowRSB arrowBot
arrow [DoubleArrowShape dasw] 'dblhwarrowdown' null hwArrowMidX arrowTop hwArrowMidX arrowBot WIDTH arrow [DoubleArrowShape dasw] [MangleName 'dblarrowdownleft'] [MangleUnicode 0x21D9] arrowRSB arrowTop arrowSB arrowBot
arrow [DoubleArrowShape dasw] 'dblarrowupleft' 0x21D6 arrowRSB arrowBot arrowSB arrowTop
arrow [DoubleArrowShape dasw] 'dblarrowupright' 0x21D7 arrowSB arrowBot arrowRSB arrowTop
arrow [DoubleArrowShape dasw] 'dblarrowdownright' 0x21D8 arrowSB arrowTop arrowRSB arrowBot
arrow [DoubleArrowShape dasw] 'dblarrowdownleft' 0x21D9 arrowRSB arrowTop arrowSB arrowBot
doublearrow ArrowShape 'arrowleftright' 0x2194 arrowSB symbolMid arrowRSB symbolMid doublearrow ArrowShape [MangleName 'arrowleftright'] [MangleUnicode 0x2194] arrowSB symbolMid arrowRSB symbolMid
doublearrow ArrowShape 'arrowupdown' 0x2195 arrowMidX arrowTop arrowMidX arrowBot doublearrow ArrowShape [MangleName 'arrowupdown'] [MangleUnicode 0x2195] arrowMidX arrowTop arrowMidX arrowBot
doublearrow ArrowShape 'arrowupleftdownright' 0x2921 arrowSB arrowTop arrowRSB arrowBot doublearrow ArrowShape [MangleName 'arrowupleftdownright'] [MangleUnicode 0x2921] arrowSB arrowTop arrowRSB arrowBot
doublearrow ArrowShape 'arrowuprightdownleft' 0x2922 arrowRSB arrowTop arrowSB arrowBot doublearrow ArrowShape [MangleName 'arrowuprightdownleft'] [MangleUnicode 0x2922] arrowRSB arrowTop arrowSB arrowBot
let [dasw doubleArrowStemWidth] : do let [dasw doubleArrowStemWidth] : do
doublearrow [DoubleArrowShape dasw] 'dblarrowleftright' 0x21D4 arrowSB symbolMid arrowRSB symbolMid doublearrow [DoubleArrowShape dasw] [MangleName 'dblarrowleftright'] [MangleUnicode 0x21D4] arrowSB symbolMid arrowRSB symbolMid
doublearrow [DoubleArrowShape dasw] 'dblarrowupdown' 0x21D5 arrowMidX arrowTop arrowMidX arrowBot doublearrow [DoubleArrowShape dasw] [MangleName 'dblarrowupdown'] [MangleUnicode 0x21D5] arrowMidX arrowTop arrowMidX arrowBot
arrow dhArrowShape 'dharrowleft' 0x219E arrowRSB symbolMid arrowSB symbolMid arrow dhArrowShape [MangleName 'dharrowleft'] [MangleUnicode 0x219E] arrowRSB symbolMid arrowSB symbolMid
arrow dhArrowShape 'dharrowright' 0x21A0 arrowSB symbolMid arrowRSB symbolMid arrow dhArrowShape [MangleName 'dharrowright'] [MangleUnicode 0x21A0] arrowSB symbolMid arrowRSB symbolMid
arrow dhArrowShape 'dharrowup' 0x219F arrowMidX arrowBot arrowMidX arrowTop arrow dhArrowShape [MangleName 'dharrowup'] [MangleUnicode 0x219F] arrowMidX arrowBot arrowMidX arrowTop
arrow dhArrowShape 'dharrowdown' 0x21A1 arrowMidX arrowTop arrowMidX arrowBot arrow dhArrowShape [MangleName 'dharrowdown'] [MangleUnicode 0x21A1] arrowMidX arrowTop arrowMidX arrowBot
arrow htArrowShape 'htarrowleft' 0x21A2 arrowRSB symbolMid arrowSB symbolMid arrow htArrowShape [MangleName 'htarrowleft'] [MangleUnicode 0x21A2] arrowRSB symbolMid arrowSB symbolMid
arrow htArrowShape 'htarrowright' 0x21A3 arrowSB symbolMid arrowRSB symbolMid arrow htArrowShape [MangleName 'htarrowright'] [MangleUnicode 0x21A3] arrowSB symbolMid arrowRSB symbolMid
composite glyphs.arrowleft glyphs.arrSlashOver [into-unicode 0x219A] composite [MangleName 'uni219A'] glyphs.[MangleName 'arrowleft'] glyphs.arrSlashOver [into-unicode : MangleUnicode 0x219A]
composite glyphs.arrowright glyphs.arrSlashOver [into-unicode 0x219B] composite [MangleName 'uni219B'] glyphs.[MangleName 'arrowright'] glyphs.arrSlashOver [into-unicode : MangleUnicode 0x219B]
composite glyphs.arrowleftright glyphs.arrSlashOver [into-unicode 0x21AE] composite [MangleName 'uni21AE'] glyphs.[MangleName 'arrowleftright'] glyphs.arrSlashOver [into-unicode : MangleUnicode 0x21AE]
composite glyphs.arrowleft glyphs.arrVStrokeOver [into-unicode 0x21F7] composite [MangleName 'uni21F7'] glyphs.[MangleName 'arrowleft'] glyphs.arrVStrokeOver [into-unicode : MangleUnicode 0x21F7]
composite glyphs.arrowright glyphs.arrVStrokeOver [into-unicode 0x21F8] composite [MangleName 'uni21F8'] glyphs.[MangleName 'arrowright'] glyphs.arrVStrokeOver [into-unicode : MangleUnicode 0x21F8]
composite glyphs.arrowleftright glyphs.arrVStrokeOver [into-unicode 0x21F9] composite [MangleName 'uni21F9'] glyphs.[MangleName 'arrowleftright'] glyphs.arrVStrokeOver [into-unicode : MangleUnicode 0x21F9]
composite glyphs.arrowleft glyphs.arrDblVStrokeOver [into-unicode 0x21FA] composite [MangleName 'uni21FA'] glyphs.[MangleName 'arrowleft'] glyphs.arrDblVStrokeOver [into-unicode : MangleUnicode 0x21FA]
composite glyphs.arrowright glyphs.arrDblVStrokeOver [into-unicode 0x21FB] composite [MangleName 'uni21FB'] glyphs.[MangleName 'arrowright'] glyphs.arrDblVStrokeOver [into-unicode : MangleUnicode 0x21FB]
composite glyphs.arrowleftright glyphs.arrDblVStrokeOver [into-unicode 0x21FC] composite [MangleName 'uni21FC'] glyphs.[MangleName 'arrowleftright'] glyphs.arrDblVStrokeOver [into-unicode : MangleUnicode 0x21FC]
composite glyphs.dblarrowleft glyphs.arrSlashOver [into-unicode 0x21CD] composite [MangleName 'uni21CD'] glyphs.[MangleName 'dblarrowleft'] glyphs.arrSlashOver [into-unicode : MangleUnicode 0x21CD]
composite glyphs.dblarrowleftright glyphs.arrSlashOver [into-unicode 0x21CE] composite [MangleName 'uni21CE'] glyphs.[MangleName 'dblarrowleftright'] glyphs.arrSlashOver [into-unicode : MangleUnicode 0x21CE]
composite glyphs.dblarrowright glyphs.arrSlashOver [into-unicode 0x21CF] composite [MangleName 'uni21CF'] glyphs.[MangleName 'dblarrowright'] glyphs.arrSlashOver [into-unicode : MangleUnicode 0x21CF]
do do
local hcDist : Math.max (halfstroke * 5) (arrowWidth / 2) local hcDist : Math.max (halfstroke * 5) (arrowWidth / 2)
vcombine nothing 0x21C4 'arrowright' 'arrowleft' (arrowSize * 1.75) vcombine [MangleName 'uni21C4'] [MangleUnicode 0x21C4] [MangleName 'arrowright'] [MangleName 'arrowleft'] (arrowSize * 1.75)
hcombine nothing 0x21C5 'arrowup' 'arrowdown' hcDist hcombine [MangleName 'uni21C5'] [MangleUnicode 0x21C5] [MangleName 'arrowup'] [MangleName 'arrowdown'] hcDist
vcombine nothing 0x21C6 'arrowleft' 'arrowright' (arrowSize * 1.75) vcombine [MangleName 'uni21C6'] [MangleUnicode 0x21C6] [MangleName 'arrowleft'] [MangleName 'arrowright'] (arrowSize * 1.75)
vcombine nothing 0x21C7 'arrowleft' 'arrowleft' (arrowSize * 1.75) vcombine [MangleName 'uni21C7'] [MangleUnicode 0x21C7] [MangleName 'arrowleft'] [MangleName 'arrowleft'] (arrowSize * 1.75)
hcombine nothing 0x21C8 'arrowup' 'arrowup' hcDist hcombine [MangleName 'uni21C8'] [MangleUnicode 0x21C8] [MangleName 'arrowup'] [MangleName 'arrowup'] hcDist
vcombine nothing 0x21C9 'arrowright' 'arrowright' (arrowSize * 1.75) vcombine [MangleName 'uni21C9'] [MangleUnicode 0x21C9] [MangleName 'arrowright'] [MangleName 'arrowright'] (arrowSize * 1.75)
hcombine nothing 0x21CA 'arrowdown' 'arrowdown' hcDist hcombine [MangleName 'uni21CA'] [MangleUnicode 0x21CA] [MangleName 'arrowdown'] [MangleName 'arrowdown'] hcDist
hcombine nothing 0x21F5 'arrowdown' 'arrowup' hcDist hcombine [MangleName 'uni21F5'] [MangleUnicode 0x21F5] [MangleName 'arrowdown'] [MangleName 'arrowup'] hcDist
vcombine nothing 0x21CB 'arrowleftHR' 'arrowrightHR' (arrowSize) vcombine [MangleName 'uni21CB'] [MangleUnicode 0x21CB] [MangleName 'arrowleftHR'] [MangleName 'arrowrightHR'] (arrowSize)
vcombine nothing 0x21CC 'arrowrightHL' 'arrowleftHL' (arrowSize) vcombine [MangleName 'uni21CC'] [MangleUnicode 0x21CC] [MangleName 'arrowrightHL'] [MangleName 'arrowleftHL'] (arrowSize)
vcombine nothing 0x21B9 'arrowbarright' 'arrowbarleft' (arrowSize * 1.75) vcombine [MangleName 'uni21B9'] [MangleUnicode 0x21B9] [MangleName 'arrowbarright'] [MangleName 'arrowbarleft'] (arrowSize * 1.75)
break : list ArrowShape if (MosaicWidth == FULLWIDTH2) : set exportArrowShape ArrowShape
### Standard geometric shapes ### Standard geometric shapes
do 'Geometric' foreach {suffix MosaicWidth} [items-of WidthKinds] : do 'Geometric'
define shapeWidth FULLWIDTH2 define [MangleUnicode unicode] : if (MosaicWidth == FULLWIDTH2) unicode nothing
define [MangleName name] : name + suffix
define shapeWidth MosaicWidth
define middleFW : shapeWidth / 2 define middleFW : shapeWidth / 2
define left : mix MIDDLE SB 1.1 define left : mix MIDDLE SB 1.1
@ -445,8 +448,7 @@ export : define [apply] : begin
include UnFullWidthify include UnFullWidthify
include : FlipAround x y s [fallback sy s] include : FlipAround x y s [fallback sy s]
include FullWidthify include FullWidthify
include : into-unicode unicode
save [fallback newid : [if (s < 1) 'small' 'large'] + id] unicode
define FullWidthify : glyph-construction define FullWidthify : glyph-construction
apply-transform [Upright] true apply-transform [Upright] true
@ -470,7 +472,7 @@ export : define [apply] : begin
line-to right (symbolMid - squareRadius) line-to right (symbolMid - squareRadius)
line-to left (symbolMid - squareRadius) line-to left (symbolMid - squareRadius)
include FullWidthify include FullWidthify
save 'blacksquare' 0x25A0 save [MangleName 'blacksquare'] [MangleUnicode 0x25A0]
sketch # smallblacksquare sketch # smallblacksquare
local r : squareRadius * designParameters.geometric_small_x local r : squareRadius * designParameters.geometric_small_x
start-from (MIDDLE - r) (symbolMid + r) start-from (MIDDLE - r) (symbolMid + r)
@ -478,31 +480,31 @@ export : define [apply] : begin
line-to (MIDDLE + r) (symbolMid - r) line-to (MIDDLE + r) (symbolMid - r)
line-to (MIDDLE - r) (symbolMid - r) line-to (MIDDLE - r) (symbolMid - r)
include FullWidthify include FullWidthify
save 'smallblacksquare' 0x25AA save [MangleName 'smallblacksquare'] [MangleUnicode 0x25AA]
sketch # blacktrianglerb sketch # blacktrianglerb
start-from right (symbolMid + squareRadius) start-from right (symbolMid + squareRadius)
line-to right (symbolMid - squareRadius) line-to right (symbolMid - squareRadius)
line-to left (symbolMid - squareRadius) line-to left (symbolMid - squareRadius)
include FullWidthify include FullWidthify
save 'blacktrianglerb' 0x25E2 save [MangleName 'blacktrianglerb'] [MangleUnicode 0x25E2]
sketch # blacktrianglelb sketch # blacktrianglelb
start-from left (symbolMid + squareRadius) start-from left (symbolMid + squareRadius)
line-to right (symbolMid - squareRadius) line-to right (symbolMid - squareRadius)
line-to left (symbolMid - squareRadius) line-to left (symbolMid - squareRadius)
include FullWidthify include FullWidthify
save 'blacktrianglelb' 0x25E3 save [MangleName 'blacktrianglelb'] [MangleUnicode 0x25E3]
sketch # blacktrianglelt sketch # blacktrianglelt
start-from left (symbolMid + squareRadius) start-from left (symbolMid + squareRadius)
line-to right (symbolMid + squareRadius) line-to right (symbolMid + squareRadius)
line-to left (symbolMid - squareRadius) line-to left (symbolMid - squareRadius)
include FullWidthify include FullWidthify
save 'blacktrianglelt' 0x25E4 save [MangleName 'blacktrianglelt'] [MangleUnicode 0x25E4]
sketch # blacktrianglert sketch # blacktrianglert
start-from left (symbolMid + squareRadius) start-from left (symbolMid + squareRadius)
line-to right (symbolMid + squareRadius) line-to right (symbolMid + squareRadius)
line-to right (symbolMid - squareRadius) line-to right (symbolMid - squareRadius)
include FullWidthify include FullWidthify
save 'blacktrianglert' 0x25E5 save [MangleName 'blacktrianglert'] [MangleUnicode 0x25E5]
sketch # blackrectangle sketch # blackrectangle
start-from left (symbolMid + squareRadius / 1.5) start-from left (symbolMid + squareRadius / 1.5)
@ -510,7 +512,7 @@ export : define [apply] : begin
line-to right (symbolMid - squareRadius / 1.5) line-to right (symbolMid - squareRadius / 1.5)
line-to left (symbolMid - squareRadius / 1.5) line-to left (symbolMid - squareRadius / 1.5)
include FullWidthify include FullWidthify
save 'blackrectangle' 0x25AC save [MangleName 'blackrectangle'] [MangleUnicode 0x25AC]
sketch # blackparallelogram sketch # blackparallelogram
define skew : squareRadius * 1 / 4 define skew : squareRadius * 1 / 4
@ -519,14 +521,14 @@ export : define [apply] : begin
line-to (right - skew) (symbolMid - squareRadius / 1.5) line-to (right - skew) (symbolMid - squareRadius / 1.5)
line-to (left - skew) (symbolMid - squareRadius / 1.5) line-to (left - skew) (symbolMid - squareRadius / 1.5)
include FullWidthify include FullWidthify
save 'blackparallelogram' 0x25B0 save [MangleName 'blackparallelogram'] [MangleUnicode 0x25B0]
sketch # whiteparallelogram sketch # whiteparallelogram
define skew : squareRadius * 1 / 4 define skew : squareRadius * 1 / 4
define w : GEOMETRYSTROKE * (WIDTH / shapeWidth) define w : GEOMETRYSTROKE * (WIDTH / shapeWidth)
set-width shapeWidth set-width shapeWidth
include : intersection include : intersection
begin glyphs.blackparallelogram begin glyphs.[MangleName 'blackparallelogram']
create-glyph : glyph-construction create-glyph : glyph-construction
include : dispiro include : dispiro
widths.rhs w widths.rhs w
@ -546,7 +548,7 @@ export : define [apply] : begin
curl (left + skew) (symbolMid + squareRadius / 1.5) curl (left + skew) (symbolMid + squareRadius / 1.5)
include FullWidthify include FullWidthify
save 'whiteparallelogram' 0x25B1 save [MangleName 'whiteparallelogram'] [MangleUnicode 0x25B1]
sketch # blacklongrectangle sketch # blacklongrectangle
start-from left (symbolMid + squareRadius * 1.5) start-from left (symbolMid + squareRadius * 1.5)
@ -554,7 +556,7 @@ export : define [apply] : begin
line-to right (symbolMid - squareRadius * 1.5) line-to right (symbolMid - squareRadius * 1.5)
line-to left (symbolMid - squareRadius * 1.5) line-to left (symbolMid - squareRadius * 1.5)
include FullWidthify include FullWidthify
save 'blacklongrectangle' 0x25AE save [MangleName 'blacklongrectangle'] [MangleUnicode 0x25AE]
local triangleOvershoot : 2 / [Math.sqrt 3] local triangleOvershoot : 2 / [Math.sqrt 3]
sketch # blacktriangleup sketch # blacktriangleup
@ -562,66 +564,64 @@ export : define [apply] : begin
line-to [mix MIDDLE right triangleOvershoot] (symbolMid - squareRadius) line-to [mix MIDDLE right triangleOvershoot] (symbolMid - squareRadius)
line-to [mix MIDDLE left triangleOvershoot] (symbolMid - squareRadius) line-to [mix MIDDLE left triangleOvershoot] (symbolMid - squareRadius)
include FullWidthify include FullWidthify
save 'blacktriangleup' 0x25B2 save [MangleName 'blacktriangleup'] [MangleUnicode 0x25B2]
sketch # blacktriangledown sketch # blacktriangledown
start-from MIDDLE (symbolMid - squareRadius) start-from MIDDLE (symbolMid - squareRadius)
line-to [mix MIDDLE left triangleOvershoot] (symbolMid + squareRadius) line-to [mix MIDDLE left triangleOvershoot] (symbolMid + squareRadius)
line-to [mix MIDDLE right triangleOvershoot] (symbolMid + squareRadius) line-to [mix MIDDLE right triangleOvershoot] (symbolMid + squareRadius)
include FullWidthify include FullWidthify
save 'blacktriangledown' 0x25BC save [MangleName 'blacktriangledown'] [MangleUnicode 0x25BC]
sketch # blacktriangleleft sketch # blacktriangleleft
start-from left symbolMid start-from left symbolMid
line-to right (symbolMid - squareRadius * triangleOvershoot) line-to right (symbolMid - squareRadius * triangleOvershoot)
line-to right (symbolMid + squareRadius * triangleOvershoot) line-to right (symbolMid + squareRadius * triangleOvershoot)
include FullWidthify include FullWidthify
save 'blacktriangleleft' 0x25C0 save [MangleName 'blacktriangleleft'] [MangleUnicode 0x25C0]
sketch # blacktriangleright sketch # blacktriangleright
start-from right symbolMid start-from right symbolMid
line-to left (symbolMid + squareRadius * triangleOvershoot) line-to left (symbolMid + squareRadius * triangleOvershoot)
line-to left (symbolMid - squareRadius * triangleOvershoot) line-to left (symbolMid - squareRadius * triangleOvershoot)
include FullWidthify include FullWidthify
save 'blacktriangleright' 0x25B6 save [MangleName 'blacktriangleright'] [MangleUnicode 0x25B6]
sketch # thinblacktriangleleft sketch # thinblacktriangleleft
start-from left symbolMid start-from left symbolMid
line-to right (symbolMid - squareRadius * triangleOvershoot * 0.618) line-to right (symbolMid - squareRadius * triangleOvershoot * 0.618)
line-to right (symbolMid + squareRadius * triangleOvershoot * 0.618) line-to right (symbolMid + squareRadius * triangleOvershoot * 0.618)
include FullWidthify include FullWidthify
save 'thinblacktriangleleft' 0x25C4 save [MangleName 'thinblacktriangleleft'] [MangleUnicode 0x25C4]
sketch # thinblacktriangleright sketch # thinblacktriangleright
start-from right symbolMid start-from right symbolMid
line-to left (symbolMid + squareRadius * triangleOvershoot * 0.618) line-to left (symbolMid + squareRadius * triangleOvershoot * 0.618)
line-to left (symbolMid - squareRadius * triangleOvershoot * 0.618) line-to left (symbolMid - squareRadius * triangleOvershoot * 0.618)
include FullWidthify include FullWidthify
save 'thinblacktriangleright' 0x25BA save [MangleName 'thinblacktriangleright'] [MangleUnicode 0x25BA]
sketch # blackdiamond sketch # blackdiamond
start-from MIDDLE (symbolMid + squareRadius) start-from MIDDLE (symbolMid + squareRadius)
line-to right symbolMid line-to right symbolMid
line-to MIDDLE (symbolMid - squareRadius) line-to MIDDLE (symbolMid - squareRadius)
line-to left symbolMid line-to left symbolMid
save 'hwblackdiamond'
include FullWidthify include FullWidthify
save 'blackdiamond' 0x25C6 save [MangleName 'blackdiamond'] [MangleUnicode 0x25C6]
sketch # blackLonzenge sketch # blackLonzenge
start-from MIDDLE (symbolMid + squareRadius) start-from MIDDLE (symbolMid + squareRadius)
line-to [mix MIDDLE right (2 / 3)] symbolMid line-to [mix MIDDLE right (2 / 3)] symbolMid
line-to MIDDLE (symbolMid - squareRadius) line-to MIDDLE (symbolMid - squareRadius)
line-to [mix MIDDLE left (2 / 3)] symbolMid line-to [mix MIDDLE left (2 / 3)] symbolMid
save 'hwBlackLonzenge'
include FullWidthify include FullWidthify
save 'blackLonzenge' 0x29EB save [MangleName 'blackLonzenge'] [MangleUnicode 0x29EB]
sketch # whiteLonzenge sketch # whiteLonzenge
define w : GEOMETRYSTROKE * (WIDTH / shapeWidth) define w : GEOMETRYSTROKE * (WIDTH / shapeWidth)
set-width shapeWidth set-width shapeWidth
include : intersection include : intersection
begin glyphs.blackLonzenge begin glyphs.[MangleName 'blackLonzenge']
create-glyph : glyph-construction create-glyph : glyph-construction
include : dispiro include : dispiro
widths.rhs w widths.rhs w
@ -640,7 +640,7 @@ export : define [apply] : begin
flat [mix MIDDLE left (2 / 3)] symbolMid flat [mix MIDDLE left (2 / 3)] symbolMid
curl MIDDLE (symbolMid + squareRadius) curl MIDDLE (symbolMid + squareRadius)
include FullWidthify include FullWidthify
save 'whiteLonzenge' 0x25CA save [MangleName 'whiteLonzenge'] [MangleUnicode 0x25CA]
sketch # blackcircle sketch # blackcircle
include markset.plus include markset.plus
@ -651,7 +651,7 @@ export : define [apply] : begin
g4 (right + O) symbolMid g4 (right + O) symbolMid
close close
reverse-last reverse-last
save 'hwblackcircleO' save [MangleName 'blackcircleO']
sketch # blackcircle sketch # blackcircle
include markset.plus include markset.plus
@ -662,9 +662,30 @@ export : define [apply] : begin
g4 right symbolMid g4 right symbolMid
close close
reverse-last reverse-last
save 'hwblackcircle'
include FullWidthify include FullWidthify
save 'blackcircle' 0x25CF save [MangleName 'blackcircle'] [MangleUnicode 0x25CF]
sketch # leftblackcircle
set-width shapeWidth
include : intersection
begin glyphs.[MangleName 'blackcircle']
spiro-outline
corner (0 - shapeWidth) (symbolMid - squareRadiusFW * 2)
corner (shapeWidth / 2) (symbolMid - squareRadiusFW * 2)
corner (shapeWidth / 2) (symbolMid + squareRadiusFW * 2)
corner (0 - shapeWidth) (symbolMid + squareRadiusFW * 2)
save [MangleName 'leftblackcircle'] [MangleUnicode 0x25D6]
sketch # rightblackcircle
set-width shapeWidth
include : intersection
begin glyphs.[MangleName 'blackcircle']
spiro-outline
corner (shapeWidth * 2) (symbolMid - squareRadiusFW * 2)
corner (shapeWidth / 2) (symbolMid - squareRadiusFW * 2)
corner (shapeWidth / 2) (symbolMid + squareRadiusFW * 2)
corner (shapeWidth * 2) (symbolMid + squareRadiusFW * 2)
save [MangleName 'rightblackcircle'] [MangleUnicode 0x25D7]
sketch # smallblackcircle sketch # smallblackcircle
include : spiro-outline include : spiro-outline
@ -674,9 +695,8 @@ export : define [apply] : begin
g4 (MIDDLE + squareRadius * designParameters.geometric_small_x) symbolMid g4 (MIDDLE + squareRadius * designParameters.geometric_small_x) symbolMid
close close
reverse-last reverse-last
save 'hwsmallblackcircle'
include FullWidthify include FullWidthify
save 'smallblackcircle' save [MangleName 'smallblackcircle']
sketch # bigblackcircle sketch # bigblackcircle
include : spiro-outline include : spiro-outline
@ -686,9 +706,8 @@ export : define [apply] : begin
g4 (MIDDLE + squareRadius * designParameters.geometric_large_x) symbolMid g4 (MIDDLE + squareRadius * designParameters.geometric_large_x) symbolMid
close close
reverse-last reverse-last
save 'hwbigblackcircle'
include FullWidthify include FullWidthify
save 'bigblackcircle' save [MangleName 'bigblackcircle'] [MangleUnicode 0x2B24]
let let
: configurations : list : configurations : list
@ -704,9 +723,9 @@ export : define [apply] : begin
currentGlyph.([if j 'line-to' 'start-from']) currentGlyph.([if j 'line-to' 'start-from'])
mix left right (0.5 - 0.5 * overflow * [Math.sin angle]) mix left right (0.5 - 0.5 * overflow * [Math.sin angle])
symbolMid + squareRadius * [Math.cos angle] * overflow symbolMid + squareRadius * [Math.cos angle] * overflow
save "hw\(name)" save [MangleName "hw\(name)"]
include FullWidthify include FullWidthify
save name unicode save [MangleName name] [MangleUnicode unicode]
sketch # dottedcircle sketch # dottedcircle
local n 12 local n 12
@ -728,52 +747,48 @@ export : define [apply] : begin
apply-transform [Italify] true apply-transform [Italify] true
include FullWidthify include FullWidthify
save 'dottedcircle' 0x25CC save [MangleName 'dottedcircle'] [MangleUnicode 0x25CC]
hollow 'whitesquare' 0x25A1 'blacksquare' hollow [MangleName 'whitesquare'] [MangleUnicode 0x25A1] [MangleName 'blacksquare']
hollowWithCenter 'whitesquareWithCenter' 0x25A3 'blacksquare' hollowWithCenter [MangleName 'whitesquareWithCenter'] [MangleUnicode 0x25A3] [MangleName 'blacksquare']
hollow 'whitehexagon' 0x2B21 'blackhexagon' hollow [MangleName 'whitehexagon'] [MangleUnicode 0x2B21] [MangleName 'blackhexagon']
hollow 'whitepentagon' 0x2B20 'blackpentagon' hollow [MangleName 'whitepentagon'] [MangleUnicode 0x2B20] [MangleName 'blackpentagon']
hollow 'rhwhitepentagon' 0x2B54 'rhblackpentagon' hollow [MangleName 'rhwhitepentagon'] [MangleUnicode 0x2B54] [MangleName 'rhblackpentagon']
hollow 'whiterectangle' 0x25AD 'blackrectangle' [hollowScale squareRadius] [hollowScale (squareRadius / 1.5)] hollow [MangleName 'whiterectangle'] [MangleUnicode 0x25AD] [MangleName 'blackrectangle'] [hollowScale squareRadius] [hollowScale (squareRadius / 1.5)]
hollow 'whitelongrectangle' 0x25AF 'blacklongrectangle' [hollowScale squareRadius] [hollowScale (squareRadius * 1.5)] hollow [MangleName 'whitelongrectangle'] [MangleUnicode 0x25AF] [MangleName 'blacklongrectangle'] [hollowScale squareRadius] [hollowScale (squareRadius * 1.5)]
hollow 'whitecircle' 0x25CB 'blackcircle' hollow [MangleName 'whitecircle'] [MangleUnicode 0x25CB] [MangleName 'blackcircle']
hollowWithCenter 'whitecircleWithCenter' 0x25C9 'blackcircle' hollowWithCenter [MangleName 'whitecircleWithCenter'] [MangleUnicode 0x25C9] [MangleName 'blackcircle']
doubleHollow 'doubleWhitecircle' 0x25CE 'blackcircle' doubleHollow [MangleName 'doubleWhitecircle'] [MangleUnicode 0x25CE] [MangleName 'blackcircle']
hollow 'bigwhitecircle' 0x25EF 'bigblackcircle' [hollowScale : squareRadius * designParameters.geometric_large_x] hollow [MangleName 'bigwhitecircle'] [MangleUnicode 0x25EF] [MangleName 'bigblackcircle'] [hollowScale : squareRadius * designParameters.geometric_large_x]
hollow 'hwbigwhitecircle' null 'hwbigblackcircle' [hollowScale (squareRadius * designParameters.geometric_large_x) 1] hollow [MangleName 'smallwhitecircle'] null [MangleName 'smallblackcircle'] [hollowScale : squareRadius * designParameters.geometric_small_x]
hollow 'smallwhitecircle' null 'smallblackcircle' [hollowScale : squareRadius * designParameters.geometric_small_x] hollow [MangleName 'smallwhitesquare'] [MangleUnicode 0x25AB] [MangleName 'smallblacksquare'] [hollowScale : squareRadius * designParameters.geometric_small_x]
hollow 'hwsmallwhitecircle' null 'hwsmallblackcircle' [hollowScale (squareRadius * designParameters.geometric_small_x) 1]
hollow 'smallwhitesquare' 0x25AB 'smallblacksquare' [hollowScale : squareRadius * designParameters.geometric_small_x]
hollow 'hwwhitecircle' null 'hwblackcircle'
let [s : hollowScale squareRadius nothing (GEOMETRYSTROKE * [Math.sqrt 2])] : begin let [s : hollowScale squareRadius nothing (GEOMETRYSTROKE * [Math.sqrt 2])] : begin
hollow 'hwwhitediamond' 0x22C4 'hwblackdiamond' s hollow [MangleName 'whitediamond'] [MangleUnicode 0x25C7] [MangleName 'blackdiamond'] s
hollow 'whitediamond' 0x25C7 'blackdiamond' s hollowWithCenter [MangleName 'whitediamondWithCenter'] [MangleUnicode 0x25C8] [MangleName 'blackdiamond'] s
hollowWithCenter 'whitediamondWithCenter' 0x25C8 'blackdiamond' s
let [sts 0.75] let [sts 0.75]
: begin : begin
resized 'smallblacktriangleup' 0x25B4 'blacktriangleup' MIDDLE symbolMid 0.75 resized [MangleName 'smallblacktriangleup'] [MangleUnicode 0x25B4] [MangleName 'blacktriangleup'] MIDDLE symbolMid 0.75
resized 'smallblacktriangleright' 0x25B8 'blacktriangleright' MIDDLE symbolMid 0.75 resized [MangleName 'smallblacktriangleright'] [MangleUnicode 0x25B8] [MangleName 'blacktriangleright'] MIDDLE symbolMid 0.75
resized 'smallblacktriangledown' 0x25BE 'blacktriangledown' MIDDLE symbolMid 0.75 resized [MangleName 'smallblacktriangledown'] [MangleUnicode 0x25BE] [MangleName 'blacktriangledown'] MIDDLE symbolMid 0.75
resized 'smallblacktriangleleft' 0x25C2 'blacktriangleleft' MIDDLE symbolMid 0.75 resized [MangleName 'smallblacktriangleleft'] [MangleUnicode 0x25C2] [MangleName 'blacktriangleleft'] MIDDLE symbolMid 0.75
let let
: sl : hollowScale (squareRadius * 2 / [Math.sqrt 3]) nothing (GEOMETRYSTROKE * [Math.sqrt 3]) : sl : hollowScale (squareRadius * 2 / [Math.sqrt 3]) nothing (GEOMETRYSTROKE * [Math.sqrt 3])
: slt : hollowScale (squareRadius * 2 / [Math.sqrt 3]) nothing (GEOMETRYSTROKE * [Math.sqrt 3]) : slt : hollowScale (squareRadius * 2 / [Math.sqrt 3]) nothing (GEOMETRYSTROKE * [Math.sqrt 3])
: ss : hollowScale (squareRadius * sts * 2 / [Math.sqrt 3]) nothing (GEOMETRYSTROKE * [Math.sqrt 3]) : ss : hollowScale (squareRadius * sts * 2 / [Math.sqrt 3]) nothing (GEOMETRYSTROKE * [Math.sqrt 3])
: begin : begin
hollow 'whitetriangleup' 0x25B3 'blacktriangleup' sl nothing MIDDLE (symbolMid - squareRadius / 3) hollow [MangleName 'whitetriangleup'] [MangleUnicode 0x25B3] [MangleName 'blacktriangleup'] sl nothing MIDDLE (symbolMid - squareRadius / 3)
hollow 'whitetriangledown' 0x25BD 'blacktriangledown' sl nothing MIDDLE (symbolMid + squareRadius / 3) hollow [MangleName 'whitetriangledown'] [MangleUnicode 0x25BD] [MangleName 'blacktriangledown'] sl nothing MIDDLE (symbolMid + squareRadius / 3)
hollow 'whitetriangleleft' 0x25C1 'blacktriangleleft' sl nothing [mix MIDDLE right (1 / 3)] symbolMid hollow [MangleName 'whitetriangleleft'] [MangleUnicode 0x25C1] [MangleName 'blacktriangleleft'] sl nothing [mix MIDDLE right (1 / 3)] symbolMid
hollow 'whitetriangleright' 0x25B7 'blacktriangleright' sl nothing [mix MIDDLE left (1 / 3)] symbolMid hollow [MangleName 'whitetriangleright'] [MangleUnicode 0x25B7] [MangleName 'blacktriangleright'] sl nothing [mix MIDDLE left (1 / 3)] symbolMid
hollow 'smallwhitetriangleup' 0x25B5 'smallblacktriangleup' ss nothing MIDDLE (symbolMid - squareRadius / 3 * sts) hollow [MangleName 'smallwhitetriangleup'] [MangleUnicode 0x25B5] [MangleName 'smallblacktriangleup'] ss nothing MIDDLE (symbolMid - squareRadius / 3 * sts)
hollow 'smallwhitetriangledown' 0x25BF 'smallblacktriangledown' ss nothing MIDDLE (symbolMid + squareRadius / 3 * sts) hollow [MangleName 'smallwhitetriangledown'] [MangleUnicode 0x25BF] [MangleName 'smallblacktriangledown'] ss nothing MIDDLE (symbolMid + squareRadius / 3 * sts)
hollow 'smallwhitetriangleleft' 0x25C3 'smallblacktriangleleft' ss nothing [mix MIDDLE right (sts / 3)] symbolMid hollow [MangleName 'smallwhitetriangleleft'] [MangleUnicode 0x25C3] [MangleName 'smallblacktriangleleft'] ss nothing [mix MIDDLE right (sts / 3)] symbolMid
hollow 'smallwhitetriangleright' 0x25B9 'smallblacktriangleright' ss nothing [mix MIDDLE left (sts / 3)] symbolMid hollow [MangleName 'smallwhitetriangleright'] [MangleUnicode 0x25B9] [MangleName 'smallblacktriangleright'] ss nothing [mix MIDDLE left (sts / 3)] symbolMid
hollow 'thinwhitetriangleleft' 0x25C5 'thinblacktriangleleft' sl nothing [mix MIDDLE right (1 / 3)] symbolMid hollow [MangleName 'thinwhitetriangleleft'] [MangleUnicode 0x25C5] [MangleName 'thinblacktriangleleft'] sl nothing [mix MIDDLE right (1 / 3)] symbolMid
hollow 'thinwhitetriangleright' 0x25BB 'thinblacktriangleright' sl nothing [mix MIDDLE left (1 / 3)] symbolMid hollow [MangleName 'thinwhitetriangleright'] [MangleUnicode 0x25BB] [MangleName 'thinblacktriangleright'] sl nothing [mix MIDDLE left (1 / 3)] symbolMid
hollow 'whitestar' 0x2606 'blackstar' sl hollow [MangleName 'whitestar'] [MangleUnicode 0x2606] [MangleName 'blackstar'] sl
# Mark sampler # Mark sampler
sketch sketch
@ -789,7 +804,7 @@ export : define [apply] : begin
g4 (MIDDLE + XH * 0.4) (XH * 0.5) g4 (MIDDLE + XH * 0.4) (XH * 0.5)
g4 MIDDLE (XH * 0.1) g4 MIDDLE (XH * 0.1)
close close
save 'marksampler' 0xE09E save [MangleName 'marksampler'] [MangleUnicode 0xE09E]
# Rounded # Rounded
sketch # roundwhitesquare, U+25A2 sketch # roundwhitesquare, U+25A2
@ -811,7 +826,8 @@ export : define [apply] : begin
arcvh arcvh
flat (middleFW + cr) (symbolMid + squareRadiusFW) [heading LEFTWARD] flat (middleFW + cr) (symbolMid + squareRadiusFW) [heading LEFTWARD]
curl (middleFW - 1) (symbolMid + squareRadiusFW) [heading LEFTWARD] curl (middleFW - 1) (symbolMid + squareRadiusFW) [heading LEFTWARD]
save 'roundwhitesquare' 0x25A2 save [MangleName 'roundwhitesquare'] [MangleUnicode 0x25A2]
# Shaded hollow squares # Shaded hollow squares
sketch # hshadesquare, U+25A4 sketch # hshadesquare, U+25A4
define lineWidth : Math.min GEOMETRYSTROKE ((squareRadiusFW * 2 - GEOMETRYSTROKE * 2) * 1 / 11) define lineWidth : Math.min GEOMETRYSTROKE ((squareRadiusFW * 2 - GEOMETRYSTROKE * 2) * 1 / 11)
@ -819,9 +835,9 @@ export : define [apply] : begin
define bot : symbolMid - (top - symbolMid) define bot : symbolMid - (top - symbolMid)
set-width shapeWidth set-width shapeWidth
include : union include : union
begin glyphs.whitesquare begin glyphs.[MangleName 'whitesquare']
intersection intersection
begin glyphs.blacksquare begin glyphs.[MangleName 'blacksquare']
create-glyph : glyph-construction create-glyph : glyph-construction
include : dispiro include : dispiro
widths.center lineWidth widths.center lineWidth
@ -835,16 +851,17 @@ export : define [apply] : begin
widths.center lineWidth widths.center lineWidth
flat leftFW [mix top bot 0.75] [heading RIGHTWARD] flat leftFW [mix top bot 0.75] [heading RIGHTWARD]
curl rightFW [mix top bot 0.75] [heading RIGHTWARD] curl rightFW [mix top bot 0.75] [heading RIGHTWARD]
save 'hshadesquare' 0x25A4 save [MangleName 'hshadesquare'] [MangleUnicode 0x25A4]
sketch # vshadesquare, U+25A5 sketch # vshadesquare, U+25A5
define lineWidth : Math.min GEOMETRYSTROKE ((squareRadiusFW * 2 - GEOMETRYSTROKE * 2) * 1 / 11) define lineWidth : Math.min GEOMETRYSTROKE ((squareRadiusFW * 2 - GEOMETRYSTROKE * 2) * 1 / 11)
define r : shapeWidth / 2 + squareRadiusFW - GEOMETRYSTROKE + lineWidth / 2 define r : shapeWidth / 2 + squareRadiusFW - GEOMETRYSTROKE + lineWidth / 2
define l : shapeWidth / 2 - (r - shapeWidth / 2) define l : shapeWidth / 2 - (r - shapeWidth / 2)
set-width shapeWidth set-width shapeWidth
include : union include : union
begin glyphs.whitesquare begin glyphs.[MangleName 'whitesquare']
intersection intersection
begin glyphs.blacksquare begin glyphs.[MangleName 'blacksquare']
create-glyph : glyph-construction create-glyph : glyph-construction
include : dispiro include : dispiro
widths.center lineWidth widths.center lineWidth
@ -858,45 +875,49 @@ export : define [apply] : begin
widths.center lineWidth widths.center lineWidth
flat [mix l r 0.75] topFW [heading DOWNWARD] flat [mix l r 0.75] topFW [heading DOWNWARD]
curl [mix l r 0.75] bottomFW [heading DOWNWARD] curl [mix l r 0.75] bottomFW [heading DOWNWARD]
save 'vshadesquare' 0x25A5 save [MangleName 'vshadesquare'] [MangleUnicode 0x25A5]
sketch # hvshadesquare, U+25A6 sketch # hvshadesquare, U+25A6
set-width shapeWidth set-width shapeWidth
include : union glyphs.hshadesquare glyphs.vshadesquare include : union glyphs.[MangleName 'hshadesquare'] glyphs.[MangleName 'vshadesquare']
save 'hvshadesquare' 0x25A6 save [MangleName 'hvshadesquare'] [MangleUnicode 0x25A6]
sketch # ddiagshadesquare, U+25A7 sketch # ddiagshadesquare, U+25A7
define lineWidth : Math.min GEOMETRYSTROKE ((squareRadiusFW * 2 - GEOMETRYSTROKE * 2) * 1 / 11) define lineWidth : Math.min GEOMETRYSTROKE ((squareRadiusFW * 2 - GEOMETRYSTROKE * 2) * 1 / 11)
define top : symbolMid + squareRadiusFW define top : symbolMid + squareRadiusFW
define bot : symbolMid - (top - symbolMid) define bot : symbolMid - (top - symbolMid)
set-width shapeWidth set-width shapeWidth
include : union include : union
begin glyphs.whitesquare begin glyphs.[MangleName 'whitesquare']
intersection intersection
begin glyphs.blacksquare begin glyphs.[MangleName 'blacksquare']
create-glyph : glyph-construction create-glyph : glyph-construction
foreach [j : range (-10) till 10] : include : dispiro foreach [j : range (-10) till 10] : include : dispiro
widths.center lineWidth widths.center lineWidth
flat leftFW [mix top bot (j / 4)] [heading RIGHTWARD] flat leftFW [mix top bot (j / 4)] [heading RIGHTWARD]
curl rightFW [mix top bot (j / 4 + 1)] [heading RIGHTWARD] curl rightFW [mix top bot (j / 4 + 1)] [heading RIGHTWARD]
save 'ddiagshadesquare' 0x25A7 save [MangleName 'ddiagshadesquare'] [MangleUnicode 0x25A7]
sketch # udiagshadesquare, U+25A8 sketch # udiagshadesquare, U+25A8
define lineWidth : Math.min GEOMETRYSTROKE ((squareRadiusFW * 2 - GEOMETRYSTROKE * 2) * 1 / 11) define lineWidth : Math.min GEOMETRYSTROKE ((squareRadiusFW * 2 - GEOMETRYSTROKE * 2) * 1 / 11)
define top : symbolMid + squareRadiusFW define top : symbolMid + squareRadiusFW
define bot : symbolMid - (top - symbolMid) define bot : symbolMid - (top - symbolMid)
set-width shapeWidth set-width shapeWidth
include : union include : union
begin glyphs.whitesquare begin glyphs.[MangleName 'whitesquare']
intersection intersection
begin glyphs.blacksquare begin glyphs.[MangleName 'blacksquare']
create-glyph : glyph-construction create-glyph : glyph-construction
foreach [j : range (-10) till 10] : include : dispiro foreach [j : range (-10) till 10] : include : dispiro
widths.center lineWidth widths.center lineWidth
flat leftFW [mix top bot (j / 4)] [heading RIGHTWARD] flat leftFW [mix top bot (j / 4)] [heading RIGHTWARD]
curl rightFW [mix top bot (j / 4 - 1)] [heading RIGHTWARD] curl rightFW [mix top bot (j / 4 - 1)] [heading RIGHTWARD]
save 'udiagshadesquare' 0x25A8 save [MangleName 'udiagshadesquare'] [MangleUnicode 0x25A8]
sketch # uddiagshadesquare, U+25A9 sketch # uddiagshadesquare, U+25A9
set-width shapeWidth set-width shapeWidth
include : union glyphs.ddiagshadesquare glyphs.udiagshadesquare include : union glyphs.[MangleName 'ddiagshadesquare'] glyphs.[MangleName 'udiagshadesquare']
save 'uddiagshadesquare' 0x25A9 save [MangleName 'uddiagshadesquare'] [MangleUnicode 0x25A9]
# partial circles # partial circles
define quarters : list define quarters : list
@ -910,7 +931,7 @@ export : define [apply] : begin
define r : squareRadiusFW - GEOMETRYSTROKE / 2 define r : squareRadiusFW - GEOMETRYSTROKE / 2
set-width shapeWidth set-width shapeWidth
include : union include : union
begin glyphs.whitecircle begin glyphs.[MangleName 'whitecircle']
intersection intersection
spiro-outline spiro-outline
g4 middleFW (symbolMid + r) g4 middleFW (symbolMid + r)
@ -939,7 +960,21 @@ export : define [apply] : begin
corner middleFW (symbolMid - squareRadiusFW) corner middleFW (symbolMid - squareRadiusFW)
corner (middleFW + squareRadiusFW) (symbolMid - squareRadiusFW) corner (middleFW + squareRadiusFW) (symbolMid - squareRadiusFW)
corner (middleFW + squareRadiusFW) symbolMid corner (middleFW + squareRadiusFW) symbolMid
save ('uni' + u) u save [MangleName ('uni' + u)] [MangleUnicode u]
sketch
set-width shapeWidth
include : difference
begin glyphs.[MangleName 'blacklongrectangle']
begin glyphs.[MangleName 'blackcircle']
save [MangleName 'uni25D8'] [MangleUnicode 0x25D8]
sketch
set-width shapeWidth
include : difference
begin glyphs.[MangleName 'blacklongrectangle']
begin glyphs.[MangleName 'whitecircle']
save [MangleName 'uni25D9'] [MangleUnicode 0x25D9]
### POWERLINE glyphs ### POWERLINE glyphs
### 'Powerline' ### 'Powerline'
@ -1097,4 +1132,4 @@ export : define [apply] : begin
include : FlipAround MIDDLE [mix pwlTop pwlBot 0.5] include : FlipAround MIDDLE [mix pwlTop pwlBot 0.5]
save 'pwlSlashTopRight' 0xE0BF save 'pwlSlashTopRight' 0xE0BF
return [object ArrowShape] return [object [ArrowShape exportArrowShape]]

View file

@ -102,10 +102,10 @@ export : define [apply] : begin
local right : RIGHTSB + sw * k local right : RIGHTSB + sw * k
sketch # mathO sketch # mathO
include glyphs.hwwhitecircle include glyphs.'whitecircle.hwid'
save 'mathO' save 'mathO'
sketch # mathO-outline sketch # mathO-outline
include glyphs.hwblackcircleO include glyphs.'blackcircleO.hwid'
save 'mathOOutline' save 'mathOOutline'
sketch # mathBoxOutline sketch # mathBoxOutline
include : spiro-outline include : spiro-outline
@ -358,7 +358,7 @@ export : define [apply] : begin
composite glyphs.mathO [intersection glyphs.mathOOutline glyphs.innerMultiply] [into-unicode 0x2297] composite glyphs.mathO [intersection glyphs.mathOOutline glyphs.innerMultiply] [into-unicode 0x2297]
composite glyphs.mathO [intersection glyphs.mathOOutline glyphs.innerMultiplyStroke1] [into-unicode 0x2298] composite glyphs.mathO [intersection glyphs.mathOOutline glyphs.innerMultiplyStroke1] [into-unicode 0x2298]
composite glyphs.mathO [intersection glyphs.mathOOutline glyphs.mathcdot] [into-unicode 0x2299] composite glyphs.mathO [intersection glyphs.mathOOutline glyphs.mathcdot] [into-unicode 0x2299]
composite glyphs.mathO [intersection glyphs.mathOOutline glyphs.hwsmallwhitecircle] [into-unicode 0x229A] composite glyphs.mathO [intersection glyphs.mathOOutline glyphs.'smallwhitecircle.hwid'] [into-unicode 0x229A]
composite glyphs.mathO [intersection glyphs.mathOOutline glyphs.mathAsterisk] [into-unicode 0x229B] composite glyphs.mathO [intersection glyphs.mathOOutline glyphs.mathAsterisk] [into-unicode 0x229B]
composite composite
begin glyphs.mathO begin glyphs.mathO
@ -932,41 +932,41 @@ export : define [apply] : begin
composite glyphs.space [aplBoxed glyphs.equal] [into-unicode 0x2338] composite glyphs.space [aplBoxed glyphs.equal] [into-unicode 0x2338]
composite glyphs.space [aplBoxed glyphs.divide] [into-unicode 0x2339] composite glyphs.space [aplBoxed glyphs.divide] [into-unicode 0x2339]
composite glyphs.space [aplBoxed glyphs.hwwhitediamond] [into-unicode 0x233A] composite glyphs.space [aplBoxed glyphs.'whitediamond.hwid'] [into-unicode 0x233A]
composite glyphs.space [aplBoxed glyphs.hwsmallwhitecircle] [into-unicode 0x233B] composite glyphs.space [aplBoxed glyphs.'smallwhitecircle.hwid'] [into-unicode 0x233B]
composite glyphs.space [aplBoxed glyphs.hwwhitecircle] [into-unicode 0x233C] composite glyphs.space [aplBoxed glyphs.'whitecircle.hwid'] [into-unicode 0x233C]
composite glyphs.space [Overlay glyphs.aplbar glyphs.hwwhitecircle] [into-unicode 0x233D] composite glyphs.space [Overlay glyphs.aplbar glyphs.'whitecircle.hwid'] [into-unicode 0x233D]
composite glyphs.hwwhitecircle glyphs.hwsmallwhitecircle [into-unicode 0x233E] composite glyphs.'whitecircle.hwid' glyphs.'smallwhitecircle.hwid' [into-unicode 0x233E]
composite glyphs.space [Overlay glyphs.aplminus glyphs.slash] [into-unicode 0x233F] composite glyphs.space [Overlay glyphs.aplminus glyphs.slash] [into-unicode 0x233F]
composite glyphs.space [Overlay glyphs.aplminus glyphs.backslash] [into-unicode 0x2340] composite glyphs.space [Overlay glyphs.aplminus glyphs.backslash] [into-unicode 0x2340]
composite glyphs.space [aplBoxed glyphs.slash] [into-unicode 0x2341] composite glyphs.space [aplBoxed glyphs.slash] [into-unicode 0x2341]
composite glyphs.space [aplBoxed glyphs.backslash] [into-unicode 0x2342] composite glyphs.space [aplBoxed glyphs.backslash] [into-unicode 0x2342]
composite glyphs.space [aplBoxed glyphs.less] [into-unicode 0x2343] composite glyphs.space [aplBoxed glyphs.less] [into-unicode 0x2343]
composite glyphs.space [aplBoxed glyphs.greater] [into-unicode 0x2344] composite glyphs.space [aplBoxed glyphs.greater] [into-unicode 0x2344]
composite glyphs.space [Overlay glyphs.hwarrowleft glyphs.aplbar] [into-unicode 0x2345] composite glyphs.space [Overlay glyphs."arrowleft.hwid" glyphs.aplbar] [into-unicode 0x2345]
composite glyphs.space [Overlay glyphs.hwarrowright glyphs.aplbar] [into-unicode 0x2346] composite glyphs.space [Overlay glyphs."arrowright.hwid" glyphs.aplbar] [into-unicode 0x2346]
composite glyphs.space [aplBoxed glyphs.hwarrowleft] [into-unicode 0x2347] composite glyphs.space [aplBoxed glyphs."arrowleft.hwid"] [into-unicode 0x2347]
composite glyphs.space [aplBoxed glyphs.hwarrowright] [into-unicode 0x2348] composite glyphs.space [aplBoxed glyphs."arrowright.hwid"] [into-unicode 0x2348]
composite glyphs.space [Overlay glyphs.aplbackslash glyphs.hwwhitecircle] [into-unicode 0x2349] composite glyphs.space [Overlay glyphs.aplbackslash glyphs.'whitecircle.hwid'] [into-unicode 0x2349]
composite glyphs.bot glyphs.underlineBelow [into-unicode 0x234A] composite glyphs.bot glyphs.underlineBelow [into-unicode 0x234A]
composite glyphs.space [Overlay glyphs.increment glyphs.aplbar] [into-unicode 0x234B] composite glyphs.space [Overlay glyphs.increment glyphs.aplbar] [into-unicode 0x234B]
composite glyphs.space [aplBoxed glyphs.vee] [into-unicode 0x234C] composite glyphs.space [aplBoxed glyphs.vee] [into-unicode 0x234C]
composite glyphs.space [aplBoxed glyphs.increment] [into-unicode 0x234D] composite glyphs.space [aplBoxed glyphs.increment] [into-unicode 0x234D]
composite glyphs.space [Overlay glyphs.hwarrowup glyphs.minus] [into-unicode 0x234F] composite glyphs.space [Overlay glyphs."arrowup.hwid" glyphs.minus] [into-unicode 0x234F]
composite glyphs.space [aplBoxed glyphs.hwarrowup] [into-unicode 0x2350] composite glyphs.space [aplBoxed glyphs."arrowup.hwid"] [into-unicode 0x2350]
composite glyphs.top glyphs.overlineAbove [into-unicode 0x2351] composite glyphs.top glyphs.overlineAbove [into-unicode 0x2351]
composite glyphs.space [Overlay glyphs.nabla glyphs.aplbar] [into-unicode 0x2352] composite glyphs.space [Overlay glyphs.nabla glyphs.aplbar] [into-unicode 0x2352]
composite glyphs.space [aplBoxed glyphs.wedge] [into-unicode 0x2353] composite glyphs.space [aplBoxed glyphs.wedge] [into-unicode 0x2353]
composite glyphs.space [aplBoxed glyphs.nabla] [into-unicode 0x2354] composite glyphs.space [aplBoxed glyphs.nabla] [into-unicode 0x2354]
composite glyphs.space [Overlay glyphs.hwarrowdown glyphs.minus] [into-unicode 0x2356] composite glyphs.space [Overlay glyphs."arrowdown.hwid" glyphs.minus] [into-unicode 0x2356]
composite glyphs.space [aplBoxed glyphs.hwarrowdown] [into-unicode 0x2357] composite glyphs.space [aplBoxed glyphs."arrowdown.hwid"] [into-unicode 0x2357]
composite glyphs.singleQuote markset.plus glyphs.underlineBelow [into-unicode 0x2358] composite glyphs.singleQuote markset.plus glyphs.underlineBelow [into-unicode 0x2358]
composite glyphs.increment glyphs.underlineBelow [into-unicode 0x2359] composite glyphs.increment glyphs.underlineBelow [into-unicode 0x2359]
composite glyphs.hwwhitediamond markset.plus glyphs.underlineBelow [into-unicode 0x235A] composite glyphs.'whitediamond.hwid' markset.plus glyphs.underlineBelow [into-unicode 0x235A]
composite glyphs.hwsmallwhitecircle markset.plus glyphs.underlineBelow [into-unicode 0x235B] composite glyphs.'smallwhitecircle.hwid' markset.plus glyphs.underlineBelow [into-unicode 0x235B]
composite glyphs.hwwhitecircle markset.plus glyphs.underlineBelow [into-unicode 0x235C] composite glyphs.'whitecircle.hwid' markset.plus glyphs.underlineBelow [into-unicode 0x235C]
composite composite
begin glyphs.hwsmallwhitecircle begin glyphs.'smallwhitecircle.hwid'
ScaleAround MIDDLE symbolMid 0.75 ScaleAround MIDDLE symbolMid 0.75
Realign MIDDLE symbolMid MIDDLE (operBot + SMOOTH) Realign MIDDLE symbolMid MIDDLE (operBot + SMOOTH)
UShape operTop operBot [adviceBlackness 5] true UShape operTop operBot [adviceBlackness 5] true
@ -978,8 +978,8 @@ export : define [apply] : begin
composite glyphs.top glyphs.dieresisAbove [into-unicode 0x2361] composite glyphs.top glyphs.dieresisAbove [into-unicode 0x2361]
composite glyphs.nabla glyphs.dieresisAbove [into-unicode 0x2362] composite glyphs.nabla glyphs.dieresisAbove [into-unicode 0x2362]
composite glyphs.'asterisk.low' glyphs.dieresisAbove [into-unicode 0x2363] composite glyphs.'asterisk.low' glyphs.dieresisAbove [into-unicode 0x2363]
composite glyphs.hwsmallwhitecircle markset.plus glyphs.dieresisAbove [into-unicode 0x2364] composite glyphs.'smallwhitecircle.hwid' markset.plus glyphs.dieresisAbove [into-unicode 0x2364]
composite glyphs.hwwhitecircle markset.plus glyphs.dieresisAbove [into-unicode 0x2365] composite glyphs.'whitecircle.hwid' markset.plus glyphs.dieresisAbove [into-unicode 0x2365]
composite glyphs.space [Overlay glyphs.cup glyphs.aplbar] [into-unicode 0x2366] composite glyphs.space [Overlay glyphs.cup glyphs.aplbar] [into-unicode 0x2366]
composite glyphs.space [Overlay glyphs.subst glyphs.aplbar] [into-unicode 0x2367] composite glyphs.space [Overlay glyphs.subst glyphs.aplbar] [into-unicode 0x2367]
composite glyphs.'asciitilde.low' glyphs.dieresisAbove [into-unicode 0x2368] composite glyphs.'asciitilde.low' glyphs.dieresisAbove [into-unicode 0x2368]
@ -1009,8 +1009,9 @@ export : define [apply] : begin
notGlyph 0x2224 'mathbar' [mix symbolMid operTop 0.5] [mix symbolMid operBot 0.5] 0.1 notGlyph 0x2224 'mathbar' [mix symbolMid operTop 0.5] [mix symbolMid operBot 0.5] 0.1
dual 'parallel' 0x2225 'bar' (WIDTH * 0.35) dual 'parallel' 0x2225 'bar' (WIDTH * 0.35)
notGlyph 0x2226 'parallel' [mix symbolMid operTop 0.5] [mix symbolMid operBot 0.5] 0 notGlyph 0x2226 'parallel' [mix symbolMid operTop 0.5] [mix symbolMid operBot 0.5] 0
alias 'mathsmallcircle' 0x2218 'hwsmallwhitecircle' alias 'mathsmallcircle' 0x2218 'smallwhitecircle.hwid'
alias 'mathstar' 0x22C6 'hwblackstar' alias 'whiteDiamondOperator' 0x22C4 'whitediamond.hwid'
alias 'mathstar' 0x22C6 'blackstar.hwid'
turned 'amalg' 0x2A3F 'Pi' MIDDLE (CAP / 2) turned 'amalg' 0x2A3F 'Pi' MIDDLE (CAP / 2)
sketch # sqrt sketch # sqrt

View file

@ -17,13 +17,13 @@
"object-assign": "^4.1.1", "object-assign": "^4.1.1",
"otfcc-ttcize": "^0.9.5", "otfcc-ttcize": "^0.9.5",
"primitive-quadify-off-curves": "^0.4.0", "primitive-quadify-off-curves": "^0.4.0",
"toml": "^2.3.2", "toml": "^3.0.0",
"topsort": "0.0.2", "topsort": "0.0.2",
"ttf2woff": "^2.0.1", "ttf2woff": "^2.0.1",
"ttf2woff2": "^2.0.3", "ttf2woff2": "^2.0.3",
"unorm": "^1.4.1", "unorm": "^1.6.0",
"verda": "^1.0.0-10", "verda": "^1.0.0-10",
"yargs": "^12.0.0" "yargs": "^14.2.0"
}, },
"devDependencies": { "devDependencies": {
"colors": "^1.3.3", "colors": "^1.3.3",

View file

@ -95,6 +95,9 @@ enableCvSs = true
# Whether to generate ligation # Whether to generate ligation
enableLigation = true enableLigation = true
# Excluded code points
excludedCodePointRanges = []
[verbose] [verbose]
verbose = true verbose = true
@ -568,3 +571,8 @@ powerlineShiftX = 500
# unicode = 57600 # 0xE100 # unicode = 57600 # 0xE100
# featureTag = 'XV00' # featureTag = 'XV00'
# sequence = '<*>' # sequence = '<*>'
# Exclude code points
[exclude-check-and-cross-symbol.appends]
excludedCodePointRanges = [[10003, 10008]]

86
support/regulate-glyph.js Normal file
View file

@ -0,0 +1,86 @@
const Glyph = require("./glyph");
const autoRef = require("./autoref");
const caryllShapeOps = require("caryll-shapeops");
const c2q = require("megaminx").geometry.c2q;
function regulateGlyph(g, skew) {
if (!g.contours) return;
// Regulate
for (let k = 0; k < g.contours.length; k++) {
const contour = g.contours[k];
for (let p = 0; p < contour.length; p++) {
contour[p].x += contour[p].y * skew;
if (!contour[p].on) continue;
contour[p].x = Math.round(contour[p].x);
}
let offJ = null,
mx = null;
for (let p = 0; p < contour.length; p++) {
if (!contour[p].on) continue;
if (offJ) {
const origX = contour[p].x;
const rx = Math.round(contour[p].x * 4) / 4;
const origX0 = mx;
const rx0 = contour[offJ - 1].x;
if (origX === origX0) continue;
for (let pOff = offJ; pOff < p; pOff++) {
contour[pOff].x =
((contour[pOff].x - origX0) / (origX - origX0)) * (rx - rx0) + rx0;
}
}
mx = contour[p].x;
contour[p].x = Math.round(contour[p].x * 4) / 4;
offJ = p + 1;
}
}
const c1 = [];
for (let k = 0; k < g.contours.length; k++) {
c1.push(Glyph.contourToStandardCubic(g.contours[k]));
}
// De-overlap
g.contours = caryllShapeOps.removeOverlap(c1, 1, 256, true);
// Finalize
g.contours = c2q.contours(g.contours);
for (let k = 0; k < g.contours.length; k++) {
const contour = g.contours[k];
for (let p = 0; p < contour.length; p++) {
contour[p].x -= contour[p].y * skew;
}
}
}
function byGlyphPriority(a, b) {
const pri1 = a.cmpPriority || 0;
const pri2 = b.cmpPriority || 0;
if (pri1 > pri2) return -1;
if (pri1 < pri2) return 1;
if (a.contours && b.contours && a.contours.length < b.contours.length) return 1;
if (a.contours && b.contours && a.contours.length > b.contours.length) return -1;
if (a.advanceWidth < b.advanceWidth) return -1;
if (a.advanceWidth > b.advanceWidth) return 1;
if ((a.unicode && a.unicode[0] && !b.unicode) || !b.unicode[0]) return -1;
if ((b.unicode && b.unicode[0] && !a.unicode) || !a.unicode[0]) return +1;
if (a.unicode && a.unicode[0] && b.unicode && b.unicode[0] && a.unicode[0] < b.unicode[0])
return -1;
if (a.unicode && a.unicode[0] && b.unicode && b.unicode[0] && a.unicode[0] > b.unicode[0])
return +1;
return a.name < b.name ? -1 : a.name > b.name ? 1 : 0;
}
module.exports = function(font, skew) {
const excludeUnicode = new Set();
excludeUnicode.add(0x80);
for (let c = 0x2500; c <= 0x259f; c++) excludeUnicode.add(c);
// autoref
font.glyf = font.glyf.map((g, j) => ((g.glyphOrder = j), g)).sort(byGlyphPriority);
autoRef(font.glyf, excludeUnicode);
// regulate
for (let g of font.glyf) regulateGlyph(g, skew);
// reorder
font.glyf = font.glyf.sort((a, b) => a.glyphOrder - b.glyphOrder);
};

53
support/variant-data.js Normal file
View file

@ -0,0 +1,53 @@
const objectAssign = require("object-assign");
function mergeVSHive(_target, source) {
if (!source) return _target;
let __cvmap = objectAssign({}, _target.__cvmap, source.__cvmap);
let target = objectAssign(_target, source);
target.__cvmap = __cvmap;
return target;
}
function produceComposite(vs, para, dflt, g) {
let sel = objectAssign({}, dflt);
if (g.design)
for (let h of g.design) {
sel = mergeVSHive(sel, vs[h]);
}
if (!para.isItalic && g.upright) {
for (let h of g.upright) {
sel = mergeVSHive(sel, vs[h]);
}
}
if (para.isItalic && g.italic) {
for (let h of g.italic) {
sel = mergeVSHive(sel, vs[h]);
}
}
sel.__isComposite = true;
return sel;
}
module.exports = function formVariantData(data, para) {
const vs = {};
// simple selector
for (let k in data.simple) {
const hive = objectAssign({}, data.simple[k]);
const tag = hive.tag;
delete hive.tag;
if (tag) {
let __cvmap = {};
for (let k in hive) __cvmap[k] = tag;
hive.__cvmap = __cvmap;
}
vs[k] = hive;
if (tag) vs[tag] = hive;
}
// default selector
vs.default = produceComposite(vs, para, {}, data.default);
// ss## selector
for (let k in data.composite) {
vs[k] = produceComposite(vs, para, vs.default, data.composite[k]);
}
return vs;
};