You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Despite the CoreText FeatureList.append's doc comments claiming to use "the same" feature syntax as HarfBuzz, this is not the case; the syntax for features passed to hb_feature_from_string can be found in the HarfBuzz docs.
The practical impact of this is that many configs that will work under HarfBuzz will not under CoreText, and it's actually impossible to specify non-boolean features (such as a specific character alternative).
I am willing to implement a parser with proper parity to the HarfBuzz one, it shouldn't be too difficult, but I figure'd I'd open this issue first to keep track of it since I might not get around to it for a couple days.
The text was updated successfully, but these errors were encountered:
mitchellh
changed the title
Properly parse font features under CoreText
CoreText: parse features equivalently to HarfBuzz (currently we only parse binary features)
Dec 26, 2024
The CoreText shaper parses the provided font features using overly simplified assumptions about how font features are specified:
ghostty/src/font/shaper/coretext.zig
Lines 131 to 140 in 7027147
The HarfBuzz shaper uses
Feature.fromString
which is a loose wrapper aroundhb_feature_from_string
:ghostty/src/font/shaper/harfbuzz.zig
Line 48 in 7027147
Despite the CoreText
FeatureList.append
's doc comments claiming to use "the same" feature syntax as HarfBuzz, this is not the case; the syntax for features passed tohb_feature_from_string
can be found in the HarfBuzz docs.The practical impact of this is that many configs that will work under HarfBuzz will not under CoreText, and it's actually impossible to specify non-boolean features (such as a specific character alternative).
I am willing to implement a parser with proper parity to the HarfBuzz one, it shouldn't be too difficult, but I figure'd I'd open this issue first to keep track of it since I might not get around to it for a couple days.
The text was updated successfully, but these errors were encountered: