From afd3e45dce5f3698676b20859201f25bbb80cecb Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Wed, 17 Apr 2024 11:57:48 +0200 Subject: [PATCH 1/3] Adapt to Nerd Fonts 3.2.1 [why] Some internals of the font-patcher changed since 2.3.3, that we use directly. Signed-off-by: Fini Jastrow --- .github/workflows/ci.yaml | 2 +- rename-font | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f9452a3..acc0cbb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -105,7 +105,7 @@ jobs: - name: Install configparser run: pip3 install configparser - name: Extract additional powerline glyphs - run: fontforge -lang=ff -script "`pwd`/extract-extra-glyphs" "`pwd`" `pwd`/src/**/octicons.ttf + run: fontforge -lang=ff -script "`pwd`/extract-extra-glyphs" "`pwd`" `pwd`/src/glyphs/octicons/octicons.ttf - name: Build Powerline run: | ./do_generate 01 --powerline --mono CascadiaCodePL-Regular.ttf DelugiaPL.ttf "Delugia PL" diff --git a/rename-font b/rename-font index 0e08bd2..15171b3 100644 --- a/rename-font +++ b/rename-font @@ -3,6 +3,7 @@ import os.path import fontforge +import sys, logging from argparse import ArgumentParser sys.path.insert(0, os.path.abspath(os.path.dirname(sys.argv[0])) + '/bin/scripts/name_parser/') @@ -23,7 +24,8 @@ SIL_TABLE = [('cascadia ?(code|mono)( ?pl)?', args.name), ] print("\nRenaming process\n {}\n as {}\n -> {}".format(args.input, args.orig, args.output)) fname = os.path.splitext(os.path.basename(args.orig))[0] -n = FontnameParser(fname) +logger = logging.getLogger() +n = FontnameParser(fname, logger) n.add_name_substitution_table(SIL_TABLE) n.set_keep_regular_in_family(False) if not n.parse_ok: @@ -36,7 +38,7 @@ delugia=fontforge.open(args.input) n.rename_font(delugia) # Other information -delugia.appendSFNTName("English (US)", "UniqueID", "{};{}".format(args.version, n.ps_fontname())) +delugia.appendSFNTName("English (US)", "UniqueID", "{};{}".format(args.version, n.psname())) delugia.appendSFNTName("English (US)", "Trademark", "") # Mix our version information in @@ -44,7 +46,7 @@ delugia.sfntRevision = None # Auto-set (refreshed) by fontforge delugia.appendSFNTName("English (US)", "Version", args.version) delugia.version = args.version -if n.ps_fontname().lower().find("mono"): +if n.psname().lower().find("mono"): # For MS-Windows console apps panose = list(delugia.os2_panose) if panose[0] < 3: # https://forum.high-logic.com/postedfiles/Panose.pdf From 66facb9b4acea4f1aad75225833c9655e1759c28 Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Thu, 2 May 2024 11:48:48 +0200 Subject: [PATCH 2/3] CI: Update actions [why] Some actions still run with Node16. Signed-off-by: Fini Jastrow --- .github/workflows/ci.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index acc0cbb..f4e88d9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,7 +31,7 @@ jobs: run: | echo "CASCADIATAG=${{ fromJson(steps.get_latest_release.outputs.data).tag_name }}" >> $GITHUB_ENV - name: Check if tag exists - uses: mukunku/tag-exists-action@v1.2.0 + uses: mukunku/tag-exists-action@v1.6.0 id: check_tag with: tag: ${{ env.CASCADIATAG }} @@ -50,7 +50,7 @@ jobs: CASCADIATAG_ISNOTNEW: ${{ needs.check-for-new-cascadia.outputs.tag_exists }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Decide on version @@ -65,7 +65,7 @@ jobs: fi echo "OURVERSION=${OURVERSION}" >> $GITHUB_ENV - name: Download latest version of Cascadia - uses: robinraju/release-downloader@v1.7 + uses: robinraju/release-downloader@v1.10 with: repository: "microsoft/cascadia-code" tag: ${{ needs.check-for-new-cascadia.outputs.tag_name }} @@ -91,7 +91,7 @@ jobs: fontforge --version - name: Get Font Patcher - uses: robinraju/release-downloader@v1.5 + uses: robinraju/release-downloader@v1.10 with: repository: "ryanoasis/nerd-fonts" latest: true @@ -164,23 +164,23 @@ jobs: - name: Check for preexisting glyphs run: | grep 'Found existing' process*.log | grep -vE ' Powerline(Extra)?Symbols>' - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: Delugia Powerline path: "delugia-powerline" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: Delugia Mono Powerline path: "delugia-mono-powerline" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: Delugia Complete path: "delugia-complete" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: Delugia Mono Complete path: "delugia-mono-complete" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: Delugia Book path: "delugia-book" @@ -188,7 +188,7 @@ jobs: # Release part - name: Create tag if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/') && needs.check-for-new-cascadia.outputs.tag_exists != 'true' }} - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: github-token: ${{ github.token }} script: | @@ -214,7 +214,7 @@ jobs: if: ${{ startsWith(github.ref, 'refs/tags/') }} uses: battila7/get-version-action@v2 - name: Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 if: ${{ github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || needs.check-for-new-cascadia.outputs.tag_exists != 'true') }} with: tag_name: ${{ startsWith(github.ref, 'refs/tags/') && steps.get_tag_name.outputs.version || needs.check-for-new-cascadia.outputs.tag_name }} From 0284b4a3cfbdfe656fde6b3f513c260a74633fd9 Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Thu, 2 May 2024 12:21:30 +0200 Subject: [PATCH 3/3] CI: Fix debug information [why] The actual message changes with the newest font-patcher and furthermore the message is suppressed unless specifically run in debug mode. Signed-off-by: Fini Jastrow --- .github/workflows/ci.yaml | 2 +- do_generate | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f4e88d9..e696464 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -163,7 +163,7 @@ jobs: zip delugia-book.zip delugia-book/* - name: Check for preexisting glyphs run: | - grep 'Found existing' process*.log | grep -vE ' Powerline(Extra)?Symbols>' + grep 'Skipping...' process*.log | grep -vE ' Powerline(Extra)?Symbols>' - uses: actions/upload-artifact@v4 with: name: Delugia Powerline diff --git a/do_generate b/do_generate index 57162d4..7b77add 100755 --- a/do_generate +++ b/do_generate @@ -22,7 +22,7 @@ fi PWD=$( pwd ) rm -f C*.ttf -fontforge -script "${PWD}/font-patcher" --careful "${3}" --custom SomeExtraSymbols.sfd --no-progressbars "${PWD}/ttf/static/${4}" "${2}" --outputdir "${PWD}" | tee "process${1}.log" +fontforge -script "${PWD}/font-patcher" --debug 2 --careful "${3}" --custom SomeExtraSymbols.sfd --no-progressbars "${PWD}/ttf/static/${4}" "${2}" --outputdir "${PWD}" | tee "process${1}.log" if [ -z "${OURVERSION}" ]; then # Github CI sets this variable, but this can be useful for manual calls: