Are text styles local to the window? (Z-machine spec)

If I print with normal font (no text style applied) in the lower window, switch to the upper window, choose reverse font and print some stuff, then switch back to the lower window and print some more text, should it come out in reverse?

1 Like

Try it and you will get your answer!

[ Main   key;
   @split_window 3;
   @set_window 0; 
   print "Hello, world!^";
   @set_window 1;
   style reverse;
   print "Hello, world!";
   @set_window 0; 
   print "Hello, world!";

   @read_char 1 ->key;

Yes, but I haven’t tried with the library.

1 Like

Section 8.3 of the Z-Machine Standard:

Under Versions 5 and later, text printing has a current foreground and background colour. In Version 6, each window has its own pair.

Seems reasonable to assume the same should be true of text styles: one “current style” is shared between all windows in V1-5, and each window has its own in V6. The Frotz source agrees: