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

Block characters are too tall #449

Closed
SamusAranX opened this issue Jul 7, 2017 · 13 comments
Closed

Block characters are too tall #449

SamusAranX opened this issue Jul 7, 2017 · 13 comments
Labels
Milestone

Comments

@SamusAranX
Copy link

SamusAranX commented Jul 7, 2017

...at least in iTerm 2 and Terminal.app, which are the only ligature-supporting, frequently-used apps that I have.

Screenshot of iTerm 2 displaying a bunch of text, including a progress bar made of block characters
Another screenshot of iTerm 2, this time displaying all block characters in a row above a line of text that's being clipped by them

Fira Mono has the same problem, but this repo seems to be a little more active, so I'm opening the issue here.

@tonsky
Copy link
Owner

tonsky commented Jul 7, 2017

Thanks for reporting this! I’ll see what I can do. Wouldn’t they make vertical gaps if I make them shorter though?

@SamusAranX
Copy link
Author

SamusAranX commented Jul 7, 2017

If Apple's font designers don't have to worry about multiple lines of block chars having vertical gaps, you shouldn't have to, either.
Let's take a look at █ U+2588 FULL BLOCK, repeated a bunch of times with different Apple-made fonts:

Monaco, by Apple (ew gross)
blocks_monaco

Menlo, by Apple (thoroughly okay)
blocks_menlo

SF Mono, by Apple (still good, imho. also in active development, this is what it looks like in macOS 10.12.5)
blocks_sfmono

Fira Code (nice, but a bit too tall)
blocks_firacode

@jmcs
Copy link

jmcs commented Sep 27, 2017

I read FULL BLOCK as really being full vertical height (the keyword here being full). Apple Designers are not gods and their word is not gospel.

@ctongfei
Copy link

ctongfei commented Mar 3, 2018

Yes, this influences the visual effects of progressbars using unicode block symbols.

@YaLTeR
Copy link

YaLTeR commented Aug 7, 2019

The same can be seen on the vertical line . They are actually so tall they visibly overlap which doesn't look good. Look for the small bolder pieces where the stacked vertical lines join. Test file:

 ╭──
 │
 │
 │
 ╰──
     █
│││││││█
  UO █ 

Screenshots from otf-fira-code-git from commit 7a5965a:

  • pango-view:
    image
  • Alacritty:
    image
    image
  • Firefox Nightly:
    image
    image
  • gucharmap:
    image

When combined with full blocks to draw TUI the overlap is extremely noticable:
image
image
image
image

@tonsky
Copy link
Owner

tonsky commented Aug 9, 2019

Last time I looked into this it seemed different terminals/editors used different means to calculate font width. Also, some users (me included) intentionally increase line height for better readability. But I agree that overlapping lines look kind of ugly. Maybe it’s worth another look

@tonsky
Copy link
Owner

tonsky commented Aug 15, 2019

Interesting problem. So if I make box-drawing characters go up/down exactly to font metrics, it’s slightly not enough. I suspect that’s because editors have to round font metrics to non-fractional amount of pixels and that’s always slightly more than font metrics suggest.

This is Sublime Text 3 on macOS with Fira Code Retina 13px. Parens on the left were adjusted to not go outside font metrics. Parens on the right have previous behaviour (they overlap by quite a lot, and you can see it as @YaLTeR mentioned)

Screenshot 2019-08-15 at 15 52 11

Another issue is that e.g. VS Code computes font height differently for some reason:

Screenshot 2019-08-15 at 16 09 45

Same font, same size, but gaps are bigger!

So I’m afraid, sadly, there’s no right answer :( You either commit to gaps or have overlaps that render not that great at all.

@YaLTeR
Copy link

YaLTeR commented Aug 15, 2019

There's an argument to be made here that if the editors are rendering full blocks with gaps then it's an issue of the respective editors and should be fixed on that side. I personally think that characters out in TUIs is a worse issue (and in this case I'm afraid the font gets the blame because the characters are indeed too large).

Could you upload a test version with correct full blocks so I could check how it looks in my applications?

@tonsky tonsky added the metrics label Aug 19, 2019
@tonsky tonsky added this to the 1.208 milestone Aug 27, 2019
tonsky added a commit that referenced this issue Aug 29, 2019
…Box characters to not overflow line height #449
@tonsky
Copy link
Owner

tonsky commented Aug 29, 2019

@YaLTeR and everyone interested: please try those https://github.com/tonsky/FiraCode/tree/b32369cb03ad3c0fe43fd30fd19427169e9592dc/distr/otf

I removed the overlap on full blocks and the rest of Block elements since it’s often used in progress-bar etc. I left overlap in the Box Drawing block as those are rarely used on their own, I think it looks worse without the overlap and removing overlap would make text-based UIs look worse.

I slightly tuned UPM (2000->1950) so that Fira Code 13px would match pixel grid perfectly.

Let me know what you think.

Screenshot 2019-08-30 at 02 21 44

@YaLTeR
Copy link

YaLTeR commented Aug 29, 2019

It's nice to see perfect alignment on full blocks! 👍
image

However all of the TUI overlaps are still present because they are caused by the box drawing characters being too long. :/
image
image
image
image

@tonsky
Copy link
Owner

tonsky commented Aug 30, 2019

However all of the TUI overlaps are still present because they are caused by the box drawing characters being too long. :/

Yes but you are not supposed to use them like this are you? If you want to end the line midway there are glyphs for that too, e.g. https://unicode-table.com/en/2575/

@YaLTeR
Copy link

YaLTeR commented Aug 30, 2019

Hmm, maybe you're right. I can't find anything that says that these lines are intended to "connect" to full blocks without overlap. So my only remaining argument is the presence of those kind-of visible overlaps with other lines.

tonsky added a commit that referenced this issue Sep 9, 2019
@tonsky tonsky closed this as completed Sep 9, 2019
@blahgeek
Copy link

blahgeek commented Sep 15, 2019

Thanks for the good work. But in my personal opinion, the new | seems too tall in normal code. Now the || is way taller than &&, which seems inconsistent. Also, some related ligatures is inconsistent to this taller |, like |=

2019-09-15_11-24-04


EDIT: I'm talking about the ASCII symbol | (U+007C) instead of the BOX DRAWINGS LIGHT VERTICAL (U+2502). In v2.0, the | (U+007C) becomes taller, which I think is a mistake.

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

No branches or pull requests

6 participants