Glk: getting current style

I’m doing some stuff involving some debug output. I’d really like to be able to get the current output stream’s current style so I can push it on the stack, explicitly set style_Normal, and restore the previous style so my debug output won’t intermittently be bold (or whatever).

I’m not seeing a way to do this other than redefining glk_set_style and glk_set_style_stream and have them store the style parameter on a per stream basis.

Is there a better way I’m missing?

Nope, pretty sure that’s what would be required. It perhaps should be built into the future Glk system? (Though I’m not sure if it should be part of GlkKit.)

1 Like

The other thing I was thinking would need to know when set_style is called was for text capture with formatting, which kind of would make the most sense as a hook. But if the hook wasn’t used that would be poor performance for the default case…

It would be easier to make these things work together if they were just built in to Inform, but we generally want to keep optional things like these as extensions. Tricky.

1 Like