diff --git a/.esformatter b/.esformatter new file mode 100644 index 0000000..5198072 --- /dev/null +++ b/.esformatter @@ -0,0 +1,461 @@ +{ + "indent" : { + "ReturnStatement": ">=1", + "value": "\t", + "alignComments": true, + "ArrayExpression": 1, + "ArrayPattern": 1, + "ArrowFunctionExpression": 1, + "AssignmentExpression": 1, + "AssignmentExpression.BinaryExpression": 1, + "AssignmentExpression.LogicalExpression": 1, + "AssignmentExpression.UnaryExpression": 1, + "CallExpression": 1, + "CallExpression.BinaryExpression": 1, + "CallExpression.LogicalExpression": 1, + "CallExpression.UnaryExpression": 1, + "CatchClause": 1, + "ConditionalExpression": 1, + "CommentInsideEmptyBlock": 1, + "ClassDeclaration": 1, + "DoWhileStatement": 1, + "ForInStatement": 1, + "ForOfStatement": 1, + "ForStatement": 1, + "FunctionDeclaration": 1, + "FunctionExpression": 1, + "IfStatement": 1, + "MemberExpression": 1, + "MultipleVariableDeclaration": 1, + "NewExpression": 1, + "ObjectExpression": 1, + "ObjectExpression.BinaryExpression": 1, + "ObjectExpression.LogicalExpression": 1, + "ObjectExpression.UnaryExpression": 1, + "ObjectPattern": 1, + "ParameterList": 1, + "SingleVariableDeclaration": 0, + "SwitchCase": 1, + "SwitchStatement": 1, + "TopLevelFunctionBlock": 1, + "TryStatement": 1, + "VariableDeclaration.BinaryExpression": 1, + "VariableDeclaration.LogicalExpression": 1, + "VariableDeclaration.UnaryExpression": 1, + "WhileStatement": 1 + }, + + "lineBreak" : { + "value" : "\n", + + "before" : { + "AssignmentExpression" : -1, + "AssignmentOperator": -1, + "AssignmentPattern" : 0, + "ArrayPatternOpening": 0, + "ArrayPatternClosing": 0, + "ArrayPatternComma": 0, + "ArrowFunctionExpressionArrow": 0, + "ArrowFunctionExpressionOpeningBrace": 0, + "ArrowFunctionExpressionClosingBrace": "<=1", + "BlockStatement" : -1, + "BreakKeyword": ">=1", + "CallExpression" : -1, + "CallExpressionOpeningParentheses" : 0, + "CallExpressionClosingParentheses" : -1, + "ClassDeclaration" : ">=1", + "ClassDeclarationOpeningBrace" : 0, + "ClassDeclarationClosingBrace" : "<=1", + "ConditionalExpression" : ">=1", + "CatchOpeningBrace" : 0, + "CatchClosingBrace" : "<=1", + "CatchKeyword": 0, + "DeleteOperator" : -1, + "DoWhileStatement" : -1, + "DoWhileStatementOpeningBrace" : 0, + "DoWhileStatementClosingBrace" : "<=1", + "EndOfFile" : 1, + "EmptyStatement" : -1, + "FinallyKeyword" : -1, + "FinallyOpeningBrace" : 0, + "FinallyClosingBrace" : "<=1", + "ForInStatement" : -1, + "ForInStatementExpressionOpening" : -1, + "ForInStatementExpressionClosing" : -1, + "ForInStatementOpeningBrace" : 0, + "ForInStatementClosingBrace" : "<=1", + "ForOfStatement" : ">=1", + "ForOfStatementExpressionOpening" : 0, + "ForOfStatementExpressionClosing" : 0, + "ForOfStatementOpeningBrace" : 0, + "ForOfStatementClosingBrace" : "<=1", + "ForStatement" : -1, + "ForStatementExpressionOpening" : -1, + "ForStatementExpressionClosing" : -1, + "ForStatementOpeningBrace" : 0, + "ForStatementClosingBrace" : "<=1", + "FunctionExpression" : -1, + "FunctionExpressionOpeningBrace" : 0, + "FunctionExpressionClosingBrace" : "<=1", + "FunctionDeclaration" : -1, + "FunctionDeclarationOpeningBrace" : 0, + "FunctionDeclarationClosingBrace" : "<=1", + "IIFEClosingParentheses" : 0, + "IfStatement" : -1, + "IfStatementOpeningBrace" : 0, + "IfStatementClosingBrace" : "<=1", + "ElseIfStatement" : -1, + "ElseIfStatementOpeningBrace" : 0, + "ElseIfStatementClosingBrace" : "<=1", + "ElseStatement" : 0, + "ElseStatementOpeningBrace" : 0, + "ElseStatementClosingBrace" : "<=1", + "LogicalExpression" : -1, + "MethodDefinition": ">=1", + "MemberExpressionOpening": 0, + "MemberExpressionClosing": 0, + "MemberExpressionPeriod": -1, + "ObjectExpressionClosingBrace" : -1, + "ObjectPatternOpeningBrace": 0, + "ObjectPatternClosingBrace": 0, + "ObjectPatternComma": 0, + "Property" : -1, + "PropertyValue" : 0, + "ReturnStatement" : -1, + "SwitchOpeningBrace" : 0, + "SwitchClosingBrace" : -1, + "ThisExpression" : -1, + "ThrowStatement" : -1, + "TryKeyword": -1, + "TryOpeningBrace" : 0, + "TryClosingBrace" : "<=1", + "VariableName" : -1, + "VariableValue" : -1, + "VariableDeclaration" : -1, + "VariableDeclarationSemiColon": -1, + "VariableDeclarationWithoutInit" : -1, + "WhileStatement" : -1, + "WhileStatementOpeningBrace" : 0, + "WhileStatementClosingBrace" : "<=1" + }, + + "after" : { + "AssignmentExpression" : -1, + "AssignmentOperator" : -1, + "AssignmentPattern" : 0, + "ArrayPatternOpening": 0, + "ArrayPatternClosing": 0, + "ArrayPatternComma": 0, + "ArrowFunctionExpressionArrow": 0, + "ArrowFunctionExpressionOpeningBrace": ">=1", + "ArrowFunctionExpressionClosingBrace": -1, + "BlockStatement" : -1, + "BreakKeyword": -1, + "CallExpression" : -1, + "CallExpressionOpeningParentheses" : -1, + "CallExpressionClosingParentheses" : -1, + "ClassDeclaration" : ">=1", + "ClassDeclarationOpeningBrace" : ">=1", + "ClassDeclarationClosingBrace" : ">=1", + "CatchOpeningBrace" : "<=1", + "CatchClosingBrace" : -1, + "CatchKeyword": 0, + "ConditionalExpression" : -1, + "DeleteOperator" : -1, + "DoWhileStatement" : -1, + "DoWhileStatementOpeningBrace" : "<=1", + "DoWhileStatementClosingBrace" : -1, + "EmptyStatement" : 1, + "FinallyKeyword" : -1, + "FinallyOpeningBrace" : "<=2", + "FinallyClosingBrace" : -1, + "ForInStatement" : -1, + "ForInStatementExpressionOpening" : -1, + "ForInStatementExpressionClosing" : -1, + "ForInStatementOpeningBrace" : "<=1", + "ForInStatementClosingBrace" : -1, + "ForOfStatement" : -1, + "ForOfStatementExpressionOpening" : "<2", + "ForOfStatementExpressionClosing" : -1, + "ForOfStatementOpeningBrace" : ">=1", + "ForOfStatementClosingBrace" : ">=1", + "ForStatement" : -1, + "ForStatementExpressionOpening" : -1, + "ForStatementExpressionClosing" : -1, + "ForStatementOpeningBrace" : "<=1", + "ForStatementClosingBrace" : -1, + "FunctionExpression" : -1, + "FunctionExpressionOpeningBrace" : "<=1", + "FunctionExpressionClosingBrace" : -1, + "FunctionDeclaration" : -1, + "FunctionDeclarationOpeningBrace" : "<=1", + "FunctionDeclarationClosingBrace" : -1, + "IIFEOpeningParentheses" : 0, + "IfStatement" : -1, + "IfStatementOpeningBrace" : "<=1", + "IfStatementClosingBrace" : -1, + "ElseIfStatement" : -1, + "ElseIfStatementOpeningBrace" : "<=1", + "ElseIfStatementClosingBrace" : -1, + "ElseStatement" : -1, + "ElseStatementOpeningBrace" : "<=1", + "ElseStatementClosingBrace" : -1, + "LogicalExpression" : -1, + "MethodDefinition": ">=1", + "MemberExpressionOpening": 0, + "MemberExpressionClosing" : ">=0", + "MemberExpressionPeriod": 0, + "ObjectExpressionOpeningBrace" : "<=1", + "ObjectPatternOpeningBrace": 0, + "ObjectPatternClosingBrace": 0, + "ObjectPatternComma": 0, + "Property" : -1, + "PropertyName" : 0, + "ReturnStatement" : -1, + "SwitchOpeningBrace" : "<=1", + "SwitchClosingBrace" : -1, + "SwitchCaseColon": ">=1", + "ThisExpression" : -1, + "ThrowStatement" : -1, + "TryKeyword": -1, + "TryOpeningBrace" : "<=1", + "TryClosingBrace" : -1, + "VariableValue" : -1, + "VariableDeclaration" : -1, + "VariableDeclarationSemiColon" : ">=1", + "WhileStatement" : -1, + "WhileStatementOpeningBrace" : "<=1", + "WhileStatementClosingBrace" : -1 + } + }, + + + "whiteSpace" : { + "value" : " ", + "removeTrailing" : 1, + + "before" : { + "AssignmentPattern" : 1, + "ArrayExpressionOpening" : -1, + "ArrayExpressionClosing" : -1, + "ArrayExpressionComma" : -1, + "ArrayPatternOpening": 1, + "ArrayPatternClosing": 0, + "ArrayPatternComma": 0, + "ArrowFunctionExpressionArrow": 1, + "ArrowFunctionExpressionOpeningBrace": 1, + "ArrowFunctionExpressionClosingBrace": 0, + "ArgumentComma" : -1, + "ArgumentList" : 0, + "AssignmentOperator" : 1, + "BinaryExpression": -1, + "BinaryExpressionOperator" : 1, + "BlockComment" : 1, + "CallExpression" : -1, + "CallExpressionOpeningParentheses" : 0, + "CallExpressionClosingParentheses" : -1, + "CatchParameterList" : 0, + "CatchOpeningBrace" : 1, + "CatchClosingBrace" : 1, + "CatchKeyword" : 1, + "CommaOperator" : 0, + "ClassDeclarationOpeningBrace" : 1, + "ClassDeclarationClosingBrace" : 1, + "ConditionalExpressionConsequent" : 1, + "ConditionalExpressionAlternate" : 1, + "DoWhileStatementOpeningBrace" : 1, + "DoWhileStatementClosingBrace" : 1, + "DoWhileStatementConditional" : 1, + "EmptyStatement" : 0, + "ExpressionClosingParentheses": 0, + "FinallyKeyword" : -1, + "FinallyOpeningBrace" : 1, + "FinallyClosingBrace" : 1, + "ForInStatement" : 1, + "ForInStatementExpressionOpening" : 1, + "ForInStatementExpressionClosing" : 0, + "ForInStatementOpeningBrace" : 1, + "ForInStatementClosingBrace" : 1, + "ForOfStatement" : 1, + "ForOfStatementExpressionOpening" : 1, + "ForOfStatementExpressionClosing" : 0, + "ForOfStatementOpeningBrace" : 1, + "ForOfStatementClosingBrace" : 1, + "ForStatement" : 1, + "ForStatementExpressionOpening" : 1, + "ForStatementExpressionClosing" : 0, + "ForStatementOpeningBrace" : 1, + "ForStatementClosingBrace" : -1, + "ForStatementSemicolon" : 0, + "FunctionDeclarationOpeningBrace" : 1, + "FunctionDeclarationClosingBrace" : 1, + "FunctionExpressionOpeningBrace" : 1, + "FunctionExpressionClosingBrace" : 1, + "FunctionGeneratorAsterisk": 1, + "FunctionName" : 1, + "IIFEClosingParentheses" : 0, + "IfStatementConditionalOpening" : 1, + "IfStatementConditionalClosing" : 0, + "IfStatementOpeningBrace" : 1, + "IfStatementClosingBrace" : -1, + "ModuleSpecifierClosingBrace": 1, + "ElseStatementOpeningBrace" : 1, + "ElseStatementClosingBrace" : -1, + "ElseIfStatementOpeningBrace" : 1, + "ElseIfStatementClosingBrace" : -1, + "LineComment" : 1, + "LogicalExpressionOperator" : 1, + "MemberExpressionOpening": 0, + "MemberExpressionClosing" : -1, + "MemberExpressionPeriod": 0, + "ObjectExpressionOpeningBrace": -1, + "ObjectExpressionClosingBrace": -1, + "ObjectPatternOpeningBrace": -1, + "ObjectPatternClosingBrace": -1, + "ObjectPatternComma": 0, + "Property" : -1, + "PropertyValue" : 1, + "ParameterComma" : -1, + "ParameterList" : 0, + "SwitchDiscriminantOpening" : 1, + "SwitchDiscriminantClosing" : -1, + "SwitchCaseColon": 0, + "ThrowKeyword": -1, + "TryKeyword": -1, + "TryOpeningBrace" : 1, + "TryClosingBrace" : -1, + "UnaryExpressionOperator": -1, + "VariableName" : -1, + "VariableValue" : 1, + "VariableDeclarationSemiColon" : 0, + "WhileStatementConditionalOpening" : -1, + "WhileStatementConditionalClosing" : -1, + "WhileStatementOpeningBrace" : -1, + "WhileStatementClosingBrace" : -1 + }, + + "after" : { + "AssignmentPattern" : 1, + "ArrayExpressionOpening" : -1, + "ArrayExpressionClosing" : -1, + "ArrayExpressionComma" : 1, + "ArrayPatternOpening": 0, + "ArrayPatternClosing": 1, + "ArrayPatternComma": 1, + "ArrowFunctionExpressionArrow": 1, + "ArrowFunctionExpressionOpeningBrace": 0, + "ArrowFunctionExpressionClosingBrace": 0, + "ArgumentComma" : 1, + "ArgumentList" : 0, + "AssignmentOperator" : 1, + "BinaryExpression": -1, + "BinaryExpressionOperator" : 1, + "BlockComment" : -1, + "CallExpression" : -1, + "CallExpressionOpeningParentheses" : -1, + "CallExpressionClosingParentheses" : -1, + "CatchParameterList" : -1, + "CatchOpeningBrace" : -1, + "CatchClosingBrace" : -1, + "CatchKeyword" : -1, + "ClassDeclarationOpeningBrace" : 1, + "ClassDeclarationClosingBrace" : 1, + "CommaOperator" : 1, + "ConditionalExpressionConsequent" : 1, + "ConditionalExpressionTest" : 1, + "DoWhileStatementOpeningBrace" : -1, + "DoWhileStatementClosingBrace" : -1, + "DoWhileStatementBody" : -1, + "EmptyStatement" : -1, + "ExpressionOpeningParentheses" : 0, + "FinallyKeyword" : -1, + "FinallyOpeningBrace" : -1, + "FinallyClosingBrace" : -1, + "ForInStatement" : -1, + "ForInStatementExpressionOpening" : -1, + "ForInStatementExpressionClosing" : -1, + "ForInStatementOpeningBrace" : -1, + "ForInStatementClosingBrace" : -1, + "ForStatement" : -1, + "ForStatementExpressionOpening" : -1, + "ForStatementExpressionClosing" : -1, + "ForStatementClosingBrace" : -1, + "ForStatementOpeningBrace" : -1, + "ForStatementSemicolon" : -1, + "FunctionReservedWord": 1, + "FunctionName" : 0, + "FunctionExpressionOpeningBrace" : 1, + "FunctionExpressionClosingBrace" : -1, + "FunctionDeclarationOpeningBrace" : 1, + "FunctionDeclarationClosingBrace" : -1, + "IIFEOpeningParentheses" : 0, + "IfStatementConditionalOpening" : 0, + "IfStatementConditionalClosing" : -1, + "IfStatementOpeningBrace" : -1, + "IfStatementClosingBrace" : 1, + "ModuleSpecifierOpeningBrace": 1, + "ElseStatementOpeningBrace" : -1, + "ElseStatementClosingBrace" : -1, + "ElseIfStatementOpeningBrace" : -1, + "ElseIfStatementClosingBrace" : -1, + "MemberExpressionOpening" : -1, + "MemberExpressionClosing": 0, + "MemberExpressionPeriod": 0, + "MethodDefinitionName" : 0, + "LogicalExpressionOperator" : 1, + "ObjectExpressionOpeningBrace": -1, + "ObjectExpressionClosingBrace": -1, + "ObjectPatternOpeningBrace": -1, + "ObjectPatternClosingBrace": -1, + "ObjectPatternComma": 1, + "PropertyName" : 0, + "PropertyValue" : -1, + "ParameterComma" : 1, + "ParameterList" : 0, + "SwitchDiscriminantOpening" : -1, + "SwitchDiscriminantClosing" : 1, + "ThrowKeyword": -1, + "TryKeyword": -1, + "TryOpeningBrace" : -1, + "TryClosingBrace" : -1, + "UnaryExpressionOperator": -1, + "VariableName" : 1, + "VariableValue" : 0, + "VariableDeclarationSemiColon": -1, + "WhileStatementConditionalOpening" : -1, + "WhileStatementConditionalClosing" : -1, + "WhileStatementOpeningBrace" : -1, + "WhileStatementClosingBrace" : -1 + } + }, + + "jsx": { + "formatJSX": true, + "attrsOnSameLineAsTag": false, + "maxAttrsOnTag": 3, + "firstAttributeOnSameLine": false, + "alignWithFirstAttribute": false, + "spaceInJSXExpressionContainers": "", + "htmlOptions": { + "brace_style": "collapse", + "indent_char": " ", + "indent_size": 2, + "max_preserve_newlines": 2, + "preserve_newlines": true + } + }, + + "plugins": [ + "esformatter-quotes", + "esformatter-literal-notation", + "esformatter-spaced-lined-comment", + "esformatter-semicolons", + "esformatter-semicolon-first", + "esformatter-jsx" + ], + + "quotes": { + "type": "double", + "avoidEscape": true + } +} \ No newline at end of file diff --git a/README.md b/README.md index 58915b4..f8f0975 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Iosevka’s default ligation set is assigned to `calt` feature, though not all o To build Iosevka you should: -1. Ensure that [`node`](http://nodejs.org) (≥ 6.0), [`FontForge`](http://fontforge.org) (with Python scripting support, ≥ Aug. 2015 release), [`ttfautohint`](http://www.freetype.org/ttfautohint/), [`otfcc`](https://github.com/caryll/otfcc) (≥ 0.4.4) and `make` are runnable in your terminal. +1. Ensure that [`nodejs`](http://nodejs.org) (≥ 6.0), [`ttfautohint`](http://www.freetype.org/ttfautohint/), [`otfcc`](https://github.com/caryll/otfcc) (≥ 0.4.4) and `make` are runnable in your terminal. - Windows users may need to install MinGW and make \*nix utilities accessible (`mkdir.exe`, `cp.exe`, `cat.exe` and `rm.exe`, in particular) from Command Prompt. Utilities provided by [Git for Windows](https://git-for-windows.github.io/) works fine. 2. Install necessary libs by `npm install`. If you’ve installed them, upgrade to the latest. 3. `make`. @@ -54,24 +54,36 @@ The `webfonts/` directory is used to build Iosevka for web font uses. To build t 1. Build Iosevka. 2. Ensure that `sfnt2woff` and `woff2_compress` are installed and runnable. -3. `make webfonts`. +3. Run `make web` . -The web fonts will be generated into `dist/webfonts`. +The web fonts will be generated into `dist/iosevka/web` and `dist/iosevka-slab/web`. ## Build Your Own Style ![Styles Preview](https://raw.githubusercontent.com/be5invis/Iosevka/master/images/variants.png) -Iosevka comes with several visual styles, however they are inactive using the default build. To build these variants you should use style variables in the `make` procedure: +Iosevka comes with several visual styles, however they are inactive using the default build. To build these variants, you should perform custom build: -* `STYLE_COMMON` for both uprights and italics, -* `STYLE_UPRIGHT` for upright and oblique, and -* `STYLE_ITALIC` for itaics only. +1. `make custom-config [set=]` with the parameters listed below to create a configuration. The `set=` part is optional, it will be set to `custom` when absent. +2. `make custom [set=]` to acquire your custom font. + - `make custom-web [set=]` is for web fonts. -You can add arbitary styles for these variables, for example, `make STYLE_UPRIGHT='v-l-zshaped v-i-zshaped'` to create a variant with Z-shaped letter `l` and `i` for uprights. +The first step, `make custom-config` takes following parameters to set styles of your custom build. All of them are optional, and would default to Iosevka’s default configuration: + +* `design=''`, styles for your custom font set. +* `upright=''`, styles for uprights only. +* `italic=''`, styles for italics only. +* `oblique=''`, styles for obliques only. + +You can add arbitary styles for these variables, for example, `make custom-config upright='v-l-zshaped v-i-zshaped' && make custom` will create a variant with Z-shaped letter `l` and `i` for uprights. The current avaliable styles are: +* Styles for general shape: + * `sans` : Sans serif (default). + * `slab` : Slab serif. When present, the family of your font would be `Iosevka Slab`. +* Styles related to ligations + - `term` : Disable ligations. When this style is present, the font built will not contain ligatures, and its family name will be set to `Iosevka Term`. In case of your OS or editor cannot handle ligatures correctly, you can disable ligations with it. * Styles for letter `l`: * `v-l-hooky` : Hooky `l`. * `v-l-zshaped` : Z-shaped `l`. @@ -117,151 +129,5 @@ The current avaliable styles are: * Styles for curly brackets ({}) * `v-brace-straight` : More straight braces. * `v-brace-curly` : More curly braces (default). -* Styles related to ligations - * `term` : Disable ligations. When this style is present, the font built will not contain ligatures, and its family name will be set to `Iosevka Term`. In case of your OS or editor cannot handle ligatures correctly, you can disable ligations using it. - - -## Release Notes - -* **1.10.5** - - Added a Sulzbacher-style Eszet (`ß`), assigned to `cv35`/`v-eszet-sulzbacher`. The old, traditional Eszet is assigned to `cv34`/`v-eszet-traditional`. - - Made braces more curly. It is assigned to `cv37`/`v-brace-curly`. The old straight braces are assigned to `cv36`/`v-brace-straight`. - - Added several symbols. - - Fixed incorrect shapes of /capitalTurnm (`Ɯ`), /lrtail(`ɭ`) and /suplrtail (`ᶩ`). -* **1.10.4** - - Added feature tag for ML (`XML_`), Idris (`XIDR`), F# (`XFS_`), F\* (`XFST`), Elm (`XELM`), PureScript (`PURS`), Swift (`SWFT`) and Coq (`XV__`). - - Added ligation for `/\` and `\/`. - - Added arbitary-length ligations, like `***********>` or `<-------------`. -* **1.10.3** - - Improved ligations, including `<*>`, etc. -* **1.10.2** - - Complete APL Support.Optimize shape of overlay symbols. -* **1.10.1** - - Add APL symbols. -* **1.10.0** - - Added `cv29` and `cv30` for `^`. - - Added two new `@` glyphs, assigned to `cv32` and `cv33`, while the old `@` is assigned to `cv31`. - - Made `S` and `$` more distinctive. -* **1.9.6** - - Make the font conformal with MS FontVal. - - Make backslash less slant. -* **1.9.5** - - Fixed the bug that FireFox reject to display. -* **1.9.4** - - Add two styles of `l`. -* **1.9.3** - - Minor symbol additions. -* **1.9.2** - - Added short-legged `m` (assigned to `cv26`). -* **1.9.1** - - Added /latinayin. - - Added more symbols. -* **1.9.0** - - Added open double-storey `g` (assigned to `cv24`). - - Redesigned single-storey `a`. - - Reassigned the `ss**` styles. Now they are designed to simulate existing fonts. -* **1.8.6** - - Added Bulgarian and Macedonian Cyrillic variants - - Added ligations about colons -* **1.8.5** - - Added `XHS_` and `XPTL` feature tags for Language-Specific ligations. - - Added `/bolt`, `/blackflag`, `/circlestar` and `/heavyballotcross` symbols. -* **1.8.4** - - Added `opbd` feature for punctuation compression. -* **1.8.3** - - Added Kome symbol (`※`). - - Reorganized pre-built release packages. The “IosevkaNL” is renamed to “Iosevka Term”. -* **1.8.2** - - Iosevka now provides a new variant family “IosevkaNL”, with ligation disabled to avoid typesetting issues under some Linux environments. -* **1.8.1** - - Added more ligations. - - Fixed the incorrectly-sized symbol `∞` in the CC variants. -* **1.8.0** - - Added a lower paragraph symbol (`¶`) shape, and two OpenType features (`cv22` and `cv23`) to enable them. - - Most mathematical operators, like `≤`, will be full-width in the CC variants. - - Added experimental ligatures support. Currently the ligatures are assigned to feature “`calt`” and contains these figures only: `-> --> <- <-- <-> $@ - @fontforge -quiet -script $^ $@.a.ttf $(if $(findstring italic,$@),10,$(if $(findstring oblique,$@),10,0)) $(_DONTREF) $(SUPPRESS_ERRORS) - @$(HINT) $@.a.ttf $@ - @-rm $@.a.ttf -# Pass 2 : add metadata -$(TARGETS) : $(OBJDIR)/%.ttf : pass2-finalize.js $(OBJDIR)/.pass1-%.ttf $(OBJDIR)/.pass0-%.fdt - @otfccdump $(word 2,$^) | $(NODE) $< $(word 3,$^) | otfccbuild -s -O3 -o $@ --keep-average-char-width $(HINT_SUFFIX) - -$(DISTTARGETS) : $(DISTDIR)/%.ttf : $(OBJDIR)/%.ttf - @cp $< $@ - -# releaseing -ARCHIVEDIR = release-archives - -PAGEDIR = pages/assets -PAGESTTF = $(subst $(DISTDIR)/,$(PAGEDIR)/,$(DISTTARGETS)) -$(PAGESTTF) : $(PAGEDIR)/%.ttf : $(DISTDIR)/%.ttf - cp $< $@ -PAGESWOFF = $(subst .ttf,.woff,$(PAGESTTF)) -$(PAGESWOFF) : $(PAGEDIR)/%.woff : $(PAGEDIR)/%.ttf - sfnt2woff $< -PAGESWOFF2 = $(subst .ttf,.woff2,$(PAGESTTF)) -$(PAGESWOFF2) : $(PAGEDIR)/%.woff2 : $(PAGEDIR)/%.ttf - woff2_compress $< -PAGESMAPS = $(subst $(OBJDIR)/,$(PAGEDIR)/,$(MAPS)) -$(PAGESMAPS) : $(PAGEDIR)/%.charmap : $(OBJDIR)/%.charmap - cp $< $@ - -WEBFONTDIR = dist/webfonts/assets -WEBFONTSTTF = $(subst $(DISTDIR)/,$(WEBFONTDIR)/,$(DISTTARGETS)) -$(WEBFONTSTTF) : $(WEBFONTDIR)/%.ttf : $(DISTDIR)/%.ttf - cp $< $@ -WEBFONTSWOFF = $(subst .ttf,.woff,$(WEBFONTSTTF)) -$(WEBFONTSWOFF) : $(WEBFONTDIR)/%.woff : $(WEBFONTDIR)/%.ttf - sfnt2woff $< -WEBFONTSWOFF2 = $(subst .ttf,.woff2,$(WEBFONTSTTF)) -$(WEBFONTSWOFF2) : $(WEBFONTDIR)/%.woff2 : $(WEBFONTDIR)/%.ttf - woff2_compress $< -WEBFONTCSS = dist/webfonts/$(ARCPREFIXB).css -$(WEBFONTCSS) : webfont-csses/$(ARCPREFIXB).css - cp $< $@ - -#$(ARCHIVEDIR)/$(ARCPREFIX)$(ARCPREFIXB)-$(VERSION).tar.bz2 : $(DISTTARGETS) -# cd $(DISTDIR) && tar -cjvf ../$@ $(subst $(DISTDIR)/,,$^) -$(ARCHIVEDIR)/$(ARCPREFIX)$(ARCPREFIXB)-$(VERSION).zip : $(DISTTARGETS) - cd $(DISTDIR) && 7z a -tzip -mx=9 ../../$@ ./*.ttf -$(ARCHIVEDIR)/$(ARCPREFIX)$(ARCPREFIXB)-$(VERSION).7z : $(DISTTARGETS) - cd $(DISTDIR) && 7z a -t7z -mmt=on -m0=LZMA:a=1:d=1536m:fb=256 ../../$@ ./*.ttf - -#archives : $(ARCHIVEDIR)/$(ARCPREFIX)$(ARCPREFIXB)-$(VERSION).tar.bz2 $(ARCHIVEDIR)/$(ARCPREFIX)$(ARCPREFIXB)-$(VERSION).zip -archives : $(ARCHIVEDIR)/$(ARCPREFIX)$(ARCPREFIXB)-$(VERSION).zip $(ARCHIVEDIR)/$(ARCPREFIX)$(ARCPREFIXB)-$(VERSION).7z -pages : $(PAGESTTF) $(PAGESWOFF) $(PAGESWOFF2) $(PAGESMAPS) -webfonts : $(WEBFONTSTTF) $(WEBFONTSWOFF) $(WEBFONTSWOFF2) $(WEBFONTCSS) - -SNAPSHOT_ASSETS = $(subst dist/webfonts/,snapshot/,$(WEBFONTSTTF) $(WEBFONTSWOFF) $(WEBFONTSWOFF2) $(WEBFONTCSS)) -$(SNAPSHOT_ASSETS) : snapshot/% : dist/webfonts/% - cp $< $@ -snapshot: $(SNAPSHOT_ASSETS) - -# testdrive -TESTDIR = testdrive/assets -TESTTTF = $(subst $(DISTDIR)/,$(TESTDIR)/,$(DISTTARGETS)) -$(TESTTTF) : $(TESTDIR)/%.ttf : $(DISTDIR)/%.ttf - cp $< $@ -TESTMAPS = $(subst $(OBJDIR)/,$(TESTDIR)/,$(MAPS)) -$(TESTMAPS) : $(TESTDIR)/%.charmap : $(OBJDIR)/%.charmap - cp $< $@ - -test : $(TESTTTF) $(TESTMAPS) \ No newline at end of file diff --git a/package.json b/package.json index 95fbe8a..ed0b2c6 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,8 @@ "dependencies": { "bezier-js": "^2.0.0", "cubic2quad": "^1.0.0", + "otfcc-c2q": "^0.5.0", + "caryll-shapeops": "^0.2.0", "libspiro-js": ">=0.3.0", "patel": ">=0.32.0", "toml": ">=2.3.0", diff --git a/parameters.toml b/parameters.toml index 2a96dd6..c72be9c 100644 --- a/parameters.toml +++ b/parameters.toml @@ -1,7 +1,7 @@ [iosevka] family = 'Iosevka' -version = '1.10.5' -codename = 'Juno' +version = '1.11.0' +codename = 'Klaes' copyright = 'Copyright (c) 2015-2016 Belleve Invis.' licence = '''This font software is licenced under the SIL Open Font Licence, Version 1.1. This is licence is avaliable with a FAQ at: http://scripts.sil.org/OFL. This font software is distributes on an 'AS IS' basis, without warranties or conditions of any kind, either express or implied. See the SIL Open Font licence fot the specific language, premissions and limitations governing your use of this font software.''' manufacturer = 'Belleve Invis' diff --git a/pass1-cleanup.py b/pass1-cleanup.py deleted file mode 100644 index 146d58f..0000000 --- a/pass1-cleanup.py +++ /dev/null @@ -1,51 +0,0 @@ -import fontforge -import psMat -import math -import sys - -source = sys.argv[1] -font = fontforge.open(source) - -if len(sys.argv) < 5 or sys.argv[4] != "true": - # Replace accented characters into references - font.selection.select(("ranges", None), ".notdef", "nonmarkingreturn") - font.replaceWithReference() - - font.selection.select("braille1", "braille13", "braille12", "braille17", "braille123", "braille127", "braille137", "braille1237") - for i in font.selection: - glyph = font[i] - glyph.unlinkRef() - -# Remove overlapped area -font.selection.all() -font.removeOverlap() -for i in font: - glyph = font[i] - if len(glyph.references) > 0 and len(glyph.layers["Fore"]) > 0: # a mixed glyph - glyph.unlinkRef() - glyph.removeOverlap() - -for u in range(0x20, 0x7F): - font.selection.select(("unicode", None), u) - for g in font.selection: - font[g].unlinkRef() - -font.selection.all() -font.simplify(0.05, ("smoothcurves", "choosehv"), 0.1) - -#font.em = 2000 -font.selection.all() -font.layers["Fore"].is_quadratic = True -font.transform(psMat.skew(float(sys.argv[3]) / 180 * math.pi)) -font.em = 1000 - -font.selection.all() -font.round() -font.removeOverlap() -font.simplify(0.01) -font.selection.all() -font.removeOverlap() - -font.canonicalContours() -font.canonicalStart() -font.generate(sys.argv[2], flags = ("opentype")) \ No newline at end of file diff --git a/pass2-finalize.js b/pass2-finalize.js deleted file mode 100644 index ae333aa..0000000 --- a/pass2-finalize.js +++ /dev/null @@ -1,22 +0,0 @@ -var path = require('path'); -var fs = require('fs'); -var toml = require('toml'); -var argv = require('yargs').argv; - -var glyfsource = ''; -process.stdin.resume(); -process.stdin.on('data', function (buf) { glyfsource += buf.toString(); }); -process.stdin.on('end', function () { - var ttf = JSON.parse(fs.readFileSync(argv._[0], 'utf-8')); - if(glyfsource[0] == '\uFEFF') glyfsource = glyfsource.slice(1); - var glyfs = JSON.parse(glyfsource); - ttf.post.format = 3.0; - ttf.cmap = glyfs.cmap; - ttf.glyf = glyfs.glyf; - ttf.prep = glyfs.prep; - ttf.fpgm = glyfs.fpgm; - ttf.cvt_ = glyfs.cvt_; - ttf.maxp = glyfs.maxp; - ttf.gasp = glyfs.gasp; - process.stdout.write(JSON.stringify(ttf) + '\n'); -}); \ No newline at end of file diff --git a/support/autoref.js b/support/autoref.js new file mode 100644 index 0000000..5c71283 --- /dev/null +++ b/support/autoref.js @@ -0,0 +1,99 @@ +var Point = require("./point"); + +function delta(a, b) { + return Math.round((a - b) * 32); +} + +function contourHash(c) { + if (!c || c.length < 2) return "."; + var lx = c[0].x, ly = c[0].y; + var buf = ""; + for (var j = 1; j < c.length; j++) { + var z = c[j]; + buf += `${z.on ? 'o':'f'}${z.cubic?'c':'q'}${delta(z.x, lx)},${delta(z.y, ly)};`; + lx = z.x, ly = z.y; + } + return buf; +} + +function match(g1, g2, _n) { + for (let j = 0; j + g1.contours.length <= g2.contours.length; j++) { + var found = true; + for (var k = j; k < g2.contours.length && k - j < g1.contours.length; k++) { + if (g1.contours[k - j].hash !== g2.contours[k].hash + || !(k <= j || delta(g1.contours[k - j][0].x, g1.contours[k - j - 1][0].x) === delta(g2.contours[k][0].x, g2.contours[k - 1][0].x) + && delta(g1.contours[k - j][0].y, g1.contours[k - j - 1][0].y) === delta(g2.contours[k][0].y, g2.contours[k - 1][0].y))) { + found = false; + break; + } + } + if (found) { + if (!g2.references) g2.references = []; + g2.references.push({ + glyph: g1.name, + _n: _n, + x: g2.contours[j][0].x - g1.contours[0][0].x, + y: g2.contours[j][0].y - g1.contours[0][0].y + }); + g2.contours.splice(j, g1.contours.length); + return true; + } + } + return false; +} + +function unlinkRef(g, dx, dy, glyf) { + var cntrs = g.contours.map(c => c.map(z => new Point(z.x + dx, z.y + dy, z.on, z.cubic))); + if (g.references) + for (let r of g.references) { + cntrs = cntrs.concat(unlinkRef(glyf[r._n], r.x + dx, r.y + dy, glyf)); + } + return cntrs; +} + +function autoref(glyf) { + for (var j = 0; j < glyf.length; j++) { + var g = glyf[j]; + if (g.contours) { + for (var k = 0; k < g.contours.length; k++) { + var contour = g.contours[k]; + contour.hash = contourHash(contour); + } + } + } + + + // Refl-referencify, forward. + for (var j = 0; j < glyf.length; j++) { + if (!glyf[j].contours.length || glyf[j].references && glyf[j].references.length) continue; + for (var k = j + 1; k < glyf.length; k++) { + if (glyf[j].contours.length === glyf[k].contours.length) { + if (match(glyf[j], glyf[k], j)) { + // console.log("Refl", glyf[j].name, glyf[j].unicode, "->", glyf[k].name, glyf[k].unicode); + } + } + } + } + + // referencify, backward + for (var j = 0; j < glyf.length; j++) { + if (glyf[j].cmpPriority < 0 || !glyf[j].contours.length || glyf[j].references && glyf[j].references.length) continue; + for (var k = j - 1; k >= 0; k--) { + if (glyf[j].contours.length > glyf[k].contours.length) continue; + while(match(glyf[j], glyf[k], j)){ + // console.log("Part", glyf[j].name, "->", glyf[k].name); + } + } + } + + // unlink composite + for (var j = 0; j < glyf.length; j++) { + if (glyf[j].contours.length === 0 || !glyf[j].references || glyf[j].references.length === 0) continue; + // console.log("Unlink", glyf[j].name); + var cs = unlinkRef(glyf[j], 0, 0, glyf); + glyf[j].contours = g.contours.concat(cs); + glyf[j].references = []; + } +} + +module.exports = autoref; diff --git a/support/fairify.js b/support/fairify.js index 2b5e971..a44f39e 100644 --- a/support/fairify.js +++ b/support/fairify.js @@ -122,9 +122,9 @@ function splitAtExtrema(z1, z2, z3, z4, angles, splitpoints) { var t2 = ts[k]; var bef = splitBefore(z1, z2, z3, z4, t2); var seg = splitAfter(bef[0], bef[1], bef[2], bef[3], t1 / t2); - seg[1].onCurve = seg[2].onCurve = false; + seg[1].on = seg[2].on = false; seg[1].cubic = seg[2].cubic = true; - seg[3].onCurve = true; + seg[3].on = true; splitpoints.push(seg[1], seg[2], seg[3]); } } @@ -211,7 +211,7 @@ function fairify(scurve, gizmo, denseQ, cleanMore) { var splitpoints = [scurve[0]]; var last = scurve[0]; for (var j = 1; j < scurve.length; j++) { - if (scurve[j].onCurve) { + if (scurve[j].on) { splitpoints.push(last = scurve[j]); } else if (scurve[j].cubic) { var z1 = last, @@ -238,13 +238,13 @@ function fairify(scurve, gizmo, denseQ, cleanMore) { } // Mark corners and extrema for (var j = 1; j < splitpoints.length - 1; j++) { - if (splitpoints[j].onCurve && !splitpoints[j - 1].onCurve) { + if (splitpoints[j].on && !splitpoints[j - 1].on) { splitpoints[j].prev = splitpoints[j - 1]; } - if (splitpoints[j].onCurve && !splitpoints[j + 1].onCurve) { + if (splitpoints[j].on && !splitpoints[j + 1].on) { splitpoints[j].next = splitpoints[j + 1]; } - if (splitpoints[j].onCurve && !splitpoints[j - 1].onCurve && !splitpoints[j + 1].onCurve) { + if (splitpoints[j].on && !splitpoints[j - 1].on && !splitpoints[j + 1].on) { var z1 = splitpoints[j], z0 = splitpoints[j - 1], z2 = splitpoints[j + 1]; @@ -272,7 +272,7 @@ function fairify(scurve, gizmo, denseQ, cleanMore) { } else { z1.mark = true; // also corner } - } else if (splitpoints[j].onCurve) { + } else if (splitpoints[j].on) { splitpoints[j].mark = true; // corner } } @@ -312,7 +312,7 @@ function fairify(scurve, gizmo, denseQ, cleanMore) { nextmark = splitpoints[k]; segments = estimateSegments(lastmark, nextmark); } - if (splitpoints[j].onCurve && !splitpoints[j].mark) { + if (splitpoints[j].on && !splitpoints[j].mark) { var z1 = splitpoints[j], z0 = splitpoints[j - 1], z2 = splitpoints[j + 1]; @@ -327,12 +327,12 @@ function fairify(scurve, gizmo, denseQ, cleanMore) { } } // Rebuild curve - for (var j = 0; j < splitpoints.length; j++) if (splitpoints[j].onCurve && !splitpoints[j].remove && splitpoints[j + 1] && !splitpoints[j + 1].onCurve) { + for (var j = 0; j < splitpoints.length; j++) if (splitpoints[j].on && !splitpoints[j].remove && splitpoints[j + 1] && !splitpoints[j + 1].on) { for (var k = j + 2; k < splitpoints.length && splitpoints[k].remove; k++); if (k - j > 2) { var zs = fitpts(splitpoints[j], splitpoints[j + 1], splitpoints[k], splitpoints[k + 1]); if (zs) { - zs[0].onCurve = zs[1].onCurve = false; + zs[0].on = zs[1].on = false; zs[0].cubic = zs[1].cubic = true; splitpoints[j + 1] = zs[0]; splitpoints[k] = zs[1]; diff --git a/support/glyph.ptl b/support/glyph.ptl index 9514e14..870e067 100644 --- a/support/glyph.ptl +++ b/support/glyph.ptl @@ -25,7 +25,7 @@ define [closepoint p q t] : begin define [oncurveRemovable a b c t] : begin local xm : (a.x + c.x) / 2 local ym : (a.y + c.y) / 2 - return : [not a.onCurve] && b.onCurve && [not c.onCurve] && [not a.cubic] && [not c.cubic] && (a.x <= b.x && b.x <= c.x || a.x >= b.x && b.x >= c.x) && (a.y <= b.y && b.y <= c.y || a.y >= b.y && b.y >= c.y) && [Math.abs (b.x - xm)] <= (t / 2) && [Math.abs (b.y - ym)] <= (t / 2) + return : [not a.on] && b.on && [not c.on] && [not a.cubic] && [not c.cubic] && (a.x <= b.x && b.x <= c.x || a.x >= b.x && b.x >= c.x) && (a.y <= b.y && b.y <= c.y || a.y >= b.y && b.y >= c.y) && [Math.abs (b.x - xm)] <= (t / 2) && [Math.abs (b.y - ym)] <= (t / 2) define PRECISION 1000 define [cov x] : piecewise @@ -154,7 +154,7 @@ export all : class Glyph local c {} set c.tag : contour.tag || component.tag || t.defaultTag foreach [point : items-of contour] : begin - c.push : new Point (point.x + shiftx) (point.y + shifty) point.onCurve point.cubic point.subdivided + c.push : new Point (point.x + shiftx) (point.y + shifty) point.on point.cubic point.subdivided newcontours.push c set this.contours : this.contours.concat newcontours if (([not contours] || copyAnchors) && glyph.anchors) : begin @@ -187,7 +187,7 @@ export all : class Glyph for [local j 1] (j < contour.length) [inc j] : begin local point contour.(j) piecewise - point.onCurve : begin + point.on : begin if delta : then : set buf : buf + "l \[cov : point.x - lx] \[cov : point.y - ly]" : else : set buf : buf + "L \[cov point.x] \[cov point.y]" @@ -215,16 +215,52 @@ export all : class Glyph inc j set buf : buf + " Z\n" return buf + + static [contourToStandardCubic contour] : begin + local c {} + if (!contour || !contour.length) : return c + + local lx contour.0.x + local ly contour.0.y + c.push {.x lx .y ly .on true} + for [local j 1] (j < contour.length) [inc j] : begin + local point contour.(j) + piecewise + point.on : begin + c.push {.x point.x .y point.y .on true} + set {.x lx .y ly} point + point.cubic : begin + local z1 point + local z2 contour.(j + 1) + local z3 contour.(j + 2) + c.push {.x z1.x .y z1.y .on false} + c.push {.x z2.x .y z2.y .on false} + c.push {.x z3.x .y z3.y .on true} + set {.x lx .y ly} z3 + set j : j + 2 + true : begin + local zc point + local zf : if contour.(j + 1) contour.(j + 1) contour.0 + local x1 : mix lx zc.x (2 / 3) + local y1 : mix ly zc.y (2 / 3) + local x2 : mix zf.x zc.x (2 / 3) + local y2 : mix zf.y zc.y (2 / 3) + c.push {.x x1 .y y1 .on false} + c.push {.x x2 .y y2 .on false} + c.push {.x zf.x .y zf.y .on true} + set {.x lx .y ly} zf + inc j + return c public [cleanup t] : begin foreach c [range 0 this.contours.length] : begin local ocontour this.contours.(c) # add infections - local contour {[new Point ocontour.0.x ocontour.0.y ocontour.0.onCurve]} + local contour {[new Point ocontour.0.x ocontour.0.y ocontour.0.on]} local flag 0 foreach [j : range 1 (ocontour.length - 1)] : piecewise flag : dec flag - ocontour.(j).onCurve : contour.push ocontour.(j) + ocontour.(j).on : contour.push ocontour.(j) ocontour.(j).cubic : begin local p0 contour.(contour.length - 1) local p1 ocontour.(j) @@ -249,7 +285,7 @@ export all : class Glyph local p0 contour.(contour.length - 1) local p1 ocontour.(j) local p2 ocontour.(j + 1) - if [not p2.onCurve] : set p2 : new Point [mix p1.x p2.x 0.5] [mix p1.y p2.y 0.5] true + if [not p2.on] : set p2 : new Point [mix p1.x p2.x 0.5] [mix p1.y p2.y 0.5] true local strand : new Bezier p0.x p0.y p1.x p1.y p2.x p2.y local ts [strand.extrema].y piecewise @@ -265,7 +301,7 @@ export all : class Glyph new Point s.points.2.x s.points.2.y true set flag 1 - contour.push [new Point ocontour.(ocontour.length - 1).x ocontour.(ocontour.length - 1).y ocontour.(ocontour.length - 1).onCurve] + contour.push [new Point ocontour.(ocontour.length - 1).x ocontour.(ocontour.length - 1).y ocontour.(ocontour.length - 1).on] # cleanup local cleanedContour {} @@ -296,7 +332,7 @@ export all : class Glyph set contour.(k + 2).unimportant true set k : k + 2 if found : begin - set contour.(j).onCurve true + set contour.(j).on true set j (k - 1) foreach point [items-of contour] : if [not point.unimportant] : cleanedContour.push point this.contours.(c) = cleanedContour diff --git a/support/point.ptl b/support/point.ptl index 95acae9..df9e445 100644 --- a/support/point.ptl +++ b/support/point.ptl @@ -1,14 +1,14 @@ export all : class Point - public [new x y onCurve cubic subdivided] : begin + public [new x y on cubic subdivided] : begin this.x = x this.y = y - this.onCurve = onCurve || false + this.on = on || false this.subdivided = subdivided || false this.cubic = cubic || false - static [transformed tfm x y onCurve cubic subdivided] : new Point + static [transformed tfm x y on cubic subdivided] : new Point * x * tfm.xx + y * tfm.yx + tfm.x * x * tfm.xy + y * tfm.yy + tfm.y - * onCurve + * on * cubic * subdivided \ No newline at end of file diff --git a/support/transform.ptl b/support/transform.ptl index 82785d2..89d6691 100644 --- a/support/transform.ptl +++ b/support/transform.ptl @@ -14,7 +14,7 @@ export all : class Transform static [transformPoint tfm pt] : new Point * pt.x * tfm.xx + pt.y * tfm.yx + tfm.x * pt.x * tfm.xy + pt.y * tfm.yy + tfm.y - * pt.onCurve + * pt.on * pt.cubic * pt.subdivided static [inverse tfm] : begin @@ -31,6 +31,6 @@ export all : class Transform return : new Point * (xx * tfm.yy - yy * tfm.yx) / denom * (yy * tfm.xx - xx * tfm.xy) / denom - * pt.onCurve + * pt.on * pt.cubic * pt.subdivided \ No newline at end of file