Closed RadioNoiseE closed 1 year ago
I'm not sure what calt means (and I could not find a lot of documentation about what it is, or how it is supported in iOS).
Emm, that's just the name of a OpenType font feature. I'll try of I can find a documentation about that on iOS. I'm not very sure if iOS supports it because in Pages we can't specify that too. (But Adobe Illustrator has that.
Yes I think I find it in the documentation
https://developer.apple.com/documentation/uikit/uifontdescriptor/featurekey
(The UIFontDescripor.FeatureKey
).
And calt
means contextual alternatives, it can be used for things like Fira-code ligatures.
(Anyway, thanks for this great app!)
I gave it a try. On all the monospace fonts I have installed (not that many, but still) featureKey is nil
.
Do you have a pointer to a monospace font with that feature? (the terminal representation works better with monospaced fonts, but you can load non-monospaced fonts)
update: even Fira Code has featureKey: nil
.
updatex2: I have it working on my machine! It's just a matter of setting the right CSS variable. Now should that be an option, or should that be always activated? Is there any chance someone installs a font like Fira Code and doesn't want the code ligatures?
Great!
But maybe you have misunderstood the feature
of a font.
So there are many features available for a font, for instance there are also:
aalt
Access all alternatives calt
Contextual alternatives liga
Standard ligatures hist
Historical Forms ccmp
Glyph Composition/decomposition
and many many more of them which can do different things.And my idea is that we can have a command like config -f <feature name>
to allow users to specify the features for the font they want. And if they don't, they can just simply ignore it (don't set it).
While calt
.
Also, not only Fira Code but most fonts have features, and that's why I think this feature request is a not bad idea.
Thanks a lot!
I see your point. Because a-Shell uses HTML and JavaScript to render the terminal, it's a CSS value, so the possible values are:
See https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-ligatures for reference. I don't see an option for "all" or "glyph decomposition", and apparently the various options cannot be combined. If you have other examples of fonts with similar features that I could test, that would be great.
(I see?), but that's not really a problem.
Features like ccmp
are enabled by default in typestters that isn't really needed in a text editor (like vim
in a-shell). It is used to combine Chinese, Japanese and Korean ideographic characters. I mentioned it just as an example of a font feature.
(BTW: I also don't know about web and CSS)
And the ones you listed above is already really nice. Actually we don't want our text editor to act like a typesetter (LoL).
For the font that can be used to test, how about Iosevka?
https://github.com/be5invis/Iosevka
It seems to have many features that can be used to test. Also it seems to support some Programming Language Specific features (see fig). But that's low priority.
(I don't know a lot about CSS so I'm not quite sure if we can specify font feature by the TeX way (like <fontname>:<features>
) or need to use a wrapper like thing (I.e., like the fontspec package we have in TeX).
Have a nice day.
Hi, if you want to test, the new config option is available on the TestFlight version of a-Shell mini: https://testflight.apple.com/join/REdHww5C
Ligatures are on by default, but can be deactivated with config -l none
(and reactivated with config -l contextual
). From my tests:
config -l common
is not honored by the system, and the value remains at its previous value. I have no idea why.none
, normal
and contextual
are working, at least with Fira Code.normal
sometimes adds a strange glyph in the cursor place (so the default value is contextual
, which doesn't have this bug). Fantastic!
I tested it and it worked perfectly with Fira Code. (The problem with normal
did occurred.)
However with Iosevka, although I'm sure the font supports code ligatures, seems like it doesn't work.
(I haven't tested Haskel and JetBrains.)
I'll try to figure out why Iosevka didn't work (so I'll leave this issue open but tomorrow is weekday and I have to go to school so hopefully I'll have to continue on the next weekend).
And this works perfectly on normal fonts, thank you so much!
-- (I have to use Iosevka (actually, sarasa) because I need a font that supports CJK characters while the iOS fallback font is ugly.) So maybe it doesn't work because of its large char set or the wrong script (script = cjk
) or something else. --
I did not manage to install Sarasa (because it's too large) but I have ligatures with Iosevka. There was a twist: Iosevka-fixed does not have coding ligatures, but Iosevka-term has them. contextual
and discretionary-ligatures
have different ligatures set, as shown on their web page.
On the Sarasa documentation page (https://picaq.github.io/sarasa/), ligatures take ages to activate (again, on my underpowered iPad Pro (...)). Maybe we need to wait a while for the webView to load the ligatures the first time.
Ohh! I installed the fixed one. Now everything is okey. Many thanks!
Is it possible to specify font features (for example
calt
) in a-shell (like usingconfig
)? That would be quiet useful. (I don't know much about iOS development.)