kaBeech / serious-shanns

A legible monospace font for playful professionals. Comic Sans for hackers
https://kabeech.github.io/serious-shanns/
Other
89 stars 1 forks source link

Italics font doens't work nicely in Kitty. #52

Open mcourteaux opened 2 weeks ago

mcourteaux commented 2 weeks ago

See https://github.com/kovidgoyal/kitty/issues/7824

image image

@kovidgoyal blaims the font.

I see you are also using Kitty, @kaBeech. You don't have this issue??

kaBeech commented 2 weeks ago

@mcourteaux Thank you for reporting this here!

I had noticed this and opened #41 (see also #40). However, the issues weren't appearing in other terminal emulators (see https://github.com/kaBeech/serious-shanns/issues/39#issuecomment-2317641897) and I didn't remember seeing them before I made a major workstation transition, so I figured it was something I did to mess up my Kitty config and closed them pending further investigation.

Kovid's usually right. Each style does have a consistent width (e.g. 506 for SeriousShanns Nerd Font Mono Italic), but the widths are not the same between styles (e.g. SeriousShanns Nerd Font Mono Regular has a width of 543). I imagine that when Kovid refers to "a decent monospaced font that has an italic face that has compatible metrics to its regular face," that means Kitty wants those widths to be the same.

Currently I've got some personal things to focus on for about 1-2 weeks, but I'll dig into this issue after that.

Addendum: looking again at Victor's screenshot linked above, it looks that's from VSC, not WezTerm/NeoVim as I had assumed. That being said, I don't see the issue in Konsole:

image

kaBeech commented 2 weeks ago

@mcourteaux While awaiting a full fix, this patch may help your immediate needs.

serious_sans_patch

It patches "SeriousShanns Nerd Font Mono", "SeriousShanns Nerd Font Mono It", and "SeriousShanns Nerd Font Mono Bd It". The regular "SeriousShanns Nerd Font Mono Bd" can be used as-is.

Please let me know how it works for you!

SeriousShannsPatch.zip

mcourteaux commented 2 weeks ago

Please let me know how it works for you!

I installed the patched fonts, and they do definitely look better:

image

But not at all sizes. Some sizes are perfect:

image

Some are still bad:

image (F is chopped of on the left)

image (Here, C and U seems chopped off to the right)

But as you can see, the bad is still A LOT better than the previous version. Thanks for this! This is already a lot more usable!

kaBeech commented 2 weeks ago

Excellent - thanks for the feedback! Expect a more polished fix in about 2 weeks :smile_cat:

kaBeech commented 4 days ago

@all-contributors please add @mcourteaux for bug reporting

allcontributors[bot] commented 4 days ago

@kaBeech

I've put up a pull request to add @mcourteaux! :tada:

kaBeech commented 4 days ago

@mcourteaux

Thanks for your patience here!

This looks like it fixes it for me:

serious-width

How does it look for you?

SeriousShanns.zip

mcourteaux commented 4 days ago

Now I have this:

image and image

Probably the font indeed doesn't cross the cell boundaries anywhere at this point anymore. However, it looks very s p a c e d, as a side-effect.

For reference, here is Recursive Mono Casual:

image and image

I'm no expert at all at this, but it seems that it is possible to create an italics font that accepted by Kitty, and is somehow not spaced.

Toggling back and forth between the two screenshots, it seems that Recursive Mono just makes "better use" of the horizontal space: the o, i, h, e, etc are all wider, and fill up the cell nicely.

I'm not sure if this is a technical problem with the font you create, or just a limitation of Kitty that makes it hard for you to make this particular font work nicely.

kaBeech commented 3 days ago

So I think the core issue is that Kitty doesn't support Italic font styles, only Oblique (which Recursive Mono Casual appears to be). This is probably why other programs like Konsole and Alacritty don't show this issue, but Kovid & Co. have compelling arguments for why they take this approach.

The proper fix here would be to make my Italic styles into Oblique styles. I'll look into this, but font design is hard and before digging deeper it's difficult to know how long this will take.

I'll post a version later today that works around this by making the Regular styles narrower than the Bold styles, but this is a hack and depending on your use case it might be better to use the old patch from above for now.

I'll keep you posted on the progress!

(Side note per this FAQ link, apparently Kitty doesn't like using patched Nerd Fonts. It seems like that would mean we are not to use Nerd Fonts at all, since the official Nerd Fonts are themselves other fonts run through a patcher - I can confirm that they do show a bunch of validation errors - but I'm not sure. In any case, Kitty includes the Nerd Font symbols itself, so according to Kovid we should use the non-Nerd Font version of Serious Shanns and Kitty will fill in the gaps automatically.)

kaBeech commented 3 days ago

I'll post a version later today that works around this by making the Regular styles narrower than the Bold styles, but this is a hack and depending on your use case it might be better to use the old patch from above for now.

Actually, playing with the widths today didn't prove very fruitful. I am archiving the italics-width-hack branch with the super-wide version until I make an Oblique version, in case it's helpful to anyone.

The patch for the Nerd Font Mono family that improves the issue but does not fix it is still available here. If anyone wants patches for the other families while waiting for the Oblique versions, let me know and I can make them!

kaBeech commented 3 days ago

First attempt at Oblique styles:

serious-oblique

Spacing needs some adjustment and it's maybe a little wider than I'd like, but overall not bad!

SeriousShannsOTF.zip SeriousShannsNerdFont.zip SeriousShannsNerdFontMono.zip SeriousShannsNerdFontPropo.zip

kaBeech commented 3 days ago

One more try for tonight. This one is narrower, but even more obviously needs spacing adjustment:

serious-oblique-2

It might be a while before I do any finer spacing adjustment - since it's a time-consuming process I want to get as many other issues as feasible taken care of first to avoid redoing work. But for now at least people have a few workarounds to choose from :smile_cat:

SeriousShannsOTF.zip SeriousShannsNerdFont.zip SeriousShannsNerdFontMono.zip SeriousShannsNerdFontPropo.zip