Skip to content

Commit

Permalink
Merge branch 'develop' into colorcodebot
Browse files Browse the repository at this point in the history
  • Loading branch information
AndydeCleyre committed Sep 9, 2024
2 parents ee7277e + d51cde6 commit e815881
Show file tree
Hide file tree
Showing 14 changed files with 250 additions and 89 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/buildpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ jobs:
buildah config --workingdir /home/dev/ttfautohint ctnr
buildah run ctnr makepkg --noconfirm -si
- name: install templating tools
run: |
python3 -m pip install -U pip setuptools wheel
python3 -m pip install -r requirements.txt
printf '%s\n' "$HOME/.local/bin" >>$GITHUB_PATH
- name: render PKGBUILDs
run: ./mk/pkgbuilds.sh

Expand All @@ -61,9 +55,15 @@ jobs:
printf '%s\n' "${RUNNER_TEMP}/dist/"
ls -lh "${RUNNER_TEMP}/dist/"
- name: make release notes
run: |
printf '%s\n' '`vars.nt`:' '```yaml' >release.md
cat vars.nt >>release.md
printf '%s\n' '```' >>release.md
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{ runner.temp }}/dist/*
fail_on_unmatched_files: true
body_path: private-build-plans.toml
body_path: release.md
31 changes: 20 additions & 11 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
This is free and unencumbered software released into the public domain.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

Copyright (C) 2022 Andy Kluger
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
12 changes: 7 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ fork this repo on GitHub, then:
$ git clone <your-github-fork>
$ cd archbuilder_iosevka
- configure your font (see the `character variants`_), either by editing ``vars.yml``:
- configure your font (see the `character variants`_), either by editing ``vars.nt``:

.. code:: console
$ $EDITOR vars.yml
$ $EDITOR vars.nt
or by `Using the Customizer Site`_.

Expand Down Expand Up @@ -73,18 +73,20 @@ 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.nt``'s ``build`` list, ensure the only uncommented item is ``ttf-iosevka-custom-git``,
with either an editor:

.. code:: console
$ $EDITOR vars.yml
$ $EDITOR vars.nt
or yamlpath's ``yaml-merge``:
or NestedTextTo and yamlpath's ``yaml-merge``:

.. code:: console
$ nt2yaml vars.nt >vars.yml
$ yaml-merge -A right -w vars.yml vars.yml <<<'{"build": ["ttf-iosevka-custom-git"]}'
$ yaml2nt vars.yml >vars.nt
.. _Iosevka: https://github.com/be5invis/Iosevka/
Expand Down
2 changes: 1 addition & 1 deletion mk/buildpkg.yml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
pip install -qr requirements.txt

wheezy.template "${gitroot}"/templates/buildpkg.yml.wz \
"$(yaml-get -p . "${gitroot}"/vars.yml)" \
"$(nt2json -s "${gitroot}"/vars.types.nt "${gitroot}"/vars.nt)" \
>"${gitroot}"/.github/workflows/buildpkg.yml

printf '%s\n' "Wrote ${gitroot}/.github/workflows/buildpkg.yml"
Expand Down
15 changes: 11 additions & 4 deletions mk/pkgbuilds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ pip install -qr requirements.txt

pbp_sha256="$(sha256sum "${gitroot}"/private-build-plans.toml | cut -d ' ' -f 1)"

build_webfonts="$(yaml-get -p build_webfonts "${gitroot}"/vars.yml)"
upstream_branch="$(yaml-get -p branch "${gitroot}"/vars.yml)"
vars="$(mktemp)"
nt2json -s "${gitroot}"/vars.types.nt "${gitroot}"/vars.nt >"$vars"

yaml-get -p 'spacings.*' "${gitroot}"/vars.yml | while read -r spacing; do
build_webfonts="$(yaml-get -p build_webfonts "$vars")"
upstream_branch="$(yaml-get -p branch "$vars")"

folder="${gitroot}/pkgs/ttf-iosevka-${spacing}${spacing:+-}custom-git"
yaml-get -p 'spacings.*' "$vars" | while read -r spacing; do

if [ "$spacing" = normal ]; then
folder="${gitroot}/pkgs/ttf-iosevka-custom-git"
else
folder="${gitroot}/pkgs/ttf-iosevka-${spacing}-custom-git"
fi
mkdir -p "$folder"

cp "${gitroot}"/private-build-plans.toml "${folder}"/private-build-plans.toml.example
Expand Down
2 changes: 1 addition & 1 deletion mk/private-build-plans.toml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi
pip install -qr requirements.txt

wheezy.template "${gitroot}"/templates/private-build-plans.toml.wz \
"$(yaml-get -p . "${gitroot}"/vars.yml)" \
"$(nt2json -s "${gitroot}"/vars.types.nt "${gitroot}"/vars.nt)" \
>"${gitroot}"/private-build-plans.toml

printf '%s\n' "Wrote ${gitroot}/private-build-plans.toml"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/ttf-iosevka-git
Submodule ttf-iosevka-git updated from 9dd340 to 010c53
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
yamlpath>=3.4.0
wheezy.template
nt2
24 changes: 19 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
python-dateutil==2.8.2 # via yamlpath
ruamel-yaml==0.17.21 # via yamlpath
arrow==1.3.0 # via inform
attrs==24.2.0 # via cattrs
cattrs==24.1.0 # via nt2
exceptiongroup==1.2.2 # via cattrs
inform==1.31 # via nestedtext
markdown-it-py==3.0.0 # via rich
mdurl==0.1.2 # via markdown-it-py
nestedtext==3.7 # via nt2
nt2==0.2.6 # via -r requirements.in
plumbum==1.8.3 # via nt2
pygments==2.18.0 # via rich
python-dateutil==2.9.0.post0 # via arrow, yamlpath
rich==13.8.0 # via nt2
ruamel-yaml==0.17.21 # via nt2, yamlpath
ruamel-yaml-clib==0.2.8 # via ruamel-yaml
six==1.16.0 # via python-dateutil
wheezy-template==3.2.1 # via -r requirements.in
yamlpath==3.8.1 # via -r requirements.in
six==1.16.0 # via inform, python-dateutil
types-python-dateutil==2.9.0.20240906 # via arrow
typing-extensions==4.12.2 # via cattrs
wheezy-template==3.2.2 # via -r requirements.in
yamlpath==3.8.2 # via -r requirements.in, nt2
23 changes: 16 additions & 7 deletions templates/PKGBUILD.wz
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
@require(spacing, pbp_sha256, build_webfonts, branch)
@(
name = '-'.join(filter(None, ('ttf-iosevka', spacing, 'custom')))
if isinstance(build_webfonts, str):
build_webfonts = build_webfonts.lower() in ('yes', 'true')
name = f"ttf-iosevka-{spacing}-custom"
if spacing == 'normal':
plan = 'IosevkaCustom'
name = 'ttf-iosevka-custom'
elif spacing == 'quasi-proportional':
plan = 'IosevkaQpCustom'
elif spacing == 'quasi-proportional-extension-only':
plan = 'IosevkaQpeCustom'
elif spacing == 'fontconfig-mono':
plan = 'IosevkaFcmCustom'
else:
plan = f"Iosevka{spacing.title()}Custom"
)\
# Maintainer: Andy Kluger <https://t.me/andykluger>
# Contributor: Markus Weimar <mail@@markusweimar.de>
Expand Down Expand Up @@ -46,17 +55,17 @@ build () {
cd Iosevka
npm install
npm update
NO_COLOR=1 npm run build -- @{build_webfonts and 'contents' or 'ttf'}::${_pkgname#*-}
NO_COLOR=1 npm run build -- @{build_webfonts and 'contents' or 'ttf'}::@{plan}
}

package () {
install -d "${pkgdir}/usr/share/fonts/TTF"
install -m644 Iosevka/dist/*/ttf/*.ttf "${pkgdir}/usr/share/fonts/TTF/"
install -m644 Iosevka/dist/@{plan}/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/"
install -m644 Iosevka/dist/@{plan}/WOFF2/*.woff2 "${pkgdir}/usr/share/fonts/WOFF2/"
printf '%s\n' 'CSS BELOW:'
cat Iosevka/dist/*/*.css
cat Iosevka/dist/@{plan}/*.css
printf '%s\n' 'CSS ABOVE'
@end
install -d "${pkgdir}/usr/share/licenses/${pkgname}"
Expand Down
14 changes: 7 additions & 7 deletions templates/buildpkg.yml.wz
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ jobs:
buildah config --workingdir /home/dev/ttfautohint ctnr
buildah run ctnr makepkg --noconfirm -si

- name: install templating tools
run: |
python3 -m pip install -U pip setuptools wheel
python3 -m pip install -r requirements.txt
printf '%s\n' "$HOME/.local/bin" >>$GITHUB_PATH

- name: render PKGBUILDs
run: ./mk/pkgbuilds.sh

Expand All @@ -64,9 +58,15 @@ jobs:
ls -lh "${RUNNER_TEMP}/dist/"

@end
- name: make release notes
run: |
printf '%s\n' '`vars.nt`:' '```yaml' >release.md
cat vars.nt >>release.md
printf '%s\n' '```' >>release.md

- name: Release
uses: softprops/action-gh-release@@v1
with:
files: ${{ runner.temp }}/dist/*
fail_on_unmatched_files: true
body_path: private-build-plans.toml
body_path: release.md
102 changes: 89 additions & 13 deletions templates/private-build-plans.toml.wz
Original file line number Diff line number Diff line change
@@ -1,27 +1,83 @@
@require(charvars, spacings, custom_weights, use_custom_weights)
@#
@require(charvars, italic_overrides, spacings, custom_weights, use_custom_weights, contextual_widths, extra_widths)
@(
if isinstance(use_custom_weights, str):
use_custom_weights = use_custom_weights.lower() in ('yes', 'true')
contextual_widths = str(contextual_widths).lower()
)\
@for spacing in spacings:
@(
plan = '-'.join(filter(None, ('iosevka', spacing, 'custom')))
family = plan.replace('-', ' ').title()
if spacing == 'normal':
plan = 'IosevkaCustom'
family = 'Iosevka Custom'
elif spacing == 'quasi-proportional':
plan = 'IosevkaQpCustom'
family = 'Iosevka QP Custom'
elif spacing == 'quasi-proportional-extension-only':
plan = 'IosevkaQpeCustom'
family = 'Iosevka QPE Custom'
elif spacing == 'fontconfig-mono':
plan = 'IosevkaFcmCustom'
family = 'Iosevka FCM Custom'
else:
plan = f"Iosevka{spacing.title()}Custom"
family = f"Iosevka {spacing.title()} Custom"
)\
@#
[buildPlans.@plan]
[buildPlans.@{plan}]
family = "@family"
export-glyph-names = false
@if spacing:
exportGlyphNames = false
buildTextureFeature = @contextual_widths
spacing = "@spacing"
@end

[buildPlans.@{plan}.ligations]
inherits = "dlig"
# disables = []
# enables = []

[buildPlans.@{plan}.widths.Normal]
shape = 500
menu = 5
css = "normal"

@if 'condensed' in extra_widths:
[buildPlans.@{plan}.widths.Condensed]
shape = 416
menu = 3
css = "condensed"

@end
@if 'semi-condensed' in extra_widths:
[buildPlans.@{plan}.widths.SemiCondensed]
shape = 456
menu = 4
css = "semi-condensed"

@end
@if 'semi-extended' in extra_widths:
[buildPlans.@{plan}.widths.SemiExtended]
shape = 548
menu = 6
css = "semi-expanded"

@end
@if 'extended' in extra_widths:
[buildPlans.@{plan}.widths.Extended]
shape = 600
menu = 7
css = "expanded"

@end
@if 'extra-extended' in extra_widths:
[buildPlans.@{plan}.widths.ExtraExtended]
shape = 658
menu = 8
css = "extra-expanded"

@end
@if 'ultra-extended' in extra_widths:
[buildPlans.@{plan}.widths.UltraExtended]
shape = 720
menu = 9
css = "ultra-expanded"

@end
# [buildPlans.@{plan}.variants]
# inherits = "ss16"

Expand All @@ -32,8 +88,10 @@ inherits = "dlig"

# Override above variants for each slope:
# [buildPlans.@{plan}.variants.upright]
# [buildPlans.@{plan}.variants.italic]
# [buildPlans.@{plan}.variants.oblique]
[buildPlans.@{plan}.variants.italic]
@for char, style in italic_overrides.items():
@char = "@style"
@end

@if use_custom_weights:
@for name, weight in custom_weights.items():
Expand All @@ -44,4 +102,22 @@ css = @weight['default']

@end
@end
[buildPlans.@{plan}.slopes.Upright]
angle = 0
shape = "upright"
menu = "upright"
css = "normal"

# [buildPlans.@{plan}.slopes.Oblique]
# angle = 9.4
# shape = "oblique"
# menu = "oblique"
# css = "oblique"

[buildPlans.@{plan}.slopes.Italic]
angle = 9.4
shape = "italic"
menu = "italic"
css = "italic"

@end
Loading

0 comments on commit e815881

Please sign in to comment.