microsoft / vscode

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

Add support for `font-stretch` #95493

Open aruiplex opened 4 years ago

aruiplex commented 4 years ago

Steps to Reproduce:

  1. set font is iosevka extended (it is Monospaced font),
  2. it not Monospaced font in display.

Does this issue occur when all extensions are disabled?: Yes/No yes

p.s.: iosevka

chrmarti commented 4 years ago

Does it work in Chrome / Chromium when you set it as the font of some sample html?

eugene-babichenko commented 4 years ago

"Extended" are in the same font family with "simple" Iosevka fonts (see the image). Seems like extended is a font width or some other property unsupported by VS Code. See a relevant issue https://github.com/be5invis/Iosevka/issues/479

image

bpasero commented 4 years ago

This seems to be about changing the font for the editor.

eugene-babichenko commented 4 years ago

Exactly. So, Iosevka has two different variants. The extended one can be enabled in CSS with font-stretch: expanded.

aruiplex commented 4 years ago

you mean 'Iosevaka' has 'isoevka extended' for variant font, so i cannot use the variant for my vscode editor. All I can do is set the 'font-family' which is a set of fonts. I try to set the user setting in vscode font-stretch but there seem to don't have this option. Thank you gays for helping me.

sharpjs commented 4 years ago

Here's an illustration of the issue, using VS Code:

Iosevka used: image

Iosevka not used: image

chmielcode commented 4 years ago

Here's an illustration of the issue, using VS Code:

Iosevka used: image

Iosevka not used: image

The extended version of Iosevka is called "expanded". Just figured it out by looking at build-plans.

[widths.extended]
shape = 7
menu  = 7
css   = "expanded"

Try using "Iosevka Term ss04 Expanded". Worked for me at least.

singularitti commented 4 years ago

Here's an illustration of the issue, using VS Code: Iosevka used: image Iosevka not used: image

The extended version of Iosevka is called "expanded". Just figured it out by looking at build-plans.

[widths.extended]
shape = 7
menu  = 7
css   = "expanded"

Try using "Iosevka Term ss04 Expanded". Worked for me at least.

Does not work for me with

  "editor.fontFamily": "Iosevka Term SS14 Expanded",

I tried different capitalizations but still failed. @chmielcode What operating system are you using? Do you install the latest release?

madispp commented 4 years ago

Iosevka Expanded worked me in Windows and Iosevka-extended worked for me in macOS. This is the same name format that Fira Code font suggests for its "retina" variant: Fira Code Retina for Linux and Windows, FiraCode-retina for macOS.

singularitti commented 4 years ago

I believe it is a temporal workaround, we still need the actual feature to be implemented in VSCode. I tested it on macOS, and it turns out do not work well when characters are slanted. For example, I set

  "editor.fontFamily": "'Iosevka-SS14-Extended'",

the characters do extend compared to "editor.fontFamily": "'Iosevka SS14'",. However, when there are slanted words with spaces between them, selecting the text will expand the spaces and you will see text expanding and contracting. This is intolerable.

no

ex

See the right-shift of characters in that line just by selecting them?

AnrDaemon commented 4 years ago

@singularitti can this be letter spacing? I've noticed similar behavior when using fractional letter spacing.

singularitti commented 4 years ago

@singularitti can this be letter spacing? I've noticed similar behavior when using fractional letter spacing.

Perhaps not? I have "editor.letterSpacing": 0, as default.

AnrDaemon commented 4 years ago

Answering to your earlier question, I've used a different font and 1px spacing. Not ideal, but bearable.

themowski commented 3 years ago

I have Iosevka Fixed v3.3.1 (which includes Iosevka Fixed Extended), VS Code v1.46.1, and Windows 10 Pro and I want to use Iosevka Fixed Extended as my terminal font. As others have pointed out, the following setting worked for me; note that the font name for VS Code purposes uses "Expanded" instead of "Extended", which apparently has something to do with CSS spacing per the above discussion:

"terminal.integrated.fontFamily": "Iosevka Fixed Expanded"

It's very unclear to me whether this is a VS Code issue, or an issue with Iosevka -- seems to me like both parties have a hand in this, although I think that VS Code should be smart enough to identify that "Iosevka Fixed Extended" is the name of that particular font & style.

FWIW, other Windows applications recognize "Iosevka Fixed Extended" (the actual font name, not "Expanded" as in VS Code) as a valid font:

amiroff commented 3 years ago

However weird it may sound, setting editor.fontFamily to Iosevka Expanded in VsCode does it for me (windows). app font

lakshits11 commented 3 years ago

However weird it may sound, setting editor.fontFamily to Iosevka Expanded in VsCode does it for me (windows). app font

Hello, your settings worked for me. By the way can you please tell me which theme are you using because I am very choosy in these things 😅😅

amiroff commented 3 years ago

However weird it may sound, setting editor.fontFamily to Iosevka Expanded in VsCode does it for me (windows). app font

Hello, your settings worked for me. By the way can you please tell me which theme are you using because I am very choosy in these things 😅😅

It's Aylin.

lakshits11 commented 3 years ago

And by the way how to use Iosevka Semibold Expanded in vs code ? Only Iosevka Expanded worked and not others like medium, semibold or heavy worked?

madispp commented 3 years ago

If you only install the "extended" variants to your system (all matching iosevka-extended*.ttf or iosevka-term-extended*.ttf), then using "Iosevka Semibold" works and shows the expanded variant. Works for me in Windows and in macOS as well IIRC, even with various other programs.

I guess there's some kind of name shadowing / aliasing going on with fonts like this.

AnrDaemon commented 3 years ago

Iosevka Semibold Expanded

Try different order of words.

franka107 commented 1 year ago

Hello, What happened to this feature?

konung commented 1 month ago

I just ran into this issue running brew upgrade on my macOS.

My fonts all of a sudden were messed up in VSCode.

Here is the config that finally worked for me:

Used to have

{
"editor.fontFamily": "'Iosevka SS09 Extended'
"editor.fontLigatures": "'aalt','rlig','liga','calt','dlig','zero','onum','ss09'",
}

Now

{
"editor.fontFamily": "'Iosevka-SS09-Extended'",
"editor.fontLigatures": "'aalt','rlig','liga','calt','dlig','zero','onum','ss09'",
}

I use the same font in iTerm2 and a few other apps, and DID NOT have to adjust it anywhere else. Just VS Code

coolfizzin commented 1 month ago

I've been trying to get VS Code to use NK57 Monospace Condensed Light. I can get it to use the base font: "editor.fontFamily": "'NK57 Monospace'", The following shows the non-condensed base font: "editor.fontFamily": "'NK57 Monospace Condensed'", "editor.fontVariations": "'wdth' 75" And these do not work at all: "editor.fontFamily": "'NK57 Monospace Cd'", "editor.fontFamily": "'NK57 Monospace Cd Rg'", "editor.fontFamily": "'NK57 Monospace Condensed Regular'", "editor.fontFamily": "'NK57-Monospace-Cd-Rg'", Note that one way to tell whether the font is working is the ¶ character, which includes an unusual curved downward-pointing tail.

Inclushe commented 3 weeks ago

Getting an issue where Iosevka Extended isn't working properly anymore. A workaround for now is to add a dash in place of spaces, which is the same as https://github.com/microsoft/vscode/issues/95493#issuecomment-2152823608.

However, italics are not expanded, making commented code in certain themes hard to work with.

Screenshot 2024-06-10 at 9 59 27 PM

This is an issue even with the latest Iosevka, version 30.1.2 from https://github.com/be5invis/Iosevka/releases/tag/v30.1.2.

This may be related to #214805 and #214390. According to https://github.com/microsoft/vscode/issues/214390#issuecomment-2157792098, the patch for this will be released later this week.

konung commented 3 weeks ago

This is an issue even with the latest Iosevka, version 30.1.2 from https://github.com/be5invis/Iosevka/releases/tag/v30.1.2.

This may be related to #214805 and #214390. According to #214390 (comment), the patch for this will be released later this week.

Good to know about the font issues you referenced. Didn't think to check there, because all of the same font is working fine in iTerm and Word for me. So didn't think it was a font, but they are probably loading fonts in a different manner.

Glad my workaround gave you a temp solution. Italics and Bold actually work for me - but you may need to try a different version of the font. I suggest checking your Fonts folder for available options: For example: ls -la /Users/konung/Library/Fonts/Iosevka*Light*

AnrDaemon commented 3 weeks ago

If you are not against a system-wide workaround, you may install only preferred typeface. (I.e. I'm only installing Extended variants of Iosevka font, thus making it all work in fallback mode.)

konung commented 3 weeks ago

If you are not against a system-wide workaround, you may install only preferred typeface. (I.e. I'm only installing Extended variants of Iosevka font, thus making it all work in fallback mode.)

That's not a bad idea, since I only use one variant of Iosevka. But I manage it as a brew package, so it will get restored every time I run it.

P.S.: I guess I can modify my brew update aliast, and call a custom Iosevka clean function

I'll wait a week to see if next font update will fix this bug.

nonoash commented 1 week ago

I've managed to use "extended" fonts with "expanded" on windows but is there a proper fix to use certain weights like "Iosevka Medium Expanded" without having to delete all other types other than Expanded?

I'm also using non extended with some other IDEs or when i need more horizontal space, so having to delete everything non extended is not super optimal.