ryanoasis / nerd-fonts

Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts: Hack, Source Code Pro, more. Glyph collections: Font Awesome, Material Design Icons, Octicons, & more
https://NerdFonts.com
Other
52.6k stars 3.59k forks source link

Font patcher leaves non monspaced font. #1642

Closed rayzorben closed 1 month ago

rayzorben commented 1 month ago

πŸ—Ή Requirements

🎯 Subject of the issue

Experienced behavior: When I patch a monospace font with font-patcher the corresponding font does not seem to be monospaced. I have verified my base font is monospaced and shows up as selectable in programs that only allow monospaced fonts. I install my patched font (in Windows for all users) and it shows up in programs such as notepad.exe but not cmd.exe

Expected behavior: Should remain monospace and selectable by cmd.exe and others that only allow monospace fonts.

β˜… Screenshots (Optional)

Here is the patched font not appearing in cmd.exe - but my non patched font installed at the same time and in the same way appears.

image

Finii commented 1 month ago

Sorry to hear of your problem.

Usually that should not happen. Can you post the output of a patch run with --debug 2 added to the command line? Best would be to additionally have the to-be-patched font available somewhere, so that I can reproduce. But maybe we see something in the output. Please also include your command line.

Finii commented 1 month ago

Is the font Lucida Sans or Lucida Console or something special? The more details the better (best of course would be the actual font file).

https://lucidafonts.com

rayzorben commented 1 month ago

The font is 'Lucida Programmer', a modification I made to Lucida Console over 15 years ago to add in a more unique zero and pipe character and I think maybe 1 other small tweak. Here is a link

https://www.dropbox.com/scl/fi/r0xqtas73jjq4s4vsf8og/LucProg.ttf?rlkey=etidpbdei1eiwvejl71ngk8re&dl=1

Finii commented 1 month ago

Thanks for the link. Can you give me your font-patcher options? Anyhow, I will try it out with 'regular' and --mono; cmd will need the mono option as it can not accept glyphs that are wider than one cell. Windows Terminal can for example.

Finii commented 1 month ago

Debug wise this looks good.

Nerd Fonts Patcher v3.2.1-41 (4.14.3) (ff 20230101)
DEBUG: Naming mode 1
DEBUG: Monospace check: Panose says "monospaced"; glyph-width-mono True
DEBUG: Final font cell dimensions 1234 w x 2048 h
DEBUG: 48/160 box drawing glyphs will be replaced
Adding 188 Glyphs from Seti-UI + Custom Set
β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•Ÿ 100%
Adding 6 Glyphs from Heavy Angle Brackets Set
β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•Ÿ 100%
Adding 160 Glyphs from Box Drawing Set
β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•Ÿ 100%
Adding 198 Glyphs from Devicons Set
β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•Ÿ 100%
Done with Patch Sets, generating font...
DEBUG: Weight approximations: OS2/PS/Name: 400/400/400 (from 400/'Book'/'')
DEBUG: =====> Family (ID 1)      ok       (26 <=31): LucidaProgrammer Nerd Font
DEBUG: =====> SubFamily (ID 2)   ok       ( 7 <=31): Regular
DEBUG: =====> Fullname (ID 4)    ok       (26 <=63): LucidaProgrammer Nerd Font
DEBUG: =====> PSN (ID 6)         ok       (18 <=63): LucidaProgrammerNF
DEBUG: Preserving bitmaps (5, 6, 7, 8)
DEBUG: Tweaking 1/1
DEBUG: Changing lowestRecPPEM from 8 to 12
   LucidaProgrammer Nerd Font
   \===> 'LucidaProgrammerNerdFont-Regular.ttf'

Now I need to find a Windows box, which will take some time (maybe in the evening today).

rayzorben commented 1 month ago

I just followed the 'Patch your own font' and did this command ./FontForge.AppImage -script $PWD/font-patcher $PWD/LucProg.ttf -out /tmp

Finii commented 1 month ago

Ah, for cmd you need to add --mono, maybe you want to try that.

rayzorben commented 1 month ago

OK, here is what I got from just the command I ran

~/Downloads ξ‚° ./FontForge.AppImage -script $PWD/font-patcher $PWD/LucProg.ttf -out /tmp
Copyright (c) 2000-2023. 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: 20230101
 Based on sources from 2023-01-01 05:26 UTC-ML-TtfDb-D-GDK3.
 Based on source from git with hash: a1dad3e81da03d5d5f3c4c1c1b9b5ca5ebcfcecf
Nerd Fonts Patcher v3.2.1 (4.13.1) (ff 20230101)
The following table(s) in the font have been ignored by FontForge
  Ignoring 'DSIG' digital signature table
Warning: Mac and Windows entries in the 'name' table differ for the
  Family string in the language English (US)
  Mac String: Lucida Console
  Windows String: Lucida Programmer
Warning: Mac and Windows entries in the 'name' table differ for the
  UniqueID string in the language English (US)
  Mac String: Lucida Console Regular; B&H alpha25
  Windows String: Lucida Programmer Regular; B&H alpha25
Warning: Mac and Windows entries in the 'name' table differ for the
  Fullname string in the language English (US)
  Mac String: Lucida Console
  Windows String: Lucida Programmer
Warning: Mac and Windows entries in the 'name' table differ for the
  Version string in the language English (US)
  Mac String: Version 1.60
  Windows String: Version 1.0
Warning: Mac and Windows entries in the 'name' table differ for the
  PostScript string in the language English (US)
  Mac String: LucidaConsole
  Windows String: LucidaProgrammer
Glyph 2 is called ".notdef", a singularly inept choice of name (only glyph 0
  may be called .notdef)
  FontForge will rename it.
The glyph named macron is mapped to U+02C9.
  But its name indicates it should be mapped to U+00AF.
The glyph named Delta is mapped to U+0394.
  But its name indicates it should be mapped to U+2206.
The glyph named Omega is mapped to U+03A9.
  But its name indicates it should be mapped to U+2126.
The glyph named mu is mapped to U+03BC.
  But its name indicates it should be mapped to U+00B5.
The glyph named fraction1 is mapped to U+2044.
  But its name indicates it should be mapped to U+2215.
Adding 188 Glyphs from Seti-UI + Custom Set
β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•Ÿ 100%
Adding 6 Glyphs from Heavy Angle Brackets Set
β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•Ÿ 100%
Adding 160 Glyphs from Box Drawing Set
β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•Ÿ 100%
Adding 198 Glyphs from Devicons Set
β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•Ÿ 100%
Done with Patch Sets, generating font...
   LucidaProgrammer Nerd Font
   \===> '/tmp/LucidaProgrammerNerdFont-Regular.ttf'
rayzorben commented 1 month ago

How do I add --mono? I tried just adding it into command line and I got the same output.

Finii commented 1 month ago

For the difference, I mean what --mono does, have a look here

With mono the patcher output should mention the patched font name with Nerd Font Mono.

Finii commented 1 month ago

The options are not ordered, you can add them anywhere after font-patcher. I did this fontforge font-patcher --debug 2 ~/Downloads/LucProg.ttf --mono

Finii commented 1 month ago

image

cmd and the other conhost things need a strict monospaced font.

rayzorben commented 1 month ago

Does the command differ since I am using the AppImage? I am getting this

 ~/Downloads ξ‚° ./FontForge.AppImage -script $PWD/font-patcher --debug 2 ~/Downloads/LucProg.ttf --mono
Copyright (c) 2000-2023. 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: 20230101
 Based on sources from 2023-01-01 05:26 UTC-ML-TtfDb-D-GDK3.
 Based on source from git with hash: a1dad3e81da03d5d5f3c4c1c1b9b5ca5ebcfcecf
Nerd Fonts Patcher v3.2.1 (4.13.1) (ff 20230101)
DEBUG: Naming mode 1
The following table(s) in the font have been ignored by FontForge
  Ignoring 'DSIG' digital signature table
Warning: Mac and Windows entries in the 'name' table differ for the
  Family string in the language English (US)
  Mac String: Lucida Console
  Windows String: Lucida Programmer
Warning: Mac and Windows entries in the 'name' table differ for the
  UniqueID string in the language English (US)
  Mac String: Lucida Console Regular; B&H alpha25
  Windows String: Lucida Programmer Regular; B&H alpha25
Warning: Mac and Windows entries in the 'name' table differ for the
  Fullname string in the language English (US)
  Mac String: Lucida Console
  Windows String: Lucida Programmer
Warning: Mac and Windows entries in the 'name' table differ for the
  Version string in the language English (US)
  Mac String: Version 1.60
  Windows String: Version 1.0
Warning: Mac and Windows entries in the 'name' table differ for the
  PostScript string in the language English (US)
  Mac String: LucidaConsole
  Windows String: LucidaProgrammer
Glyph 2 is called ".notdef", a singularly inept choice of name (only glyph 0
  may be called .notdef)
  FontForge will rename it.
The glyph named macron is mapped to U+02C9.
  But its name indicates it should be mapped to U+00AF.
The glyph named Delta is mapped to U+0394.
  But its name indicates it should be mapped to U+2206.
The glyph named Omega is mapped to U+03A9.
  But its name indicates it should be mapped to U+2126.
The glyph named mu is mapped to U+03BC.
  But its name indicates it should be mapped to U+00B5.
The glyph named fraction1 is mapped to U+2044.
  But its name indicates it should be mapped to U+2215.
DEBUG: Monospace check: Panose says "monospaced"; glyph-width-mono True
DEBUG: Final font cell dimensions 1234 w x 2048 h (with icon cell 1538 h)
DEBUG: 48/160 box drawing glyphs will be replaced
Adding 188 Glyphs from Seti-UI + Custom Set
β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•Ÿ 100%
Adding 6 Glyphs from Heavy Angle Brackets Set
β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•Ÿ 100%
Adding 160 Glyphs from Box Drawing Set
β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•Ÿ 100%
Adding 198 Glyphs from Devicons Set
β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•Ÿ 100%
Done with Patch Sets, generating font...
DEBUG: Weight approximations: OS2/PS/Name: 400/400/400 (from 400/'Book'/'')
DEBUG: =====> Family (ID 1)      ok       (31 <=31): LucidaProgrammer Nerd Font Mono
DEBUG: =====> SubFamily (ID 2)   ok       ( 7 <=31): Regular
DEBUG: =====> Fullname (ID 4)    ok       (31 <=63): LucidaProgrammer Nerd Font Mono
DEBUG: =====> PSN (ID 6)         ok       (19 <=63): LucidaProgrammerNFM
DEBUG: Preserving bitmaps (5, 6, 7, 8)
Save Failed
Traceback (most recent call last):
  File "/home/rayben/Downloads/font-patcher", line 2114, in <module>
    main()
  File "/home/rayben/Downloads/font-patcher", line 2106, in main
    patcher.generate(sourceFonts)
  File "/home/rayben/Downloads/font-patcher", line 447, in generate
    sourceFont.generate(outfile, bitmap_type=bitmaps, flags=gen_flags)
OSError: Font generation failed
Finii commented 1 month ago

You forgot to add/keep your -out parameter :grimacing:

Edit:

The Appimage can not write to the current working directory, which is in the FUSE filesystem usually and not in the place where you start the Appimage executable. That is the reason why a -out is needed for Appimage runs.

Finii commented 1 month ago

Btw, there are some (unrelated) issues with the LucideProgrammer font that fontforge complains about. Some things overlooked when you modified the font.

Warning: Mac and Windows entries in the 'name' table differ for the
  Version string in the language English (US)
  Mac String: Version 1.60
  Windows String: Version 1.0
Warning: Mac and Windows entries in the 'name' table differ for the
  PostScript string in the language English (US)
  Mac String: LucidaConsole
  Windows String: LucidaProgrammer
Glyph 2 is called ".notdef", a singularly inept choice of name (only glyph 0
  may be called .notdef)
  FontForge will rename it.
Finii commented 1 month ago

For the final patched font you might want to also add --complete to get all icons. At the moment only the smallest select-able subset is patched in. But I do not know what you intend.

Symbol Fonts:
  -c, --complete        Add all available Glyphs
  --codicons            Add Codicons Glyphs (https://github.com/microsoft/vscode-codicons)
  --fontawesome         Add Font Awesome Glyphs (http://fontawesome.io/)
  --fontawesomeext      Add Font Awesome Extension Glyphs (https://andrelzgava.github.io/font-awesome-extension/)
  --fontlogos           Add Font Logos Glyphs (https://github.com/Lukas-W/font-logos)
  --material, --mdi     Add Material Design Icons (https://github.com/templarian/MaterialDesign)
  --octicons            Add Octicons Glyphs (https://octicons.github.com)
  --powersymbols        Add IEC Power Symbols (https://unicodepowersymbol.com/)
  --pomicons            Add Pomicon Glyphs (https://github.com/gabrielelana/pomicons)
  --powerline           Add Powerline Glyphs
  --powerlineextra      Add Powerline Extra Glyphs (https://github.com/ryanoasis/powerline-extra-symbols)
  --weather             Add Weather Icons (https://github.com/erikflowers/weather-icons)
rayzorben commented 1 month ago

Thanks, that gets me a monospaced font, but it seems that a glyph is missing? I did --complete. Notice the last line on the prompt on my font

image

Here is 'Hack Nerd'

image

Finii commented 1 month ago

The small arrow? That is most likely 2191 or one of these. The arrow set is not in the Nerd Fonts Patchset. If the original font does not have it it will not be added.

Screenshot 2024-05-30 at 05 47 19
Finii commented 1 month ago

I guess the original problem is solved, so closing. Please reopen if you still have issues.