pop-os / cosmic-epoch

Next generation Cosmic desktop environment
2.79k stars 78 forks source link

Right arrow ligature `->` not working across cosmic apps #813

Open A-Walrus opened 2 weeks ago

A-Walrus commented 2 weeks ago

Cosmic apps don't display the right arrow -> ligature correctly, really strange since other ligatures work just fine...

Maybe a bug in cosmic-text?

Screenshot

All using Fira Code, (also reproduced with Iosevka and Jetbrains Mono)

Cosmic terminal Kitty
Cosmic text editor Gnome text editor

image

jackpot51 commented 2 weeks ago

!= also does not ligature. I assume they are being shaped separately in different ShapeWords in cosmic-text

A-Walrus commented 2 weeks ago

related https://github.com/pop-os/cosmic-term/issues/157

A-Walrus commented 2 weeks ago

!= also does not ligature. I assume they are being shaped separately in different ShapeWords in cosmic-text

@jackpot51 That seems to be what's going on. <- becomes a single ShapeWord, where -> becomes two.

This happens because we separate words by unicode_linebreak::linebreaks, which says where we can break a line, and it considers many symbols (-, !, |...) as places where we can break.

Not sure what would be a better way to separate the words, any ideas? Trivial solutions like splitting on whitespace would ruin breaking on dashes in the middle of words :thinking: