Nerd-fonts: Various fonts (including: Hurmit) glyphs offset/wrong size

Created on 17 Mar 2017  ยท  32Comments  ยท  Source: ryanoasis/nerd-fonts

Subject of the issue

Text and glyphs at 14pt:
screen shot 2017-03-17 at 10 09 30

text at 14pt, glyphs at 18pt:
screen shot 2017-03-17 at 10 10 28

The glyphs seem to be either shifted on x and y axis, or just their size doesn't match text, or even both.

Your Setup

OSX, iTerm2, tmux.

โœŽ in progress ...

All 32 comments

To clarify this issue isn't present in single-width version of the font.

That's troubling ๐Ÿ˜Ÿ but thanks for the report

@sharkusk did a lot of great work fixing issues (in particular the mono issues) :smile: but I think we can carry over some of his logic to apply to _both_ mono and non-mono versions of fonts, in particular to:

  1. vertical center the glyphs
  2. stretch the powerline glyphs

I am pretty confident we want to do #1 but not sure on doing #2

Here are some screenshots with my tweaks to the patcher:

selection_013

this is with #1 change applied:
selection_014

these are with #1 and #2 change applied:
selection_015

selection_016

More info:

The above was the light version. Below is a shot of the medium which has slightly different offset:

screen shot 2017-03-21 at 10 52 55

@Cpt0r Thanks, I will test that version too

This is working well so far but I have some more tweaking for the powerline glyphs to do.

Here is a before and after for Sauce Code Pro:

selection_017

I noticed even in the fixed version there's more bottom edge space than top - is this intentional or are they not centered/using maximum available space?

I know nothing about fonts so this may very well be A Good Thing/The Right Way (tm).

Not sure on that. I'll have to check in more detail. Thanks

Where could I try the font-patcher with the latest fixes/tries? I didn't find any branch/commit with that :(

@ddnexus No branch yet. I'll try to create one this weekend or if not at least a gist diff

Thank you Ryan! A gist would be great too! Looking forward to try it soon. Thanks.

Didn't get around to it today. Maybe tomorrow

Thank you Ryan.
Maybe a simple gist with the whole font-patcher file would be an easier option for you? Just a copy &paste, but that would allow us to patch the fonts right away. I cannot wait to fix how my terminal looks :)

@ddnexus here you go: https://gist.github.com/ryanoasis/1b9a525aa3b5cad40c66d5e1d84c9b4d

very much a WIP (fixing a couple issues at the same time). If you manage to test it out let me know how it works for you...

I am considering also just getting a dev/next branch up that is up to date with WIP stuff... but not yet decided

Thanks @ryanoasis, this has been bugging me for a long time. The current patch, however, does not fix it for me.

Before patch:

beforepatch

After Patch:
(Deleted font, used git apply on the gist you just uploaded, ran ./install.sh, reloaded font)

afterdiff

I don't notice any major difference.

My system:
OSX: 10.12.4
iTerm: Build 3.0.15
using Oh-My Fish with agnoster theme
Font: 24pt Liberation Mono Powerline Nerd Font Complete

Thank you Ryan,
this WIP is aleady a huge improvement of the look of the fonts.

It looks like the Vertical and Horizontal centering is perfect for all glyphs, however the scaling still needs a few fixes: here is what I noticed till now, HTH you to continue with this great WIP:

  • Powerline Extra Symbols

    • Vertical scale is OK
    • Horizontal scale is WRONG. The x scale ratio should be the same as y, instead the glyphs are stretched/shortened to the single char width. That is OK for the mono (single width variant) but not OK for the regular variant
  • Seti-UI

    • The scale factor is huge! Especially compared to the Devicons. (E.g. compare the dimensions of the python logo in the 2 sets and you will have a huge scale ratio difference.)
  • Devicons

    • The scale factor is small Especially compared to the Seti-UI (E.g. compare the dimensions of the python logo in the 2 set and you will have a huge scale ratio difference.)

While maximizing the scale to the full line height of the source font does make the glyphs as visible as possible, it may make them look wrong when used with a line background as in a prompt.

The glyphs that have the vertical dimension >= than the horizontal dimension will extend to the full line-height, hence they will leave no space for the background above and below (graphically quite unpleasant).

The full line height is the correct size for the Powerline Extra Symbols (that have to play with the background), but for any other glyphs the scale factor should be calculated with a small percentage less than the available line height. Maybe the calculation (of all but powerline Extra Symbols) should be done on the global collection of glyphs instead of group by group?
A good test would be e.g. the python logo in the Seti-UI and Devicon, which should result in quite the same dimensions.

Thank you for the great improvements till now!

PS: A dev branch is certainly welcome, and may help eventual contributions. ;)

@matthew-groth: It doesn't look you patched the font using the new font-patcher. Did you re-patch the font?

Thanks @ddnexus you're right that I missed that step.

However, it still didn't work for me after running ./font-patcher "/Users/Matt/Library/Fonts/NerdFonts/Literation Mono Powerline Nerd Font Complete.ttf"

Here's the output from the font patcher.

There's still no difference between the font pre- and post-patch. The patched font had "Nerd Font" appended to the name in the following pics:

Pre-Patch
image
image

Post-Patch
image
image

By the way, the color changes are due to me changing my oh-my-fish theme to bobthefish.

Am I still missing a step?

It looks like you are patching an already patched font, missing a flag. You should patch the original not-yet-patched font, and use the -c flag.

@matthew-groth Did you re-clear font cache? @ddnexus might be right (try patching an un-yet patched font). Also I would remove whatever nerd fonts you have, clear cache, run patcher on unpatched font, close terminals and re-open. Might this is overkill but might be something missing in those steps


Looking at your output all I can think is "really need to fix that progress bar" :blush:

@ddnexus Thanks for the feedback on the WIP, I really appreciate it. I will try to reply to your comments sometime tomorrow.

For now I am working on some test scripts to help make testing easier, preview:

selection_031

Also I will push a dev branch up tomorrow

Still no luck ๐Ÿ˜•

Here's what I did:

  1. Deleted all my powerline fonts
  2. cleared font cache with sudo atsutil databases -remove
  3. ran ./font-patcher -c "/Users/Matt/Desktop/nerd-fonts/src/unpatched-fonts/LiberationMono/Literation Mono Powerline.ttf"
  4. copied /Users/Matt/Desktop/nerd-fonts/Literation Mono Powerline Nerd Font Complete.ttf to ~/Library/Fonts
  5. logged out and back in
  6. opened up iTerm and set font to LiberationMonoPowerLine Nerd Font
  7. restarted iTerm

image

I must still be forgetting something?

By the way the "progress bar" made pretty pattern on my terminal, so no worries.

It looks like you are using a Powerline patched font. Could you try to patch a normal font like Menlo?

And BTW... Literation or Liberation?

@ddnexus Just fixed one of the points you raised:

Horizontal scale is WRONG. The x scale ratio should be the same as y, instead the glyphs are stretched/shortened to the single char width. That is OK for the mono (single width variant) but not OK for the regular variant

You can see mono (left side) and non-mono (right side):

selection_032


The scale factor is huge! Especially compared to the Devicons. (E.g. compare the dimensions of the python logo in the 2 sets and you will have a huge scale ratio difference.)

From top to bottom: Mono, non-Mono (reduced size), non-Mono (original large size):
selection_034

That looks great! Thanks Ryan!

@ddnexus Sure thank you. There are still some spacing problems as you can see but I think we are moving in a good direction. Also this is being updated in the dev branch.

@ryanoasis not sure what the proper etiquette is for closed issues but here's a quick update.

Using latest dev [8ab0affbee9c61c38a455b0d9c51bf2c01cc93b5] things are looking much better ๐Ÿ‘. Except for two things which keep grating my eyes:

  • the left facing powerline separator < is offset to the right, while the right facing > is perfect
  • the git branch icon is offset to the right as well

screen shot 2017-04-28 at 10 56 18

screen shot 2017-04-28 at 10 55 52

@Cpt0r Thanks for the update ๐Ÿ‘ . I'll see what I can do... it's getting there

By the way master has all those fixes and tweaks that dev had now.

Probably going to abandon dev for simpler workflow

Actually yeah np on the etiquette. This was auto closed because of my commit message reference

Hi @ryanoasis another update against the latest master 39db2fb0c255c75e27de59a4ed8f211a867be59e.

Hurmit font:

  1. The powerline separators have regressed since last update:
    screen shot 2017-07-03 at 10 42 38

  2. I tried running the patcher myself against the Hermit and Input fonts but I get question mark boxes for all the icons - the Hurmit font in the repo is what I used above.

@Cpt0r I will test patching Hurmit on my end and get back to you. Thanks ๐Ÿ‘

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fornwall picture fornwall  ยท  5Comments

laughedelic picture laughedelic  ยท  5Comments

gitfool picture gitfool  ยท  3Comments

blueyed picture blueyed  ยท  6Comments

jinmel picture jinmel  ยท  6Comments