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

CascadiaCode-2407.24 #5996

Closed
1 task done
720720 opened this issue Dec 11, 2024 · 44 comments
Closed
1 task done

CascadiaCode-2407.24 #5996

720720 opened this issue Dec 11, 2024 · 44 comments
Assignees
Labels
🤩 enhancement Improvement of a feature

Comments

@720720
Copy link

720720 commented Dec 11, 2024

Code of Conduct

  • I agree to follow this project's Code of Conduct

What would you like to see changed?

oh-my-posh font install CascadiaCode-2407.24 as regular user installs all Cascadia Code otf static fonts to the users font directory.

There are several problems with this approach:

Windows 11 Pro comes with Windows Terminal 1.21.3231.0 preinstalled that bundles:

CascadiaCode.ttf
CascadiaCodeItalic.ttf
CascadiaMono.ttf
CascadiaMonoItalic.ttf

so you end up with a duplicate installation of these fonts.

For Windows or any OS that employs TrueType hinting the ttf variable variant of Cascadia Code would be a better choice.

Reading the Oh My Posh Fonts documentation a user expects to install Cascadia Code Nerd Font and not:

Cascadia Code
Cascadia Code NF
Cascadia Code PL
Cascadia Mono
Cascadia Mono NF
Cascadia Mono PL

CascadiaCode-2407.24 should just install the ttf variable variant of Cascadia Code NF:

CascadiaCodeNF.ttf
CascadiaCodeNFItalic.ttf
CascadiaMonoNF.ttf
CascadiaMonoNFItalic.ttf

@720720 720720 added the 🤩 enhancement Improvement of a feature label Dec 11, 2024
@JanDeDobbeleer
Copy link
Owner

CascadiaCode-2407.24 should just install the ttf variable variant of Cascadia Code NF:

@720720 that's incorrect. There are two entries, the NF version and the official one being this one. By request of our user base. I'm adding a switch that allows to specify ttf or otf, as now we default to otf.

@720720
Copy link
Author

720720 commented Dec 13, 2024

https://github.com/microsoft/cascadia-code#font-formats

There are two Cascadia Code ttf variants: ttf variable and ttf static.
A switch for the ttf variable would be great.

font

The font installer is very convenient but it allows you to install fonts twice.
You might consider a check if a font is already installed.

@JanDeDobbeleer
Copy link
Owner

@720720 the problem with that switch is that Fonts aren't versioned. So you can update the font rather easily, in this case, oh-my-posh will always replace it.

@720720
Copy link
Author

720720 commented Dec 14, 2024

https://www.jordanmalcolm.com/deploying-windows-10-fonts-at-scale/

Windows 10 Version 1809 and higher allows you to install a font at least 4 times if you just copy the font and set a registry entry.

ttf, otf, %windir%\Fonts, %LOCALAPPDATA%\Microsoft\Windows\Fonts

This might lead to improper font rendering.

@JanDeDobbeleer
Copy link
Owner

@720720 that blog post doesn't state that, where did you get this information from? Nobody has ever reported that, nor have I ever seen this become unstable and I install the font over and over again when testing.

@720720
Copy link
Author

720720 commented Dec 14, 2024

https://github.com/microsoft/cascadia-code#installation

Note: If you have previously installed a version of Cascadia Code, please uninstall the previous version prior to installing a new version. Not doing so can result in improper rendering.

oh-my-posh font install hack as user

%LOCALAPPDATA%\Microsoft\Windows\Fonts
HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

hack1

oh-my-posh font install hack as administrator

%windir%\Fonts
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

hack2

Image 2 shows 8 font faces, the font is now installed 2 times, i could repeat that with otf and have 4 installations of the same font.

hack3

The Windows font installer gives you a warning if a font is already installed.
The Oh-My-Posh font installer currently does not check if a font is installed.
I'm not sure about the effects of a duplicate font installation, but it might lead to undesirable results.

@JanDeDobbeleer
Copy link
Owner

@720720 that comment is one that says "can", never trust comments like that IMHO. I'll check where it gets that information from because on file level, I don't see these being added additionally.

@720720
Copy link
Author

720720 commented Dec 15, 2024

@JanDeDobbeleer
Copy link
Owner

@720720 aware of that, a GitHub action step we use has a broken update

@JanDeDobbeleer
Copy link
Owner

@720720 fixed

@JanDeDobbeleer
Copy link
Owner

@720720 the last issue of duplicate entries is now also fixed.

@720720
Copy link
Author

720720 commented Dec 16, 2024

@JanDeDobbeleer thanks for your work, but i think there are some issues left.

@720720
Copy link
Author

720720 commented Dec 16, 2024

176e3a0

oh-my-posh font install hack as administrator
oh-my-posh font install hack as user

Administrator and User can still install fonts to %windir%\Fonts and %LOCALAPPDATA%\Microsoft\Windows\Fonts at the same time.

@720720
Copy link
Author

720720 commented Dec 16, 2024

c2734a9

Nerd Fonts 3.3.0: 68 fonts total, 55 fonts ttf, 13 fonts otf

Nerd Fonts 3.3.0
0xProto ttf
3270 ttf
Agave ttf
AnonymousPro ttf
Arimo ttf
AurulentSansMono otf
BigBlueTerminal ttf
BitstreamVeraSansMono ttf
CascadiaCode ttf
CascadiaMono ttf
CodeNewRoman otf
ComicShannsMono otf
CommitMono otf
Cousine ttf
D2Coding ttf
DaddyTimeMono ttf
DejaVuSansMono ttf
DepartureMono otf
DroidSansMono otf
EnvyCodeR ttf
FantasqueSansMono ttf
FiraCode ttf
FiraMono otf
GeistMono otf
Go-Mono ttf
Gohu ttf
Hack ttf
Hasklig otf
HeavyData ttf
Hermit otf
iA-Writer ttf
IBMPlexMono ttf
Inconsolata ttf
InconsolataGo ttf
InconsolataLGC ttf
IntelOneMono ttf
Iosevka ttf
IosevkaTerm ttf
IosevkaTermSlab ttf
JetBrainsMono ttf
Lekton ttf
LiberationMono ttf
Lilex ttf
MartianMono ttf
Meslo ttf
Monaspace otf
Monofur ttf
Monoid ttf
Mononoki ttf
MPlus ttf
NerdFontsSymbolsOnly ttf
Noto ttf
OpenDyslexic otf
Overpass otf
ProFont ttf
ProggyClean ttf
Recursive ttf
RobotoMono ttf
ShareTechMono ttf
SourceCodePro ttf
SpaceMono ttf
Terminus ttf
Tinos ttf
Ubuntu ttf
UbuntuMono ttf
UbuntuSans ttf
VictorMono ttf
ZedMono ttf

https://ohmyposh.dev/docs/installation/fonts

By default, Oh My Posh installs the .otf version of the font. If you prefer the .ttf version, you can specify it with the --ttf flag

There is no nerd font that comes in ttf and otf format at the moment.
The --ttf flag currently has no effect on the nerd font installation.

@720720
Copy link
Author

720720 commented Dec 16, 2024

oh-my-posh font install cascadiacode-2407.24

Failed to download zip file: 404 Not Found
https://github.com/ryanoasis/nerd-fonts/releases/latest/download/cascadiacode-2407.24.zip

@720720
Copy link
Author

720720 commented Dec 16, 2024

user
oh-my-posh font install --ttf
select CascadiaCode-2407.24

%LOCALAPPDATA%\Microsoft\Windows\Fonts

ttf variable 6 / 12
CascadiaCode.ttf +
CascadiaCodeItalic.ttf +
CascadiaCodeNF.ttf -
CascadiaCodeNFItalic.ttf +
CascadiaCodePL.ttf +
CascadiaCodePLItalic.ttf -
CascadiaMono.ttf -
CascadiaMonoItalic.ttf -
CascadiaMonoNF.ttf +
CascadiaMonoNFItalic.ttf -
CascadiaMonoPL.ttf +
CascadiaMonoPLItalic.ttf -
ttf static 66 / 72
CascadiaCode-Italic.ttf -
CascadiaCodeNF-Italic.ttf -
CascadiaCodePL-Regular.ttf -
CascadiaCode-Regular.ttf -
CascadiaMonoNF-Regular.ttf -
CascadiaMonoPL-Regular.ttf -
66 total +

https://github.com/microsoft/cascadia-code#installation

ttf variable: we recommend this version for all users, and particularly those on Windows or any other OS that employs TrueType hinting.
ttf static: in the rare situation where the above variable font version is not supported, or a singular weight is preferred to the entire range, static formats are supplied.

oh-my-posh font install --ttf select CascadiaCode-2407.24 as user installs 6 of 12 ttf variable and 66 of 72 ttf static fonts to %LOCALAPPDATA%\Microsoft\Windows\Fonts

most users probably want variable fonts but in no way an incomplete combination of variable and static fonts

@JanDeDobbeleer
Copy link
Owner

@720720 I can't solve unavailable fonts.

About the first one, yes, that's by design. The replacement logic only works for the same context (user or system). As a user you can't access the admin registry nor font location anyways, so it's uninstall as user/system and install as user/system.

@720720
Copy link
Author

720720 commented Dec 16, 2024

@JanDeDobbeleer I think the Cascadia Code ttf variable and static font installation is a problem.

@JanDeDobbeleer
Copy link
Owner

@720720 Yeah but that's a new requirement. That wasn't something I was aware off.

@720720
Copy link
Author

720720 commented Dec 16, 2024

@JanDeDobbeleer I came across the problem last week when writing a simple powershell script to install Cascadia Code.

@720720
Copy link
Author

720720 commented Dec 16, 2024

@JanDeDobbeleer from a usability point of view it would be nice to choose the Cascadia Code font variant in the font selector.

oh-my-posh font install

    Select font

    CascadiaCode
    CascadiaCode-2407.24 (otf static)
    CascadiaCode-2407.24 (ttf static)
    CascadiaCode-2407.24 (ttf variable)

@JanDeDobbeleer
Copy link
Owner

@720720 that's also an option. But a little more work. I already regret adding this font option which on its own was already a hack.

@720720
Copy link
Author

720720 commented Dec 16, 2024

I also regret trying to write that powershell script.

@720720
Copy link
Author

720720 commented Dec 18, 2024

@JanDeDobbeleer https://ohmyposh.dev/docs/installation/fonts

oh-my-posh font install and select CascadiaCode-2407.24 from the menu

No matching font families were installed. Try setting --zip-folder to the correct folder when using Cascadia Code or a custom font zip file

oh-my-posh font install CascadiaCode-2407.24

No matching font families were installed. Try setting --zip-folder to the correct folder when using Cascadia Code or a custom font zip file

oh-my-posh font install CascadiaCode-2407.24 --zip-folder ttf

ttf
    static
    CascadiaCode.ttf
    CascadiaCodeItalic.ttf
    CascadiaCodeNF.ttf
    CascadiaCodeNFItalic.ttf
    CascadiaCodePL.ttf
    CascadiaCodePLItalic.ttf
    CascadiaMono.ttf
    CascadiaMonoItalic.ttf
    CascadiaMonoNF.ttf
    CascadiaMonoNFItalic.ttf
    CascadiaMonoPL.ttf
    CascadiaMonoPLItalic.ttf

The CascadiaCode-2407.24 ttf folder contains the ttf variable fonts and a static subfolder.
The parameter --zip-folder recursively installs fonts and causes #5996 (comment).
The parameter --zip-folder will only work if it does not add fonts from subfolders.

The first two variants are inconvenient, you might consider #5996 (comment) since CascadiaCode-2407.24 is already a hack.

Try setting --zip-folder to the correct folder when using Cascadia Code or a custom font zip file

Cascadia Code is misleading since only CascadiaCode-2407.24 and not the Cascadia Code Nerd Font is affected.
There is a period missing at the end of the error message.

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Dec 18, 2024

The CascadiaCode-2407.24 ttf folder contains the ttf variable fonts and a static subfolder.

@720720 valid point, I didn't take that into account. The problem is that there' no good folder support when dealing with zip files. I'll fix that bug!

@720720
Copy link
Author

720720 commented Dec 18, 2024

@JanDeDobbeleer thanks for the update

oh-my-posh font install CascadiaCode-2407.24 --zip-folder ttf

Failed to download zip file: 404 Not Found
https://github.com/ryanoasis/nerd-fonts/releases/latest/download/CascadiaCode-2407.24.zip

@720720
Copy link
Author

720720 commented Dec 18, 2024

oh-my-posh font install and select CascadiaCode-2407.24 from the menu

Downloading CascadiaCode-2407.24

No matching font families were installed. Try setting --zip-folder to the correct folder when using CascadiaCode (MS) or a custom font zip file.

Seems to download CascadiaCode-2407.24 before it does the error check.
The download is 143 MB, perhaps you should check the error first.

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Dec 18, 2024

@720720 I changes the font name to CascadiaCode (MS) (see docs).

About the second remark, it's impossible to know the zip's layout without hardcoding that which I don't want to do. I understand the feedback, but this way it stays dynamic.

@720720
Copy link
Author

720720 commented Dec 18, 2024

oh-my-posh font install "CascadiaCode (MS)" --zip-folder ttf
Is now working as intended and installs the ttf variant, thanks.

oh-my-posh font install --zip-folder ttf and select CascadiaCode-2407.24 from the menu
Is working but undocumented and difficult to understand.
A new user will just select the font without the parameter and get an error.

Theres a mismatch between CascadiaCode (MS) in the Docs and CascadiaCode-2407.24 in the font selection menu.

I think for users it would be way easier to just select the font in the menu.

oh-my-posh font install

    Select font

    CascadiaCode
    CascadiaCode-2407.24 (otf static)
    CascadiaCode-2407.24 (ttf static)
    CascadiaCode-2407.24 (ttf variable)

@JanDeDobbeleer CascadiaCode-2407.24 is still hardcoded anyway.

@JanDeDobbeleer
Copy link
Owner

@720720 true but there's a difference in what's hardcoded and how dynamic it can be.

@720720
Copy link
Author

720720 commented Dec 18, 2024

@JanDeDobbeleer the font installer can't work without hardcoding as long as you mix Nerd Fonts and CascadiaCode-2407.24.

This is why I would solve the problem via the font selector.

Command line parameters scare average users that just want to install a font quickly.

And the error message that you get for the CascadiaCode-2407.24 installation via menu is an unexpected behaviour.

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Dec 18, 2024

@720720 A combination of both would work though. I agree on the accessibility part. Something for tomorrow.

Theres a mismatch between CascadiaCode (MS) in the Docs and CascadiaCode-2407.24 in the font selection menu.

That's because of caching.

@JanDeDobbeleer
Copy link
Owner

@720720 I have implemented this in #6039 It also now caches the font zip in TMP, which allows to easily rerun it.

@720720
Copy link
Author

720720 commented Dec 20, 2024

@JanDeDobbeleer thanks, the cache is really smart.

@720720
Copy link
Author

720720 commented Dec 20, 2024

https://en.wikipedia.org/wiki/Web_Open_Font_Format
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_fonts/WOFF

oh-my-posh font install select CascadiaCode (MS) - WOFF2
oh-my-posh font install select CascadiaCode (MS) - WOFF2 Static

No matching font families were installed. Try setting --zip-folder to the correct folder when using CascadiaCode (MS) or a custom font zip file.

The Web Open Font Format (WOFF) is a font format for use in web pages.

@JanDeDobbeleer you cannot install woff fonts in Windows.

@720720
Copy link
Author

720720 commented Dec 20, 2024

oh-my-posh font install select CascadiaCode (MS) - OTF Static
oh-my-posh font install select CascadiaCode (MS) - TTF Static

Windows otf static ttf static
%LOCALAPPDATA%\Microsoft\Windows\Fonts 0 72
HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts 0 72
Oh-My-Posh otf static ttf static
%LOCALAPPDATA%\Microsoft\Windows\Fonts 72 72
HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts 0 72

The Windows installer detects that otf static is installed and replaces it with ttf static.
Windows replaces otf static with ttf static fonts and replaces otf static with ttf static registry entries.

The Oh-My-Posh installer does not check if a font is already installed.
Oh-My-Posh installs all fonts and replaces otf static with ttf static registry entries.

The otf fonts are still in the fonts directory but users cannot uninstall the fonts via windows settings any longer.

@720720
Copy link
Author

720720 commented Dec 20, 2024

oh-my-posh font install select CascadiaCode (MS) - OTF Static
oh-my-posh font install select CascadiaCode (MS) - TTF

font otf ttf
Cascadia Code Regular (TrueType) CascadiaCode-Regular.otf CascadiaCode.ttf
Cascadia Code Italic (TrueType) CascadiaCode-Italic.otf CascadiaCodeItalic.ttf
Cascadia Code NF Regular (TrueType) CascadiaCodeNF-Regular.otf CascadiaCodeNF.ttf
Cascadia Code NF Italic (TrueType) CascadiaCodeNF-Italic.otf CascadiaCodeNFItalic.ttf
Cascadia Code PL Regular (TrueType) CascadiaCodePL-Regular.otf CascadiaCodePL.ttf
Cascadia Code PL Italic (TrueType) CascadiaCodePL-Italic.otf CascadiaCodePLItalic.ttf
Cascadia Mono Regular (TrueType) CascadiaMono-Regular.otf CascadiaMono.ttf
Cascadia Mono Italic (TrueType) CascadiaMono-Italic.otf CascadiaMonoItalic.ttf
Cascadia Mono NF Regular (TrueType) CascadiaMonoNF-Regular.otf CascadiaMonoNF.ttf
Cascadia Mono NF Italic (TrueType) CascadiaMonoNF-Italic.otf CascadiaMonoNFItalic.ttf
Cascadia Mono PL Regular (TrueType) CascadiaMonoPL-Regular.otf CascadiaMonoPL.ttf
Cascadia Mono PL Italic (TrueType) CascadiaMonoPL-Italic.otf CascadiaMonoPLItalic.ttf
Windows otf static ttf variable
%LOCALAPPDATA%\Microsoft\Windows\Fonts 66 12
HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts 66 12
Oh-My-Posh otf static ttf variable
%LOCALAPPDATA%\Microsoft\Windows\Fonts 72 12
HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts 66 12

The Windows installer does not detect that CascadiaCode ttf variable contains several fonts.
Windows replaces otf static with ttf variable fonts and replaces otf static with ttf variable registry entries.

The Oh-My-Posh installer does not check if a font is already installed.
Oh-My-Posh installs all fonts and replaces otf static with ttf variable registry entries.

The result is a broken font installation in both cases.

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Dec 20, 2024

@720720 can you explain those last sentences like I'm 5? Why is that broken? I thought I did remove the fonts which were there previously, but can double check on that. Maybe it's an idea to explicitly list what you expect to happen in each case.

@720720
Copy link
Author

720720 commented Dec 21, 2024

#5996 (comment)

oh-my-posh font install

    Select font

        CascadiaCode (MS) - WOFF2
        CascadiaCode (MS) - WOFF2 Static

WOFF2 fonts are for web use only, you cannot install them on any OS.

@JanDeDobbeleer I think you should remove them from the font selection menu.

@720720
Copy link
Author

720720 commented Dec 21, 2024

@JanDeDobbeleer Im working on a better description for

#5996 (comment)
#5996 (comment)

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Dec 21, 2024

@720720 but is this the only thing to fix then?

The otf fonts are still in the fonts directory but users cannot uninstall the fonts via windows settings any longer.

I'm not going to write a replacement for Windows font installation, that's a bridge too far IMHO. So if more obscure information fetching is needed (these are terrible win32 API's), I'm just removing this font from the menu entirely.

@720720
Copy link
Author

720720 commented Dec 22, 2024

DESCRIPTION

@JanDeDobbeleer #5996 (comment)

oh-my-posh font install

    Select font

        CascadiaCode (MS) - OTF Static
        CascadiaCode (MS) - TTF
        CascadiaCode (MS) - TTF Static

The font installer lists all CascadiaCode font formats.
This is a great feature but it can lead to problems.

TEST

1. Install CascadiaCode otf static

CascadiaCodeNF-Bold.otf
CascadiaCodeNF-ExtraLight.otf
CascadiaCodeNF-Light.otf
CascadiaCodeNF-Regular.otf
CascadiaCodeNF-SemiBold.otf
CascadiaCodeNF-SemiLight.otf

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Fonts]
"Cascadia Code NF Regular (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-Regular.otf"
"Cascadia Code NF Bold (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-Bold.otf"
"Cascadia Code NF ExtraLight (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-ExtraLight.otf"
"Cascadia Code NF Light (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-Light.otf"
"Cascadia Code NF SemiBold (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-SemiBold.otf"
"Cascadia Code NF SemiLight (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-SemiLight.otf"

2. Install CascadiaCode ttf variable

CascadiaCodeNF.ttf

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Fonts]
"Cascadia Code NF Regular (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF.ttf"
"Cascadia Code NF Bold (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-Bold.otf"
"Cascadia Code NF ExtraLight (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-ExtraLight.otf"
"Cascadia Code NF Light (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-Light.otf"
"Cascadia Code NF SemiBold (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-SemiBold.otf"
"Cascadia Code NF SemiLight (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-SemiLight.otf"

EXPECTED RESULT

CascadiaCodeNF.ttf contains 6 fonts:

Cascadia Code NF Regular
Cascadia Code NF Bold
Cascadia Code NF ExtraLight
Cascadia Code NF Light
Cascadia Code NF SemiBold
Cascadia Code NF SemiLight

The installer detects that CascadiaCodeNF.ttf contains 6 fonts.
The installer removes the 6 matching otc static fonts.
The installer installs the ttf variable font.

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Fonts]
"Cascadia Code NF Regular (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF.ttf"

ACTUAL RESULT

The installer does not detect that CascadiaCodeNF.ttf contains 6 fonts.
The installer replaces CascadiaCodeNF-Regular.otf with CascadiaCodeNF.ttf
The installer does not remove the other 5 CascadiaCode otf static font variants.

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Fonts]
"Cascadia Code NF Regular (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF.ttf"
"Cascadia Code NF Bold (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-Bold.otf"
"Cascadia Code NF ExtraLight (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-ExtraLight.otf"
"Cascadia Code NF Light (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-Light.otf"
"Cascadia Code NF SemiBold (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-SemiBold.otf"
"Cascadia Code NF SemiLight (TrueType)"="%LOCALAPPDATA%\\Microsoft\\Windows\\Fonts\\CascadiaCodeNF-SemiLight.otf"

The result is a font installation of 6 ttf variable and 5 otf static fonts.

CONCLUSION

Windows and Oh-My-Posh font installers cannot handle the replacement of static by variable fonts in a sane way.

SOLUTIONS

1. Remove the CascadiaCode static font variants from the font installer

https://github.com/microsoft/cascadia-code#installation

The ttf variable font is recommended for all users.
Users that need the static font can install it via commandline.
This avoids potential font installation problems and the selection of a suboptimal font.

2. Remove CascadiaCode from the font installer when a winget package is available

microsoft/cascadia-code#283
microsoft/winget-cli#166
microsoft/winget-cli#4515

Winget will support fonts at some point.
You could then remove CascadiaCode.

3. Improve the font installer

https://github.com/Crosse/font-install

The font installer has no functional uninstaller.
Perhaps there is a go package that offers what we need.
The effort of writing an uninstaller from scratch is probably high.

@JanDeDobbeleer
Copy link
Owner

@720720 I will only allow the installation of .tff here. This is what makes the most sense for the project, if you want something else, you'll have to find a different way.

@720720
Copy link
Author

720720 commented Dec 23, 2024

@JanDeDobbeleer thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤩 enhancement Improvement of a feature
Projects
None yet
Development

No branches or pull requests

2 participants