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

Cascadia Code arrow segments not displaying correctly #740

Open
riverar opened this issue May 8, 2024 · 6 comments
Open

Cascadia Code arrow segments not displaying correctly #740

riverar opened this issue May 8, 2024 · 6 comments

Comments

@riverar
Copy link

riverar commented May 8, 2024

Cascadia family version

2404.023

Cascadia family variant(s)

Cascadia Code (the version with ligatures)

Font file format(s)

Windows Terminal included version (TTF (variable))

Platform

Windows

Other Software

Microsoft Terminal 1.21.1272.0

What happened?

See also: microsoft/terminal#17217

Steps to reproduce

  1. Create a text file on your desktop with the following content:

    Howdy! 🤠
    
    =>
    
    ==>
    
    ===>
    
    ====>
    
    =====>
    
    ======>
    
    =======>
    
    ========>
    
    =========>
    
    ==========>
    
    ===========>
    
    ============>
    
    =============>
    
    ==============>
    
  2. Launch Terminal app

  3. Display content in Terminal (e.g., Get-Content test.txt)

  4. Observe arrow segments are not connected together cleanly

Expected Behavior

Arrows with cleanly connected segments (https://github.com/microsoft/cascadia-code/blob/main/images/arrow_support.png)

Actual Behavior

Arrows without cleanly joined segments at various font sizes, such as 26px, 28px, 50px, 84px, etc.

image

@aaronbell
Copy link
Collaborator

This is a rendering bug caused by the rasterization environment. Unfortunately I don't know if there's anything I can do to fix this in the font. @DHowett, the issue is similar to #350, if you have any ideas...

@Nahor
Copy link

Nahor commented May 16, 2024

The arrows are not the only ones.

See the oblique bar for the "Large Type N":
image

Or how the oblique bars join the verticals:
image

Or how "██████████" creates lines (but only when using cleartype antialiasing):
image

@PhMajerus
Copy link
Contributor

PhMajerus commented May 18, 2024

All of those issues are exactly at the cells boundaries.

I believe there is a problem with the way the Terminal renderer handles characters that at some scales do not fit a round number of pixels, so some alignent is snapped to the closest integer pixel while some is handled as subpixels/fractional, ending up with some space or overlap at the subpixel level, which shows as darker or brighter pixels where glyphs are supposed to join precisely.
The Cleartype problem is the same, as it effectively triples the horizontal resolution, again making the integer vs float alignments differ.

We have more details about this in discussions about the Terminal custom rendering of box drawing:
microsoft/terminal#16729 (comment)

I think the same problem is causing the multi-cells ligatures I tried to build for the large type pieces to drift slightly and not join properly the separate cells on other rows, as explained in #723 (comment)

@riverar
Copy link
Author

riverar commented May 18, 2024

@DHowett asserted this was a font issue, so it's not clear to me if Dustin has some information we're missing here.
microsoft/terminal#17217

@DHowett
Copy link
Member

DHowett commented May 18, 2024

It reproduces anywhere there are overlapping glyphs due to antialiased edges alpha-blending on the edges of shapes. It reproduces in Chromium (Skia?) in addition to Windows Terminal. It is somewhere in between a font and a renderer issue.

@Geobert
Copy link

Geobert commented Jul 4, 2024

Not only arrows but anything that joined
neovide_BwXxrWLWvN

Fira Code Nerd Font:
neovide_23jRrQj8H0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants