I have started specifying Gargoyle’s Glk extensions so that they can be exposed directly to the VMs for all of you to use, and perhaps for them to be implemented in other interpreters in the future. For now I’m specifying the text formatting functions, which is what has been most under demand!
Have a look at the specification, and let me know if you think it needs any clarifications.
This seems like a good idea! It all looks pretty straightforward, except for “zcolor_Transparent (-4)”. Is that actually useful or even useable at all? “Transparent” was only supported by Z-code V6 and used for overlaying text onto images, but with Glk as it currently is, I don’t see how you could usefully use “transparent” at the moment.
garglk itself just completely ignores both zcolor_Transparent and zcolor_Cursor. Maybe it would be better to leave them out of what I’m specifying here? If, in some distant future, they ever become useful it would be easy to add them back because it would be a backwards-compatible change.
Leaving them out makes sense - I’d forgotten that zcolor_Cursor is only really of use in the same way as zcolor_Transparent. If we’re not going to have any use for them yet, and no-one implements it, let;s leave it out.
A further suggestion for clarification: what happens after glk_set_style() is called after a garglk_set_zcolors() call? Does the over-ride of the style colours remain, or do we reset back to what’s in the Glk style hints? I would favour the latter, but the most important thing is to specify one way or another…
Unfortunately it doesn’t look like it will be possible to make an inline colour change (like [colour #ff0000] or [colour “#ff0000”]). It would be possible to have say phrases for the colour functions, but they’d need to use text variables/constants rather than inline texts. I thought that would be too confusing so didn’t add the phrases.
If no one has any trouble with it, I’ll submit it to the PL soon.