Skip to content

Commit

Permalink
Merge pull request #85 from adam7/feature/NF3.2.1
Browse files Browse the repository at this point in the history
Adapt to Nerd Fonts 3.2.1
  • Loading branch information
Finii authored May 2, 2024
2 parents 9837d7a + 0284b4a commit f843ba4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -163,32 +163,32 @@ jobs:
zip delugia-book.zip delugia-book/*
- name: Check for preexisting glyphs
run: |
grep 'Found existing' process*.log | grep -vE ' Powerline(Extra)?Symbols>'
- uses: actions/upload-artifact@v3
grep 'Skipping...' process*.log | grep -vE ' Powerline(Extra)?Symbols>'
- 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"

# 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: |
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion do_generate
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 5 additions & 3 deletions rename-font
Original file line number Diff line number Diff line change
Expand Up @@ -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/')
Expand All @@ -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:
Expand All @@ -36,15 +38,15 @@ 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
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
Expand Down

0 comments on commit f843ba4

Please sign in to comment.