-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Numeric fontWeight
is rejected by the profile parser
#7690
Comments
So, the error message does a right poor job of surfacing this... Can you try |
Gah. >_< Yeah, that works. Thank you. I'm going to go sit quietly away from the computer for a little while... I assume the error message doesn't mention integers because the "Override mapping parser to add boolean parsing" (sic) code doesn't override I've just noticed that the hover-text in VS Code says:
which suggests a couple of newlines are missing in the schema comment to take the last clause out of the list. Not that this would have clued me in to my mistake, if looking at profiles.schema.json and implementation didn't. Although given the current error message, the first thing I checked was "Is this code newer than the version I'm using?". |
I should at least throw in a better type description. Thanks for calling that out 😄 |
🎉This issue was addressed in #8558, which has now been successfully released as Handy links: |
Environment
Steps to reproduce
(How I got there, starting from a working setup, is hidden inside the fold. It shouldn't affect the reproduction, but is here in case there is something relevant hidden there.)
Starting from a working default profile:
with the Fira Code TTFs (six files, one for each of Bold, Light, Mediuma, Regular, Retina, SemiBold) installed.
I then removed the Fira Code TTFs, and installed the Variable TTF (FiraCode-VF.ttf).
Samples in white-on-black are from the Windows "Font Properties" dialogs.
After this change, my terminal looked like this:
which is Consolas Regular at 14pt:
, but with better anti-aliasing. (Or rather, with any anti-aliasing, I suspect)
This makes sense, since there isn't a "Fira Code Retina" font anymore on my machine, although some kind of notification that my font wasn't found would have been nice. Also, I would have expected a fallback to Cascadia Code, not Consolas. Cascadia Code is installed on my machine as part of the Windows Terminal package (twice, once for Preview, once for regular), so it seems like a better fallback?
I initially tried to move the 'Retina' from the fontFace to the fontWeight
but that's not in the hard-coded list of named font-weights. I was disappointed that it wasn't just asking the chosen font if the
fontWeight
given matched to a font instance name, but not super-disappointed:I saw in the profile schema and settings implementation that I could pass in a uint to
fontWeight
, if there was no existing hard-coded name for my desired weight.I looked up the weight of the Retina instance in the Fira Code variable TTF (450), and got:
Expected behavior
I get the same font I had when using
Fira Code Retina
as myfontFace
and nofontWeight
setting, with the Fira Code non-variable TTF files installed, i.e. 6 separate TTFs, one for each of Bold, Light, Mediuma, Regular, Retina, and SemiBold.Actual behavior
Windows Terminal raises an error about the fontWeight value:
and then ignores the entire theme configuration, including my colour scheme setting.
So yeah, unlike above, I was super-disappointed this time. As a workaround, I'm using
"fontWeight": "medium"
.If I comment-out the![image](https://user-images.githubusercontent.com/138397/93772765-92510800-fc62-11ea-8725-3c1d596a8889.png)
rather than 'Retina' instance (weight 450):
which makes sense, if the default value for
fontWeight
, it looks like this:which appears to be 'Regular' instance (weight 400):
fontWeight
is 'normal'.Side-note: I was inspired to make this change by noticing that Cascadia Code recommends their Variable TTF over the fixed-size TTFs, and also #107 (comment)
The text was updated successfully, but these errors were encountered: