Closed strauhmanis closed 9 months ago
Are you using macOS 14.0 Sonoma?
Are you using macOS 14.0 Sonoma?
Yes, I do.
@strauhmanis Then I found the prime cause.
@1024jp could you please enforce that the editor uses .kern = 0
if it uses any NSAttributedString?
macOS 14 has introduced an undocumented change regarding how to compress the CJK puncutations (which is a terrible implementation). Force .kern = 0
can avoid this behavior.
@strauhmanis Thank you for the report. To test whether the advice by @ShikiSuen works, could you tell me the font settings you are using. I need the status of the antialias and ligature settings as well as the font name and size.
@ShikiSuen Thank you for the advice. It helps me a lot.
@ShikiSuen and @1024jp thank you both for your help!
The name of the font I'm using is "JetBrains Mono Slashed": https://github.com/sharpjs/JetBrainsMonoSlashed Please see a short video to learn about all the settings: https://vimeo.com/872770481/c5d94c9e75
Thank you very much!
I've studied this phenomenon in the last few days. And figured out:
Thus, from my point of view, the third item is the cause of this issue. I figured out that TextKit does not give a full tab width space even if the gap between the characters before and after a tab is (almost) zero in some specific conditions. I suppose the tab width should have the full width in those conditions, at least when the gap is less than 1px. I also explored a way to work around it, but could not find it, at least in an efficient way. So, I'll report this to Apple so that they can handle it in a better way.
Then, looking back on the @strauhmanis's request in the original post:
I would like to see an option that would allow to set a static defined length of a Tab character, please.
Your request is not to avoid this unintuitive character layout, namely the zero-width tab, but to provide a specific fixed width to all tab characters in the editor. However, it is the nature of a tab character that it has not a fixed width but an elastic width. A tab character is not a character that has a wide customizable space. I will not set it fixed even as an optional setting. Moreover, I think this is also not a standard option in text editors other than CotEditor.
To summarize, I need to say:
@ShikiSuen By the way, the kerning issue you pointed out can be another topic. I suppose this kind of unwanted kerning in monospaced fonts (actually in a fallback font of the monospaced font) should be avoided when the user intentionally uses a monospaced font.
So, could you provide the conditions to reproduce such a problematic kerning with CJK punctuations? I need:
@1024jp
Sarasa Fixed Slab TC
from https://github.com/be5invis/Sarasa-Gothic . I already set CotEditor settings to use Monospace
.八月中秋山林涼,風吹大地草枝擺。
八八八八八八八八八八八八八八八八
BTW you might want to see this: https://github.com/ShikiSuen/NSAttributedStringKernIssueDemo
@ShikiSuen Thank you! I've just added [.kern] = 0 for the monospaced font for the editor.
@1024jp You're welcome. Does it work well?
@ShikiSuen Yes, yes. It works as you described.
Hello!
Is your feature request related to a problem? Please describe. Yes. The problem is that sections that are separated by Tab within a line can be hard to discern.
Describe the solution you'd like I would like to see an option that would allow to set a static defined length of a Tab character, please.
Describe alternatives you've considered Can't think of any.
Additional context Please see 1min video at the link below: https://vimeo.com/870628976/a8c13a1f6c
Thank you very much!