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

Glyphs from U+f900 to U+fad9 have wrong extra space in certain condition when we use colors #13328

Closed
ahmedwelhakim opened this issue Jun 19, 2022 · 4 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Resolution-External For issues that are outside this codebase

Comments

@ahmedwelhakim
Copy link

ahmedwelhakim commented Jun 19, 2022

Windows Terminal version

1.13.11432.0

Windows build number

10.0.22000.0

Other Software

No response

Steps to reproduce

First we need to install Nerd Font, (I tesed with FantasqueSansMono NF, and CaskaydiaCove NF)

After installing it and use the font in the Windows Terminal, then we can print any glyphs that there hex range from U+f900 to U+fad9 with any color and Then putting any character next to it BUT with different color.
The script code for that is very simple:

Method 1 using ANSI escape sequence color

$col = 15
for ($i = 0xf900-$col*3; $i -lt 0xfaff+$col*3; $i+=$j) {
    for($j = 0; $j - lt $col; $j++){
        Write-Host("{0}`e[38;2;0;255;10m{1}`e[0m{2}{3:x}   "  -f "[",[char]($i+$j), "]",($i+$j)) -NoNewLine 
    }
    Write-Host('')
}

OR

Method 2 using -ForegroundColor parameter

$col = 15
for ($i = 0xf900-$col*3; $i -lt 0xfaff+$col*3; $i+=$j) {
    for($j = 0;$j -lt $col ;$j++){
        Write-Host("{0}{1}" -f '(',[char]($i+$j)) -NoNewLine -ForegroundColor Red 
        Write-Host("{0}{1:x}  " -f ')', ($i + $j) ) -NoNewLine -ForegroundColor Green
    }
    Write-Host('')
}

Method 3 which is behaving half correctly but in certain condition

when we don't change the color and we must continue with the same color IF WE CHANGE IT the first character after changing the color will be spaced

$col = 15
for ($i = 0xf900-$col*3; $i -lt 0xfaff+$col*3; $i+=$j) {
    for($j = 0;$j -lt $col ;$j++){
        Write-Host("{0}`e[38;2;0;255;10m{1}{2}{3:x}   "  -f "[",[char]($i+$j), "]",($i+$j)) -NoNewLine 
    }
    Write-Host('')
}

Expected Behavior

Method 3 output :

method 3

Here as we can see when we don't change the color after the glyph so there is no space, and that should be the normal case even when we change the color.

BUT

if I change the color of hex there will be an extra space but before the hex not the square bracket as the square bracket with the same color of glyph as in the screen shots in the actual behavior down.

Actual Behavior

Method 1 Output

case1 method1

We can see here there is space after every glyph in first color transition.

Method 2 Output as above but with using -Foreground parameter.

case1 method2

shifting the space location by using same color of glyph then change it

case3

We can notice that the glyph is green colored and "]" is also green so no space between them when we change the color the space became before the changed text color

Here is another proof that it depends on changing the color

case 3 wrong

There should be no space between hex and "dummy"

@ahmedwelhakim ahmedwelhakim added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Jun 19, 2022
@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 Jun 19, 2022
@j4james
Copy link
Collaborator

j4james commented Jun 20, 2022

I haven't looked at your code in detail, so I'm not sure why you're seeing different results based on the color usage, but either way I wouldn't expect that glyph range to work in Nerd Fonts. Those positions are reserved for CJK Compatibility Ideographs and shouldn't have been used by them. This is a know issue, and is apparently planned to be fixed in version 3.0.

Some relevant links:

@DHowett
Copy link
Member

DHowett commented Jun 20, 2022

Thanks for the quick triage, James!

@DHowett DHowett closed this as completed Jun 20, 2022
@DHowett
Copy link
Member

DHowett commented Jun 20, 2022

/dup ryanoasis/nerd-fonts#637

@ghost
Copy link

ghost commented Jun 20, 2022

Hi! We've identified this issue as a duplicate of one that exists on somebody else's Issue Tracker. Please make sure you subscribe to the referenced external issue for future updates. Thanks for your report!

@ghost ghost added Resolution-External For issues that are outside this codebase and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Resolution-External For issues that are outside this codebase
Projects
None yet
Development

No branches or pull requests

3 participants