Font Features UI & Parser

Currently, in Bloom if you want a particular alternate glyph, you have to come up with CSS to select it. e.g.

[lang="kdj"]
{
    font-feature-settings: "dig4" 1;
}

I’m thinking about how we can improve that, and have two questions:

Question 1) Are there any good examples of a program with a user interface that lets you see all your options and select which ones you want? I know about this one from Word:

image

But that does not seem particularly helpful if I want, for example, to get a particular glyph alternate.

I also see this interface in Figma:

image

Which seems like the right idea. We could build a javascript component that takes a font, shows a UI like that, and gives you back the CSS rule needed to activate whatever font-features the user selects.

Are there other UI’s anyone can point me to that I could use for inspiration?

Question 2) I don’t know much about fonts… should I expect opentype.js, which can parse fonts, to tell me all I need to know (for this purpose) about any SIL font?

Thanks for help.

Hi John. Yes please! WSTech has been trying to encourage developers to include GUI interfaces to font features.

Be aware that fonts that contain both Graphite and OpenType logic (as do most of SIL’s fonts), contain two sets of feature information: that for Graphite and that for OpenType, and the two sets of feature information are not always identical.

As for extracting feature information from a font, Graphite has an API for this, but I don’t know about OpenType libraries. I can tell you how the information is stored in Opentype, but that is as far as my understanding goes.

Regarding examples of GUIs, I noticed a recent post from Kim Blewett that LibreOffice 6.4 introduced such an interface… I’m just installing to try for myself.

Bob thanks for the tip on LO 6.4. I had only looked in LO 6.1 and didn’t see anything.

Graphite has an API for this

Are you referring to the Python/locally installable server? That’s probably going to be quite problematic for embedding in applications. Maybe we could collaborate with WSTech… y’all provide a Javascript library that can deliver the information for a font of either format, and we make the web UI component that uses it.

Just took a brief look at the code. It does look like OpenType featureParams information – at least the pointer – is returned in the feature structure, so that is a start (for OpenType features, not Graphite). If it is just the pointer, you’ll need to decode the structure. Contact me offline if you want more details.

I did a paper at a Unicode conference on this topic. I can send it to you if you want. It’s dated because at that point LO didn’t have a UI. It has screenshots from Word, InDesign, FleX, etc.
One that I though was particularly nice is from Nisus Writer Pro:

Most of the apps only support Stylistic Sets (ssxx) and not Character Variants (cvxx)

Also, I believe Paul N was working on specking out a UI, but I’m not sure where he got with that.

Thanks Lorna.

I did a paper at a Unicode conference on this topic. I can send it to you if you want.

Yes, please!

I should be clear, this is just a very preliminary inquiry I’m making, to measure how costly the feature would be. If I had a library in hand that could give us all the info, then sure we’d put up a UI soon. But the more of a research project this turns out to be, the more expensive, and so the feature will probably still end up far in the future.