Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apropos #4
I'm not sure we'd want to merge this as-is, but I think it demonstrates directionally how a scaling factor could work.
In the first commit, in order to be able to specify a font size, we have to adopt a non-default font. (This is filed as https://gitlab.com/DavidGriffith/frotz/-/issues/286.) I've downloaded Roboto for the
text
font and Roboto Mono for thefixed
font. We preload the.ttf
files in the preamble, along withsfrotz.rc
, a configuration file that instructssfrotz
which fonts (and what font sizes to use).Note that even though
sfrotz
uses 14pt font by default, Roboto Mono is slightly larger thansfrotz
's default monospace font, and so we have to use an 11ptfixed
font in order to fit in the Zork Zero banner.In the second commit, once we've got the fonts loaded up, we can apply a simple 2x scaling factor to the game's width/height, font sizes, and the
Infocom V6 Scaling
factor. The result is a 1280x800 canvas with Roboto fonts. The result looks way better on my desktop screen.I wonder if we'd want to generate the
sfrotz.rc
file at runtime, based onscreen.width
(and perhaps incorparatewindow.devicePixelRatio
). 🤔I didn't do any testing of mobile clickability, because mobile clickability seems to be completely broken, perhaps related to issue #13.