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
55.16k stars 3.65k forks source link

[Fura Mono] Font does not appear in Command Prompt/Powershell font options #1110

Closed Tyler799 closed 1 year ago

Tyler799 commented 1 year ago

🗹 Requirements

🎯 Subject of the issue

Experienced behavior: The Windows-compatible Fura Mono font does not appear in the font options available to any of the Windows terminal tools. (Command Prompt, Powershell, WSL)

It does however appear in other applications, like WordPad.

Expected behavior: The font would appear as an option in the "Fonts" tab.

🔧 Your Setup

Finii commented 1 year ago

The reason is that cmd does only work with TrueType fonts, but that is an OpenType/CFF font.

If we would create it with --ext ttf it works (see image below).

The difference is in the way the outlines are encoded.

image

In principle my answer would be: CMD needs ttf and you choose otf

But that raises the question why we encode them as otf (well, apart from the fact that we just keep the encoding)? And in principle we could also produce a otf with ttf outlines. I guess this needs some investigation.

For the time being, I can only point you to 'self patching'. Or if you need just that one font I can put it somewhere for you to download. Or use Windows Terminal instead of the raw CMD tool thing.

Tyler799 commented 1 year ago

Thank you for the explanation.

I only need one: Fura Mono Regular Nerd Font Complete Mono Windows Compatible.otf

I'm not just using CMD, I'm also using things like WSL, which uses the same terminal framework.

Unfortunately, I'm running into an issue. Not all Nerd Fonts have a .ttf version. Of those that do, they all seem to support the symbols neccesary for LSDeluxe. However, none of them I've tested so far have the symbols needed to make the Starship Prompt work properly.

Finii commented 1 year ago

No problem, let me provide you the fonts in a fork...

Here you go: https://github.com/Finii/nerd-fonts/tree/fira-mono-ttf/patched-fonts/FiraMono

symbols needed to make the Starship Prompt work properly

What is Starship Prompt :-D On https://starship.rs/ they say 'a Nerd Fonts font' is enough. Which symbols are missing and where do they come from?

Tyler799 commented 1 year ago

No problem, let me provide you the fonts in a fork...

Here you go: https://github.com/Finii/nerd-fonts/tree/fira-mono-ttf/patched-fonts/FiraMono

symbols needed to make the Starship Prompt work properly

What is Starship Prompt :-D On https://starship.rs/ they say 'a Nerd Fonts font' is enough. Which symbols are missing and where do they come from?

This does not appear to work. I think I see why it never had a TTF version. OTF must allow more symbols than TTF supports. It works fine for some common symbols, but for the special ones Fura/Fira uses, they do not work.

For example, the "branch" symbol does not appear. As well as the arrow for the prompt.

It looks like there is no solution to getting starship to work in a WSL prompt. Unfortunate.

Finii commented 1 year ago

No, otf and ttf support the same number of glyphs. In fact the differences between otf and ttf are minuscle. Where our otf is in fact a postscript font that just uses otf as container, but that all should not matter.

And I can see the branch symbol in the ttf

image

Which codepoints are missing? Maybe enter the glyps in a comment here as text (copy and paste), I can then use for example [1] to extract the codepoint.

[1] https://onlineunicodetools.com/convert-unicode-to-code-points

Tyler799 commented 1 year ago

Actually now the branch symbol is appearing. I hadn't checked since the prompt looked broken.

But some are still missing. Here is one, the prompt symbol: ❯

Another is here: 🔒

Finii commented 1 year ago

Both symbols are not in the Nerd Fonts set.

The > like thing is one of the 276F set, that Nerd Fonts does not patch in (although I remember we have an issue to add them, somewhere, maybe [1]).

image Lots and lots of parentheses like things

And the lock is somewhere else altogether, it comes from the NotoColorEmoji I guess.


[1] Ah, here

Tyler799 commented 1 year ago

So, the issue is now that the Starship prompt claims it only needs a Nerd Font, but in fact uses symbols that only a small number of patched Nerd Fonts actually have?

Finii commented 1 year ago

Well, I do not know how Starship works.

With the powerline prompts that I use, there is some kind of infrastructure, and then one gets the real look-and-feel from 'someone' there are usual suspects. But they just make their presets available, If they use a different font the glyph they use is missing. But that would not be a fault of the core project. And anyhow, every user can replace everything in the prompts to their liking.

So, I do not know how much you can 'blame' Starship for the fact you have a not widely present glyph in your prompt.

Tyler799 commented 1 year ago

So, I do not know how much you can 'blame' Starship for the fact you have a not widely present glyph in your prompt.

Those are default symbols. I modified the prompt slightly to do things like disable path truncation, but all the symbols are the defaults.

So yeah, I blame Starship. They could have easily said in their instructions "We only support fonts X, Y, Z" and things would have been easier.

I'll take a look at powerline, if it's possible to use in the places I want it.

Thanks.

Finii commented 1 year ago

Note to self: Maybe model after my old code here

https://github.com/adam7/delugia-code/pull/30/commits/646548b16202ec6ca34fc2a8f422369fcd23ee9f

We added for some time 2262 2263 26A1 276F

Finii commented 1 year ago

Here is a list of the glyphs that starship expects of a Nerd Font

https://starship.rs/presets/nerd-font.html https://starship.rs/presets/toml/nerd-font-symbols.toml

name glyph codepoint status
[aws] E33D
[buf] F49D
[c] E61E
[conda] F10C
[dart] E798
[directory] F83D :red_circle:
[docker_context] F308
[elixir] E275
[elm] E62C :red_circle:
[git_branch] F418
[golang] E627 :red_circle:
[guix_shell] F325
[haskell] E777
[haxe] 2318
[hg_branch] F418
[java] E256
[julia] E624
[lua] E620
[memory_usage] F85A :red_circle:
[meson] FA36 :red_circle:
[nim] F6A4 :red_circle:
[nix_shell] F313
[nodejs] E718
Alpine F300
Amazon F270
Android F17B
Arch F303
CentOS F304
Debian F306
DragonFly E28E
Emscripten F205
EndeavourOS F197
Fedora F30A
FreeBSD F30C
Garuda FBD1 :red_circle:
Gentoo F30D
HardenedBSD FC8A :red_circle:
Illumos F737 :red_circle:
Linux F31A
Macos F302
Manjaro F312
Mariner F1CD
MidnightBSD F186
Mint F30E
NetBSD F024
NixOS F313
OpenBSD F739 :red_circle:
openSUSE F314
OracleLinux F836 :red_circle:
Pop E2A3
Raspbian F315
Redhat F316
RedHatEnterprise F316
Redox F517 :red_circle:
Solus FD31 :red_circle:
SUSE F314
Ubuntu F31B
Unknown F22D
Windows F871 :red_circle:
[package] F8D6 :red_circle:
[python] E235
[rlang] FCD2 :red_circle:
[ruby] E791
[rust] E7A8
[scala] E737
[spack] 🅢 1F162 not part of NF

:red_circle: = Glyph will vanish with Nerd Fonts v3.0.0

The 276F is not mentioned here.

Finii commented 1 year ago

All 6 heavy brackets are now part of every Nerd Fonts font:

image

via 59c5cb5

276C 276D 276E 276F 2770 2771

Related:

Tyler799 commented 1 year ago

Thank you for your contributions to both Nerd Fonts as well as the additional info you provided to those maintaining Starship. I'll keep my eyes peeled, I may be able to use starship again sometime soon. :)

github-actions[bot] commented 1 year ago

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.