adam7 / delugia-code

Can we add Nerd Fonts to Cascadia Code Font using a GitHub Action
MIT License
571 stars 33 forks source link

Correct vertical alignment of added glyphs #55

Closed Finii closed 3 years ago

Finii commented 3 years ago

[why] Added symbol glyphs like the Ubuntu logo 0xF31B appear too high. At least they are not centered around the visual font center given by square brackets, less then, minus, _and the powerline triangles (0xE0B0).

[how] The font-patcher script takes the 'Win Ascent' and 'Win Descent' values to determine the visual height of the font (the space in which new glyphs are centered).

For some reason (most probably the oversized overlapping box drawing glyphs like unicode 0x2563) the 'Windows' values in Cascadia are far greater than the HHead and Typo Metrics values.

Patch font-patcher to use the Typo Metrics values instead for a more pleasing look.

Fixes: #53 Reported-by: Charles Roper charles@roper.im Signed-off-by: Fini Jastrow ulf.fini.jastrow@desy.de

Finii commented 3 years ago

Here a visual how the Complete font looks like: image

And the Book with double-width chars: image

Glyphs: [ a F1D3 [ F31B < X 23FC F31C F314 - a ] 2563

Please have a look, esp on Windows ;)

Finii commented 3 years ago

This is a (possible) fix for #53 This possibly replaces #54

Vovcharaa commented 3 years ago

On Windows it definitely fixed my problem image image image

Finii commented 3 years ago

After a lot of work I came up with this issue https://github.com/ryanoasis/nerd-fonts/issues/592 and this PR https://github.com/ryanoasis/nerd-fonts/pull/593.

Having seen this patch being applied to a number of fonts successfully confirms for me it is the correct way to handle #53.

I will merge.

Mellbourn commented 3 years ago

Book looks great now, definitely well centered! ~Was Complete changed too, or just Book?~ Nevermind, I see now that Complete was centered too (but with small Icons).

Thanks for your awesome work!

Finii commented 3 years ago

This works for all fonts faces, even for the all other fonts over there at Nerd-Fonts, after they pulled my PR. Some of them there look really ugly without this fix.