coteditor / CotEditor

Lightweight Plain-Text Editor for macOS
https://coteditor.com
Other
6.31k stars 431 forks source link

Font ligatures can't be disabled #1670

Open sh2sg opened 1 month ago

sh2sg commented 1 month ago

Description

Ligatures can't be disabled.

To Reproduce

  1. Go to 'Settings / Appearance'.
  2. Choose a font that supports ligatures, like "JetBrains Mono".
  3. Disable the "Ligatures" option.
  4. The ligatures are still visible.
Screenshot 2024-07-11 at 22 50 26

Expected behavior

Ligatures efforts should be disabled.

CotEditor version

4.8.7

macOS version

14.5

Additional context

No response

1024jp commented 1 month ago

Thank you for the report. I looked into it and found this is a bug on the Apple side within the framework used by CotEditor.

The ligature option in CotEditor works with most fonts (such as Baskerville) while does not work with some specific fonts like JetBrains Mono or Fira Code. TextKit 2, the successor to the text framework used by CotEditor, seems to have solved this problem, but unfortunately, there are still high barriers that prevent CotEditor from migrating to TextKit 2. So, I feel CotEditor can nothing for this issue at the moment.

I have reported it to Apple: FB14352598. Let's hope Apple will fix it.

Sample

A test app I made to check this issue. The first line, "fi," is Baskerville and the second line, "==>," is JetBrains Mono.

https://github.com/user-attachments/assets/693c794d-ab92-482c-b0ca-cc0fe47ebffd

sh2sg commented 1 month ago

I doubt Apple will provide support for TextKit 1. Anyway, thanks for checking. Maybe I should stick with the ligature efforts or choose another font.

1024jp commented 1 month ago

I doubt Apple will provide support for TextKit 1.

Haha, in fact, that's what I think too. I'll migrate to TextKit 2 one day, but not now.

sh2sg commented 1 month ago

I just realized that JetBrains Mono also offers a non-ligature version... I am happy user again. https://github.com/JetBrains/JetBrainsMono/releases/tag/v2.304