From 4192741817c6a8de37f3d7187b54bd401320ee57 Mon Sep 17 00:00:00 2001 From: Andy Kluger Date: Fri, 27 Nov 2020 02:11:28 -0500 Subject: [PATCH 1/6] add instructions for using with the new upstream customizer site --- README.rst | 59 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/README.rst b/README.rst index 0e68a0f..dca75c6 100644 --- a/README.rst +++ b/README.rst @@ -19,40 +19,42 @@ How to Use If you want to have GitHub build your custom configuration, fork this repo on GitHub, then: -- get a local copy +- get a local copy: -.. code:: console + .. code:: console - $ git clone - $ cd archbuilder_iosevka + $ git clone + $ cd archbuilder_iosevka -- configure your font +- activate a `Python Virtual Environment`_ matching ``requirements.txt``: -.. code:: console + .. code:: console - $ $EDITOR vars.yml + $ python3 -m venv venv + $ . ./venv/bin/activate + $ python -m pip install -r requirements.txt -- activate a `Python Virtual Environment`_ matching ``requirements.txt``, e.g.: +- configure your font, either by editing ``vars.yml``: -.. code:: console + .. code:: console - $ python3 -m venv venv - $ . ./venv/bin/activate - $ python -m pip install -r requirements.txt + $ $EDITOR vars.yml -- generate your new workflow + or by `Using the Customizer Site`_. -.. code:: console +- generate your new workflow: - $ ./mk/buildpkg.yml.sh + .. code:: console -- tag your changes as a release (start tag with 'r'), and push + $ ./mk/buildpkg.yml.sh -.. code:: console +- tag your changes as a release (start tag with 'r'), and push: - $ git commit vars.yml .github/workflows/buildpkg.yml -m "much better now" - $ git tag r123-awesome-build-label - $ git push --tags + .. code:: console + + $ git commit -am "much better now" + $ git tag r123-awesome-build-label + $ git push --tags You can watch the build process in your ``Actions`` tab, and after ~30 minutes find the built font in your ``Releases``. @@ -110,9 +112,24 @@ pipx $ pipx install wheezy.template yamlpath +Using the Customizer Site +------------------------- + +There is now `an official web app`_ for configuring a build visually. + +To use a configuration thus generated with this builder: + +- in the customizer, leave the default Family Name ("Iosevka Custom") +- save the generated configuration as ``templates/private-build-plans.toml.wz`` +- in ``vars.yml``'s ``build`` list, ensure the only uncommented item is ``ttf-iosevka-custom-git``: + + .. code:: console + + $ yaml-merge -A right -w vars.yml vars.yml <<<'{"build": ["ttf-iosevka-custom-git"]}' + -.. _ttf-iosevka-term-custom-git: https://aur.archlinux.org/packages/ttf-iosevka-term-custom-git .. _Iosevka: https://github.com/be5invis/Iosevka/ +.. _an official web app: https://typeof.net/Iosevka/customizer .. _zpy: https://github.com/andydecleyre/zpy .. _pip-tools: https://github.com/jazzband/pip-tools From 5aa45b4725d729bd41d786881647ab54b73b62e5 Mon Sep 17 00:00:00 2001 From: Andy Kluger Date: Tue, 8 Dec 2020 23:27:13 -0500 Subject: [PATCH 2/6] preliminary work for building webfonts as well --- mk/pkgbuilds.sh | 21 ++++++++++++++++----- templates/PKGBUILD.wz | 17 +++++++++++++++-- vars.yml | 1 + 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/mk/pkgbuilds.sh b/mk/pkgbuilds.sh index f76f4cb..cd24bfc 100755 --- a/mk/pkgbuilds.sh +++ b/mk/pkgbuilds.sh @@ -3,19 +3,30 @@ cd "$(dirname "$0")" gitroot="$(git rev-parse --show-toplevel)" "${gitroot}"/mk/private-build-plans.toml.sh + pbp_sha256="$(sha256sum "${gitroot}"/private-build-plans.toml | cut -d' ' -f 1)" -yaml-get -p 'spacings.*' "${gitroot}"/vars.yml | while read spacing; do +if [ "$(yaml-get -p build_webfonts "${gitroot}"/vars.yml)" = yes ]; then + build_webfonts=true +else + build_webfonts=false +fi - folder="${gitroot}/pkgs/ttf-iosevka-${spacing}${spacing:+-}custom-git" +yaml-get -p 'spacings.*' "${gitroot}"/vars.yml | while read -r spacing; do + folder="${gitroot}/pkgs/ttf-iosevka-${spacing}${spacing:+-}custom-git" mkdir -p "$folder" + cp "${gitroot}"/private-build-plans.toml "${folder}"/private-build-plans.toml.example - wheezy.template "${gitroot}"/templates/PKGBUILD.wz \ - '{"spacing": "'$spacing'", "pbp_sha256": "'$pbp_sha256'"}' \ - >"${folder}"/PKGBUILD + + wheezy.template "${gitroot}"/templates/PKGBUILD.wz '{ + "spacing": "'"$spacing"'", + "pbp_sha256": "'"$pbp_sha256"'", + "build_webfonts": '"$build_webfonts"' + }' >"${folder}"/PKGBUILD printf '%s\n' \ '/*.pkg.*' '/src' '/pkg' '/Iosevka' \ >"${folder}/.gitignore" + done diff --git a/templates/PKGBUILD.wz b/templates/PKGBUILD.wz index 29f430e..604cb94 100644 --- a/templates/PKGBUILD.wz +++ b/templates/PKGBUILD.wz @@ -1,4 +1,4 @@ -@require(spacing, pbp_sha256) +@require(spacing, pbp_sha256, build_webfonts) # Maintainer: Andy Kluger # Contributor: Markus Weimar _pkgname=ttf-iosevka-@{spacing and spacing + '-' or ''}custom @@ -44,12 +44,25 @@ build() { cd Iosevka npm install npm update - npm run build -- ttf::${_pkgname#*-} + npm run build -- @{build_webfonts and 'contents' or 'ttf'}::${_pkgname#*-} } package() { install -d "${pkgdir}/usr/share/fonts/TTF" install -m644 Iosevka/dist/*/ttf/*.ttf "${pkgdir}/usr/share/fonts/TTF/" +@if build_webfonts: + install -d "${pkgdir}/usr/share/fonts/WOFF2" + install -m644 Iosevka/dist/*/woff2/*.woff2 "${pkgdir}/usr/share/fonts/WOFF2/" + # where's the css stuff? + printf '%s\n' "IN THE DIST FOLDER, TOP LEVEL:" + ls Iosevka/dist/ + printf '%s\n' "IN THE DIST FOLDER, SECOND LEVEL:" + ls Iosevka/dist/*/ + printf '%s\n' "IN THE DIST FOLDER, THIRD LEVEL:" + ls Iosevka/dist/*/*/ + # install -d "${pkgdir}/usr/share/fonts/WOFF2" + # install -m644 Iosevka/dist/*/woff2/*.woff2 "${pkgdir}/usr/share/fonts/WOFF2/" +@end install -d "${pkgdir}/usr/share/licenses/${pkgname}" install -m644 Iosevka/LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/" } diff --git a/vars.yml b/vars.yml index bedf3a0..1d58383 100644 --- a/vars.yml +++ b/vars.yml @@ -9,6 +9,7 @@ spacings: - term # fewer wide glyphs - fontconfig-mono # no wide glyphs - fixed # neither wide glyphs nor ligatures +build_webfonts: yes charvars: digit-form: lining turn-v: curly From 50db39e067582249a587d3f7c3931984ff1033ed Mon Sep 17 00:00:00 2001 From: Andy Kluger Date: Wed, 9 Dec 2020 00:25:53 -0500 Subject: [PATCH 3/6] alter logging to include CSS directly --- templates/PKGBUILD.wz | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/templates/PKGBUILD.wz b/templates/PKGBUILD.wz index 604cb94..e214b5e 100644 --- a/templates/PKGBUILD.wz +++ b/templates/PKGBUILD.wz @@ -53,15 +53,9 @@ package() { @if build_webfonts: install -d "${pkgdir}/usr/share/fonts/WOFF2" install -m644 Iosevka/dist/*/woff2/*.woff2 "${pkgdir}/usr/share/fonts/WOFF2/" - # where's the css stuff? - printf '%s\n' "IN THE DIST FOLDER, TOP LEVEL:" - ls Iosevka/dist/ - printf '%s\n' "IN THE DIST FOLDER, SECOND LEVEL:" - ls Iosevka/dist/*/ - printf '%s\n' "IN THE DIST FOLDER, THIRD LEVEL:" - ls Iosevka/dist/*/*/ - # install -d "${pkgdir}/usr/share/fonts/WOFF2" - # install -m644 Iosevka/dist/*/woff2/*.woff2 "${pkgdir}/usr/share/fonts/WOFF2/" + printf '%s\n' 'CSS BELOW:' + cat Iosevka/dist/*/*.css + printf '%s\n' 'CSS ABOVE' @end install -d "${pkgdir}/usr/share/licenses/${pkgname}" install -m644 Iosevka/LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/" From 43aace321a2ff3262b67d0bb3afbb36f489351d8 Mon Sep 17 00:00:00 2001 From: Andy Kluger Date: Wed, 9 Dec 2020 00:30:03 -0500 Subject: [PATCH 4/6] turn off building webfonts by default --- vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars.yml b/vars.yml index 1d58383..7068a04 100644 --- a/vars.yml +++ b/vars.yml @@ -9,7 +9,7 @@ spacings: - term # fewer wide glyphs - fontconfig-mono # no wide glyphs - fixed # neither wide glyphs nor ligatures -build_webfonts: yes +build_webfonts: no charvars: digit-form: lining turn-v: curly From a7f58e8c2c4f8aaac203706e4131618b16725672 Mon Sep 17 00:00:00 2001 From: Andy Kluger Date: Wed, 9 Dec 2020 00:40:03 -0500 Subject: [PATCH 5/6] add to readme: EDITOR method for crafting vars.yml when using customizer --- README.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index dca75c6..df2f6be 100644 --- a/README.rst +++ b/README.rst @@ -121,7 +121,14 @@ To use a configuration thus generated with this builder: - in the customizer, leave the default Family Name ("Iosevka Custom") - save the generated configuration as ``templates/private-build-plans.toml.wz`` -- in ``vars.yml``'s ``build`` list, ensure the only uncommented item is ``ttf-iosevka-custom-git``: +- in ``vars.yml``'s ``build`` list, ensure the only uncommented item is ``ttf-iosevka-custom-git``, + with either an editor: + + .. code:: console + + $ $EDITOR vars.yml + + or yamlpath's ``yaml-merge``: .. code:: console From ed59f3d50303dfb888191613d1da105f8cde7c21 Mon Sep 17 00:00:00 2001 From: Andy Kluger Date: Thu, 17 Dec 2020 22:23:56 -0500 Subject: [PATCH 6/6] try new rounded e --- vars.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars.yml b/vars.yml index 7068a04..d5a2356 100644 --- a/vars.yml +++ b/vars.yml @@ -26,6 +26,7 @@ charvars: a: doublestorey-tailed b: toothless-corner d: tailed + e: rounded f: flat-hook-tailed g: opendoublestorey h: straight