-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
(Caskaydia Code and) Visual Studio 2022 #1242
Comments
Thanks. First it is run through VTT and then through |
The 'massaged' source font ( Both |
✔️ The last work, but the hints are obviously broken. If this is compared to without-rename_font, which is basically the identical font just with other names, this means Visual Studio handles the font differently based on the name 😒 Maybe something is cached, so this might or might not be true. At least the hints even the basically renamed font are not active rendering the font useless. I have to stop here for now, sorry. |
Same thing happens using Notepad++. It reverts to another font, I believe Arial. When installing the regular fonts on Windows 10, it registers 2 of the fonts twice. Very strange. For instance, the 12 physical font files produces 14 entries when looking at the list of fonts under CaskaydiaCove NF. |
Will tackle this asap, for v3.0.2. @jaygreina Thanks for the information. Can you share some screenshots? Edit: Screenshots of the font settings with the 14 fonts |
@Finii , turns out there I had a process that had the font open. I closed everything, restarted Windows and tried installing a clean copy. All the fonts were installed correctly and no duplicates. |
Yes something is amiss with Cascadia :-( |
This appears to be the same issue with SQL Server Management Studio. It uses a similar underlying "shell" as Visual Studio. I brought it up in the below Discussion. |
Hmm, I can not reproduce with Notepad++ 8.5.3. Font looks similar apart from line spacing: Edit: The small letter L ( |
Interestingly the Visual Studio problem seems to be fixed if I patch with the current HEAD patcher. $ git log --oneline d812d153a^..HEAD font-patcher
f3f8da13b Revert "font-patcher: Add ScaleGroupVert"
c8dd88015 Codicons: Revert to no Scale grouping
fcf5c8420 font-patcher: Add ScaleGroupVert
b0e5a3547 name-parser: Remove filename parsing code
1050729d6 font-patcher: Improve some debug messages [skip ci]
438843d57 FontnameParser: Fix fsSelection for --has-no-italic
6903e2f39 font-patcher: Fix DaddyTimeMono NFM
d812d153a Start release v3.0.1
$ git log --oneline d812d153a^..HEAD bin/scripts/name_parser/FontnameParser.py
b0e5a3547 name-parser: Remove filename parsing code
438843d57 FontnameParser: Fix fsSelection for --has-no-italic
$ git log --oneline d812d153a^..HEAD bin/scripts/name_parser/FontnameTools.py
930eef239 name-parser: Fix some Blex fonts
f5e648b87 IBM Plex: Fix "Text" weight
2e9caea9c name-parser: Simplify for CodeClimate
07a23bda9 name-parser: Allow dashes between modifier and weight
f1c2eea93 name-parser: Fix unify_style_names()
b0e5a3547 name-parser: Remove filename parsing code I see nothing that really changes the font? |
Regarding the hints, lets see - <flags value="00000000 00001111"/>
+ <flags value="00000000 00011111"/>
- <maxSizeOfInstructions value="3971"/>
+ <maxSizeOfInstructions value="303"/> What happened to the instructions?? - <maxComponentDepth value="5"/>
+ <maxComponentDepth value="4"/>
- <fsSelection value="00000000 11000000"/>
+ <fsSelection value="00000001 11000000"/>
- <usWinAscent value="2226"/>
+ <usWinAscent value="1900"/>
- <usMaxContext value="5"/>
+ <usMaxContext value="40"/>
- <component glyphName="A" x="0" y="0" flags="0x204"/>
- <component glyphName="uni0306.case" x="0" y="0" flags="0x4"/>
+ <component glyphName="A" x="0" y="0" flags="0x1204"/>
+ <component glyphName="uni0306.case" x="0" y="0" flags="0x1004"/>
</contour>
- <instructions>
- <bytecode>
- 400c0300 282b0007 6a2b246a 2b00002f
- 2f2b2b11 33113330 31•
- </bytecode>
- </instructions>
+ <instructions/>
</TTGlyph>
|
Very strange, even if I re-VTT the patched font on a windows machine the hints do not work in Visual Studio 2022??! |
Missing hintsOk, after a lot of experimentation I can say definitively that Visual Code 2022 enables the hints based on the font name.
How bad is that? :-( A solution for Visual Code users would be to self-patch then, with disabled renaming. diff --git a/font-patcher b/font-patcher
index 74f0ced14..fdd2f834a 100755
--- a/font-patcher
+++ b/font-patcher
@@ -720,7 +720,7 @@ class font_patcher:
short_family = projectNameAbbreviation + variant_abbrev if self.args.makegroups >= 4 else projectNameSingular + variant_full
# inject_suffix(family, ps_fontname, short_family)
n.inject_suffix(verboseAdditionalFontNameSuffix, ps_suffix, short_family)
- n.rename_font(font)
+ # n.rename_font(font)
font.comment = projectInfo
font.fontlog = projectInfo DetailsCreating a patched fonts that DOES work $ git diff
diff --git a/bin/scripts/name_parser/FontnameParser.py b/bin/scripts/name_parser/FontnameParser.py
index 2c5aff4b1..bb96a7362 100644
--- a/bin/scripts/name_parser/FontnameParser.py
+++ b/bin/scripts/name_parser/FontnameParser.py
@@ -273,6 +273,12 @@ class FontnameParser:
def rename_font(self, font):
"""Rename the font to include all information we found (font is fontforge font object)"""
+ font.sfnt_names = tuple()
+ font.fondname = None
+ font.fontname = 'CascadiaCode-Regular'
+ font.fullname = 'Cascadia Code Regular'
+ font.familyname = 'Cascadia Code'
+ return
font.fondname = None
font.fontname = self.psname()
font.fullname = self.fullname() Creating a patched fonts that DOES NOT work $ git diff
diff --git a/bin/scripts/name_parser/FontnameParser.py b/bin/scripts/name_parser/FontnameParser.py
index 2c5aff4b1..0f6705d4d 100644
--- a/bin/scripts/name_parser/FontnameParser.py
+++ b/bin/scripts/name_parser/FontnameParser.py
@@ -273,6 +273,12 @@ class FontnameParser:
def rename_font(self, font):
"""Rename the font to include all information we found (font is fontforge font object)"""
+ font.sfnt_names = tuple()
+ font.fondname = None
+ font.fontname = 'CastadiaCode-Regular'
+ font.fullname = 'Castadia Code Regular'
+ font.familyname = 'Castadia Code'
+ return
font.fondname = None
font.fontname = self.psname()
font.fullname = self.fullname() To make sure we have no caching effects, I also did patch with variations of this (copying lower case letter glyphs around) diff --git a/font-patcher b/font-patcher
index 74f0ced14..0166dcafd 100755
--- a/font-patcher
+++ b/font-patcher
@@ -2007,6 +2007,12 @@ def main():
sys.exit(1)
patcher.setup_name_backup(sourceFonts[-1])
+ sourceFonts[-1].selection.select('y')
+ sourceFonts[-1].copy()
+ sourceFonts[-1].selection.select('b')
+ sourceFonts[-1].paste()
+ sourceFonts[-1].selection.select('c')
+ sourceFonts[-1].paste()
patcher.patch(sourceFonts[-1])
print("Done with Patch Sets, generating font...") |
Fallback to CourierI can not reproduce anymore with current HEAD.
|
[why] Sometimes a user might want to keep the original name. This is escpecially true as Visual Studio seems to look at the font names directly and enables special handling for 'Cascadia Code'. Users might want to self-patch without renaming. [how] Add additional value to makegroups option. That option should probably be renamed into 'naming scheme' or something, as it is not really a fitting description of what it does. Fixes: #1242 (some aspect of it) Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
So I'll have to use a custom build of the font and can't use the release because I have to pass in the flag to use Cascadia Code? |
A custom (un-renamed) build is only needed for Visual Studio to enable the hints. I'm not really sure what your issue was, because you just say 'same here' but there were multiple different issue aspects before (iirc). The issue with falling back to |
Thank you for the extensive analysis @Finii I installed v3.0.2 and set the font to CaskadiaCove NFM, and VS still falls back to the default font.
I was the original reporter of this ticket reporting this issue specifically, so I'm a little confused. I shall create a new ticket for this issue - regarding/relating to v3.0.2? |
Hmm, this is strange, because I could reproduce, but with Edit: The same (fallback to Courier) happened with |
I installed yesterday, before a shutdown bootup cycle. But I guess it's not a clean restart. I can try that later. |
I have just that one Windows machine available here, where I did the work above. That is Win10. Could test on other machines later today, also Win11 - but you are also on 10. Hmm. I'm rather confident the issue went away, because how should I have tested the hints if it is not even the correct font. I always look for the lower-case L ( I also noticed that Visual Studio seems to cache ?! the font itself? I always needed to select some random other font and go back to the font I wanted to check, or the changes were not visible (at least not always), even after a complete Visual Studio restart. Edit:
|
I can confirm: with 3.1.1 the font can't be found even if the name is correct. Tried in Alacritty and Windows Terminal. I had to revert to 3.1.0 |
Hmm, I tried (If Caskaydia has a naming problem then Monaspice would also have that, because the scheme is identical; using Monaspice because it is visually more distinct and one can see if it works quite easily.) and with more debug |
Also works on Windows 11 with Windows Terminal 1.18.2822.0 So I can not reproduce @graphixillusion. This whole Issue was just about Visual Studio, because that seems to be the only affected application. Please show more information on how to reproduce,. |
@Finii 3.1.1 doesn't work on my side. Note: Windows Terminal can load this font, but not CaskaydiaCode This is with 3.1.0 with no issue at all with any fonts. |
Thanks for the feedback. I see you use Alacritty on Windows. I believe I have found a way to circumvent the problem without dropping the long name completely.
That means Windows Terminal works with MonaspiceNF3.1.1 but not with CaskaydiaCodeNF3.1.1? |
Right. |
Alacritty likes the name "MonaspiceKr Nerd Font" with version 3.1.1 and loads it successfully. Still no luck with CaskaydiaCove 3.1.1: doesn't work both with CaskaydiaCove NF / Nerd Font in Alacritty and Windows Terminal. In Windows Terminal it appears in the list with the name "CaskaydiaCove Nerd Font" but when i hit save i get an error msg says it can't locate the font named "CaskaydiaCove NF". |
Tnx, checking. |
Ah, your edit ... This is what my 'new solution' does. It just stores both family names in the font, the long and the short form (NF/Nerd Font), so that it should not matter what people enter in the configs and what GUI dialogues select. Terminal seems to take the long form to show in the dialog, but when selecting it uses the short form, and that is not encoded in the typographic family name. So this looks all to be the same root cause, preparing a Caskaydia test font. |
Please find a set of the hopefully fixed Caskaydia Cove Nerd Font here: If possible, please try and report back. |
Tried this one: Windows Terminal can load it and it works. Alacritty works too with both names CaskaydiaCove NF/Nerd Font |
Yep with this version seems to work. I've edited the post becouse i used a different name in the Alacritty config, i typed CaskaydiaCode while the name in this version is CaskaydiaCove, that's why at the beginning it wasn't working. |
Works fine for me too 👍 |
Wow, thanks for testing. What a kludge, but at least it seems to solve both contradicting issues at once :-) |
Hopefully this is topical, but I'm using v 2111.01. No issues in the VS 2022 editor, but the glyphs don't render correctly inside the VS integrated terminal. This is the inverse problem of the issue reported in #785. I followed the advice in #785 (comment) and installed |
@jhigh2000 There is a possible workaround in #1442, and here is somewhere a differently patched font set for you to try out... *searching . . .* It would be great if you can test that 👍 Edit: After rereading your comment and all linked material I am not so sure my comment makes any sense. |
So I tried the differently patched fonts that you suggested #1442 (comment) and those font variants immediately fixed the issue in the VS integrated terminal! After reading your edit, maybe the process of "installing" the differently patched fonts was the fix, and not the fonts themselves. I will try to re-install the official release (https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/CascadiaCode.zip) and will report back. Edit: after re-trying the release version, the integrated terminal is broken again. So this is where things are now:
|
Thanks a lot!! I guess that patch will come into Nerd Fonts v3.2 (like next week or something) 👍 💚 |
Fixed by |
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. |
I have removed Caskaydia Cove, verified no Caskaydia font files in system nor user folder, restarted the system, installed all the Caskaydia ttf for all users.
They work fine in various programs (VS Code, KDiff3, Double Commander).
But not in Visual Studio. (It falls back to a different font, seemingly Courier.)
Windows 10. VS 2022 17.5.5. Nerd Fonts 3.0.1.
Originally posted by @ite-klass in #785 (comment)
The text was updated successfully, but these errors were encountered: