Default character height is greater than Cascadia Code
rashil2000 opened this issue · 19 comments
Thanks for reporting. Sorry to hear you have an issue.
I assume you use the Cascadia Code VF
, which is hard-bundled with Windows Terminal
?
There are slight differences between the VF and the static versions, even the unpatched fonts.
Or do you have the static Cascadia Code
version(s) installed? Then I would have a look.
Explanation: We use the static Cascadia Code font files as source because fontforge
has problems with modern VF.
Edit: Add explanation
Yes, I'm using the Cascadia Code that is bundled with Windows Terminal (Preview).
Ok, I tried to normal (non preview) version, and it uses the ttf-VF:
Lets see if we can see differences.
Download release from MS, compare ttf
versions of static and VF:
The glyph is drawn a light bit differently, but the top-point on the exact same position: 604/1080.
Delugia is the same:
Vertical metrics are also the same (except WIN values which should not be used because use-typo-metrics bit is set:
Testing CascadiaCodeVL vs Delugia at 42pt at 400% magnification:
The difference is less than 1 pixel. Even with still bigger fonts, the difference is always < 1 px.
I believe this is a rendering issue.
I also noticed that Caskaydia Cove
(the 'original' Nerd Fonts version of Cascadia Code
has even more rendering problems, the antialiasing seems to be broken there? Ah, now that I write that, NF uses the otf
versions. Hmm. There is devinitively somthing strange about how Windows Terminal
handles Cascadia Code
in the antialias, it looks far far smoother than all other fonts.
Unfortunately I have forgotten almost all Windows related things. Would be worth to try disabling ClearType (I believe it was called something like that) and or other font rendering settings. But were are they ;-D
#!/usr/bin/env sh
#
# Create and rename one font style according to the specs
#
# Example invocation:
# do_generate 01 --powerline --mono CascadiaCodePL-Regular.ttf DelugiaPowerline.ttf Delugia Regular
#
# No parameters are checked, but they are:
# 1: Number of logfile
# 2: Conversion spec #1
# 3: Conversion spec #2
# 4: Input font file name
# 5: Output font file name
# 6: Font family name
set -e
if [ "$#" -ne 6 ]; then
exit 1
fi
PWD=$( pwd )
rm -f C*.ttf
fontforge -script "${PWD}/font-patcher" --careful "${3}" --custom SomeExtraSymbols.sfd --no-progressbars "${PWD}/ttf/static/${4}" "${2}" --outputdir "${PWD}" | tee "process${1}.log"
if [ -z "${OURVERSION}" ]; then
# Github CI sets this variable, but this can be useful for manual calls:
OURVERSION=`git describe --always --tags`
fi
fontforge -script "${PWD}/rename-font" --orig "${PWD}/ttf/static/${4}" --input ${PWD}/C*.ttf --output "${PWD}/${5}" --version "${OURVERSION}" --name "${6}"
First patching, the patching fixes the flags and lowest-ppm AFTER fontforge
did its thing.
And then again fontforge
to change the names, but fontforge
always writes dump default values in both fields :-(
Maybe you can check the fonts generated with the fix (scroll down):
https://github.com/adam7/delugia-code/actions/runs/4062092045
If they are fine we can pull and re-release.
There is devinitively somthing strange about how Windows Terminal handles Cascadia Code in the antialias, it looks far far smoother than all other fonts.
Yes damn you're right, I remember suddenly spotting this difference when I upgraded my Terminal version some months ago. I felt something changed with how the Terminal handles fonts, and waited for the next release.
Maybe you can check the fonts generated with the fix (scroll down):
I downloaded the artifact from the action.
The font size is 11, unfortunately I still see the original difference.
So. Finally to be able to really test this, I removed the Cascadia Cove that are part of the Windows Terminal app.
Which is kind of hard
- gain access to C:/Programs/WindowsApps
- set youself as owner for
C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.15.3466.0_x64__8wekyb3d8bbwe
- set youself as owner for all 4 font files in that folder
- add full access right for
everyone
on the 4 fonts - move the 4 fonts to another location (e.g. desktop) - deleting is impossible
- reboot
- enjoy to be able to install whichever Cascadia Code you like and use Windows Terminal with that
No Cascadia Code to be seen in neither Terminal nor Fonts
The otf
version has no autohint
run, at least not in the version number.
Edit: Which should not have anything to do anything with glyph height
Ah, so if I create a Delugia with the current HEAD font-patcher
(HEAD of nerd-fonts) from the static/ttf, it will look different, but look the same as Cascadia Code static/ttf.
So there are differences in Cascadia Code depending on static/variable and ttf/otf, but we can do nothing about these.
The patched fonts (Delugia and also vanilla Caskaydia) look the same as the original MS font that has been taken as source.
I would close this now. (?)
This (Delugia) should be more like the "normal / autoinstalled" Cascadia Code, because Windows Terminal
installs the variable-ttf version.
Delugia is based on the static-ttf version.
CaskaydiaCove is based on static-otf which looks even more different.
Okay, thanks for the detailed investigation!