Hyper: Incorrect Cursor Location When Using Avenir Font Family

Created on 5 Apr 2018  路  4Comments  路  Source: vercel/hyper

  • [x] I am on the latest Hyper.app version
  • [x] I have searched the issues of this repo and believe that this is not a duplicate

Issue

Hello There,
I am trying to use Avenir Next font which is already included in macOS. But actual position of mouse cursor and the cursor position showed on screen differs. There's large gap between typed letters and cursor. When I use default fonts provided in hyper.js, it works fine ( e.g., Menlo, monospace etc ). But when I add existing font family "Avenir Next" in hyper.js, this issue occurs. If anyone could help to fix this issue. It would be helpful.
Thank You.
problem in cursor position

All 4 comments

Duplicate of #2525

Avenir Next is not a monospace font and shouldn't be used inside your terminal,

https://github.com/zeit/hyper/issues/2525#issuecomment-349736985

The reason why terminals and editors use monospaced font is so that the code will line up, if you have 1.5x chars, it will shift that row by 0.5x char widths, which will make two lines that have the same amount of characters in them, not line up:

this line has 23 chars.
this lime has 23 chars.

the line with m 1.5x spaced will render kinda like this:

this line has 23 chars.
this lim e has 23 chars.

So even if we supported it, it wouldn't make sense? 馃 Navigation up/down would be "skewed", pressing up would move the cursor .5 char widths to the left/right in this simple case

Thanks for the reply. It was really helpful. I didn't knew the technical details behind this. I'll try other good looking monospace fonts.

No problem, good luck ! 馃槉 You could try running our canary version (https://zeit.co/blog/canary), which has better support for fonts. (and tons of other fixes) soon to be released as stable.

Thanks. I will switch to Canary build. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rauchg picture rauchg  路  3Comments

anthonyettinger picture anthonyettinger  路  3Comments

eoinmurray picture eoinmurray  路  3Comments

yvan-sraka picture yvan-sraka  路  3Comments

laur1s picture laur1s  路  3Comments