Merge branch 'master' into dev

This commit is contained in:
Belleve Invis 2020-05-19 20:57:49 -07:00
commit af0bdb0109
15 changed files with 179 additions and 135 deletions

196
README.md
View file

@ -38,6 +38,7 @@ Afrikaans, Aghem, Akan, Albanian, Asturian, Asu, Azerbaijani, Bafia, Bambara, Ba
<!-- END Section-Language-List -->
Iosevka supports accessing all letter variants using OpenType features.
![Style Sets](https://raw.githubusercontent.com/be5invis/Iosevka/master/images/stylesets.png)
@ -71,119 +72,124 @@ Since version 2.0, Iosevka would no longer support building via `makefile`. To i
2. Add a build plan into `private-build-plans.toml`, following this format:
```toml
[buildPlans.iosevka-custom] # <iosevka-custom> is your plan name
family = "Iosevka Custom" # Font menu family name
design = ["v-i-hooky", "v-l-hooky"] # Customize styles
# upright = ["upright-styles"] # Uncomment this line to set styles for upright only
# italic = ["italic-styles"] # Uncomment this line to set styles for italic only
# oblique = ["oblique-styles"] # Uncomment this line to set styles for oblique only
hintParams = ["-a", "sss"] # Optional custom parameters for ttfautohint
<!-- BEGIN Section-Private-Build-Plan-Sample -->
<!-- THIS SECTION IS AUTOMATICALLY GENERATED. DO NOT EDIT. -->
###################################################################################################
# Override default building weights
# When buildPlans.<plan name>.weights is absent, all weights would built and mapped to
# default values.
# IMPORTANT : Currently "menu" and "css" property only support numbers between 0 and 1000.
# and "shape" properly only supports number between 100 and 900 (inclusive).
# If you decide to use custom weights you have to define all the weights you
# plan to use otherwise they will not be built.
[buildPlans.iosevka-custom.weights.regular]
shape = 400 # Weight for glyph shapes.
menu = 400 # Weight for the font's names.
css = 400 # Weight for webfont CSS.
[buildPlans.iosevka-custom] # <iosevka-custom> is your plan name
family = "Iosevka Custom" # Font menu family name
design = ["v-i-hooky", "v-l-hooky"] # Customize styles
# upright = ["upright-styles"] # Uncomment this line to set styles for upright only
# italic = ["italic-styles"] # Uncomment this line to set styles for italic only
# oblique = ["oblique-styles"] # Uncomment this line to set styles for oblique only
hintParams = ["-a", "sss"] # Optional custom parameters for ttfautohint
[buildPlans.iosevka-custom.weights.book]
shape = 450
menu = 450 # Use 450 here to name the font's weight "Book"
css = 450
###################################################################################################
# Override default building weights
# When buildPlans.<plan name>.weights is absent, all weights would built and mapped to
# default values.
# IMPORTANT : Currently "menu" and "css" property only support numbers between 0 and 1000.
# and "shape" properly only supports number between 100 and 900 (inclusive).
# If you decide to use custom weights you have to define all the weights you
# plan to use otherwise they will not be built.
[buildPlans.iosevka-custom.weights.regular]
shape = 400 # Weight for glyph shapes.
menu = 400 # Weight for the font's names.
css = 400 # Weight for webfont CSS.
[buildPlans.iosevka-custom.weights.bold]
shape = 700
menu = 700
css = 700
[buildPlans.iosevka-custom.weights.book]
shape = 450
menu = 450 # Use 450 here to name the font's weight "Book"
css = 450
# End weight section
###################################################################################################
[buildPlans.iosevka-custom.weights.bold]
shape = 700
menu = 700
css = 700
###################################################################################################
# Override default building slant sets
# Format: <upright|italic|oblique> = <"normal"|"italic"|"oblique">
# When this section is absent, all slants would be built.
# End weight section
###################################################################################################
[buildPlans.iosevka-custom.slants]
upright = "normal"
italic = "italic"
oblique = "oblique"
###################################################################################################
# Override default building slant sets
# Format: <upright|italic|oblique> = <"normal"|"italic"|"oblique">
# When this section is absent, all slants would be built.
# End slant section
###################################################################################################
[buildPlans.iosevka-custom.slants]
upright = "normal"
italic = "italic"
oblique = "oblique"
###################################################################################################
# Override default building widths
# When buildPlans.<plan name>.widths is absent, all widths would built and mapped to
# default values.
# IMPORTANT : Currently "shape" property only support 3, 5, and 7, while "menu" only
# support 1, 2, 3, 4, 5, 6, 7, 8, 9.
# If you decide to use custom weights you have to define all the weights you
# plan to use otherwise they will not be built.
# End slant section
###################################################################################################
[buildPlans.iosevka-custom.widths.normal]
shape = 5 # Width of glyph shapes.
menu = 5 # Width for the font's names.
css = "normal" # "font-stretch' property of webfont CSS.
###################################################################################################
# Override default building widths
# When buildPlans.<plan name>.widths is absent, all widths would built and mapped to
# default values.
# IMPORTANT : Currently "shape" property only support 3, 5, and 7, while "menu" only
# support 1, 2, 3, 4, 5, 6, 7, 8, 9.
# If you decide to use custom widths you have to define all the widths you
# plan to use otherwise they will not be built.
[buildPlans.iosevka-custom.widths.extended]
shape = 7
menu = 7
css = "expanded"
[buildPlans.iosevka-custom.widths.normal]
shape = 5 # Width of glyph shapes.
menu = 5 # Width for the font's names.
css = "normal" # "font-stretch' property of webfont CSS.
# End width section
###################################################################################################
[buildPlans.iosevka-custom.widths.extended]
shape = 7
menu = 7
css = "expanded"
###################################################################################################
# Character Exclusion
# Specify character ranges in the section below to exclude certain characters from the font being
# built. Remove this section when this feature is not needed.
# End width section
###################################################################################################
[buildPlans.iosevka-custom.exclude-chars]
ranges = [[10003, 10008]]
###################################################################################################
# Character Exclusion
# Specify character ranges in the section below to exclude certain characters from the font being
# built. Remove this section when this feature is not needed.
# End character exclusion
###################################################################################################
[buildPlans.iosevka-custom.exclude-chars]
ranges = [[10003, 10008]]
###################################################################################################
# Compatibility Ligatures
# Certain applications like Emacs does not support proper programming liagtures provided by
# OpenType, but can support ligatures provided by PUA codepoints. Therefore you can edit the
# following section to build PUA characters that are generated from the OpenType ligatures.
# Remove this section when compatibility ligatures are not needed.
# End character exclusion
###################################################################################################
[[buildPlans.iosevka-custom.compatibility-ligatures]]
unicode = 57600 # 0xE100
featureTag = 'calt'
sequence = '<*>'
###################################################################################################
# Compatibility Ligatures
# Certain applications like Emacs does not support proper programming liagtures provided by
# OpenType, but can support ligatures provided by PUA codepoints. Therefore you can edit the
# following section to build PUA characters that are generated from the OpenType ligatures.
# Remove this section when compatibility ligatures are not needed.
# End compatibility ligatures section
###################################################################################################
[[buildPlans.iosevka-custom.compatibility-ligatures]]
unicode = 57600 # 0xE100
featureTag = 'calt'
sequence = '<*>'
###################################################################################################
# Metric overrides
# Certain metrics like line height (leading) could be overridden in your build plan file.
# Edit the values to change the metrics. Remove this section when overriding is not needed.
# End compatibility ligatures section
###################################################################################################
[buildPlans.iosevka-custom.metric-override]
leading = 1250
winMetricAscenderPad = 0
winMetricDescenderPad = 0
powerlineScaleY = 1
powerlineScaleX = 1
powerlineShiftY = 0
powerlineShiftX = 0
###################################################################################################
# Metric overrides
# Certain metrics like line height (leading) could be overridden in your build plan file.
# Edit the values to change the metrics. Remove this section when overriding is not needed.
[buildPlans.iosevka-custom.metric-override]
leading = 1250
winMetricAscenderPad = 0
winMetricDescenderPad = 0
powerlineScaleY = 1
powerlineScaleX = 1
powerlineShiftY = 0
powerlineShiftX = 0
# End metric override section
###################################################################################################
<!-- END Section-Private-Build-Plan-Sample -->
# End metric override section
###################################################################################################
```
3. Run `npm run build -- contents::<your plan name>` and the built fonts would be avaliable in `dist/`. Aside from `contents::<plan>`, other options are:
@ -232,6 +238,7 @@ The current available styles for `design`/`upright`/`italic`/`oblique` options a
<!-- END Section-Cherry-Picking-Predefined -->
<!-- BEGIN Section-Cherry-Picking-Ligation-Sets -->
<!-- THIS SECTION IS AUTOMATICALLY GENERATED. DO NOT EDIT. -->
@ -265,6 +272,7 @@ The current available styles for `design`/`upright`/`italic`/`oblique` options a
<!-- END Section-Cherry-Picking-Ligation-Sets -->
<!-- BEGIN Section-Stylistic-Sets -->
<!-- THIS SECTION IS AUTOMATICALLY GENERATED. DO NOT EDIT. -->
@ -288,6 +296,7 @@ The current available styles for `design`/`upright`/`italic`/`oblique` options a
<!-- END Section-Stylistic-Sets -->
<!-- BEGIN Section-Cherry-Picking-Styles -->
<!-- THIS SECTION IS AUTOMATICALLY GENERATED. DO NOT EDIT. -->
@ -431,6 +440,7 @@ The current available styles for `design`/`upright`/`italic`/`oblique` options a
<!-- END Section-Cherry-Picking-Styles -->
## For Chinese and Japanese users...
→ [Sarasa Gothic](https://github.com/be5invis/Sarasa-Gothic).

View file

@ -1 +1,2 @@
* Fixed incorrect influence of Latin character variant features on Bulgarian Cyrillic (#532).
* Added TTC-only packages back.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 184 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 399 KiB

After

Width:  |  Height:  |  Size: 399 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 KiB

After

Width:  |  Height:  |  Size: 345 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 KiB

After

Width:  |  Height:  |  Size: 337 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 954 KiB

After

Width:  |  Height:  |  Size: 954 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 KiB

After

Width:  |  Height:  |  Size: 318 KiB

Before After
Before After

View file

@ -1,6 +1,6 @@
{
"name": "iosevka",
"version": "3.0.0",
"version": "3.0.1",
"main": "./generate.js",
"engines": {
"node": ">=12.16.0"

View file

@ -51,7 +51,7 @@ oblique = "oblique"
# default values.
# IMPORTANT : Currently "shape" property only support 3, 5, and 7, while "menu" only
# support 1, 2, 3, 4, 5, 6, 7, 8, 9.
# If you decide to use custom weights you have to define all the weights you
# If you decide to use custom widths you have to define all the widths you
# plan to use otherwise they will not be built.
[buildPlans.iosevka-custom.widths.normal]

View file

@ -21,6 +21,7 @@ async function main() {
readme = (await processLigSetCherryPicking()).apply(readme);
readme = (await processLigSetPreDef()).apply(readme);
readme = (await processLangList()).apply(readme);
readme = (await processPrivateBuildPlans()).apply(readme);
await fs.writeFile(readmePath, readme);
}
@ -54,25 +55,34 @@ async function processCv() {
return md;
}
async function processPrivateBuildPlans() {
const md = new MdCol("Section-Private-Build-Plan-Sample");
const tomlPath = path.resolve(__dirname, "../../private-build-plans.sample.toml");
const toml = await fs.readFile(tomlPath, "utf-8");
md.log(toml.replace(/^/gm, "\t"));
return md;
}
class MdCol {
constructor(sectionName) {
this.data = "";
this.sectionName = sectionName;
this.matchRegex = new RegExp(
`<!-- BEGIN ${sectionName} -->\\n[\\s\\S]*?<!-- END ${sectionName} -->\\n`
`^([ \\t]*)<!-- BEGIN ${sectionName} -->\\n[\\s\\S]*?<!-- END ${sectionName} -->\\n`,
`m`
);
}
log(...s) {
this.data += s.join("") + "\n";
}
apply(s) {
return s.replace(this.matchRegex, () => {
return s.replace(this.matchRegex, (m, $1) => {
return (
`<!-- BEGIN ${this.sectionName} -->\n` +
`<!-- THIS SECTION IS AUTOMATICALLY GENERATED. DO NOT EDIT. -->\n\n` +
this.data +
`\n<!-- END ${this.sectionName} -->\n`
);
).replace(/^/gm, $1);
});
}
}

View file

@ -23,7 +23,7 @@ async function main() {
await CopyMarkdown(out, "packages-desc.md");
await GeneratePackageList(out);
await CopyMarkdown(out, "style-set-sample-image.md");
await GenerateStyleSetImage(out);
await CopyMarkdown(out, "package-reorg.md");
await GenerateChangeList(out);
@ -132,7 +132,12 @@ async function GeneratePackageList(out) {
out.log(`</tr>`);
}
}
out.log(`</table>\n`);
}
async function GenerateStyleSetImage(out) {
out.log(
`![Style Sets](https://raw.githubusercontent.com/be5invis/Iosevka/v${Version}/images/stylesets.png)\n\n`
);
}
function noBreak(s) {

View file

@ -1 +0,0 @@
![Style Sets](https://raw.githubusercontent.com/be5invis/Iosevka/master/images/stylesets.png)

View file

@ -28,6 +28,7 @@ const webfontFormats = [
const SINGLE_GROUP_EXPORT_PREFIX = `ttf`;
const COLLECTION_EXPORT_PREFIX = `pkg`;
const TTC_ONLY_COLLECTION_EXPORT_PREFIX = `ttc`;
const BUILD_PLANS = path.relative(__dirname, path.resolve(__dirname, "./build-plans.toml"));
const PRIVATE_BUILD_PLANS = path.relative(
@ -341,33 +342,29 @@ const CollectionPartsOf = computed.group("metadata:collection-parts-of", async (
////// Font Building //////
///////////////////////////////////////////////////////////
const BuildOTD = file.make(
(gr, fn) => `${BUILD}/${gr}/${fn}.otd`,
const BuildTTF = file.make(
(gr, fn) => `${BUILD}/${gr}/${fn}.ttf`,
async (target, output, gr, fn) => {
const [fi] = await target.need(FontInfoOf(fn), Version);
const charmap = output.dir + "/" + output.name + ".charmap";
await target.need(Scripts, fu`parameters.toml`, de`${output.dir}`);
await node("gen/index", { o: output.full, oCharMap: charmap, ...fi });
}
);
const BuildTTF = file.make(
(gr, fn) => `${BUILD}/${gr}/${fn}.ttf`,
async (target, output, gr, fn) => {
const [otd] = await target.need(BuildOTD(gr, fn), de`${output.dir}`);
const otdPath = `${output.dir}/${output.name}.otd`;
await node("gen/index", { o: otdPath, oCharMap: charmap, ...fi });
await run(
"otfccbuild",
otd.full,
otdPath,
["-o", `${output.full}`],
["-O3", "--keep-average-char-width", "-q"]
);
await rm(otdPath);
}
);
const BuildCM = file.make(
(gr, f) => `${BUILD}/${gr}/${f}.charmap`,
async (target, output, gr, f) => {
await target.need(BuildOTD(gr, f));
await target.need(BuildTTF(gr, f));
}
);
@ -503,10 +500,27 @@ const CollectionArchiveFile = file.make(
);
}
);
const TtcOnlyCollectionArchiveFile = file.make(
(gr, version) => `${ARCHIVE_DIR}/${TTC_ONLY_COLLECTION_EXPORT_PREFIX}-${gr}-${version}.zip`,
async (target, out, gr) => {
await target.need(de`${out.dir}`, CollectionExport(gr));
await rm(out.full);
await cd(`${DIST}/export/${gr}/ttc`).run(
["7z", "a"],
["-tzip", "-r", "-mx=9"],
`../../../../${out.full}`,
`./`
);
}
);
const CollectionArchive = task.group(`collection-archive`, async (target, cid) => {
const [version] = await target.need(Version);
await target.need(CollectionArchiveFile(cid, version));
});
const TtcOnlyCollectionArchive = task.group(`ttc-only-collection-archive`, async (target, cid) => {
const [version] = await target.need(Version);
await target.need(TtcOnlyCollectionArchiveFile(cid, version));
});
// Single-group export
const GroupArchiveFile = file.make(
@ -639,11 +653,16 @@ const AllTtfArchives = task(`all:ttf`, async target => {
await target.need(Object.keys(exportPlans).map(GroupArchive));
});
const AllTtcArchives = task(`all:ttc`, async target => {
const CollectionArchives = task(`all:pkg`, async target => {
const [collectPlans] = await target.need(CollectPlans);
await target.need(Object.keys(collectPlans.groupDecomposition).map(CollectionArchive));
});
const AllTtcArchives = task(`all:ttc`, async target => {
const [collectPlans] = await target.need(CollectPlans);
await target.need(Object.keys(collectPlans.groupDecomposition).map(TtcOnlyCollectionArchive));
});
const SpecificSuperTtc = task.group(`super-ttc`, async (target, gr) => {
await target.need(ExportSuperTtc(gr));
});
@ -673,7 +692,7 @@ phony(`clean`, async () => {
build.deleteJournal();
});
phony(`release`, async target => {
await target.need(AllTtfArchives, AllTtcArchives);
await target.need(AllTtfArchives, CollectionArchives, AllTtcArchives);
await target.need(SampleImages, Pages, ReleaseNotes);
});