diff --git a/README.rst b/README.rst index 0e68a0f..df2f6be 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: + + .. code:: console - $ git commit vars.yml .github/workflows/buildpkg.yml -m "much better now" - $ git tag r123-awesome-build-label - $ git push --tags + $ 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,31 @@ 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``, + with either an editor: + + .. code:: console + + $ $EDITOR vars.yml + + or yamlpath's ``yaml-merge``: + + .. 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 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..e214b5e 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,19 @@ 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/" + 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}/" } diff --git a/vars.yml b/vars.yml index bedf3a0..d5a2356 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: no charvars: digit-form: lining turn-v: curly @@ -25,6 +26,7 @@ charvars: a: doublestorey-tailed b: toothless-corner d: tailed + e: rounded f: flat-hook-tailed g: opendoublestorey h: straight