From edb2b110400fac0ff40a041f3a77f04812c8d834 Mon Sep 17 00:00:00 2001 From: zk-phi Date: Sat, 20 Feb 2021 20:38:55 +0900 Subject: [PATCH 01/13] Add --suffix option --- cmd.js | 1 + src/GlyphHangerSubset.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd.js b/cmd.js index ec2ab86..307d302 100755 --- a/cmd.js +++ b/cmd.js @@ -30,6 +30,7 @@ if( argv.jsdom ) { var subset = new GlyphHangerSubset(); subset.setOutputDirectory(argv.output); +subset.setOutputSuffix(argv.suffix); if( argv.formats ) { subset.setFormats( argv.formats ); diff --git a/src/GlyphHangerSubset.js b/src/GlyphHangerSubset.js index ea9c3fa..2d64b77 100644 --- a/src/GlyphHangerSubset.js +++ b/src/GlyphHangerSubset.js @@ -23,6 +23,16 @@ class GlyphHangerSubset { return this.outputDirectory; } + setOutputSuffix( suffix ) { + if( suffix ) { + this.outputSuffix = suffix; + } + } + + getOutputSuffix() { + return this.outputSuffix; + } + setFontFilesGlob( ttfFilesGlob ) { this.fontPaths = glob.sync( ttfFilesGlob ); } @@ -84,7 +94,8 @@ class GlyphHangerSubset { getFilenameFromTTFPath( ttfPath, format, useZopfli ) { var fontPath = parsePath( ttfPath ); - var outputFilename = fontPath.name + "-subset" + ( useZopfli ? ".zopfli" : "" ) + ( format ? "." + format : fontPath.ext ); + var suffix = this.getOutputSuffix() || "-subset"; + var outputFilename = fontPath.name + suffix + ( useZopfli ? ".zopfli" : "" ) + ( format ? "." + format : fontPath.ext ); return outputFilename; } From c8c7827b04eab8415938d904152709baae03dd59 Mon Sep 17 00:00:00 2001 From: zk-phi Date: Sat, 20 Feb 2021 21:21:34 +0900 Subject: [PATCH 02/13] Support empty suffix --- src/GlyphHangerSubset.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GlyphHangerSubset.js b/src/GlyphHangerSubset.js index 2d64b77..7621500 100644 --- a/src/GlyphHangerSubset.js +++ b/src/GlyphHangerSubset.js @@ -24,7 +24,7 @@ class GlyphHangerSubset { } setOutputSuffix( suffix ) { - if( suffix ) { + if( suffix != null ) { this.outputSuffix = suffix; } } @@ -94,8 +94,8 @@ class GlyphHangerSubset { getFilenameFromTTFPath( ttfPath, format, useZopfli ) { var fontPath = parsePath( ttfPath ); - var suffix = this.getOutputSuffix() || "-subset"; - var outputFilename = fontPath.name + suffix + ( useZopfli ? ".zopfli" : "" ) + ( format ? "." + format : fontPath.ext ); + var suffix = this.getOutputSuffix();; + var outputFilename = fontPath.name + (suffix == null ? "-subset" : suffix) + ( useZopfli ? ".zopfli" : "" ) + ( format ? "." + format : fontPath.ext ); return outputFilename; } From 2ba45e8538a5fe177743faa95c04c4efa06bc019 Mon Sep 17 00:00:00 2001 From: zk-phi Date: Sat, 6 Mar 2021 12:12:00 +0900 Subject: [PATCH 03/13] Add workflow to sync fork --- .github/workflows/sync.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/sync.yml diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 0000000..bdaa204 --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,17 @@ +name: Auto PR + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - uses: zk-phi/auto-pr@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + base: 'master' + head: 'filamentgroup:master' + From 659f4e3d49448ef90a133b07f38be52f08b6a290 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Mon, 8 Mar 2021 14:29:22 -0600 Subject: [PATCH 04/13] =?UTF-8?q?Link=20to=20Sara=E2=80=99s=20article=20fr?= =?UTF-8?q?om=20the=20readme.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6d58718..adb981d 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ git submodule update --init --recursive python setup.py install ``` +If you want to read an in-depth tutorial on the installation steps above, please read [How I set up Glyphhanger on macOS for optimizing and converting font files for the Web](https://www.sarasoueidan.com/blog/glyphhanger/) by Sara Soueidan. + ## Usage ### Find the glyphs in a local file or url From b3f648b18a38e758729060b624b6de31576ecc1d Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Wed, 10 Mar 2021 23:20:49 -0600 Subject: [PATCH 05/13] Update all dependencies, need a minor release. --- package.json | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index b9f610f..dbad398 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "glyphhanger", - "version": "3.2.0", + "version": "4.0.0", "description": "A tool to ease webfont subsetting.", "main": "src/GlyphHanger.js", "scripts": { @@ -24,23 +24,22 @@ "glyphhanger": "./cmd.js" }, "dependencies": { - "@zachleat/spider-pig": "^1.0.3", - "chalk": "^2.3.0", + "@zachleat/spider-pig": "^2.0.0", + "chalk": "^4.1.0", "characterset": "^1.3.0", - "connect": "^3.6.6", - "debug": "^3.1.0", - "filesize": "^3.5.11", - "fs-extra": "^5.0.0", - "get-stdin": "^6.0.0", - "glob": "^7.1.2", - "jsdom": "^13.0.0", - "minimist": "^1.2.0", + "connect": "^3.7.0", + "debug": "^4.3.1", + "filesize": "^6.1.0", + "fs-extra": "^9.1.0", + "get-stdin": "^8.0.0", + "glob": "^7.1.6", + "jsdom": "^15.2.1", + "minimist": "^1.2.5", "parse-filepath": "^1.0.2", - "rsvp": "^4.7.0", - "serve-static": "^1.13.2", - "shelljs": "^0.7.8" + "serve-static": "^1.14.1", + "shelljs": "^0.8.4" }, "devDependencies": { - "mocha": "^4.0.1" + "mocha": "^8.3.1" } } From f80463d639810482bd86c58fc01c4d6943d54105 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Wed, 10 Mar 2021 23:21:08 -0600 Subject: [PATCH 06/13] Ignore the lock --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 38e62aa..0942b0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -test/fonts/ignored \ No newline at end of file +test/fonts/ignored +package-lock.json \ No newline at end of file From db4111751ad4df832b4e51f2b37cf76f33540321 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Thu, 11 Mar 2021 09:05:08 -0600 Subject: [PATCH 07/13] Adds changelog --- CHANGELOG.md | 5 +++++ src/GlyphHangerWhitelist.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c984685 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +v4.0.0 + +* Requires Node 10+ (Node 8 is EOL) +* A bunch of major release bumps of dependencies +* Fixes the `(node:1077) Warning` console output documented at the end of https://www.sarasoueidan.com/blog/glyphhanger/ \ No newline at end of file diff --git a/src/GlyphHangerWhitelist.js b/src/GlyphHangerWhitelist.js index fbaede0..80c5143 100644 --- a/src/GlyphHangerWhitelist.js +++ b/src/GlyphHangerWhitelist.js @@ -12,7 +12,7 @@ class GlyphHangerWhitelist { } if( presets.LATIN ) { - cs = cs.union( CharacterSet.parseUnicodeRange("U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD" )); + cs = cs.union( CharacterSet.parseUnicodeRange("U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD" )); } if( typeof chars === "string" ) { From 61d948366f5c39fedccc705f420a03122f0279e5 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Mon, 15 Mar 2021 08:28:03 -0500 Subject: [PATCH 08/13] Update URLs. --- README.md | 7 +++---- package.json | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index adb981d..8c6fb5b 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ glyphhanger ./test.html --string glyphhanger http://example.com # multiple URLs, optionally using HTTPS -glyphhanger https://google.com https://www.filamentgroup.com +glyphhanger https://google.com https://www.zachleat.com # show results for each font-family on the page glyphhanger ./test.html --json @@ -235,15 +235,14 @@ echo "this is a test" | glyphhanger --jsdom ## Testing -* Build Status: [![Build Status](https://travis-ci.org/filamentgroup/glyphhanger.svg?branch=master)](https://travis-ci.org/filamentgroup/glyphhanger) - `npm test` will run the tests. Or, alternatively `npx mocha`. ## Enhancement Queue -* [Top Voted Issues 👍](https://github.com/filamentgroup/glyphhanger/issues?q=label%3Aneeds-votes+sort%3Areactions-%2B1-desc) +* [Top Voted Issues 👍](https://github.com/zachleat/glyphhanger/issues?q=label%3Aneeds-votes+sort%3Areactions-%2B1-desc) +* Archived: [Voted Issues from `filamentgroup/glyphhanger`](https://github.com/filamentgroup/glyphhanger/issues?q=label%3Aneeds-votes+sort%3Areactions-%2B1-desc) ## Alternatives to GlyphHanger diff --git a/package.json b/package.json index dbad398..aa3319b 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/filamentgroup/glyphhanger.git" + "url": "git+https://github.com/zachleat/glyphhanger.git" }, "author": { "name": "Zach Leatherman", @@ -17,9 +17,9 @@ }, "license": "MIT", "bugs": { - "url": "https://github.com/filamentgroup/glyphhanger/issues" + "url": "https://github.com/zachleat/glyphhanger/issues" }, - "homepage": "https://github.com/filamentgroup/glyphhanger#readme", + "homepage": "https://github.com/zachleat/glyphhanger#readme", "bin": { "glyphhanger": "./cmd.js" }, From 5460e82b89ea290d65c062d499266a9cfb1b044c Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Mon, 15 Mar 2021 08:28:17 -0500 Subject: [PATCH 09/13] v4.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aa3319b..df16ea6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "glyphhanger", - "version": "4.0.0", + "version": "4.0.1", "description": "A tool to ease webfont subsetting.", "main": "src/GlyphHanger.js", "scripts": { From d61132ae56005781ce35cda9c0773d92c7a79567 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Mon, 15 Mar 2021 08:29:54 -0500 Subject: [PATCH 10/13] Update author --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index df16ea6..afc0cc8 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ }, "author": { "name": "Zach Leatherman", - "email": "zach@filamentgroup.com", - "url": "https://filamentgroup.com" + "email": "zachleatherman@gmail.com", + "url": "https://zachleat.com/" }, "license": "MIT", "bugs": { From 3df614724e871c43780108ffde276587a5463ff4 Mon Sep 17 00:00:00 2001 From: zk-phi Date: Thu, 18 Mar 2021 02:40:17 +0900 Subject: [PATCH 11/13] Update upstream branch --- .github/workflows/sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index bdaa204..df0ee7b 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -13,5 +13,5 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} base: 'master' - head: 'filamentgroup:master' + head: 'zachleat:master' From 5e57767a315313211a99ab66323500f0a29e79c5 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Mon, 7 Jun 2021 12:15:51 -0500 Subject: [PATCH 12/13] Add the readme link to Unicode Range Interchange --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8c6fb5b..882610b 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ If you want to read an in-depth tutorial on the installation steps above, please ## Usage +_Related: operate on existing `unicode-range` values with [Unicode Range Interchange](https://www.zachleat.com/unicode-range-interchange/) ([read the blog post](https://www.zachleat.com/web/unicode-range-interchange/))._ + ### Find the glyphs in a local file or url ```sh From 4e7bb95ea3046dc99e7b758c9f004685a4736265 Mon Sep 17 00:00:00 2001 From: zk-phi Date: Fri, 2 Jul 2021 00:29:58 +0900 Subject: [PATCH 13/13] Use my fork of spider-pig --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index afc0cc8..ca83f69 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "glyphhanger": "./cmd.js" }, "dependencies": { - "@zachleat/spider-pig": "^2.0.0", + "@zachleat/spider-pig": "zk-phi/spider-pig", "chalk": "^4.1.0", "characterset": "^1.3.0", "connect": "^3.7.0",