Reduce line height of grid window in Parchment

I want to make the status line text smaller in a Parchment game, so I set the appropriate CSS variables:

--glkote-grid-line-height: 12px;
--glkote-grid-size: 10px;

However, Parchment still sets the status line to a fixed height in pixels, so this makes the text smaller, but leaves the window the same size.

Is there a way to make the actual status line window smaller?

1 Like

Try .WindowFrame.GridWindow { height: 5px; } in the CSS.

1 Like

That should work, so I’m not sure why it isn’t. Possibly an autorestore issue? Any chance that resizing the browser window makes the Glk window go to the proper size?

1 Like

Aha! I’ve been running into autorestore issues a lot and this seems to have been one of them. Changing the source and hitting Release again (to break autosaves) fixed it.

Is there a good way to purge Parchment autosaves in general? Right now, if I change the website template and hit Release (so that the page has changed but the game checksum hasn’t), I can’t test anything, because the autorestore breaks and Parchment crashes. I’ve resorted to adding spaces to a useless piece of text every time I hit Release to ensure the checksum changes.

I’ll update it so that it always sends a rearrange event after autosaving, that seems safest.

You can disable autosaves by adding ?do_vm_autosave to the end of the URL.

But I’m concerned to hear that it’s crashing Parchment. What exactly happens?

1 Like

This appears across the top of the viewport, and it stops accepting input so I can’t restart.

Console:

How old is the version of Parchment you’re using? I thought I’d fixed that in April.

I might be using an old version. Let me re-download and see if that changes anything.

I now have version 2023.10, and it seems to be doing okay so far (though the scroll bar issue from last ECTOCOMP remains annoying). Unless the issue shows back up I’ll chalk it up to having an old version!

Which scrollbar issue?

When the browser window is resized, it’s setting the gameport height to the full height of the window, not to the height of the window minus any other elements, so the bottom of the gameport (with the text prompt) goes off the bottom of the screen.

Since this is the only time the main window scrolls, I’ve been patching around it with this bit of JS:

function fix_height(){
	document.getElementById("gameport").style.setProperty("height", "auto");
}
window.addEventListener('scroll', fix_height);

Hmm, it should account for footers or other things as long as #gameport has appropriate margins set. (I fixed that Nov last year.)

Wouldn’t a margin be additional space, beyond what the other elements on the page take up?

The elements can overlap, so that they fit inside the gameport’s margins.

Ahh. So give it position:absolute and top:0px, then use margins to make it start below the header and end above the footer?

(I’m still not great at CSS.)

The gameport has this styles by default (though it is probably different in the onecol template):

#gameport {
  bottom: 0px;
  left: 0px;
  margin: 0 auto;
  max-width: 900px;
  overflow: hidden;
  position: absolute;
  right: 0px;
  top: 0px;
}

The top value needs to stay at 0, instead all you would change would be the margin property. (0 auto is a shorthand for top/bottom margins being 0 and left/right being auto.)

I suspect that the onecol template isn’t really safely useable with modern Parchment. It will work most of the time, but some of these edge cases may trip it up.

Unfortunate. So far, it seems to be working with this:

#gameport {
	position: fixed;
	top: 0px;
	right: 0px;
	margin-top: var(--header-size);
	margin-bottom: var(--footer-size);
	margin-left: auto;
	margin-right: auto;
	max-width: var(--game-width);
}

And hopefully no more issues will come up. I prefer not to have the Inform sidebar when I’m putting something on Itch.

1 Like

I’ve updated Parchment to always send a rearrange event after autorestoring.

2 Likes