Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2x scaling factor #14

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dfabulich
Copy link
Contributor

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 the fixed font. We preload the .ttf files in the preamble, along with sfrotz.rc, a configuration file that instructs sfrotz which fonts (and what font sizes to use).

Note that even though sfrotz uses 14pt font by default, Roboto Mono is slightly larger than sfrotz's default monospace font, and so we have to use an 11pt fixed 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 on screen.width (and perhaps incorparate window.devicePixelRatio). 🤔

I didn't do any testing of mobile clickability, because mobile clickability seems to be completely broken, perhaps related to issue #13.

zork-zero-2x

@curiousdannii
Copy link
Owner

Very interesting! I'll take a look at this when I have the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants