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

Epic: Add configuration options for font rendering things (fallback, line height, ligatures, ...) #1790

Open
9 of 10 tasks
be5invis opened this issue Jul 3, 2019 · 12 comments
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Milestone

Comments

@be5invis
Copy link

be5invis commented Jul 3, 2019

Tasks

  1. Area-Rendering Help Wanted Issue-Task Priority-3 Product-Terminal Resolution-Fix-Committed
  2. Area-Fonts Area-Settings Help Wanted In-PR Issue-Task Needs-Tag-Fix Product-Terminal
  3. Area-Rendering Area-Settings Help Wanted Issue-Task Priority-3 Product-Terminal Resolution-Fix-Committed
  4. Area-Rendering Help Wanted Issue-Task Product-Terminal
  5. Area-Rendering Area-Settings Help Wanted In-PR Issue-Task Needs-Tag-Fix Product-Terminal
    lhecker
  6. Area-Rendering Area-Settings Help Wanted In-PR Issue-Task Needs-Tag-Fix Priority-3 Product-Terminal
  7. Area-Rendering Area-Settings Issue-Task Product-Terminal Resolution-Fix-Committed
  8. Area-Settings Area-TerminalControl Issue-Task Product-Terminal Resolution-Fix-Committed
  9. Area-Settings Issue-Task Needs-Tag-Fix Product-Terminal
  10. Area-Fonts Issue-Task Needs-Triage Priority-3 Product-Terminal Resolution-By-Design Resolution-External

consider (backlog)

original content

This is a summary from #714 #455

  • To properly handle box drawing characters we may need ability to explicitly set line height in pixels (to avoid rounding error). We may also need baseline position settings to avoid clipping.
  • For the arrow issue, we may need the ability to support specifying a fallback sequence of fonts rather than a master font, pretty like how CSS works.
    • We may also need some method to allow WT to change how it measure characters in a fallen font?
  • Option for antialiasing modes — at least for the case that the console's background isn’t transparent.
@be5invis be5invis added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jul 3, 2019
@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 Jul 3, 2019
@zadjii-msft zadjii-msft added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Product-Terminal The new Windows Terminal. labels Jul 3, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jul 3, 2019
@DHowett-MSFT
Copy link
Contributor

Should we should move these things into #759 and make that the master issue for font rendering options? @miniksa.

@DHowett-MSFT
Copy link
Contributor

Congrats, this is now the epic for font rendering settings.

@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jul 8, 2019
@DHowett-MSFT DHowett-MSFT changed the title Give the ability to explicitly set line height, baseline position and font fallback sequence Epic: Add configuration options for font rendering things (fallback, line height, ligatures, ...) Jul 8, 2019
@be5invis
Copy link
Author

be5invis commented Aug 2, 2019

I think one more interesting thing is to redefine certain characters' "width", in both rendering and cell allocation. For example, if someone is working frequently with Japanese applications, they may want box-drawing characters to become full-width.

@obskyr
Copy link

obskyr commented Sep 20, 2019

Eagerly awaiting this in general, but perhaps especially for disabling ligatures and changing line heights.

Source Code Pro

Lucida Sans Console

@musm
Copy link

musm commented Oct 26, 2019

I agree this would be "epic"

@mdtauk
Copy link

mdtauk commented Nov 11, 2019

Colour vs Monocoloured Emoji's would be a good option to include too

@mdtauk
Copy link

mdtauk commented May 20, 2020

Could this be a good away to handle the Block Drawing characters? Enable Terminal to override the font characters, so even with increased line spacing, the various shapes and lines will still connect horizontally, vertically, and diagonally. #5897 #5743 #455

@DHowett
Copy link
Member

DHowett commented May 20, 2020

@mdtauk #5897 is a better place to discuss that.

@mdtauk
Copy link

mdtauk commented May 20, 2020

@mdtauk #5897 is a better place to discuss that.

Sure to discuss the implementation, but I meant would the font section of the settings be the best place to handle allowing an override option?

@waf
Copy link
Contributor

waf commented Nov 4, 2020

I suspect the "font fallback" task may become more highly requested when oh-my-posh v3 is released (it's currently in beta). It defaults to using characters that aren't in Cascadia Code, so without font fallback many people will have to switch to one of:

  • Meslo, as recommended by the oh-my-posh project
  • Caskaydia Cove, the nerd-font patched version of Cascadia Code

Another alternative is adding the missing characters directly to Cascadia Code, which would sidestep the font fallback. @aaronbell was trying to get approval for that in microsoft/cascadia-code#210 (comment)

@rbeesley
Copy link
Contributor

rbeesley commented Mar 26, 2021

I'd really like to see the option of handling 1m and 2m attributes as bold/light font weights and/or brighten/diminish intensity. Looking across the landscape of terminal programs for different platforms, bold/intensify is implemented differently, sometimes as font weight, sometimes as intensify, using brblack instead of black for instance, and sometimes both.

With the implementation of 2m/dimming it applies across all terminal colors. Obviously if the terminal color is already floored, like black #000, then it can't go lower, but brblack doesn't render the same as black. With 1m/bold/intensify, it doesn't try to brighten 30m-37m, but instead the range just shifts up to 90m-97m and 90m-97m remain the same. In this case black becomes brblack. This means that while 1m and 2m are somewhat complimentary, they aren't in their current implementations.

Font weight would be a good solution which gives the attributes meaning across the entire range of terminal colors. Likewise an intensity attribute implemented in a similar way to diminish would also give value across the full range. I think maintaining a compatibility mode would be appropriate, but for modern terminals with a palette of more than 16 colors, these changes would benefit the user. If using a Solarized theme for instance, 1;31m wouldn't be expected to be orange, it should be a bold/intensified red. It almost certainly shouldn't shift into different hues as some of the base* colors might with the current implementation, green for instance.

Edit: Looking at the links zadjii-msft added below, I'm not sure I'm contributing further to the discussion. I had already left some comments in those threads and someone else called out the problem with Solarized. Leaving this comment here as it is still relevant, but I'll redirect my efforts to one of these other issues as appropriate.

@zadjii-msft
Copy link
Member

@rbeesley FYI #109 has a much longer and specific discussion of 1m than this thread - it's dedicated to just the "bold text" discussion.

actually, after looking through #6879, the discussions are in:
#109, #5682, #6703 / #6873, #2916 (comment)

DHowett pushed a commit that referenced this issue Jul 1, 2021
Introduces `FontConfig`, an object that isolates font-related settings
in our profiles

Users can now define font settings in their json as so:
```
"font":{
    "face": "Consolas",
    "size": 12
}
```

Backwards compatible with the currently expected way of defining font
settings in the json, note however that upon hitting 'Save' in the SUI,
these settings **will be rewritten to the font-object style in the json
(as above)**. 

## Validation Steps Performed
Existing functionality works, new functionality works

References #1790 
Closes #6049
ghost pushed a commit that referenced this issue Jul 9, 2021
Add a spec for how we could allow users to define font features and axes of variation.

References #1790
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
@zadjii-msft zadjii-msft modified the milestones: Terminal Backlog, Backlog Jan 4, 2022
DHowett added a commit that referenced this issue Mar 15, 2024
This pull request introduces support for disabling full-color emoji (and
technically other COLR-related font features!)

Full-color emoji don't respond to SGR colors, intensity, faint or blink.
Some users also just prefer the line art ones.

Related to #15979
Refs #1790
Closes #956
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

9 participants