Open CryZe opened 8 months ago
See here for examples of OTF font features:
Hi, is anyone working on this as we speak? I would contribute but I am afraid I might lack the knowledge to do so.
This is an issue I am interested in working on, but still need some more information on how it would be used by users of cosmic-text.
@jackpot51 Do you think it could be helpful to look at the Zed editor code? It implements font features for Mac and Windows, but not yet for Linux (using cosmic-text). Perhaps by analyzing how it does it for Mac and Windows, and how it uses cosmic-text for Linux, you can get an idea of how it could be used? It seems like a perfect showcase with ample comparison material.
The primary cosmic-text usage seems to be here: https://github.com/zed-industries/zed/blob/main/crates/gpui/src/platform/cosmic_text/text_system.rs
The Mac implementation of font features is around here: https://github.com/zed-industries/zed/blob/f15a441c9d78c9687c1400d14c8a7991fb6db08a/crates/gpui/src/platform/mac/text_system.rs#L230
The Windows DirectWrite implementation of font features is here: https://github.com/zed-industries/zed/blob/f15a441c9d78c9687c1400d14c8a7991fb6db08a/crates/gpui/src/platform/windows/direct_write.rs#L295
The code is a bit hard to follow for me, a Rust novice and zero experience with font rendering or the Zed codebase. But I think taking some time browsing the code could give some hints as to how font features could fit in the cosmic-text usage in the Zed codebase. I was primarily looking at the different implementations of PlatformTextSystem
.
Alternatively of course, someone from the Zed team might be able to assist. I entered this rabbit hole via: https://github.com/zed-industries/zed/issues/12176
Did this end up going anywhere? I'm also going down the zed rabbit hole, and this issue seems to have gotten stale.
Hopefully it will get worked-on. Zed on Linux is kinda crippled right now for users using ligatures.
It is likely we will be using variable fonts for COSMIC soon, and that will involve implementing this. I have not yet researched the requirements.
It is likely we will be using variable fonts for COSMIC soon, and that will involve implementing this. I have not yet researched the requirements.
Oh, that’s pretty cool. Take your time with this, and thanks for your time.
At the moment it's not possible to set any font features (kerning, alternates, ligatures, capitals, tabular nums, ...) nor can you set any variation axis.