ryanoasis / nerd-fonts

Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts: Hack, Source Code Pro, more. Glyph collections: Font Awesome, Material Design Icons, Octicons, & more
https://NerdFonts.com
Other
53.71k stars 3.62k forks source link

Line height went wrong after patching Comic Code #1165

Closed Mano-Liaoyan closed 1 year ago

Mano-Liaoyan commented 1 year ago

🗹 Requirements

🎯 Subject of the issue

Experienced behavior:

The line height is different after patching, but you can see longer characters display incorrectly

Expected behavior:

image

Example symbols:

image

🔧 Your Setup

★ Screenshots (Optional)

Finii commented 1 year ago

Sorry to hear of your problem.

Maybe https://github.com/ryanoasis/nerd-fonts/issues/850#issuecomment-1500428279 can help you?

Which version of the patcher did you use (Nerd Fonts version number but more importantly the additional version in parens)?

Maybe we should add a commandline option to select one of the three different heights...

Finii commented 1 year ago

Also compare

Mano-Liaoyan commented 1 year ago

Thank you for your kind reply Finii! I've followed the instruction for font-line, however, even if I tuned the percent value to 1, it also shifts down a bit and makes the whole format look so tight.

Looks good in fontforge

image

But not in terminal ezgif com-gif-maker

In Windows:

image

You can see the j and f are not shown correctly

I wonder if there are other solutions. Thx.

Btw, Nerd Fonts version: image

Finii commented 1 year ago

I have only the demo here... (also downloaded from myfonts)

image

The problem with this font is that it has 'contradicting' baseline to baseline distances encoded:

image

The problem is in these metrixes

[OS/2] TypoAscender:   800
[OS/2] TypoDescender: -200
[OS/2] WinAscent:      1136
[OS/2] WinDescent:     331
[hhea] Ascent:         1136
[hhea] Descent:       -331

[hhea] LineGap:        200
[OS/2] TypoLineGap:    200

When I patch I get this output:

image


Needed to help with one of my kids homework :grimacing: Let me examine your new comment...

Finii commented 1 year ago

Oh, you use v2.3.3 (3.5.1), but there is a bug exactly causing your problem that has been fixed with 3.5.7 see https://github.com/ryanoasis/nerd-fonts/issues/850#issuecomment-1431787822. Current is 3.6.1.

image

Mano-Liaoyan commented 1 year ago

Haha, have fun with your kids! It's not emergence here :) . I also get the warning that reminds the vertical metrics are not consistent,

image

However, when I used the linegap version, the warning disappear,

image

If you don't mind, I can send an email to you that contains the font files

Finii commented 1 year ago

This is the font-patcher version I use:

image

If you can update to at least 3.5.7 you should be able to patch yourself. If not, feel free to mail me the file(s) and I can patch them for you with v2.3.3 style or v3.0.0 ;-D (Please specify which options you need, probably -wc.)

Finii commented 1 year ago

Btw, if you patch more than one font (e.g. Medium and Bold or Medium and Medium-Italic, or even more) you should add --makegroups to avoid the broken old naming scheme.

Edit: Well, in fact you should always add that

Finii commented 1 year ago

You seem to not-use the docker image. Probably you use the zip file. The up-to-date master zip is not on the Release page but here https://github.com/ryanoasis/nerd-fonts/blob/master/FontPatcher.zip

Mano-Liaoyan commented 1 year ago

You seem to not-use the docker image. Probably you use the zip file. The up-to-date master zip is not on the Release page but here https://github.com/ryanoasis/nerd-fonts/blob/master/FontPatcher.zip

Great! I have all the work done! Thanks a lot for your generous help!

image

All the icons are presented and fonts are correctly displayed! To you with all my sincere respect! Have a great day!

remiconnesson commented 1 year ago

@Mano-Liaoyan I have the same issue and I'm failing to understand how you've set the correct line height

image

This is using the latest version of font-patcher

(it results in too much space between lines)

image

edit: I just saw you're using 2.3.3

edit2: I tried with but also got an error :

image

this time it looks like the lines are too thin compared to the size of the characters

image
Mano-Liaoyan commented 11 months ago

@remiconnesson Apologized for letting you wait for sooo long. I have not noticed this reply at all QAQ.

It seems that your command is different from mine.

image

Maby you can try the script above?

fontforge font-patcher -wc --makegroups *.otf
Finii commented 11 months ago

@remiconnesson

Ah I see from the WARNING that there might be a problem with the metrics source in your case. The PR

would enable you to patch the height as you want. Not sure why I did not pull that yet :thinking:

Finii commented 11 months ago

Because the line height is not consistent in that ComicCode it depends on your platform which line height is displayed for the unpatched font. Nerd Fonts unifies the line height (it can not possibly work if the line height is unknown or can vary platform to platform), so it has to choose one.

Please ping me if #1300 is not pulled soon ;-) I might forget it.

Also if you specify --debug 2 on your runs I will possibly more debug infos in your screenshots to work with.

github-actions[bot] commented 5 months ago

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.