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

Request: Support for Font Width Variants #5828

Closed
Tracked by #1790
sharpjs opened this issue May 10, 2020 · 16 comments · Fixed by #10525
Closed
Tracked by #1790

Request: Support for Font Width Variants #5828

sharpjs opened this issue May 10, 2020 · 16 comments · Fixed by #10525
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@sharpjs
Copy link

sharpjs commented May 10, 2020

Some fonts have multiple width variants. Iosevka from @be5invis, for example, has an Extended variant. Terminal should support the use of such variants.

Currently:

"fontFace": "Iosevka SS04"

image

But when asking for the Extended variant, Terminal falls back to a default font — Consolas for me.

"fontFace": "Iosevka SS04 Extended"

image

I propose support for width variants either through fontFace or through a new fontWidth profile configurable.

Please add this feature request to @be5invis's epic for similar issues, #1790.

@sharpjs sharpjs added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label May 10, 2020
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 10, 2020
@DHowett-MSFT
Copy link
Contributor

Thanks for the report! I think this is mostly covered by /dup #1790 #1751--they suggest that we need something more than "font face name" for selecting the font, and might further posit that we need variant/opentype feature selection.

@ghost
Copy link

ghost commented May 11, 2020

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed May 11, 2020
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 11, 2020
@DHowett-MSFT
Copy link
Contributor

(I just realized 1751 wasn't linked up, so that was the important part of the dupe here. Weight and family/face together make up this issue 😄)

@sharpjs
Copy link
Author

sharpjs commented May 11, 2020

Thanks. Hopefully we get width and weight support at the same time.

@DHowett
Copy link
Member

DHowett commented Jul 21, 2021

Figured I'd just reopen this since we're on the cusp of closing it 😄

@DHowett DHowett removed the Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. label Jul 21, 2021
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Jul 21, 2021
@DHowett DHowett added this to the Terminal v1.11 milestone Jul 21, 2021
@DHowett DHowett added Area-Settings Issues related to settings and customizability, for console or terminal Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Jul 21, 2021
@ghost ghost added In-PR This issue has a related PR and removed Needs-Tag-Fix Doesn't match tag requirements labels Jul 21, 2021
@ghost ghost closed this as completed in #10525 Jul 22, 2021
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Jul 22, 2021
ghost pushed a commit that referenced this issue Jul 22, 2021
Adds support for users to be able to set font features and axes (see the spec for more details!)

## Detailed Description

**CustomTextLayout**
- Asks the `DxFontRenderData` for the font features when getting glyphs
- _If any features have been set/updated, we always skip the "isTextSimple" shortcut_
- Asks the `_formatInUse` for any font axes when mapping characters in `_AnalyzeFontFallback`

**DxFontRenderData**
- Stores a map of font features (initialized to the [standard feature list])
- Stores a map of font axes
- Has methods to add font features/axes to the map or update existing ones
- Has methods to retrieve the font features/axes
- Sets the font axes in the `IDWriteTextFormat` when creating it

## Validation Steps Performed
It works!

[standard feature list]: https://github.com/fdwr/TextLayoutSampler/blob/ac5aef67d1cc0cb67c5e3be29b30bda5a90c3e2b/DrawableObject.ixx#L802

Specified in #10457
Related to #1790 
Closes #759
Closes #5828
@sharpjs
Copy link
Author

sharpjs commented Jul 23, 2021

Two thoughts: "Woo!" and "Hoo!". Thanks, Terminal developers! 🙇🏽

@DHowett
Copy link
Member

DHowett commented Jul 23, 2021

Two thoughts: "Woo!" and "Hoo!". Thanks, Terminal developers! 🙇🏽

@PankajBhojwani deserves most of the credit here. Thanks Pankaj! 😄

@ghost
Copy link

ghost commented Aug 31, 2021

🎉This issue was addressed in #10525, which has now been successfully released as Windows Terminal Preview v1.11.2421.0.:tada:

Handy links:

@AnrDaemon
Copy link

And how would we utilize it? No matter how hard I look, I can't see where I could select font variant. So far my only option is to install only variant I want to use.

@zadjii-msft
Copy link
Member

zadjii-msft commented Jan 31, 2023

EDIT WAIT I'm sorry, I misread this as "font weight" and not font width. Yikes.

I think you need to manually edit the json for that.
See: https://learn.microsoft.com/en-us/windows/terminal/customize-settings/profile-appearance#font-features

@AnrDaemon
Copy link

It is good I know the specs and details of the font I'm using. But it is all but making the life unnecessarily harder for general use, and any changes to the JSON will be destroyed on any UI changes.
There's no simple way to know what to enter in each block, unless you have a very specific tool to inspect the font you wish to use.

@LtqxWYEG
Copy link

LtqxWYEG commented May 5, 2024

Hi
Width is still not implemented and adding the axis code for that does not work:

{
    "cellHeight": "1.2",
    "face": "Iosevka Custom Mono",
    "size": 13.0,
    "weight": "semi-bold",
    "axis": {
        "wdth": 658
    }
}

That should be correct. I've red through some more of the microsoft docs regarding axis's, and the value 658 is exactly one of the width of the font. (Cause you can make the font yourself); I don't get an error but nothing changes. :(

Workaround, though:
Build another font that has only the width you want. (You can't just rename the .ttf. Rename all occurances inside the .toml.) :(
Fortunately, you can define such things with Iosevka. Make one with their customizer on their website, then delete a few lines in the .toml to only leave one width. If you also only leave one weight, building the font is pretty much instant! Experimenting with it to get the perfect width and weight takes no time! 👍
BTW, the shape = 658 value in the can be anything you want! However, 10 is not a valid number. will crush your dreams. (Must be a bug!) The value can be anything between 416 and 720, which is disappointing to say the least. (Presumably, the same goes for weight.) 👎

kind regards :)

@AnrDaemon
Copy link

Why this issue was closed, pretty please?

@LtqxWYEG
Copy link

LtqxWYEG commented May 5, 2024

Aparently because of a dev misreading the point of this issue, and fixing "it". #10525

But now we have weight adjustment. One missing ;)

@DHowett
Copy link
Member

DHowett commented May 6, 2024

Width is still not implemented and adding the axis code for that does not work:

{
    "cellHeight": "1.2",
    "face": "Iosevka Custom Mono",
    "size": 13.0,
    "weight": "semi-bold",
    "axis": {
        "wdth": 658
    }
}

That should be correct. I've red through some more of the microsoft docs regarding axis's, and the value 658 is exactly one of the width of the font. (Cause you can make the font yourself); I don't get an error but nothing changes. :(

Aparently because of a dev misreading the point of this issue, and fixing "it"

You spelled axes wrong.

That does not indicate that my engineers "misread[...] the point of this issue".

If you spell it right, it works fine. Here's Bahnschrift:

wdth 100:

Image

wdth 30

Image

Do note the e in axes.

@LtqxWYEG
Copy link

LtqxWYEG commented May 8, 2024

Ffffssssffs? They wrote evrywhere "Axis". That must have blinded me to "axes". I mean, what do you need multiple axes for? You can't realistically dual-wield them. One's enough.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants