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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical color bleed for some fonts #72

Closed
rivy opened this issue Aug 27, 2019 · 4 comments
Closed

Vertical color bleed for some fonts #72

rivy opened this issue Aug 27, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@rivy
Copy link
Contributor

rivy commented Aug 27, 2019

馃帀馃

... a fun utility, thanks for the creative excellence!

Discussion

For some fonts, notably many of the "nerd fonts", the block characters used as "pixels" are not the pixel-perfect character width. So, for characters which are a mixture of colors, some color bleed can occur. This is most noticeable between the solid color swatch and the surrounding checkerboard. It's quite variable in appearance. Depending on the color selections, it can be unnoticeable or quite distracting.

pastel-color-bleed

Modifying the color swatch size to be offset from the checkerboard by a factor of two from the top and bottom of the checkerboard avoids this bleed effect. Since the swatch is centered on the checkerboard, its total size difference from the checkerboard size must be a factor of four (eg, 0, 4, 8, ...) to avoid the bleed effect.

I've done this in rivy@ee26fd6, but I'm hesitant to submit a PR because it changes the aesthetics of your output.

pastel-color-bleed-fixed

Alternatively, I could look at adding in some configuration option(s) which set the size of the checkerboard/swatch.

Any thoughts?

@sharkdp
Copy link
Owner

sharkdp commented Aug 27, 2019

Thank you for the feedback and the excellent bug report.

For some fonts, notably many of the "nerd fonts", the block characters used as "pixels" are not the pixel-perfect character width.

Ah :-/ that is unfortunate...

I've done this in rivy@ee26fd6, but I'm hesitant to submit a PR because it changes the aesthetics of your output.

Hm.. I think I like the original version better, but your proposal would have the added advantage that we also save on overall vertical screen space (horizontal too, but vertical is more valuable here). That allows us to see more color swatches on a single screen (coming to think of it, we should probably also print just a single empty line between two swatches).

All of this is to say: I think I'd be okay with your change! 馃槃
Thank you for looking into this.

@rivy
Copy link
Contributor Author

rivy commented Aug 28, 2019

Ok, I've put a little more work into it (see https://github.com/rivy/rust.pastel/tree/wa.color-bleed).
I'll put together a PR tomorrow.

@rivy
Copy link
Contributor Author

rivy commented Aug 28, 2019

Uploaded, see #75.

@sharkdp sharkdp added the enhancement New feature or request label Aug 29, 2019
@sharkdp
Copy link
Owner

sharkdp commented Sep 4, 2019

closed via #75

@sharkdp sharkdp closed this as completed Sep 4, 2019
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