D3665: graph: improve graph output by using Unicode characters

johnstiles (John Stiles) phabricator at mercurial-scm.org
Thu Jun 14 20:10:43 EDT 2018


johnstiles added a comment.


  It all depends on your terminal font. It looks like the font you're using now has issues with U+2506 ┆ and is otherwise working as expected.
  
  Most likely it is rendering ┆ as full-width instead of narrow-width. I'm almost positive this issue is fixable if you are willing to experiment with a different font or Terminal settings, because I've never seen that particular artifact. Usually it's been the circle glyphs that want to render over-wide. :)
  
  If you are willing to experiment with it, there are a bunch of very similar glyphs that we could swap out and use instead if you think it would help the general case. (https://unicode-search.net/unicode-namesearch.pl?term=DASH) I'm certainly willing to explore it, but it would help to know a little more detail about your current setup (Terminal? Font? OS?) to see if I can repro the issue locally and see whether this would actually be widespread.
  
  Broader picture: on the whole I think we can pick a really good starting point that works for the vast majority of users' setups, but we are unlikely to land on a 100% solution for all fonts and terminals. Some fonts just look bad or won't align perfectly. Some layouts will still have little gaps in them where Unicode doesn't provide the box characters we need for a perfect layout. On the other hand, the existing ASCII mode looks unaligned and goofy on all machines all of the time, so having an optional mode that looks better for most users is still a step in the right direction :)
  
  Additional thoughts: I would love to add features to this patch, such as glyph customizability or even color coding. I can certainly get it done in a followup. On the other hand, I don't want to sink tons of free time into the process it if I can't get this simple version through review. This is a spare-time project for me and I don't need to add flexibility options if it's only ever going to exist on my PC. I'd like to at least get a foothold in, then work on improvements once this has landed, instead of working for weeks just to risk having the feature rejected at the end of the process and having nothing to show for it.
  
  In https://phab.mercurial-scm.org/D3665#58616, @smf wrote:
  
  > johnstiles (John Stiles) <phabricator at mercurial-scm.org> writes:
  >
  > > johnstiles added a comment.
  > > 
  > >   Hi there @indygreg and @yuja  -- are you happy with the diff as it currently stands? Do you think this needs any additional work?
  >
  > Sorry for the late reply; was having email filtering issues (hopefully
  >  fixed now).
  >
  > Overall, I'm +0 on it because I think the "real" solution to this is to
  >  templatize the graph glpyhs so any user could use whatever unicode they
  >  desire. However, that's a tall order I wouldn't put on you so I'm fine
  >  with putting this in and adding a note along the lines of, "the path to
  >  get this in core is to get the graph log templated."
  >
  > The only hiccup I keep having is the misalignment of graphs like these:
  >
  > Do you think there's any way to fix those? I suspect the answer is "no"
  >  unless someone wants to write their own font?
  >
  > - F102394: signature.asc <https://phab.mercurial-scm.org/F102394>
  >
  >   F102393: Screen Shot 2018-06-14 at 4.01.03 PM.png <https://phab.mercurial-scm.org/F102393>
  >
  >   F102392: Screen Shot 2018-06-14 at 4.01.17 PM.png <https://phab.mercurial-scm.org/F102392>
  >
  >   F102391: Screen Shot 2018-06-14 at 4.01.25 PM.png <https://phab.mercurial-scm.org/F102391>
  >
  >   F102390: Screen Shot 2018-06-14 at 4.00.57 PM.png <https://phab.mercurial-scm.org/F102390>
  >
  >   F102389: Screen Shot 2018-06-14 at 4.00.50 PM.png <https://phab.mercurial-scm.org/F102389>

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3665

To: johnstiles, #hg-reviewers, spectral
Cc: spectral, indygreg, smf, yuja, mercurial-devel


More information about the Mercurial-devel mailing list