-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't set font features and variations #229
Comments
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 Alternatively of course, someone from the Zed team might be able to assist. I entered this rabbit hole via: zed-industries/zed#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. |
Oh, that’s pretty cool. Take your time with this, and thanks for your time. |
Thanks for pointing me to this issue. My understanding is that zed (along with several other users of advanced text features including myself) rely on the builtin platform text engines at the moment. Those would be CoreText on macOS, GDI/DirectWrite/etc. on Windows or – to the extent anything can be considered builtin on Linux – pango (which primarily leans on harfbuzz). Of these, only the latter is open source. That would place the head of the rabbit trail about here: harfbuzz/harfbuzz#2123, which has self-contained programs for rendering opentype features that aren't just calling a proprietary text engine to do it all for us. I am also generally aware of its rust port. I'm not entirely sure what its status is on the OpenType features but seems to support a subset of them. |
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.
The text was updated successfully, but these errors were encountered: