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

Cannot patch nerd font Meslo LGS with codicons #1005

Closed
3 tasks done
hgoumner opened this issue Nov 26, 2022 · 4 comments · Fixed by #1006
Closed
3 tasks done

Cannot patch nerd font Meslo LGS with codicons #1005

hgoumner opened this issue Nov 26, 2022 · 4 comments · Fixed by #1006

Comments

@hgoumner
Copy link

🗹 Requirements

  • I have searched the issues for my issue and found nothing related and/or helpful
  • I have searched the FAQ for help
  • I have searched the Wiki for help

🎯 Subject of the issue

Experienced behavior:

I cannot patch the nerd font Meslo LGS Regular with the codicons package due to the following error:

File "/home/hristo/Documents/nerd-fonts/font-patcher.py", line 1427, in <module> main() File "/home/hristo/Documents/nerd-fonts/font-patcher.py", line 1407, in main patcher.patch(sourceFonts[-1]) File "/home/hristo/Documents/nerd-fonts/font-patcher.py", line 302, in patch self.copy_glyphs(SrcStart, symfont, patch['SymStart'], patch['SymEnd'], patch['Exact'], patch['ScaleGlyph'], patch['Name'], patch['Attributes']) File "/home/hristo/Documents/nerd-fonts/font-patcher.py", line 956, in copy_glyphs currentSourceFontGlyph = min(possible_codes) ^^^^^^^^^^^^^^^^^^^ ValueError: min() arg is an empty sequence

This is the command i use: fontforge -script font-patcher.py MesloLGS\ NF\ Regular.ttf --custom codicon.ttf

And this is the structure of the directory as explained here

image

Expected behavior:

I expect to have a patched font being written in the directory.

Example symbols:

🔧 Your Setup

  • Which font are you using (e.g. Anonymice Powerline Nerd Font Complete.ttf)?
    • Meslo LGS NF Regular.ttf
    • Where did you get the file from (download link, self patched, source downloaded from [link...)
  • Which terminal emulator are you using (e.g. iterm2, urxvt, gnome, konsole)?
    • Tilix 1.9.5
  • Are you using OS X, Linux or Windows? And which specific version or distribution?
    • Linux Fedora 37

★ Screenshots (Optional)

I'm trying to set up the nvim-dap ui package which requires the codicons. This is what is currently being displaced with the wrong icons:

image

@Finii
Copy link
Collaborator

Finii commented Nov 26, 2022

Sorry to hear of the problem, and thanks for the report. This looks like a real bug.

Just one question: You take an already patched font (Meslo LG M Regular Nerd Font Complete.ttf) and patch it again?

Anyhow I will try to reproduce.

@Finii
Copy link
Collaborator

Finii commented Nov 26, 2022

Ah now I get it. The linked manual is 'old', codicons is now part of the normal (complete) Nerd Font patch set, so there is no need to do what you try to do.

Anyhow I will try to reproduce.

@Finii
Copy link
Collaborator

Finii commented Nov 26, 2022

The script is confused by the .notdef glyph

image

Creating PR to fix.

Thanks again for reporting the bug.

And ... you do not need to self-patch, codicons are part of the Nerd Font set since v2.2.0.
Although it's not the most current rev, but codicons 1.5, so maybe you want to do it anyhow. You will see the warnings, that patching has been skipped for most of the icons.

Finii added a commit that referenced this issue Nov 26, 2022
[why]
When a custom set is to be patched and that set contains the .notdef
glyph the script crashes.

[how]
The glyphs has an unicode codepoint of -1, a code that we explicitely
not patch. That leads to confusion when we try to determine the
codepoint to be used for that glyph, because it has none.

Exclude negative codepoint glyphs when we determine the selection of
to-be-patched glyphs.

As last resort for broken custom sets skip over glyphs that come out of
order (which should be impossible).

Fixes: #1005

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Finii added a commit that referenced this issue Nov 26, 2022
[why]
When a custom set is to be patched and that set contains the .notdef
glyph the script crashes.

[how]
The glyphs has an unicode codepoint of -1, a code that we explicitely
not patch. That leads to confusion when we try to determine the
codepoint to be used for that glyph, because it has none.

Exclude negative codepoint glyphs when we determine the selection of
to-be-patched glyphs.

As last resort for broken custom sets skip over glyphs that come out of
order (which should be impossible).

Fixes: #1005

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Finii added a commit that referenced this issue Nov 26, 2022
[why]
When a custom set is to be patched and that set contains the .notdef
glyph the script crashes.

[how]
The glyphs has an unicode codepoint of -1, a code that we explicitely
not patch. That leads to confusion when we try to determine the
codepoint to be used for that glyph, because it has none.

Exclude negative codepoint glyphs when we determine the selection of
to-be-patched glyphs.

As last resort for broken custom sets skip over glyphs that come out of
order (which should be impossible).

Fixes: #1005

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@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 May 29, 2023
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this issue Nov 24, 2023
[why]
When a custom set is to be patched and that set contains the .notdef
glyph the script crashes.

[how]
The glyphs has an unicode codepoint of -1, a code that we explicitely
not patch. That leads to confusion when we try to determine the
codepoint to be used for that glyph, because it has none.

Exclude negative codepoint glyphs when we determine the selection of
to-be-patched glyphs.

As last resort for broken custom sets skip over glyphs that come out of
order (which should be impossible).

Fixes: ryanoasis#1005

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants