CotEditor icon indicating copy to clipboard operation
CotEditor copied to clipboard

Enable customize font style of syntax highlight with theme

Open 1024jp opened this issue 6 years ago • 5 comments

cf. #813

And I request add the feature that can set not only color, but also bold, italic, and underline in each theme.

1024jp avatar Apr 30 '18 14:04 1024jp

I can't say I implement this soon, but I'll consider.

What I worry is the highlight performance. Modifying the font style as well as the colors must take longer time, especially when changing letter size dynamically. So I must be careful to implement this kind of feature.

1024jp avatar Apr 30 '18 14:04 1024jp

Changing font in NSLayoutManager's temporary attributes, which CotEditor currently uses for the sytnax highlighting, is not allowed. Therefore, this is technically difficult, at least as long as CotEditor does not change the syntax highlighting mechanism.

1024jp avatar Feb 21 '20 07:02 1024jp

First, I want to thank you for your amazing work on this. The attention to details is superb, and performance is great.

I also wanted to say that this feature would be very appreciated. Is it still not allowed with NSLayoutManager?

maxime-pigeon avatar Feb 13 '22 18:02 maxime-pigeon

@maxime-pigeon Unfortunately not. A chance would be when CotEditor migrates to TextKit 2, the new text rendering API by Apple released last year. But I do not have any specific plan yet because this must be an entire code update and I even do not know whether TextKit 2 changes the spec restricting this issue currently.

1024jp avatar Feb 14 '22 01:02 1024jp

Looks like it TextKit2 does allow for that, but I understand it’ll be a lot of work to migrate.

https://developer.apple.com/videos/play/wwdc2021/10061

Anyhow, thanks again for your work!

On Feb 13, 2022, at 8:22 PM, 1024jp @.***> wrote:

 @maxime-pigeon Unfortunately not. A chance would be when CotEditor migrates to TextKit 2, the new text rendering API by Apple released last year. But I do not have any specific plan yet because this must be an entire code update and I even do not know whether TextKit 2 changes the spec restricting this issue currently.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

maxime-pigeon avatar Feb 14 '22 02:02 maxime-pigeon