DavidGriffith / frotz

Infocom-style interactive fiction player for Unix and DOS (moved to https://gitlab.com/DavidGriffith/frotz)
GNU General Public License v2.0
209 stars 64 forks source link

SDL Frotz needs to allow for text to be selected and copied #68

Open DavidGriffith opened 6 years ago

DavidGriffith commented 6 years ago

Whenever text appears in a window in X11 (and probably Wayland too), it's expected that the user will be able to select and copy that text. Howtophil reported how sfrotz doesn't do this in https://www.intfiction.org/forum/viewtopic.php?f=38&t=26017&p=140613#p140610

tkorvola commented 6 years ago

This is actually complicated. Does any V6 interpreter even attempt it? It would require a high-level widget for representing text, which would seem at odds with the low-level screen model of the Z-machine (basically a frame buffer). SDL Frotz is foremost a V6 interpreter - for text-only games it has little to offer (the graphics font, such as it is) over text-based Frotz versions such as the curses one or Gargoyle.

I suppose we could have a separate scrollback display like Winfrotz. It would need a text widget from some toolkit. Maintaining a scrollback buffer would be nice also in the curses version.

DavidGriffith commented 6 years ago

I'm pretty sure that Windows Frotz allows for this. Indeed a scrollback buffer would be nice, for this and also to make for nicer resizes. Ultimately I want to get something looking very much like Windows Frotz for Unix.

DavidGriffith commented 6 years ago

i was wrong. Windows Frotz does not allow for highlighting and copying text.

tkorvola commented 6 years ago

Not in the main window. There is a separate scrollback mode, which supports text selection and copying, apparently provided by some basic Windows text widget. Should be straightforward to port, except that SDL Frotz does not currently use any GUI toolkit that would provide the text widget. One might be able to implement selectable text in raw SDL using a fixed width font, but SDL is rather low-level for this kind of thing.