Skip to content
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

feature request: configure OpenType font features #10435

Closed
siegebell opened this issue Aug 11, 2016 · 13 comments
Closed

feature request: configure OpenType font features #10435

siegebell opened this issue Aug 11, 2016 · 13 comments
Assignees
Labels
editor-rendering Editor rendering issues feature-request Request for new features or functionality font-rendering Font rendering issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@siegebell
Copy link

From #6918: Please support configuration of font features, and possibly also support "user friendly" alternate configuration via font variants.

Font features allow the user to control the use of alternate glyphs and ligatures. For example:

  • normal vs slashed zero
  • lining vs old-style numbers
  • small-caps
  • fractions (and horizontal vs diagonal)
  • ordinals

Issue #6918 demonstrates that fonts may include useful nonstandard feature tags, so it is important that the user is not restricted to just the "font variant" options.

Example:

"editor.fontFeatures": {"zero": 1, "salt": 3, "COOL": 1},
@alexdima alexdima added feature-request Request for new features or functionality editor-core Editor basic functionality labels Aug 18, 2016
@alexdima alexdima added this to the Backlog milestone Aug 18, 2016
@alexdima alexdima removed their assignment Aug 29, 2016
@voronoipotato
Copy link

voronoipotato commented Jan 31, 2019

This is a blocking feature for making use of a font I purchased for programming.

I don't think we should need extensions to use OpenType standards compliant font configuration.

If we can already do this and I'm just confused could someone help?

"[markdown]":{
"editor.fontFeatureSettings": "SS12"
}

see

tonsky/FiraCode#192
fabrizioschiavi/pragmatapro#84

@voronoipotato
Copy link

What work needs to be done to support this? As far as I can tell people have done this via extensions through the custom css extension.

{
   font-feature-settings: "ss12"
}

@voronoipotato
Copy link

bcd90ac

this commit is probably pretty close to the work that needs to be done

@voronoipotato
Copy link

voronoipotato commented Jan 31, 2019

@voronoipotato
Copy link

@voronoipotato
Copy link

I think we should be able to use these with our themes. Some people like cursive parts.

@Njke
Copy link

Njke commented Feb 10, 2019

Thanks, @voronoipotato !

One can add following to /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.css:

.monaco-editor {
    font-feature-settings: "ss02" !important;
}

More about CSS for OpenType features: https://helpx.adobe.com/fonts/using/open-type-syntax.html

@alexdima alexdima added font-rendering Font rendering issues editor-rendering Editor rendering issues and removed editor-core Editor basic functionality labels Feb 13, 2019
@voronoipotato
Copy link

@Njke hmmm that would only work if I wanted this stylistic set for all languages, however I only want ss02 on Markdown.

@swthate
Copy link

swthate commented Aug 9, 2019

@Njke

One can add following to /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.css:

.monaco-editor {
    font-feature-settings: "ss02" !important;
}

More about CSS for OpenType features: https://helpx.adobe.com/fonts/using/open-type-syntax.html

Sorry, but how do I get to /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.css

Visual Studio Code.app is an... app right? I feel dumb, how do I navigate into it?? 😆

@swthate
Copy link

swthate commented Aug 9, 2019

Right-click -> "show package contents"

Carry on!

@thundernixon
Copy link

(It seems worth noting that diving into the app Package Contents CSS is pretty hacky ... this would be much nicer and less fragile if made into an actual setting).

I like the initial proposal a lot – this would be great to basically follow the CSS syntax for OpenType features. https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/OpenType_fonts_guide

@gkeramidas
Copy link

gkeramidas commented Oct 8, 2019

With fonts like “Fira Code V2”, where several glyph alternatives can be enabled with font-feature-settings attributes, this is a super useful feature to have!

In addition to that, newer macOS versions (e.g. Catalina) will make it much harder to make changes under /Applications folders, so poking around under the app directory is going to be too cumbersome for most people.

@alexdima
Copy link
Member

Implemented via ab0eb6d (#82153) and it already shipped in Insiders.

e.g.

"editor.fontLigatures": "'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'zero', 'onum'"

or

    "editor.fontFamily": "Fira Code"    
    "editor.fontLigatures": true,
    "[cpp]": {
        "editor.fontLigatures": "'ss06', 'ss19'",
    },
    "[javascript]": {
        "editor.fontLigatures": "'ss06'",
    }, 

@alexdima alexdima self-assigned this Oct 23, 2019
@alexdima alexdima removed this from the Backlog milestone Oct 23, 2019
@alexdima alexdima added this to the October 2019 milestone Oct 23, 2019
@alexdima alexdima added the verification-needed Verification of issue is requested label Oct 28, 2019
@roblourens roblourens added the verified Verification succeeded label Oct 29, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-rendering Editor rendering issues feature-request Request for new features or functionality font-rendering Font rendering issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

8 participants