rio icon indicating copy to clipboard operation
rio copied to clipboard

Request: Support font feature: frac

Open AndydeCleyre opened this issue 8 months ago • 5 comments

Hello, and thanks!

While some font features are already supported, one that is not yet is frac, for displaying fractions in essentially NUMBER/NUMBER instances.

In Wezterm, with

harfbuzz_features = {
  "clig",
  "frac",
  "kern",
  "liga",
  "thnd",
  "txtr",
},

here's the comparison, with Rio on top:

Image

AndydeCleyre avatar Apr 02 '25 19:04 AndydeCleyre

Thanks for the issue @AndydeCleyre!

Are those features specifically for harfbuzz (haven't checked yet in harfbuzz)? If yes, then I think will need to thinking in port those to https://github.com/dfrg/swash (that's what rio uses under the hood)

raphamorim avatar Apr 03 '25 09:04 raphamorim

frac is part of the OpenType spec, and can be found listed here on Wikipedia and here on the Microsoft OpenType docs. I do see it listed here in the swash source, but I don't know how or if it's fully handled there.

AndydeCleyre avatar Apr 03 '25 15:04 AndydeCleyre

aah ok, thanks for clarifying then rio should have support for it already. Could you try using https://rioterm.com/docs/config#fontsfeatures

fonts.features = ["frac"]

raphamorim avatar Apr 03 '25 17:04 raphamorim

Yes, thanks, I have that set but there's no visible change.

AndydeCleyre avatar Apr 03 '25 19:04 AndydeCleyre

ah i see, i will try to debug later locally after finish #980 PR

raphamorim avatar Apr 03 '25 20:04 raphamorim