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

Include a python3 version of the font-patcher script #49

Closed
SageEx opened this issue Nov 26, 2015 · 5 comments
Closed

Include a python3 version of the font-patcher script #49

SageEx opened this issue Nov 26, 2015 · 5 comments

Comments

@SageEx
Copy link

SageEx commented Nov 26, 2015

Hi,
First of all thanks a lot for this project.
Recently, I tried to patch the font Fantasque Sans Mono.
The problem is that on ArchLinux the fontforge library has bindings for python3 by default( python3 is the default python). So, running with ./font-patcher ... didn't work.
I had to use the fontforge program directly - fontforge -script font-patcher --fontawesome --careful FantasqueSansMonoRegular.ttf.
But the script is in python2. Using 2to3 on the file gave an attribute error. I found the problem and everything worked.

I suggest including a python3 version of the script in the repo. I am attaching it - it will save a lot of hassle for many people.

Besides, how about including Fantasque Sans Mono in the default patched fonts set ?

font-patcher.txt

@ryanoasis
Copy link
Owner

@SageEx Thanks for the info and I am glad this project is useful to you 😄

python 3

I will have to look into that, I see the changes you had to make. There has to be a way to make it compatible for py3 and py2 without having 2 separate scripts to maintain?

how about including Fantasque Sans Mono in the default patched fonts set ?

Looks like the license will allow this (OFL (SIL Open Font License)), the only I was checking for is if there is a Reserved Font Name specified in the license but I don't see one. If the name is reserved we would just have to rename the patched version (e.g. Hack becomes Knack).

@SageEx
Copy link
Author

SageEx commented Nov 29, 2015

Most of the changes are due to the convention changes from python2 to python3 - like

  • brackets in print statements
  • dic.iteritems() to dic.items
    etc.

I doubt that a single python script would suffice.

Rather, as a solution, you can maintain the python2 script only and use 2to3 to automatically generate the python3 script. The only manual change you will have to make in the generated script is to revert the change at line 306. By default 2to3 will change from Unicode to str - but str is not an attribute - hence the error. Any way to use 2to3 which does not change this will be the answer to this problem.

I really hope to see the Fantasque Sans Mono font in the repo.

Thanks again for this repo - along with vim-webdevicons.

@ryanoasis
Copy link
Owner

Thanks btw. I will probably get to this but not anytime soon.

Fantasque Sans Mono

Probably not too difficult to add just a handful of bugs that I've been focusing on.

Cheers!

@ryanoasis ryanoasis modified the milestone: v0.6.1 Jan 7, 2016
@ryanoasis ryanoasis modified the milestones: v0.6.1, v0.7.0 Feb 4, 2016
ryanoasis added a commit that referenced this issue Mar 19, 2016
ryanoasis added a commit that referenced this issue Mar 19, 2016
@ryanoasis
Copy link
Owner

I don't have fontforge setup with py3 bindings nor have it compiled with py3 so I cannot test however this script: font-patcher-py3 should work for python3, if someone could test it out? That'd be great!

fontforge -script font-patcher-py3 unpatched-sample-fonts/Monoid/Monoid-Italic.ttf --powerline --powerlineextra
or
python3 font-patcher-py3 unpatched-sample-fonts/Monoid/Monoid-Italic.ttf --powerline --powerlineextra

This is only on the 0.7.0 branch for now.

I will test it when I get a chance.

FluxAugur pushed a commit to FluxAugur/nerd-fonts that referenced this issue May 25, 2016
Fix the branch icon in the VCS segment.

Resolves bug ryanoasis#49.
@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 Mar 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants