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

Misalignment of Powerline Glyphs for Code New Roman Font Family #296

Closed
icp1994 opened this issue Sep 30, 2018 · 15 comments
Closed

Misalignment of Powerline Glyphs for Code New Roman Font Family #296

icp1994 opened this issue Sep 30, 2018 · 15 comments

Comments

@icp1994
Copy link

icp1994 commented Sep 30, 2018

🗹 Requirements

  • 🗹 A brief but descriptive title of your issue
  • 🗹 I have searched the issues for my issue and found nothing related and/or helpful
  • 🗹 I have read or scanned the FAQ
  • 🗹 I have read or scanned the Wiki

🎯 Subject of the issue

I have tried both the variations - double-width and single-width - but the glyph in the prompt seems to be out of alignment (image below for reference) . I don't have the issue with other patched fonts like Fantasque Sans Mono or Mononoki etc. I have also tried two different emulators (termite and alacritty) just to be sure. I didn't manually patch any of the fonts, just curl-ed them from the repo.

🔧 Your Setup

  • Which font are you using (e.g. Anonymice Powerline Nerd Font Complete.ttf)? Code New Roman Nerd Font Complete.otf, Code New Roman Nerd Font Complete Mono.otf
  • Which terminal emulator are you using (e.g. iterm2, urxvt, gnome, konsole)? Termite, Alacritty
  • Are you using OS X, Linux or Windows? And which specific version or distribution? Arch

★ Optional

2cusjqe

@ylmrx
Copy link

ylmrx commented Nov 23, 2018

I'm having the same problem here. Sad, because it's the best looking font at most size (just my tastes).

  • term = tilix
  • os = linuxmint 19

@ryanoasis
Copy link
Owner

@icp1994 thanks for the report. Powerline characters are notorious for aligning

@KTibow
Copy link

KTibow commented Dec 11, 2021

Is this a dead repo? I'm experiencing the same thing 3 years later (Ubuntu, default terminal, Caskaydia Cove).

@Finii
Copy link
Collaborator

Finii commented Dec 11, 2021

@KTibow Well, this is fixed (at least for Caskaydia (*)) with #593. I guess it will be merged soon 😬, won't it @ryanoasis?

The change is very small; if you can self-patch, maybe that is an option. Otherwise if you are solely interested in a patched Cascadia Code, there is https://github.com/adam7/delugia-code (which uses Nerd Font's font-patcher with #593 applied).

(*) I do not mention Code New Roman in the PR, not sure it would fix that, it certainly looks similar, but maybe the metrics in the source font are not right.

@KTibow
Copy link

KTibow commented Dec 11, 2021

The original PL variant and Delugia seem to work better, other than one weird thing: The font size can create misalignment.
Here's what Delugia PL/Cascadia Code PL looks like at 12:
image
But at 10, I can see some misalignment (zoom in on the rounded corners):
image

(On Gnome Terminal on Ubuntu)

@Finii
Copy link
Collaborator

Finii commented Dec 11, 2021

Ubu, gnome terminal (i guess)
Will check that. Probably rounding error.

@ryanoasis
Copy link
Owner

Is this a dead repo?

No. Are you asking because of the number of unresolved issues?

I'm experiencing the same thing 3 years later (Ubuntu, default terminal, Caskaydia Cove).
@KTibow Well, this is fixed (at least for Caskaydia (*)) with #593

Yeah, I believe for at least Caskaydia this may/probably be fixed with you with the latest changes in master now.

I guess it will be merged soon grimacing, won't it @ryanoasis?

Merged!

(*) I do not mention Code New Roman in the PR, not sure it would fix that, it certainly looks similar, but maybe the metrics in the source font are not right.

Just tested this out and yeah it does not seem to make any improvement on that font in particular, as expected.

@KTibow
Copy link

KTibow commented Dec 11, 2021

I was just asking given the date the issue was opened. Anyway, it's fixed now (in cascadia code).

@ryanoasis
Copy link
Owner

@KTibow okay great, sure.

This issue should remain open unfortunately, as Code New Roman problem still exists.

@Finii
Copy link
Collaborator

Finii commented Dec 12, 2021

The fix just honors the 'we have correct metrics' flag that fonts can set.

Code New Roman does not set it:
image

So what we use is the guestimate mechanism. This needs some deeper dive into it. We could of course add an option to the config files, but that would not fix it for ad-hoc font-patcher use.

Need to punch in the numbers in a calculator and see why the guestimate is wrong.

@Finii
Copy link
Collaborator

Finii commented Dec 12, 2021

Patched font:
image

There is kind of a problem with the font - already in the sourcefont - that some letters are higher than the bounding box. Here in the example the Ü protrudes into the line above. The guesstimate accordingly centers the triangular stuff around that - too high - letters-space.

image

@Finii
Copy link
Collaborator

Finii commented Dec 12, 2021

Ah, font patcher has an option for these fonts:

image

It's all good if you specify -l:

parser.add_argument('-l', '--adjust-line-height', [...]
help='Whether to adjust line heights (attempt to center powerline separators more evenly)')

It forces the WIN values (1884, -514) into HHEA (1521, -572, gap 350) but leaves the TYPO untouched?
And removes the gap, of course....
image

There are several ways out of this... which need 'political' decisions :-D

@Finii
Copy link
Collaborator

Finii commented Dec 13, 2021

Maybe @ryanoasis can remember why this is not the default.

a610ef8 Adds flag for adjusting line height (not by default)

Other related commits are

Switches from hhea to win 😭:
fec7b20 Various improvements for mono-space generation

Sets hhea-gap to zero:
9770856 Zero out linegap values to allow power line glyphs to fill properly

Here is a list of all Code New Roman glyphs in the 'base range' that protrude out of the hhea/typo ascent-descent range.
They all protrude to the top (not bottom as assumed in 9770856).

I have no application that shows the original Code New Roman in a correct way (i.e. A-ring Åwithin the allotted space), is there an application on Windows that (still) uses win instead of typo values?

Name            bb ymin  bb ymax
--------------------------------
Oslash             -215    1522
napostrophe           0    1559
Amacron               0    1616
Emacron               0    1616
Imacron               0    1616
Omacron             -18    1616
Umacron             -18    1616
bar                -410    1638
brokenbar          -410    1638
Aacute                0    1659
Acircumflex           0    1659
Adieresis             0    1659
Agrave                0    1659
Cacute              -16    1659
Ccaron              -16    1659
Ccircumflex         -16    1659
Dcaron                0    1659
Eacute                0    1659
Ecaron                0    1659
Ecircumflex           0    1659
Edieresis             0    1659
Egrave                0    1659
Gcircumflex         -18    1659
Hcircumflex           0    1659
Iacute                0    1659
Icircumflex           0    1659
Idieresis             0    1659
Igrave                0    1659
Jcircumflex           0    1659
Lacute                0    1659
Nacute                0    1659
Ncaron                0    1659
Oacute              -18    1659
Ocircumflex         -18    1659
Odieresis           -18    1659
Ograve              -18    1659
Ohungarumlaut       -18    1659
Racute                0    1659
Rcaron                0    1659
Sacute              -18    1659
Scaron              -18    1659
Scircumflex         -18    1659
Tcaron                0    1659
Uacute              -18    1659
Ucircumflex         -18    1659
Udieresis           -18    1659
Ugrave              -18    1659
Uhungarumlaut       -18    1659
Wcircumflex           0    1659
Yacute                0    1659
Ycircumflex           0    1659
Ydieresis             0    1659
Zacute                0    1659
Zcaron                0    1659
Abreve                0    1665
Ebreve                0    1665
Gbreve              -18    1665
Ibreve                0    1665
Obreve              -18    1665
Ubreve              -18    1665
Atilde                0    1671
Itilde                0    1671
Ntilde                0    1671
Otilde              -18    1671
Utilde              -18    1671
Cdotaccent          -16    1679
Edotaccent            0    1679
Gdotaccent          -18    1679
Idotaccent            0    1679
Zdotaccent            0    1679
hcircumflex           0    1710
lacute               -6    1720
Aring                 0    1740
Uring               -18    1740

@Finii
Copy link
Collaborator

Finii commented Feb 4, 2023

Fixed via

(and some following fixups)

@Finii Finii closed this as completed Feb 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants