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

Feature request: pixel grid aligned box drawing/braile characters #12

Closed
andis-sprinkis opened this issue Aug 29, 2021 · 9 comments
Closed
Labels
enhancement New feature or request

Comments

@andis-sprinkis
Copy link

andis-sprinkis commented Aug 29, 2021

It looks very nice when box drawing graphical characters get special treatment and are always drawn aligned to pixel grid (instead of using font default anti-aliased glyphs) - e.g. always having sharp text indentation lines without gaps (indentline.vim), or precise sharp corners for popup windows with outlines..

Patch that enables it on st:
https://st.suckless.org/patches/boxdraw/

Demontstrations (on top - st, on bottom - neoray):

  • VirtualBoxVM_Z4iSTp1B3f
  • VirtualBoxVM_8bRYTWdaZH
@hismailbulut
Copy link
Owner

This will be a good feature but I need to think and do some research on this. I don't promise that it will be added but I will work on this in my free time.

hismailbulut added a commit that referenced this issue Sep 14, 2021
Currently not draws every character but there are more than half glyphs of box drawing characters from 0x2500 to 0x257F
hismailbulut added a commit that referenced this issue Sep 14, 2021
hismailbulut added a commit that referenced this issue Sep 18, 2021
@hismailbulut
Copy link
Owner

Hi @andis-sprinkis I almost finished all of box drawing and block drawing characters but I used vector library to do that which is same with most of the fonts. This solves gap problem but doesn't solve antialiased smooth lines (which sometimes blurry) and I wanted to ask you which is better? Also who is watching this issue I want to know your ideas.

@andis-sprinkis
Copy link
Author

andis-sprinkis commented Jan 29, 2022

I do like that the characters are always connected, so I consider it a good improvement over default handling of those glyphs (of font I use - CascadiaCodePL).
Minor thing I keep noticing that radius on round corners chars seems to be off, somewhat stretched (see fzf prompt corners).

Not a fan of antialiasing being applied to rectangular chars as it makes them blurry. I personally prefer the sharp bitmap drawing of these characters on standard DPI.

Looks better than what I get in iterm2 or NeovimQt, but worse than the patched st.

explorer_1jkL2mvCB1
(Neoray with flag FALSE and TRUE)

@andis-sprinkis
Copy link
Author

andis-sprinkis commented Jan 29, 2022

Result now is tad closer to patched st boxdraw patch rendering, like how htop in terminal buffer looks now :)
VirtualBoxVM_QPd6KCUcfS
(st with boxdraw and Neoray with flag TRUE)

@hismailbulut
Copy link
Owner

Minor thing I keep noticing that radius on round corners chars seems to be off, somewhat stretched (see fzf prompt corners).

Yeah this is my mistake. It's easy to fix.

I like St's drawings but I need to solve a few problems to integrate it directly. The first problem is crosses and curves. I can make the curves by drawing two lines that do not meet in the center as in st, but vector drawing is necessary for the diagonal lines to look good. The second problem is the thickness of the lines. If I set the thin lines to be 1 pixel and the thick lines to be 2, the lines will be very small on high dpi screens (I haven't tested this). Also, since the thin line cannot be drawn in the middle of the thick line, it will still look bad. If I adjust the line thickness dynamically, this time it will be as if I drew vector graphics myself, which will be worse than what the library draws :) If we apply vector and pixel drawing together, the glyphs will not match each other this time. The best solution I've come up with so far is to ignore the thick lines and draw them all the same size. I actually made the current implementation to try it out. Also, I ask you, there is a file named boxdrawingchars.txt in the root folder of the project. I want you to take a screenshot for me by opening the part up to blocks with st in this file. The reason I'm asking you this is because I don't have a linux computer and can't use st. If you post these I can better understand how st draws. Thanks in advance.

@hismailbulut
Copy link
Owner

Sorry your last image actually shows how st draws. I think they are using 1 pixel for thick lines and 3 pixel for bold lines. And they doesn't draw cross lines with this feature. I think this is enough for me.

@andis-sprinkis
Copy link
Author

Well, I hope these are somewhat useful (output from st 8.2 with boxdraw patch):
VirtualBoxVM_W4sjPNN0BX
)
VirtualBoxVM_hs0IUw8A9m

@hismailbulut hismailbulut added the enhancement New feature or request label Jul 5, 2022
hismailbulut added a commit that referenced this issue Jul 16, 2022
New box glyphs added (doubles)
Now box drawing is pixelated instead of rasterization
Better underline and strikethrough
@hismailbulut
Copy link
Owner

I think this is fully implemented as requested.

@andis-sprinkis
Copy link
Author

Looks crisp and pleasant to look at 👍
VirtualBoxVM_G2OTAgsQaK

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

No branches or pull requests

2 participants