microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.95k stars 28.77k forks source link

Intermediate font weight values (like 350) do not render correctly for variable-width fonts #199798

Closed davepeck closed 10 months ago

davepeck commented 10 months ago

Type: Bug

I use Cascadia Code; I have the variable width version installed.

Setting the editor.fontWeight to 350 results in it rendering as 400. (Bold for my taste.)

Looking at the inspector, I can see that font-weight is indeed 350, despite the too-bold rendering.

It's only when I also set editor.fontVariations: "'wght' 350" that things look correct (and variations of +/- 25 become possible to distinguish).

I see older resolved issues about this but it's not clear to me from context whether this is "expected" behavior or whether there's something amiss here. At minimum, it's surprising, so I'm opening this (a) for conversation and (b) to document how I achieved the behavior I wanted. Thanks!

VS Code version: Code 1.84.2 (Universal) (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:52:33.687Z) OS version: Darwin arm64 23.1.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M2 Pro (12 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|2, 3, 6| |Memory (System)|32.00GB (3.48GB free)| |Process Argv|dev/frontseat/fec-data --crash-reporter-id 7ddbe1c3-7783-4779-9ae1-5b4ab64520ad| |Screen Reader|no| |VM|0%|
Extensions (53) Extension|Author (truncated)|Version ---|---|--- vscode-sql-formatter|adp|1.4.4 pascal-formatter|ale|2.8.1 astro-vscode|ast|2.5.2 vscode-django|bat|1.14.0 QML|bbe|1.0.0 markdown-preview-github-styles|bie|2.0.3 vscode-tailwindcss|bra|0.10.3 ruff|cha|2023.50.0 vscode-eslint|dba|2.4.2 EditorConfig|Edi|0.16.4 prettier-vscode|esb|10.1.0 codespaces|Git|1.16.2 copilot|Git|1.139.0 copilot-chat|Git|0.10.2 vscode-github-actions|git|0.26.2 vscode-pull-request-github|Git|0.76.1 todo-tree|Gru|0.0.226 terraform|has|2.29.0 haskell|has|2.4.1 vscode-ebnf|igo|1.3.1 solidity|Jua|0.0.165 language-haskell|jus|3.6.0 graphql-for-vscode|kum|1.15.3 vscode-antlr4|mik|2.4.3 vscode-docker|ms-|1.28.0 csharp|ms-|2.12.19 vscode-dotnet-runtime|ms-|2.0.0 black-formatter|ms-|2023.6.0 isort|ms-|2023.11.13191009 python|ms-|2023.20.0 vscode-pylance|ms-|2023.11.13 jupyter|ms-|2023.10.1100000000 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.17 vscode-jupyter-cell-tags|ms-|0.1.8 vscode-jupyter-slideshow|ms-|0.1.5 remote-containers|ms-|0.321.0 cmake-tools|ms-|1.16.32 cpptools|ms-|1.18.5 cpptools-extension-pack|ms-|1.3.0 hexeditor|ms-|1.9.12 live-server|ms-|0.4.11 vsliveshare|ms-|1.0.5896 hide-gitignored|npx|1.1.0 nunjucks|ron|0.3.1 shopify-liquid|sis|4.0.1 vscode-stylelint|sty|1.3.0 even-better-toml|tam|0.19.2 vsfire|tob|1.4.1 mako|tom|0.2.0 cmake|twx|0.0.17 markdown-pdf|yza|1.5.0 material-theme|zhu|3.16.2 (5 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931cf:30280410 vshan820:30294714 vstes263cf:30335440 vscorecescf:30445987 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30410667 py29gd2263:30899288 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 azure-dev_surveyone:30548225 2e4cg342:30602488 89544117:30613380 2i9eh265:30646982 showlangstatbar:30737416 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 welcomedialogc:30910334 pythonnosmt12:30797651 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixt:30902429 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 aa_t_chat:30882232 ```
davepeck commented 10 months ago

With editor.fontVariations set:

with-fontVariations-set

Without:

without-fontVariations-set
rzhao271 commented 10 months ago

Merging with https://github.com/microsoft/vscode/issues/199765