-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Cascadia Code/Mono text height doesn't match original #998
Comments
Here a visualization of the changes: Could you please share the font details one can see with the font settings dialog when you click on that concrete font? I guess you compare the static nerd font version with the Edit: It's called VF, variable font |
Which font settings dialog are you talking about? The one in Windows' Settings app? |
I have no clue how it is called 😬 Windows-Key, type (Can not do a screenshot right now, sorry, would need to start some Windows box). |
🤔 That's Can you try Delugia instead, that is |
Sure, I'll also test |
🤔 Even the equal signs look different 🙄 |
Cascadia Mono Cascadia Mono I've dug through the issues list for both CC and NF and found microsoft/cascadia-code#371 #519. Apparently, it's related to hinting somehow. This might explain the difference between |
Thanks for the investigation. Which reminds me that VS2022 renders the patched fonts (sometimes) rather rough, or the other way round, the unpatched Cascadia Code unusual smooth. I guess it was |
Alright, crazy idea: Here's the resulting font files So I guess it just comes down to the difference between the VF and static version of the original font? |
But we use the As you use You did not show an equivalent screenshot to the first one of my #998 (comment) (search fonts for Usually you have the VF from terminal and additionally the static ones, and of course always the VF are used. Even if you deinstall |
Thanks for the work. I will try to pick this up and get to the bottom of it. |
Experiencing the same thing here on Win 11, this is particularly problematic in |
Here's an example showing what happens when, say, a lowercase
Patched font |
@aderusha Thanks for reporting these interesting finding.
Can you point me to the exact repo? I do not find their |
I'm testing the patched version provided a few posts above in the thread here. File is labelled Caskaydia Cove PL Static Nerd Font.zip |
Ah, those are If I remember correctly we already found out that the original (unpatched) I will do some more checks and conversion tests. I guess we will have to raise an issue upstream if we want to have that fixed. I'm not sure WHY Nerd Font uses the Ah, but then above longnguyen2004 shows a difference between What is wrong with that font? No other font has these problems, and I do not even see them on Linux (or do I?) |
Other main thread: adam7/delugia-code#78 |
This all seems to be not conclusive. If we just concentrate on TrueType outlines (i.e.
@longnguyen2004 said the difference between VF and static vanishes if the statics are self-produced and not taken from the Cascadia Code release. Here @#998 (comment) sees the difference but does not specify if static or VF. Strangeness. |
@longnguyen2004 The version of the font you posted is identical to the original Cascadia Code on my system, thank you very much for figuring that out. This is exactly what I was looking for. Can you share the commands you used to convert these the way you did? I'd like to automate the process of keeping Cascadia Code up to date with the latest version of Nerd Fonts, but I'm not sure how to get static fonts without making 48 of them 😅 |
@Finii Here's a TL;DR
So we can't use the upstream static fonts to make the patched fonts, because they will look wrong. Instead, we need to take the VF font, and generate static versions from it (using @ubergeek77 I'll probably make a script to automate the process when I have some free time. |
@longnguyen2004 You did notice (towards the bottom)? I'm not sure what you want to do with the fonttools, but you can not reuse the VF hinting in the static fonts, so you end up using an unhinted font or employ some autohinter. I guess with fonttools you would use So this boils down to using a different autohinter, in particular VTT or TTH, both which can not be scripted and one that is not even free. I do not have any solution for that except doing it by hand. That is still possible and wound just take 5 minutes on my machine, but still is unsatisfactory because we introduce a differently hinted font. Maybe we should 'just' add VF patching, then we can keep the original hints and have the symbols etc. In another thread we discussed the way to patch VF fonts, which would probably drop using I am not sure here. I believe it is not possible to really automate the process (but you claim otherwise with 'script to automate'). If it is possible I would just put that process in the release workflows and we are good here. Please let me know especially how you want to hint the static fonts after creation. That is the crucial question. If that is not possible we could manually hint the static source fonts (manually means automatically but triggering the autohinter manually, not really doing manual hints) after each Cascadia Code release and put that fonts as sourcefonts here. But will be there someone who does it for the next Cascadia release? What happenes when Aaron fixes the original static fonts himself? Etc. For me this is all not too clear. |
I'm using fonttools'
|
That is easy to check and I really want to, but I'm a hair away from finally releasing 3.0.0. So that will have to wait (please ping me if I forget 😬 ) But, unrelated, do you have an idea for a name replacement for good old Bitstream Vera (Issue 1173) :-D |
How about Bytestream Vira? :) |
Thanks!! This looks good. The hints are preserved and subpixel rendering in fontforge looks identical to what I got in the other experiments that looked good. Question still is if that (the overlapping outlines) will be an issue on Mac, as detailed in the Issue you linked above (fonttools/fonttools#1281, https:/twardoch/test-fonts/tree/master/varia/160413-EvenOddTT) That issue is closed, though. Did not dig too deep into that right now. |
Ping me on the relevant issue when you get around to it. |
And your instance has Panose right, something that is broken in the original release-static. |
Note: Please do not use the fonts above for the release, as the naming table does not follow the naming convention. I'll edit my script to copy the naming table from the original font to the generated one. |
The relevant code that removes overlaps in static fonts: https:/microsoft/cascadia-code/blob/017bde551af6af419cc5554c37bbdffa4f9388ed/build.py#L285-L296 |
We rename the fonts completely anyhow (build all name parts from scratch and fill them into all the appropriate tables). If nothing else works we use the filename to deduce the name parts 😬 (iirc) Whatever. With your latest finding (overlaps removed explicitly) the question is if we should go the keep-the-overlap route, or - at least for the upcoming release - just use manually offline hinted fonts. And switch to |
Let's go with the keep-overlap. Manual hinting means extra work, and it'll not match 100% with upstream. Also, |
Generated statics, with name table copied from the original font |
[why] A lot people (read: People on Windows) have the variable font (VF) version of Cascadia Code installed - it comes bundled with Windows Terminal. The static Cascadia Code instances that we use for patching are hinted with ttfautohint which creates small sized glyphs that are visibly very different. People compare the static Caskaydia Cove with the VF Cascadia Code and are surprised. [how] First switch from the CFF outlines to TTF outlines - that is the original version (i.e. otf -> ttf). It is unknown why we created patched CFF fonts instead of the TTFs. To get as close as possible to the intended look of the glyphs we should stick with the outline type. Then we need to re-hint all the fonts, to get hints that are comparable to the VF hints. We can not use the hints of the VF because the outlines are different: The VF has (of course) overlapping outlines, while the static ones (as usual) have not. The re-hinting can be done with VTT or TTH - both showed results that are more like the original VF font. The usual ttfautohint has been used of the static fonts in the font release and can not be used. It is the reason for this whole problem. * Used VTT 6.35 * Open font file in VTT * Import all programs * Generate 'VTT talk' via Tools -> AutoHint -> LightLatinAutoHint * Save font file as ... References: microsoft/cascadia-code#371 https://learn.microsoft.com/en-us/typography/tools/vtt/ Closes: #998 Signed-off-by: Fini Jastrow <[email protected]>
Thank you for preparing the font files 👍 But I guess Aaron has a point and we should stick with non-overlapping outlines. We had overlapping outlines in some symbols and I manually fixed/removed them because they raised rendering issues for some people. |
Starting release 3.0.0 (offline) 🎉 |
Funnily enough, I was experimenting around with ttfautohint again, and managed to produce a font that very closely matches the original VF: The trick? (Also, don't trust Windows Terminal's preview, that's wrong as hell) |
I tried that exception, I believe I mentioned it in the Cascadia Code Issue. The problem with that is that the top of the lower case letters gets blurry if you switch it on. Because they are not hinted at all anymore. Maybe that is only visible with some heights. |
Hmm, seems I did not mention it... This is what BladeMF wrote: Have a look at the fonts with VTT, it is easy to just see the rendering, and easy to install under Windows. If you have fontforge installed under windows, open one glyph (for example |
But the green outline is shown correct, and - as you already noticed - has the right height (moves down instead of up). Here you need to check for example the But maybe the font is indeed good - waiting with the release until we have a conclusion here. |
Hint: With the Other interesting glyphs as I said the |
Also did a quick run through TTH, the glitches are comparable to VTT, but the overall appearance is a bit too light (esp roundish vertical parts). Also the Cascadia CodeCaskaydia Cove (v3.0.0 with VTT)Caskaydia Cove after TTHThe lower bowl is bigger, slightly, but that is exaggerated by TTH's hints 😲 |
Nope, I use 12pt like others, and the x-height hack actually looks fine, I just wanna see how it looks on smaller size. But I guess I'll ignore that, because there are some glyphs that I just can't match on smaller size (like Btw with your font, |
From the images above I would say we could/should remove all hints from the I would say manual hinting is for after 3.0.0. The only question now is use my already pushed VTT fonts or your no-x-height-snapping ones? Can you put the Regular font somewhere, then I can quickly open it in Fontlab. |
Let's get 3.0.0 out first, I'm still in the process of experimenting |
ttfautohint, nsn stem width, |
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. |
🗹 Requirements
🎯 Subject of the issue
Experienced behavior:
The patched Cascadia Code font doesn't have matching text height to the original, which makes it look unusually large
Expected behavior:
The 2 fonts to have identical text height
Example symbols: Letters and numbers
🔧 Your Setup
Caskaydia Cove Nerd Font Complete Regular.otf
iterm2
,urxvt
,gnome
,konsole
)?Windows Terminal
Windows 11 22H2
★ Screenshots (Optional)
Original
Patched
The text was updated successfully, but these errors were encountered: