Loaded question probably: Glulx or Z-Machine

Hmm. What’s the status of CSS-based styling these days? It’s a great idea, but I don’t want to make the perfect the enemy of the good.

The plan for CSS in Glk was first described about 7 years ago. Meanwhile, we’re still living in a world where even though Glk is the obvious choice for anyone developing an interpreter, it has no official support for a styling feature that’s part of most IF platform specs and most system text APIs.

I floated a different plan shortly afterward:

There was some good discussion in that thread. One of the proposed features (line terminators) was added to Glk 0.7.1. Another (erasing previously printed text for use in line input) can be done without support from Glk, at the cost of some complexity in the interpreter. For the remaining feature, I proposed glk_set_stylehint_temp, which is basically garglk_set_zcolors generalized to apply to all style hints, so it could be used to implement @set_text_style as well.

garglk_set_zcolors is currently supported by Gargoyle and Chimara, and used by Nitfol, Bocfel, Frotz, and (sort of) ZLR. When I first hacked it in for ZLR, it took Z-machine color numbers and only supported the Z-machine’s palette. As implemented today in Gargoyle and Chimara, it has a companion function garglk_set_zcolors_stream, and it takes arbitrary 24-bit colors; now might be a good time to take that “z” out of the name.

I guess the next steps are

  • write a spec
  • assign gestalt and dispatch selectors
  • patch Gargoyle and Chimara to support the selectors
  • patch Basic Screen Effects to support color changes on Glulx (?)
1 Like