Skip to content
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

font patcher fails #495

Closed
doums opened this issue Jun 24, 2020 · 18 comments
Closed

font patcher fails #495

doums opened this issue Jun 24, 2020 · 18 comments
Milestone

Comments

@doums
Copy link

doums commented Jun 24, 2020

🎯 Subject of the issue

I installed FontForge from my distribution's package manager (pacman on Arch Linux).

I tried to patch several ttf fonts: JetbrainsMono (downloaded here) and Inconsolata (downloaded from google fonts), in various style. All fail with the same error message:

$ fontforge -script font-patcher --octicons static/Inconsolata-Bold.t
tf
Copyright (c) 2000-2020. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Version: 20200314
 Based on sources from 2020-03-18 19:16 UTC-ML-D-GDK3.
The following tables are ignored by FontForge
  'STAT' style attributes table
Use-my-metrics flag set on at least two components in glyph 631
File original-source.otf does not exist
Traceback (most recent call last):
  File "font-patcher", line 924, in <module>
    main()
  File "font-patcher", line 919, in main
    patcher.patch()
  File "font-patcher", line 88, in patch
    symfont = fontforge.open(__dir__ + "/src/glyphs/" + patch['Filename'])
OSError: Open failed

I don't know what is the problem ?

🔧 Your Setup

Arch Linux

@cfbender
Copy link

cfbender commented Jul 7, 2020

It doesn't make it very clear, but you cannot just run the script on it's own - you need to first clone the repo with --depth 1 and run the script from there. You may be able to get away with only downloading the files you need from src, but cloning will definitely fix this for you.

@Etherian
Copy link

I ran into this issue as well.

@ryanoasis, could what tools and resources are needed and where to find them be clarified in the Font Patcher section? For example, it wasn't immediately clear that the font-patcher script was in the repo, and I didn't know from where the script was expecting to pull the glyphs until I decyphered the Python code in the error message.

@wimstefan
Copy link

There is a new repository with just the font-patcher and all the necessary files as long as @ryanoasis is too busy to create a different repo for the font-patcher only (as he intends to do) ...

@mtsolmn
Copy link

mtsolmn commented Jul 26, 2020

Hi, I would just like to +1 @Etherian and @cfbender comments above. It is completely unclear that you need to have the repo cloned locally in order to run the font-patcher. It makes sense after the fact, as the glyphs to patch have to come from somewhere, but it is not mentioned anywhere in the documentation. I ran into this problem when I first tried patching my own fonts as well.

The default values for the font-patcher could also be added in the documentation. For instance, it is unclear which glyph packs are patched by default until you actually run the script. It would be nice to know this priori.

Great project though and works great when you know what to do! Thanks for all the work.

@doums
Copy link
Author

doums commented Jul 26, 2020

I ran into the exact same problem. You should mention this in the doc. Definitely.

@ryanoasis
Copy link
Owner

I think this is definitely confusing. Yes @wimstefan is right the goal is to create a separate repo for the patcher (and its required files) and I believe that would mean removing it from this repo to reduce confusion. Thoughts?

This was created a while back but just haven't gotten around to moving stuff yet: https://github.com/NerdFonts/patcher

It's not as simple as just copying the files.. or well if we keep the files in both repos it could be. There is a lot of automation for the builds where things are pretty tightly coupled. Haven't looked into this for some time but understand it is a pain point

@cfbender
Copy link

cfbender commented Sep 9, 2020

Maybe something like a submodule could be useful if you're worried about the file duplication

@poetaman
Copy link

poetaman commented Feb 5, 2021

@ryanoasis Yes that's super confusing. Its under a user NerdFonts, and NerdFonts themselves are under your profile. If I had not come across this discussion, I wouldn't have been able to find. Please move that repo under your profile too, I bet most people don't know of it (it has only 3 stars vs 26k stars for nerd-fonts). Or please add a link to that repo on nerd-font's description page.

Screen Shot 2021-02-05 at 3 00 48 PM

Screen Shot 2021-02-05 at 3 06 03 PM

@ryanoasis
Copy link
Owner

@reportaman it's still a WIP. the org is setup but i want to copy things over so commit and contribution history is not lost

@Finii
Copy link
Collaborator

Finii commented Dec 15, 2021

Can you not just fork, then drop the 'unneeded' half in one of the repos?

What came to my mind first was

Edit: Add link to PR

@NuraliMedeu
Copy link

NuraliMedeu commented Dec 27, 2021

Instead of splitting this repo into nerd-fonts and font-patcher, and thus introducing more maintenance burden, I suggest to edit the font-patcher script to automatically download the necessary files from this repo. That way, all a user will have to do is to download one script file from the website.

Also, both the README.md and the website need to explicitly state that currently. for the font patcher to work, the user needs to download the entire repo, not just the script file.

Idea moved to discussion Nerd Fonts 3.0 Roadmap.

@ryanoasis
Copy link
Owner

There will be some readme adjustments but the font patcher is now going to be archived with the necessary source files each release, should no longer be a need to clone any repo just for the patcher, for the 2.2.0 RC here: https://github.com/ryanoasis/nerd-fonts/releases/download/2.2.0-RC/FontPatcher.zip

On the subject of a separate repo, I created the NerdFonts org and repos when I thought separating them was the best idea, I'm no longer sold on that being a solution.

The reason being as @NuraliMedeu mentions I also agree I think that may just mean harder maintenance when all most people want is a place to grab the patcher and go (solved by an archive file).
Another reason why I thought having the patcher in a separate repo would be beneficial is for patching all the fonts for a release but we also want to commit those changes back to the repo (not just create the archives) so we'd have to checkout the repo with the fonts anyway..

I think having a downloadable archive for the font patcher probably solves 99% of the issues

@Finii
Copy link
Collaborator

Finii commented Jan 27, 2022

@ryanoasis

but we also want to commit those changes back to the repo (not just create the archives)

You never explain the why. Who and why wants the patched fonts in the repo :-D

@ryanoasis
Copy link
Owner

ryanoasis commented Feb 5, 2022

@Finii

You never explain the why. Who and why wants the patched fonts in the repo :-D

Sure I'll try to clarify. I see 2 main reasons to commit back to the repo.

  1. There is definitely a subset of users who drill down the folder structure on the repo itself to download fonts. I've seen that circumstantially on a few videos but also it is based on actual data on Github (insights > data > popular content).

Selection_100

  1. Less important but for historical reasons, we've always just had them directly available in the repo and this was how it was done before proper releases.

I'd be in favor of changing that starting in 3.0 release to go along with other breaking changes but not for 2.x releases, though that would break it for everyone but I think it's more understandable to wait for 3.0

@icy-comet
Copy link

@ryanoasis why not update the main readme and include a 2.2.0-RC font patcher link right now? Font Patcher usage is really confusing right now since the Docker image doesn't work as well.

The readme can be updated once again when 2.2.0 is dubbed stable.

@Finii
Copy link
Collaborator

Finii commented Feb 23, 2023

@Finii Finii added this to the v3.0.0 milestone Feb 23, 2023
@Finii
Copy link
Collaborator

Finii commented Apr 30, 2023

Release is in repo, release as packages pending.

@Finii Finii closed this as completed Apr 30, 2023
@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants