764 KiB
Building Iosevka from Source
Getting the files
To make the font, first you need to have the files that contain the repository’s source code. Here are two ways:
- Download the archive of Iosevka’s source code, then extract its contents into somewhere on your computer.
- Cloning this repository using Git:
git clone --depth 1 https://github.com/be5invis/Iosevka.git
Building
To build Iosevka you should:
- Install
nodejs(≥ 18.0.0) andttfautohint. Make sure that they are accessible fromPATHenvironment variable. - Open a CLI shell in a terminal,
cdinto the directory containing Iosevka source code. - Run
npm install. This command will install all the NPM dependencies. - Run
npm run build -- contents::Iosevka. This command will build your fonts.
You will find TTFs, as well as WOFF(2) web fonts and one Webfont CSS in the dist/ directory.
To using Docker build, read docker/README.md.
Customized Build
To create a custom build, you need:
-
Create
private-build-plans.tomlfile if absent, place alongside thebuild-plans.tomlin the repository. -
Add a build plan into
private-build-plans.toml. The configurable properties are described in the following sections. -
Run
npm run build -- contents::<your plan name>and the built fonts would be available indist/. Aside fromcontents::<plan>, other options are:contents::<plan>: Everything (TTF + webfont, hinted + unhinted);ttf::<plan>: TTF only;ttf-unhinted::<plan>: Unhinted TTF only;webfont::<plan>: Web fonts only (CSS + WOFF2);webfont-unhinted::<plan>: Unhinted web fonts only (CSS + WOFF2);woff2::<plan>: WOFF2 only.woff2-unhinted::<plan>: Unhinted WOFF2 only.
⚠️ Important: By default, the build system will schedule a number of concurrently running jobs equal to the number of threads available on the CPU, which will push CPU usage and also likely RAM usage, if you do not have very much to work with, to the ceiling (each job consumes more than 1 GB of RAM at its peak). If this is an issue for you, pass an additional argument --jCmd=<number of concurrent jobs>.
Configuring Custom Build
Configuration of build plans are organized under [buildPlans.<plan name>] sections in the private-build-plans.toml. You can use the Customizer to create the build plan, and/or manually edit them, following the instructions below. It is recommended to use PascalCase in the plan names.
Inside the plan, top-level properties include:
family: String, defines the family name of your custom variant.spacing: Optional, String, denotes the spacing of the custom variant. Valid values include:normal: The normal monospace font.quasi-proportional: The font will become quasi-proportional.quasi-proportional-extension-only: The font will become quasi-proportional, but will not shrink narrow letters (likei). Only wide letters (likeM) will get expanded.term: Make the symbols' width suitable for terminal emulators. Arrows and geometric symbols will become narrower.fontconfig-mono: Applytermspacing changes and further apply changes to be compatible with FontConfig's Mono spacing, which recognizes a font as monospace if and only if its every non-combining characters having the same width. The changes include:- Completely remove wide glyphs. All non-combining glyphs will be exactly the same width.
- As a consequence, the following characters will be removed:
U+27DDLONG RIGHT TACKU+27DELONG LEFT TACKU+27F5LONG LEFTWARDS ARROWU+27F6LONG RIGHTWARDS ARROWU+27F7LONG LEFT RIGHT ARROWU+27F8LONG LEFTWARDS DOUBLE ARROWU+27F9LONG RIGHTWARDS DOUBLE ARROWU+27FALONG LEFT RIGHT DOUBLE ARROWU+27FBLONG LEFTWARDS ARROW FROM BARU+27FCLONG RIGHTWARDS ARROW FROM BARU+27FDLONG LEFTWARDS DOUBLE ARROW FROM BARU+27FELONG RIGHTWARDS DOUBLE ARROW FROM BARU+27FFLONG RIGHTWARDS SQUIGGLE ARROWU+2B33LONG LEFTWARDS SQUIGGLE ARROWU+1F8D0LONG RIGHTWARDS ARROW OVER LONG LEFTWARDS ARROWU+1F8D1LONG RIGHTWARDS HARPOON OVER LONG LEFTWARDS HARPOONU+1F8D2LONG RIGHTWARDS HARPOON ABOVE SHORT LEFTWARDS HARPOONU+1F8D3SHORT RIGHTWARDS HARPOON ABOVE LONG LEFTWARDS HARPOONU+1F8D4LONG LEFTWARDS HARPOON ABOVE SHORT RIGHTWARDS HARPOONU+1F8D5SHORT LEFTWARDS HARPOON ABOVE LONG RIGHTWARDS HARPOONU+1F8D6LONG RIGHTWARDS ARROW THROUGH XU+1F8D7LONG RIGHTWARDS ARROW WITH DOUBLE SLASHU+1F8D8LONG LEFT RIGHT ARROW WITH DEPENDENT LOBE
- As a consequence, the following characters will be removed:
- Remove
NWIDandWWIDfeatures typographic features
- Completely remove wide glyphs. All non-combining glyphs will be exactly the same width.
fixed: Applyfontconfig-monochanges and further remove ligations.wide-mosaic: Similar tonormal, but all mosaic (box-drawing characters and block elements) will be wide.
serifs: Optional, String, configures style of serifs.- When set to
slab, the font will be converted into slab-serif. - Otherwise the font will be sans-serif.
- When set to
noCvSs: Optional, Boolean, disablescv##andss##OpenType features.noLigation: Optional, Boolean, disables ligations.exportGlyphNames: Optional, Boolean, whether to export glyph names into the fonts. Setting this totruewill increase file footprint, however this is necessary for ligature support in Kitty.webfontFormats: Optional, Array of String. Controls the formats needed to be exported into the webfont CSS. Valid options are'TTF'and'WOFF2', or including both.buildTextureFeature: Optional, Boolean, whether to build theTXTRfeature for cross-letter texture adjustments. Defaults to false.
Build plan could have 9 optional subsections:
ligationsvariantsweightswidthsslopescompatibilityLigaturessubsetmetricOverridenamingOverride
Configuring Ligations
Subsection ligations is used to customize the ligation set assigned to calt OpenType feature. Properties include:
-
inherits: Optional, String, defines the inherited ligation set. When absent, the ligation set will not inherit any other sets. Valid values are:default-calt: Inherit default ligation set.dlig: Default ligation set would be assigned to Discretionary ligatures.clike: Default ligation set would be assigned to C-Like.javascript: Default ligation set would be assigned to JavaScript.php: Default ligation set would be assigned to PHP.julia: Default ligation set would be assigned to Julia.raku: Default ligation set would be assigned to Raku.ml: Default ligation set would be assigned to ML.fsharp: Default ligation set would be assigned to F#.fstar: Default ligation set would be assigned to F*.haskell: Default ligation set would be assigned to Haskell.idris: Default ligation set would be assigned to Idris.elm: Default ligation set would be assigned to Elm.purescript: Default ligation set would be assigned to PureScript.swift: Default ligation set would be assigned to Swift.dafny: Default ligation set would be assigned to Dafny.coq: Default ligation set would be assigned to Coq.matlab: Default ligation set would be assigned to Matlab.verilog: Default ligation set would be assigned to Verilog.wolfram: Default ligation set would be assigned to Wolfram Language (Mathematica).erlang: Default ligation set would be assigned to Erlang Language.
-
disablesandenables: Optional, String Array, Cherry-picking ligation groups to be disabled or enabled. Valid values include:arrow-l: Left-pointing arrows.arrow-r: Right-pointing arrows.arrow-lr: Dual-pointing arrows.counter-arrow-l: Left-pointing counter-arrows.counter-arrow-r: Right-pointing counter-arrows.arrow-hyphen: Arrows using hyphen-minus (-) as the rod.arrow-equal: Arrows using equal sign (=) as the rod.arrow-wave: Arrows using tilde (~) as the rod.counter-arrow-hyphen: Counter-arrows using hyphen-minus (-) as the rod.counter-arrow-equal: Counter-arrows using equal sign (=) as the rod.counter-arrow-wave: Counter-arrows using tilde (~) as the rod.arrow-l-hyphen: Left-pointing arrows with hyphen-minus (-) being the rod.arrow-r-hyphen: Right-pointing arrows with hyphen-minus (-) being the rod.arrow-lr-hyphen: Dual-pointing arrows with hyphen-minus (-) being the rod.counter-arrow-l-hyphen: Left-pointing counter-arrows with hyphen-minus (-) being the rod.counter-arrow-r-hyphen: Right-pointing counter-arrows with hyphen-minus (-) being the rod.arrow-l-equal: Left-pointing arrows with equal sign (=) being the rod.arrow-r-equal: Right-pointing arrows with equal sign (=) being the rod.arrow-lr-equal: Dual-pointing arrows with equal sign (=) being the rod.counter-arrow-l-equal: Left-pointing counter-arrows with equal sign (=) being the rod.counter-arrow-r-equal: Right-pointing counter-arrows with equal sign (=) being the rod.arrow-l-wave: Left-pointing arrows with tilde (~) being the rod.arrow-r-wave: Right-pointing arrows with tilde (~) being the rod.arrow-lr-wave: Dual-pointing arrows with tilde (~) being the rod.counter-arrow-l-wave: Left-pointing counter-arrows with tilde (~) being the rod.counter-arrow-r-wave: Right-pointing counter-arrows with tilde (~) being the rod.eqeqeq: Enable special ligation for===with triple lines.eqeq: Enable ligation for==and===.lteq: Enable ligation for<=as less-than-or-equal sign.eqlt: Enable ligation for=<as less-than-or-equal sign.gteq: Enable ligation for>=as greater-than-or-equal sign.lteq-separate: Display<=as separate shape.eqlt-separate: Display=<as separate shape.gteq-separate: Display>=as separate shape.exeqeqeq: Enable special ligation for!===with triple lines.exeqeq: Enable special ligation for!==with triple lines.eqexeq: Enable special ligation for=!=with triple lines.eqexeq-dl: Enable special ligation for=!=with double lines.exeq: Enable ligation for!=and!==.tildeeq: Enable ligation for~=as inequality.eqslasheq: Enable special triple-line ligation for=/=as inequality.slasheq: Enable ligation for/=and=/=as inequality.trig: Enable ligation for<|,|>,<||, and other bar-and-angle-bracket symbols.ltgt-ne: Enable ligation for<>as inequality.ltgt-diamond: Enable ligation for<>as diamond.ltgt-diamond-tag: Enable ligation for<>as diamond-shaped empty HTML/XML tag.ltgt-slash-tag: Enable ligation for</,/>and</>.brst: Center asterisk in(*and*).slash-asterisk: Shift asterisk in/*and*/.kern-dotty: Move connecting dotty punctuations closer, like for::,:::and....kern-bars: Move consecutive bars closer, like for||,|||and//.center-ops: Vertically align some of the operators (like*) to the center position it is before or after a "center" operator (like+).center-op-trigger-plus-minus-l: Plus (+) and Minus (-) will trigger other operator characters at left to be centered.center-op-trigger-plus-minus-r: Plus (+) and Minus (-) will trigger other operator characters at right to be centered.center-op-trigger-equal-l: Equal (=) will trigger other operator characters at left to be centered.center-op-trigger-equal-r: Equal (=) will trigger other operator characters at right to be centered.center-op-trigger-bar-l: Bars (|) will trigger other operator characters at left to be centered.center-op-trigger-bar-r: Bars (|) will trigger other operator characters at right to be centered.center-op-trigger-angle-inside: Less (<) and Greater (>) will trigger other operator characters at inside to be centered.center-op-trigger-angle-outside: Less (<) and Greater (>) will trigger other operator characters at outside to be centered.center-op-influence-dot: Treat dot (.) as operator and perform chained centering.center-op-influence-colon: Treat colon (:) as operator and perform chained centering.tilde-tilde: Make 2 or more contiguous ASCII tildes (like~~,~~~and~~~~) connected as a wave line.tilde-tilde-tilde: Make 3 or more contiguous ASCII tildes (like~~~and~~~~) connected as a wave line.minus-minus: Make 2 or more contiguous hyphen-minuses (like--,---and----) connected as a straight solid line.minus-minus-minus: Make 3 or more contiguous hyphen-minuses (like---and----) connected as a straight solid line.plus-plus: Make 2 or more contiguous plus signs (like++,+++and++++) connected..plus-plus-plus: Make 3 or more contiguous plus signs (like+++and++++) connected..underscore-underscore: Make 2 or more contiguous underscores (like__,___and____) connected.underscore-underscore-underscore: Make 3 or more contiguous underscores (like___and____) connected.hash-hash: Make 2 or more contiguous hash signs (number signs) (like##,###and####) connected.hash-hash-hash: Make 3 or more contiguous hash signs (number signs) (like##and###) connected.logic: Enable ligation for/\and\/.llgg: Enable ligation for<<,>>and other angle-bracket chaining.llggeq: Enable ligation for<<=,>>=as shift operator.html-comment: Enable ligation for<!--and<!---.colon-greater-as-colon-arrow: Transform:>into:and a narrow arrow.brace-bar: Enable ligation for{|and|}.brack-bar: Enable ligation for[|and|].markdown-checkboxes: Enable ligation for Markdown checkboxes like- [ ]and- [x].
Configuring Character Variants
Subsection variants is used to configure character variants in the font. Properties include:
-
inherits: Optional, String, defines the inherited stylistic set. Valid options include:ss01: Set character variant to “Andale Mono Style”.ss02: Set character variant to “Anonymous Pro Style”.ss03: Set character variant to “Consolas Style”.ss04: Set character variant to “Menlo Style”.ss05: Set character variant to “Fira Mono Style”.ss06: Set character variant to “Liberation Mono Style”.ss07: Set character variant to “Monaco Style”.ss08: Set character variant to “Pragmata Pro Style”.ss09: Set character variant to “Source Code Pro Style”.ss10: Set character variant to “Envy Code R Style”.ss11: Set character variant to “X Window Style”.ss12: Set character variant to “Ubuntu Mono Style”.ss13: Set character variant to “Lucida Style”.ss14: Set character variant to “JetBrains Mono Style”.ss15: Set character variant to “IBM Plex Mono Style”.ss16: Set character variant to “PT Mono Style”.ss17: Set character variant to “Recursive Mono Style”.ss18: Set character variant to “Input Mono Style”.ss20: Set character variant to “Curly Style”.- Other build plans’ configuration, using
inherits = "buildPlans.<Plan name>".
-
design,upright,italic, andoblique: Optional, Dictionary, defines styles for individual characters. The choices are organized in key-value pairs, assigning a variant to a character group. Alternatively, you could assign numbers tocv##tags, like what you did when using OpenType in CSS. Assignments underdesignwill be applied to all the slopes, andupright,italic, andobliquewill apply to corresponded slopes.In addition, style selector for default digit form also uses these dictionaries.
The valid combinations include:
- Default digit form
- APL form
- Styles for
19 variants
- Styles for
24 variants
- Styles for
3 - Styles for
412 variants
- Styles for
512 variants
- Styles for
6 - Styles for
712 variants
- Styles for
8 - Styles for
9 - Styles for
054 variants
- Styles for
A10 variants
- Styles for
B12 variants
- Styles for
C5 variants
- Styles for
D6 variants
- Styles for
E - Styles for
F - Styles for
G36 variants
- Styles for
H4 variants
- Styles for
I - Styles for
J14 variants
- Styles for
K32 variants
- Styles for
L - Styles for
M12 variants
- Styles for
N6 variants
- Styles for
P6 variants
- Styles for
Q11 variants
- Styles for
R30 variants
- Styles for
S5 variants
- Styles for
T - Styles for
U19 variants
- Styles for
V6 variants
- Styles for
W45 variants
- Styles for
X8 variants
- Styles for
Y8 variants
- Styles for
Z27 variants
- Styles for
a33 variants
- Styles for
b12 variants
- Styles for
c5 variants
- Styles for
d14 variants
- Styles for
e - Styles for
f45 variants
- Styles for
g16 variants
- Styles for
h7 variants
- Styles for
i14 variants
- Styles for
j10 variants
- Styles for
k40 variants
- Styles for
l14 variants
- Styles for
m58 variants
- Styles for
n24 variants
- Styles for
p10 variants
- Styles for
q33 variants
- Styles for
r28 variants
- Styles for
s5 variants
- Styles for
t30 variants
- Styles for
u17 variants
- Styles for
v8 variants
- Styles for
w47 variants
- Styles for
x14 variants
- Styles for
y18 variants
- Styles for
z27 variants
- Styles for
ẞ(Capital Eszet)8 variants
- Styles for
ſ(Long-S)40 variants
- Styles for
ß(Eszet)60 variants
- Styles for
ð(Lowercase Eth (ð)) - Styles for
Þ(Capital Thorn)6 variants
- Styles for
þ(Lowercase Thorn (þ)) - Styles for
α(Greek lower Alpha)20 variants
- Styles for
β(Greek lower Beta) - Styles for
Γ(Greek capital Gamma)4 variants
- Styles for
γ(Greek lower Gamma)6 variants
- Styles for
Δ(Greek capital Delta (Δ)) - Styles for
δ(Greek lower Delta) - Styles for
ζ(Greek lower Zeta)5 variants
- Styles for
η(Greek lower Eta)10 variants
- Styles for
θ(Greek lower Theta)4 variants
- Styles for
ι(Greek lower Iota)12 variants
- Styles for
κ(Greek lower Kappa)32 variants
- Styles for
Λ(Greek capital Lambda (Λ))8 variants
- Styles for
λ(Greek lower Lambda)6 variants
- Styles for
μ(Greek lower Mu)17 variants
- Styles for
ν(Greek lower Nu)6 variants
- Styles for
ξ(Greek lower Xi)10 variants
- Styles for
π(Greek lower Pi)4 variants
- Styles for
ς(Greek lower Final Sigma)5 variants
- Styles for
τ(Greek lower Tau)6 variants
- Styles for
υ(Greek lower Upsilon)4 variants
- Styles for
φ(Greek lower Phi)5 variants
- Styles for
χ(Greek lower Chi)26 variants
- Styles for
ψ(Greek lower Psi)8 variants
- Styles for
∂(Partial derivative symbol)3 variants
- Styles for
а(Cyrillic Lower A)33 variants
- Styles for
в(Cyrillic Lower Ve)14 variants
- Styles for
Ж(Cyrillic Capital Zhe)5 variants
- Styles for
ж(Cyrillic Lower Zhe)5 variants
- Styles for
З(Cyrillic Capital Ze)7 variants
- Styles for
з(Cyrillic Lower Ze)14 variants
- Styles for
К(Cyrillic Capital Ka)28 variants
- Styles for
к(Cyrillic Lower Ka)28 variants
- Styles for
л(Cyrillic Lower El) - Styles for
м(Cyrillic Lower Em)12 variants
- Styles for
Н(Cyrillic Capital En)4 variants
- Styles for
н(Cyrillic Lower En)7 variants
- Styles for
Р(Cyrillic Capital Er)6 variants
- Styles for
р(Cyrillic Lower Er)10 variants
- Styles for
У(Cyrillic Capital U)18 variants
- Styles for
у(Cyrillic Lower U)18 variants
- Styles for
ф(Cyrillic Lower Ef)10 variants
- Styles for
ч(Cyrillic Lower Che) - Styles for
ь,ъ(Cyrillic Lower Yeri and related letters)3 variants
- Styles for
ы(Cyrillic Lower Yery)6 variants
- Styles for
Э(Cyrillic Capital E (Э))13 variants
- Styles for
э(Cyrillic Lower E (э))13 variants
- Styles for
Я(Cyrillic Capital Ya)24 variants
- Styles for
я(Cyrillic Lower Ya)42 variants
- Styles for
ij(Dots in letters “i” and “j” in particular) - Styles for
öẋ(Dot and Comma shape in diacritics) - Styles for
.,,:;(Dot and Comma shape in punctuations and symbols) - Styles for
⣝⣑(Dot shape in braille) - Styles for
…(Ellipsis dot density and spacing) - Styles for
~ - Styles for
*12 variants
- Styles for
_ - Styles for
^ - Styles for
`3 variants
- Styles for
' - Styles for
(,) - Styles for
{,} - Styles for
«,»(Guillemets) - Styles for
#8 variants
- Styles for
&10 variants
- Styles for
@9 variants
- Styles for
$12 variants
- Styles for
¢12 variants
- Styles for
%4 variants
- Styles for
|,¦ - Styles for
? - Styles for
¶ - Styles for
µ(Micro sign)17 variants
- Styles for
❮,❯(Decorative angle brackets (U+276C...U+2771))3 variants
- Styles for
<=,>=(Less-equal and Greater-equal ligations) - Styles for
!=(Not-equal ligations)6 variants
- Styles for
==(Equality ligations) - Styles for
--(Hyphen-minus ligations) - Styles for
++(Plus ligations) - Styles for
=>(Double arrow ligation) - Styles for
->(Single arrow ligation)
Configuring Weights, Widths and Slopes
Subsection weights is used to change the weight grades that the custom family needs. It is a dictionary from the filename suffix (in PascalCase) to either...
- A string formatted in
default.<weight>format, meaning reusing a default weight grade; - Or, a sub-object with properties:
shape: Number, configures the weight grade of the glyphs' shapes.menu: Integer, configures the weight grade used when naming fonts.css: Integer, configures the weight grade used in web font CSS.
Subsection widths is used to change the width grades that the custom family needs. It is a dictionary from the filename suffix (in PascalCase) to either...
- A string formatted in
default.<width>format, meaning reusing a default width grade; - Or, a sub-object with properties:
shape: Number, configures the width of the glyphs' shapes, measured in 1/1000 em.menu: Integer, configures the width grade used when naming fonts. The valid values are from1to9, inclusive.css: String, configures the font-stretch value used in web font CSS.
Subsection slopes is used to change the slope angles and grades that the custom family needs. It is a dictionary from the filename suffix (in PascalCase) to either...
- A string formatted in
default.<slope>format, meaning reusing a default slope grade; - Or, a sub-object with properties:
angle: Number, configures the slope angle in degrees. The valid vales are from0to15, inclusive.shape: String fromupright,italicoroblique. Configures the slope used for variant selection.menu: String fromupright,italicoroblique. Configures the slope grade used when naming fonts.css: String fromnormal,italicoroblique. Configures the CSS font-style value.
In addition to list all the weights/widths/slopes directly, the user could also configure the weights/widths/slopes list using “inherits” to inherit the list from another build plan:
[buildPlans.IosevkaCustom2]
family = "Iosevka Custom 2"
weights.inherits = "buildPlans.IosevkaCustom1" # Inherit weights list from "IosevkaCustom1"
widths.inherits = "buildPlans.IosevkaCustom1" # Inherit widths list from "IosevkaCustom1"
slopes.inherits = "default" # Inherit slopes list from default
Compatibility Ligatures
Certain software, notably Emacs, relies on pre-encoded ligatures instead of OpenType to provide ligations. Iosevka could be configured with additional subsection compatibilityLigatures, being an array of records with following fields:
unicode: The PUA code point being assigned to.featureTag: The feature tag to compute ligations.sequence: The source character sequence.
A sample of compatibility ligature config is:
[[buildPlans.IosevkaCustom.compatibilityLigatures]]
unicode = 57600 # 0xE100
featureTag = 'calt'
sequence = '<*>'
Limiting the Character Set
Use the subset configuration to limit the character set in the final font. The subset subsection is an object with either include or exclude property.
- When
includeis used, only the characters in the list will be included in the final font. - When
excludeis used, all characters except those in the list will be included in the final font. - When both
includeandexcludeare used, the final font will include only the characters ininclude, and without those inexclude.
In include or exclude, we could specify the character set in thre ways:
textFile: the path to a text file containing the characters to include/exclude. The file should be in UTF-8 encoding.text: a string containing the characters to include/exclude.ranges: a list of ranges of code points to include/exclude. Each range is a list of two integers, representing the start and end code points (inclusive).
Sample of include:
[buildPlans.iosevkaCustom.subset.include]
textFile = "agl.txt"
Sample of exclude:
[buildPlans.iosevkaCustom.subset.exclude]
ranges = [[10003, 10008]]
Metric Override
Subsection metricOverride provides ability to override certain metric values, if you reallly want to. Adding this section is strongly discouraged as it may introduce broken geometry or broken shapes.
| Property | Unit | Default Value | Meaning |
|---|---|---|---|
cap |
emu | 735 | Height of H. |
ascender |
emu | 735 | Height of b. |
xHeight |
emu | 520 | Height of x. |
sb |
emu | (varies, 60 for Regular) | Width of common side-bearings. |
accentWidth |
emu | 200 | Width of accent marks. |
accentClearance |
emu | 72 | Vertical clearance of accent marks to the base. |
accentHeight |
emu | 176 | Height of accent marks. |
accentStackOffset |
emu | 220 | Offset height of accent mark stack. |
dotSize |
emu | (varies, 125 for regular) | Size of dots in diacritic marks. |
periodSize |
emu | (varies, 140 for regular) | Size of dots in period. |
leading |
emu | 1250 | Built-in line height. |
symbolMid |
emu | 340 | Height of the center of hyphen (-). |
parenSize |
emu | 966 | Height of Parentheses. |
winMetricAscenderPad |
emu | 0 | Additional pad for Win metrics’ ascender to avoid clipping in legacy Windows applications. |
winMetricDescenderPad |
emu | 0 | Additional pad for Win metrics’ descender to avoid clipping in legacy Windows applications. |
powerlineScaleX, powerlineScaleY |
(ratio) | 1 | X and Y scale of Powerline glyphs. |
powerlineShiftX, powerlineShiftY |
emu | 0 | X and Y shift of Powerline glyphs. |
onumZeroHeightRatio |
(ratio) | 1.145 | Ratio of height of 0 under onum feature, to the height of x. |
essRatio |
(ratio) | (varies, 1.12 for Regular) | Ratio of the thickness of the neck of S/s/?, to the normal stroke width. essRatioUpper, essRatioLower and rssRatioQuestion will override this value for corresponded glyph categories when set. |
essRatioUpper |
(ratio) | (varies, 1.12 for Regular) | Ratio of the thickness of the neck of S, to the normal stroke width. |
essRatioLower |
(ratio) | (varies, 1.12 for Regular) | Ratio of the thickness of the neck of s, to the normal stroke width. |
essRatioQuestion |
(ratio) | (varies, 1.12 for Regular) | Ratio of the thickness of the neck of ?, to the normal stroke width. |
archDepth |
emu | (varies, 195 for Regular) | Depth of the curve segment of arches / O rings in capital letters. |
smallArchDepth |
emu | (varies, 200 for Regular) | Depth of the curve segment of arches / O rings in small letters. |
advanceScaleSp |
(ratio) | (varies, 1.0 for monospace, 0.58333 for quasi-proportional) | The advance width ratio of space character, relative to the width of digit 0. |
The values of each item could be either a number, or a string representing an expression so that it could be different for different instance fonts, or depending on default values. The syntax of valid expressions are:
Expression -> Term (('+' | '-') Term)*
Term -> Factor (('*' | '/') Factor)*
Factor -> ('+' | '-')* Primitive
Primitive -> Literal
| Call
| Binding
| Group
| List
Literal -> ['0'..'9']+ ('.' ['0'..'9']+)?
Identifier -> ['A'..'Z', 'a'..'z', '_']+
Call -> Identifier '(' Expression (',' Expression)* ')'
List -> Identifier '[' Expression (',' Expression)* ']'
Binding -> Identifier
Valid identifiers include:
weight: being the weight grade;width: being the characters' unit width, measured in em-units;slopeAngle: being the slope angle in degrees;- Default value of all overridable metrics, prefixed with
default_, i.e., defaultcapvalue will be accessable thorughdefault_cap.
Valid functions include:
blend(x, [x1, y1], [x2, y2], ...): Perform a smooth interpolation through data pairs [x1, y1], [x2, y2], ..., against parameter x.
For example, the following configuration:
[buildPlans.IosevkaCustom.metricOverride]
leading = 1500
sb = 'default_sb * 1.0625 + 15'
dotSize = 'blend(weight, [100, 50], [400, 125], [900, 180])'
will:
- Override line height to
1500em-unit; - Override the sidebearing value by its value multiplied by
1.0625then added with15. - Override the dot size by a interpolation against weight: at thin (
100) being50, at regular (400) being125, and at heavy (900) being180.
Naming Override
The properties in the namingOverride section could be uase to override menu names of the produced font. The following properties will be applied to the font directly:
copyright: Name ID 0, copyright notice.manufacturer: Name ID 8, manufacturer name.designer: Name ID 9, designer name.description: Name ID 10, description of the typeface.urlVendor: Name ID 11, URL of font vendor.urlDesigner: Name ID 12, URL of typeface designer.license(or alternativelylicence): Name ID 13, license description.licenseURL(or alternativelylicenceURL): Name ID 14, license Info URL.sampleText: Name ID 19, sample text for the font.version: Override font version. The version number should follow SemVer, like being1.0.0.vendorIdTag: Four-character vendor ID tag in OS/2 table.
Additionally, the namingOverride section now supports a menuNameMap configuration property. This property allows for the customization of menu names based on specific attributes related to the font's style and characteristics. The menuNameMap configuration is structured as follows:
weight: A mapping of menu weight numbers to their corresponding names.width: A mapping of menu width numbers to their corresponding names.slope: A mapping of menu slope values ("normal"/"italic"/"oblique") to their corresponding names.weightShort: A mapping of menu weight numbers to short names.widthShort: A mapping of menu width numbers to short names.slopeShort: A mapping of menu slope values ("normal"/"italic"/"oblique") to short names.
You are allowed to provide override names only for the values that you want to have custom names. Any values not specified in these mappings will use the default names.
For example, the following configuration:
[buildPlans.IosevkaCustom.namingOverride.menuNameMap.width]
7 = "Expanded"
[buildPlans.IosevkaCustom.namingOverride.menuNameMap.widthShort]
7 = "Exp"
... will name width 7 to "Expanded" in full, and "Exp" in short.
Sample Configuration
A sample configuration could be found at private-build-plans.sample.toml.
TTC Building
It is possible to create a customized TTC build by using the following method:
- Add a collect plan into
private-build-plans.toml, with afromfield containing all the TTF groups it needs:
[collectPlans.IosevkaCustom]
from = ["IosevkaCustom1", "IosevkaCustom2"]
- Run build with the following command:
npm run build -- ttc::IosevkaCustom: Create TTCs from collectionIosevkaCustom; The file will be saved intodist/.ttc.npm run build -- super-ttc::IosevkaCustom: Create a single-file TTC from collectionIosevkaCustom; The file will be saved intodist/.super-ttc.
Single-Group TTCs (SGr)
When your collection contains multiple groups (e.g. different spacing variants), you can also build separate TTCs for each group individually:
npm run build -- sgr-ttc::IosevkaCustom: Create individual TTCs for each group in collectionIosevkaCustom; Files will be saved intodist/.ttc/SGr-<group>/.npm run build -- sgr-super-ttc::IosevkaCustom: Create individual single-file TTCs for each group in collectionIosevkaCustom; Files will be saved intodist/.super-ttc/.
To build both bundled and single-group TTCs in one command:
npm run build -- all-ttc::IosevkaCustom: Create both bundled and separate SGr TTCs.npm run build -- all-super-ttc::IosevkaCustom: Create both bundled and separate SGr Super TTCs.
Note: SGR commands require the collection to have more than one group in the from array, since they'd otherwise be equivalent to the regular bundled TTCs.
Baking other OpenType features
There are tools tha could be used to bake other OpenType that are not configurable with TOML files (like baking localized forms). The tools include:
- https://mutsuntsai.github.io/fontfreeze/
- https://github.com/twardoch/fonttools-opentype-feature-freezer
These tools could be used in post-processing fonts. Please refer their documents for instructions.