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

incorrect sexblitter rendering in alacritty #1099

Closed
joseluis opened this issue Nov 5, 2020 · 25 comments
Closed

incorrect sexblitter rendering in alacritty #1099

joseluis opened this issue Nov 5, 2020 · 25 comments
Assignees
Labels
nonfix closed without a successful fix (invalid, wontfix)
Milestone

Comments

@joseluis
Copy link
Collaborator

joseluis commented Nov 5, 2020

Taken after removing my alacritty configuration to make sure it was not caused by it.

using alacritty 0.5 (current stable) (looks distorted in a similar way as kitty 0.15):
alacritty 0 5 sexblitter

using alacritty 0.6-dev (latest from master):
alacritty 0 6 sexblitter

using xfce4-terminal 0.8.9.1 (looks the same with kitty 0.19.1):
xfce4-terminal 0 8 9 1 sexblitter

reference image:
pic

@dankamongmen dankamongmen self-assigned this Nov 5, 2020
@dankamongmen
Copy link
Owner

Thanks for the heads-up. So if I read this correctly, we're only talking the alacritty 0.6-pre, right? The 0.5 image looks pretty much correct to me.

If so, I'll go ahead and pull alacritty from head and see what's up. I've got a decent working relationship with some of the people on that team.

@joseluis
Copy link
Collaborator Author

joseluis commented Nov 5, 2020

The 0.5 image is bad too, (distorted in a similar way kitty 0.15 does as we discussed earlier). Sorry I didn't notice it doesn't show in the thumbnail, you have to take a look at the linked full sized version to appreciate it.

EDIT: having said that, yeah, I think time wil be better employed by focusing on the current 0.6-pre version

@dankamongmen
Copy link
Owner

OK. I've definitely noticed problems with sexblitter in alacritty, as well. I think it's not displaying the sextant glyphs correctly. Here's a screenshot of vim with blit.c open in alacritty 0.5. Note how, for instance, the quotation marks closing each EGC stomp atop the sextant glyphs' right hand side.

2020-11-05-141216_720x690_scrot

@dankamongmen
Copy link
Owner

I'm gonna file a bug against alacritty shortly. From a look into its source, they're doing something special for block characters like this, but I don't quite understand it, and don't have a ton of time to go rooting around in Other People's Source in the near future. Hopefully they can get this resolved.

@dankamongmen
Copy link
Owner

alacritty/alacritty#4409

@kchibisov
Copy link

@joseluis Could you bisect alacritty or a provide me a way to reproduce the change from 0.5.0 stable to 0.6.0-dev in alacritty? I'm not sure that we(alacritty) have changed anything that could affect that at all.

@joseluis
Copy link
Collaborator Author

@kchibisov I've been trying for the past hour to compile a version that replicates the old behaviour without success...

Either through cargo install alacritty, or from this commit from Aug 1st in master, or downloading the 0.5 release tar.gz, (both using the current rustc stable version, the minimum supported version of 1.41.0 and last nightly), but it makes no difference at all. They all look like this:

Kazam_screenshot_00000

Weirdly enough I still have the v0.5 alacritty binary that shows the sexblittered image like this (compiled months ago with cargo install I believe, since I renamed it alacritty-0.5 in my ~/cargo/bin/):

Kazam_screenshot_00001

I don't understand why this happens. Let me know if I can do anything more for you.

@kchibisov
Copy link

@joseluis I'd suggest you to bisect with just cargo run. if you'll be able to find the commit that change it, I'd be curios to look why it got changed, checking versions before v0.5.0 is also fine.

@joseluis
Copy link
Collaborator Author

joseluis commented Nov 12, 2020

checking versions before v0.5.0 is also fine.

@kchibisov Ok! I found the first bad commit at 0.4.1-dev.

alacritty/alacritty@88b4dbf

@kchibisov
Copy link

@joseluis that shouldn't matter, since this code only compiles on windows, try something before?

@joseluis
Copy link
Collaborator Author

Yeah... I was wondering why that commit was insustantial... I'm gonna repeat it this time running cargo clean before cargo run...

@joseluis
Copy link
Collaborator Author

@kchibisov It was the next commit, sorry, first time using bisect 😅

alacritty/alacritty@79b1917

now this makes more sense...

@kchibisov
Copy link

Could you tell me what to run to repro it?

@dankamongmen
Copy link
Owner

Could you tell me what to run to repro it?

if you mean what to run inside of such an alacritty, i would recommend notcurses-view -b sexblitter [someimage].

@kchibisov
Copy link

if you mean what to run inside of such an alacritty, i would recommend notcurses-view -b sexblitter [someimage].

thx, also link to that image could help, so I'll run the same thing.

@joseluis
Copy link
Collaborator Author

joseluis commented Nov 12, 2020

@kchibisov

Could you tell me what to run to repro it?

notcurses-view -b sexblitter ./test-pic.jpg

thx, also link to that image could help, so I'll run the same thing.

this is the original image:
https://user-images.githubusercontent.com/5832068/98237022-8b592d00-1f64-11eb-9822-57cfab4491d3.jpg

ideally it should look like this through the terminal:
https://user-images.githubusercontent.com/5832068/98237008-87c5a600-1f64-11eb-941d-694a616e795f.png

Finally, this is the script I made to recompile & install notcurses, from the parent directory, JIC:

#!/bin/sh
# dependencies for ubuntu:
# build-essential gcc libavcodec-dev libavformat-dev libswscale-dev libncurses-dev doctest-dev libunistring-dev libqrcodegen-dev cmake pandoc libclang-dev

# download repo
# git clone https://github.com/dankamongmen/notcurses/

# recompile

cd notcurses/

rm -rf build/
mkdir -p build
cd build/

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ ..

make -j6
#make test

echo -e "now please run:\ncd notcurses/build; sudo make install; cd -"

After that you'll be able to call notcurses-view

@dankamongmen
Copy link
Owner

dankamongmen commented Nov 12, 2020

build-essential gcc libavcodec-dev libavformat-dev libswscale-dev libncursesw5-dev doctest-dev libunistring-dev libqrcodegen-dev cmake pandoc libclang-dev

does your ubuntu really not have ncurses6? on debian i just use libncurses-dev:

Package: libncurses-dev
Version: 6.2+20200918-1

@joseluis
Copy link
Collaborator Author

does your ubuntu really not have ncurses6? on debian i just use libncurses-dev:

hmmm it's a transitional package in my case, so I'm also using v6... I'll update my dependencies list 😁

@kchibisov
Copy link

@joseluis I can't repro, however I don't know what glyph is being used for foreground, since all the glyphs for me are missing, and only background is rendered.

picture

When using small font sizes it looks like

picture

Maybe the font which is being used messes things up? Maybe glyphs are actually some weird emojis...

@joseluis
Copy link
Collaborator Author

joseluis commented Nov 12, 2020

@kchibisov This font has all the shapes https://www.babelstone.co.uk/Fonts/Shapes.html (ttf)

@kchibisov
Copy link

Ok, it seems like the font you've linked has colored tables, thus freetype identifies it as colored font, so alacritty uses different code patch in font loading library for colored glyphs and sets size setting for colored glyphs with freetype completely differs from normal characters, so that's why normal characters, which this font actually has for whatever reason, fail to render at all, since the size setting for them doesn't work (you can't even mix/match them...).

So you can close this bug and I'll open one on alacritty's font library tracker.

@kchibisov
Copy link

alacritty related bug alacritty/crossfont#17

@kchibisov
Copy link

In general if you want to work around this issue in your setup, I'd suggest to use font that doesn't mix colored and normal glyphs for now...

@dankamongmen
Copy link
Owner

FWIW, I do not believe that I am using said font. I'll look into mine (I'm not even sure exactly how fallback works, so I need educate myself on that), where I'm also seeing issues (distinct from and rather less catastrophic than those of @joseluis ).

@dankamongmen dankamongmen added the nonfix closed without a successful fix (invalid, wontfix) label Nov 12, 2020
@dankamongmen dankamongmen added this to the 2.1.0 milestone Nov 12, 2020
@dankamongmen
Copy link
Owner

As noted by @kchibisov , it looks like this is a problem in the dreaded font stack, and out of our hands. Closing as NONFIX. Truly, font madness will be the end of me. Thanks for doing the hard work, @joseluis and @kchibisov !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nonfix closed without a successful fix (invalid, wontfix)
Projects
None yet
Development

No branches or pull requests

3 participants