ADRIFT font styles in Glk

Spatterlight’s “Scarier” ADRIFT interpreter is pretty great, but it’s limited in its support of rich text, because it’s limited to what Glk supports.

In particular, Glk doesn’t support:

  • Underlined text
  • Font sizes
  • Font faces

(ADRIFT uses web-style named fonts, where you just hope the user already has those fonts installed on their system.)

I’m unclear on what a Glk terp in 2026 should do. My rough understanding is that @zarf has declared that style hints are “deprecated” but that there’s no published replacement…?

There’s @Dannii’s https://curiousdannii.github.io/if/glk-proposals.html CSS proposal. That looks pretty good! But it doesn’t look like it’s ever been implemented…? (It doesn’t even have a gestalt code.)

Should we just pick a gestalt code for the CSS proposal and use it? Do something else? Where do gestalt codes come from? (Does Zarf bless them?)

First up Glk does support relative font sizes, but not absolute.

I am intending for my CSS proposal to be the next thing I work on. I can finalise the API before I get to implementing it, though I’d want to get some tests together before I call the API finished.

Scarier won’t need a gestalt code, that’s really just for Glulx.

As stylehints, which cannot be changed without tearing down and rebuilding all the windows.

Plus standard Glk only has two user styles to play with, giving you maybe two larger sizes than normal, or a big and a small.

  1. How will you choose a gestalt code? (Is there a registry or a wiki of gestalt codes? Does Zarf bless them somehow?)

  2. If we’re going to use it in Spatterlight, we’ll be in the category you described as “non-HTML interpreters supporting small text formatting subsets of CSS”.

    Presumably it should be written down somewhere which subsets we’d support. (And I guess there’d have to be some gestalt-ish way for interpreters to interrogate which CSS properties are supported or not supported…?)

    I guess this is what Zarf had in mind it his announcement about the new style system in 2010, but, 16 years later, it seems unlikely that it will be implemented (or even documented) this year or next.

I’ve already got a block of Glk gestalts assigned to me.

Maybe I could add a function for the interpreter to say whether or not it supports a CSS property. Though in the browser I’d just make it say it can support everything. Checking whether a specific font is supported probably won’t be feasible. And I’m not sure how useful it really would be, especially when you’re putting CSS from the storyfile into it - it wouldn’t be able to specify an alternative. I think it should be understood as even more the-terp-will-do-what-it-can than the stylehint system.

I’ve posted my thoughts on the CSS proposal here: