diff --git a/README.md b/README.md index aa87ea047..b6e42f07f 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Afrikaans, Aghem, Akan, Albanian, Asturian, Asu, Azerbaijani, Bafia, Bambara, Ba + Iosevka supports accessing all letter variants using OpenType features. ![Style Sets](https://raw.githubusercontent.com/be5invis/Iosevka/master/images/stylesets.png) @@ -71,120 +72,125 @@ 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] # 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] # 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 + + ################################################################################################### + # Override default building weights + # When buildPlans..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.book] + shape = 450 + menu = 450 # Use 450 here to name the font's weight "Book" + css = 450 + + [buildPlans.iosevka-custom.weights.bold] + shape = 700 + menu = 700 + css = 700 + + # End weight section + ################################################################################################### + + ################################################################################################### + # Override default building slant sets + # Format: = <"normal"|"italic"|"oblique"> + # When this section is absent, all slants would be built. + + [buildPlans.iosevka-custom.slants] + upright = "normal" + italic = "italic" + oblique = "oblique" + + # End slant section + ################################################################################################### + + ################################################################################################### + # Override default building widths + # When buildPlans..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.normal] + shape = 5 # Width of glyph shapes. + menu = 5 # Width for the font's names. + css = "normal" # "font-stretch' property of webfont CSS. + + [buildPlans.iosevka-custom.widths.extended] + shape = 7 + menu = 7 + css = "expanded" + + # End width section + ################################################################################################### + + ################################################################################################### + # 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. + + [buildPlans.iosevka-custom.exclude-chars] + ranges = [[10003, 10008]] + + # End character exclusion + ################################################################################################### + + ################################################################################################### + # 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. + + [[buildPlans.iosevka-custom.compatibility-ligatures]] + unicode = 57600 # 0xE100 + featureTag = 'calt' + sequence = '<*>' + + # End compatibility ligatures section + ################################################################################################### + + ################################################################################################### + # 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 + ################################################################################################### + + + + - ################################################################################################### - # Override default building weights - # When buildPlans..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.book] - shape = 450 - menu = 450 # Use 450 here to name the font's weight "Book" - css = 450 - - [buildPlans.iosevka-custom.weights.bold] - shape = 700 - menu = 700 - css = 700 - - # End weight section - ################################################################################################### - - ################################################################################################### - # Override default building slant sets - # Format: = <"normal"|"italic"|"oblique"> - # When this section is absent, all slants would be built. - - [buildPlans.iosevka-custom.slants] - upright = "normal" - italic = "italic" - oblique = "oblique" - - # End slant section - ################################################################################################### - - ################################################################################################### - # Override default building widths - # When buildPlans..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. - - [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. - - [buildPlans.iosevka-custom.widths.extended] - shape = 7 - menu = 7 - css = "expanded" - - # End width section - ################################################################################################### - - ################################################################################################### - # 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. - - [buildPlans.iosevka-custom.exclude-chars] - ranges = [[10003, 10008]] - - # End character exclusion - ################################################################################################### - - ################################################################################################### - # 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. - - [[buildPlans.iosevka-custom.compatibility-ligatures]] - unicode = 57600 # 0xE100 - featureTag = 'calt' - sequence = '<*>' - - # End compatibility ligatures section - ################################################################################################### - - ################################################################################################### - # 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 - ################################################################################################### - ``` - 3. Run `npm run build -- contents::` and the built fonts would be avaliable in `dist/`. Aside from `contents::`, other options are: 1. `contents::` : TTF (Hinted and Unhinted), WOFF(2) and Webfont CSS; @@ -232,6 +238,7 @@ The current available styles for `design`/`upright`/`italic`/`oblique` options a + @@ -265,6 +272,7 @@ The current available styles for `design`/`upright`/`italic`/`oblique` options a + @@ -288,6 +296,7 @@ The current available styles for `design`/`upright`/`italic`/`oblique` options a + @@ -431,6 +440,7 @@ The current available styles for `design`/`upright`/`italic`/`oblique` options a + ## For Chinese and Japanese users... → [Sarasa Gothic](https://github.com/be5invis/Sarasa-Gothic). diff --git a/changes/3.0.1.md b/changes/3.0.1.md index c22e7609f..d81dacb28 100644 --- a/changes/3.0.1.md +++ b/changes/3.0.1.md @@ -1 +1,2 @@ - * Fixed incorrect influence of Latin character variant features on Bulgarian Cyrillic (#532). \ No newline at end of file + * Fixed incorrect influence of Latin character variant features on Bulgarian Cyrillic (#532). + * Added TTC-only packages back. \ No newline at end of file diff --git a/images/charvars.png b/images/charvars.png index 0d0ff797f..46fb1902b 100644 Binary files a/images/charvars.png and b/images/charvars.png differ diff --git a/images/languages.png b/images/languages.png index f83835641..6231cb9c1 100644 Binary files a/images/languages.png and b/images/languages.png differ diff --git a/images/ligations.png b/images/ligations.png index c89d1b4fb..cea015781 100644 Binary files a/images/ligations.png and b/images/ligations.png differ diff --git a/images/matrix.png b/images/matrix.png index 6111e52d7..273438297 100644 Binary files a/images/matrix.png and b/images/matrix.png differ diff --git a/images/preview-all.png b/images/preview-all.png index 362848d23..15f27d61d 100644 Binary files a/images/preview-all.png and b/images/preview-all.png differ diff --git a/images/stylesets.png b/images/stylesets.png index abd5574c7..8d5b675bb 100644 Binary files a/images/stylesets.png and b/images/stylesets.png differ diff --git a/images/weights.png b/images/weights.png index 2d28f89fe..1b23fd690 100644 Binary files a/images/weights.png and b/images/weights.png differ diff --git a/package.json b/package.json index a098bab61..5963b56d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iosevka", - "version": "3.0.0", + "version": "3.0.1", "main": "./generate.js", "engines": { "node": ">=12.16.0" diff --git a/private-build-plans.sample.toml b/private-build-plans.sample.toml index 6399e5344..78be2810a 100644 --- a/private-build-plans.sample.toml +++ b/private-build-plans.sample.toml @@ -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] diff --git a/utility/amend-readme/index.js b/utility/amend-readme/index.js index b3f4c9802..1df0f36a4 100644 --- a/utility/amend-readme/index.js +++ b/utility/amend-readme/index.js @@ -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( - `\\n[\\s\\S]*?\\n` + `^([ \\t]*)\\n[\\s\\S]*?\\n`, + `m` ); } log(...s) { this.data += s.join("") + "\n"; } apply(s) { - return s.replace(this.matchRegex, () => { + return s.replace(this.matchRegex, (m, $1) => { return ( `\n` + `\n\n` + this.data + `\n\n` - ); + ).replace(/^/gm, $1); }); } } diff --git a/utility/generate-release-note/index.js b/utility/generate-release-note/index.js index 3e9a8915b..147a8a67d 100644 --- a/utility/generate-release-note/index.js +++ b/utility/generate-release-note/index.js @@ -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(``); } } - out.log(`\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) { diff --git a/utility/generate-release-note/release-note-fragments/style-set-sample-image.md b/utility/generate-release-note/release-note-fragments/style-set-sample-image.md deleted file mode 100644 index 65b0da2d5..000000000 --- a/utility/generate-release-note/release-note-fragments/style-set-sample-image.md +++ /dev/null @@ -1 +0,0 @@ -![Style Sets](https://raw.githubusercontent.com/be5invis/Iosevka/master/images/stylesets.png) diff --git a/verdafile.js b/verdafile.js index d6f5b0b52..1f9ce2841 100644 --- a/verdafile.js +++ b/verdafile.js @@ -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); });