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

Issue with ligature <<= #796

Open
onion108 opened this issue Feb 10, 2025 · 1 comment
Open

Issue with ligature <<= #796

onion108 opened this issue Feb 10, 2025 · 1 comment

Comments

@onion108
Copy link

onion108 commented Feb 10, 2025

Cascadia family version

2407.24

Cascadia family variant(s)

Cascadia Code (the version with ligatures)

Font file format(s)

.ttf (variable)

Platform

macOS 15.1

Other Software

kitty 0.39.1 nightly

What happened?

Screenshot

The specific combination <<= is rendered incorrectly in kitty terminal. After having a conversation with the terminal emulator's author, we confirmed that it is a bug in the font.

I personally don't know much about fonts. So I pasted their reply below for reference purpose (the original link was given above):

This is a bug in the font, demonstrated by:

hb-shape --features "+calt" "/usr/share/fonts/OTF/CascadiaCode-Regular.otf" '<<='
[less_less_equal.liga=0+1200|LIG=1+1200|equal=2+1200]
hb-shape --features "+calt" "/usr/share/fonts/OTF/CascadiaCode-Regular.otf" '==='
[equal_equal_equal.liga=0+1200|LIG=1+1200|LIG=2+1200]

From the first command output, we see that the font is return the glyphs
less_less_equal.liga and LIG and equal

in other words its is returning two ligature glyphs and one normal equal glyph, this is precisely what kitty is rendering. Contrast with the second command that shows the glyphs for === we see all three are ligature glyphs, as expected.

@aaronbell
Copy link
Collaborator

So funny story. Yes, this is a bug in the font, but it is only showing up in Kitty because of the way that Kitty is rendering the ligature.

If you look at the behavior of the ligature here in FontGoggles, you can see the ligature colored in red, behind the equals:

Image

For whatever reason, Kitty has decided to resize the ligature to fit 2 monowidths rather than allowing it to fit three as it should. And so you see this shrunken version of the ligature followed by the equals. You're not seeing the issue elsewhere because pretty much everyone else just allows the ligature to use the full 3 monowidths.

I will add this bug to the list of items to fix, but I probably won't be able to get to it for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants