-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker nerdfonts-patcher errors out on fontforge start #1647
Comments
After some testing out of docker:
In any case it seems this isn't the container issue I thought, and instead is just incompatibility with variable and potentially web fonts. If this is expected, I can close this issue? Sorry for the noise if so. |
Thanks for reporting! Indeed, variable fonts can not be opened (and then patched) with But that message "opening may fail" should also be visible in the docker runs 🤔 And this font file name does not sound very variableish (On the other hand, I never had the idea to put subdirectories under And Maybe you can give me a link to the fonts that fail and I can investigate further. The error message with the index 0 out of bounds is completely unexpected. |
Hey, thanks for the feedback! So I think the 'opening may fail' message perhaps was present in the Docker runs, although as the script now runs with The BoldItalic font you mention didn't cause an error -- I truncated some of the logs where text was repeated. When I removed the WOFF/WOFF2/variable fonts, the rest sailed through without any issue (I ran I'd be happy to provide font files, but I'm concerned about running afoul of the licence as it's not a free font. There is a trial download of the font with some vowel glyphs swapped. Let me see if I can find that and what font files are in there. If all else fails I recently spoke with the author of the fontface and think I'll need to contact him again shortly; I can ask for permission if it that's helpful. I'll also rerun the patcher and more specifically detail what fonts throw the index error, and what similarities they hold. |
Thanks for the additional information! Maybe it will be more helpful if you run the docker in sequential
I will fix the empty array / index error. But it would be interesting which font triggers it. I expected it can never turn up empty, and it would be good to understand the situation where my assumptions fail. If you can identify the font file that does, maybe it is also the case with the same file as trial version. Thanks again for helping 👍 |
@allcontributors please add @kjkent for bug |
We had trouble processing your request. Please try again later. |
[why] When the file specified to be patched is not a font file the patcher run errors out with an out of index runtime error: Traceback (most recent call last): File "/home/fini/extra/git/nerd-fonts/font-patcher", line 2155, in <module> main() File "/home/fini/extra/git/nerd-fonts/font-patcher", line 2147, in main patcher.generate(sourceFonts) File "/home/fini/extra/git/nerd-fonts/font-patcher", line 415, in generate sourceFont = sourceFonts[0] ~~~~~~~~~~~^^^ IndexError: list index out of range [how] Do not assume that the specified file will be a font file but rather check if fontforge detects a font in the file and error out if there is no font found. Fixes: #1647 Reported-by: Kristopher James Kent <[email protected]> Signed-off-by: Fini Jastrow <[email protected]>
Ok, thanks again, this will be fixed by the PR (see above). Now I need to find out what's wrong with the allcontributors bot 😬 |
[why] When the file specified to be patched is not a font file the patcher run errors out with an out of index runtime error: Traceback (most recent call last): File "/home/fini/extra/git/nerd-fonts/font-patcher", line 2155, in <module> main() File "/home/fini/extra/git/nerd-fonts/font-patcher", line 2147, in main patcher.generate(sourceFonts) File "/home/fini/extra/git/nerd-fonts/font-patcher", line 415, in generate sourceFont = sourceFonts[0] ~~~~~~~~~~~^^^ IndexError: list index out of range [how] Do not assume that the specified file will be a font file but rather check if fontforge detects a font in the file and error out if there is no font found. Fixes: #1647 Reported-by: Kristopher James Kent <[email protected]> Signed-off-by: Fini Jastrow <[email protected]>
@allcontributors please add @kjkent for bug |
I've put up a pull request to add @kjkent! 🎉 |
Hey @Finii, I've been digging into this a little bit more. It appears to be an upstream issue with fontforge, as in, As a workaround, those with the woff2 library installed can run If you'd find it beneficial, I could make a PR handling this in the script, either checking whether the user has https://github.com/google/woff2 installed and using it from PATH, or, as a fallback, cloning and building it. Admittedly, it's a bit of a |
Oh! And if it's useful to anyone reading this, I figured a way for users to grab the latest font-patcher and its deps without pulling the kitchen sink with it. It was useful for me for scripting as I was experimenting with the NerdFontsSymbolsOnly TTF. I found sparse-clone and cone mode very fickle to have it behave how I'd expect it, but the following does the job: repo='https://github.com/ryanoasis/nerd-fonts'
branch='master'
# Accepts directories and single files
git_include=(
'/font-patcher'
'/src/glyphs/**'
'/bin/scripts/name_parser/**'
)
git clone -n --depth=1 --filter=tree:0 "$repo" "${repo##*/}"
cd "$_"
git sparse-checkout set --no-cone ${git_include[@]}
git checkout "$branch" |
Thanks for sharing the interesting find above regarding woff2! I need to digest and let that simmer a bit ;-) But I want to comment on this right away:
Why not just using the https://github.com/ryanoasis/nerd-fonts/blob/master/FontPatcher.zip is updated automagically (via CI) whenever anything related to selfpatching changes in the default branch. |
@Finii oh yeah, no, you're absolutely right. What I wrote is probably more specific to my use case than others, I'm writing a python script to generate web fonts and strip unused glyphs out of the resultant file. My initial (convoluted) attempt used the icons-only font file as a reference, so, the sparse clone came in handy. I think I was in too deep and didn't realise that it was very much a me problem haha. |
After having read your report at the Fontforge repo I believe my fix could in fact be wrong (too limiting). |
🗹 Requirements
🎯 Subject of the issue
Experienced behavior:
Docker container nerdfonts/patcher errors out when run. I've attempted both compose and run syntax:
or
docker compose run --rm -v ./nf-in:/in -v ./nf-out/out nerdfonts/patcher --mono --adjust-line-height --progressbars --complete
.Both result in:
Expected behavior:
The fonts to patch without the errors
Example symbols:
N/A
🔧 Your Setup
Anonymice Powerline Nerd Font Complete.ttf
)?Nerdfonts/patcher docker image
Docker Hub
iterm2
,urxvt
,gnome
,konsole
)?Alacritty
Arch Linux
The text was updated successfully, but these errors were encountered: