Lectrote beta release 0.1.0

Aha, Libre Baskerville, that’s the one I was looking for. Lora is also good.

(PT Serif is a bit blocky for my taste.)

Wait a minute. Can’t you call out to native code in Electron? I feel certain this can be done.

This might do it: npmjs.com/package/font-manager

If I added a native code module, it would only work on Mac because I only build on Mac. Not getting into multiplatform builds at this time. Or probably ever.

You’ll need some native component if you’re ever going to run RemGlk/Glulxe as a subprocess of the Node.js server.

+1 that font-manager thing looks cool.

Not being able to use platform fonts is quite a bummer, since I sometimes use these:

int10h.org/oldschool-pc-fonts

If I understand the system Zarf is designing, it would still be possible to use any fonts through a custom css file? This is only for the in-app GUI font options.

You can definitely use system fonts on an Electron app, just like any web page can use system fonts:

font-family: "Helvetica", "Candara", sans-serif;

Will render Helvetica if a font called that is available as a system font, Candara if Helvetica isn’t and Candara is available, and the default sans-serif otherwise.

However, without using native extensions, I’m not sure you can find out which system fonts are available, which is a prerequisite to offering a good font picker experience. You can however always have a text box that just lets the user input the name of whatever font they want, which is actually how Atom does it.

A text box for a font name and a drop-in CSS file are both fallback options. I don’t think it’s necessary to offer both, but either way I’m doing the limited font picker (of packaged web fonts) first. That’s what most people will use.

(It does not currently look like I’m going to have to use the RemGlk subprocess plan.)

It’s also probably okay to make some assumptions about system fonts, eg, we can assume all Windows systems have Candara installed, iOS systems have the default iOS system fonts, etc. I suppose this isn’t really true for Linux, but even then it’s very likely Linux systems have one of Bitstream Charter or Linux Libertine (or both) installed.

Linux system will probably have Fixed installed at least. (Allowing the user to reconfigure the font would probably help)

On Linux you should be able to use generic names: “serif”, “sans-serif”, “monospace” and “cursive”. These names will then map to whatever has been configured.

Which is what zarf already has. What he wants is a way to have consistent fonts across platforms (which is easy with web fonts), and a way to choose fonts from the system (not so easy).

New release 0.1.6 now has a preferences dialog and a choice of fonts. Also dark/light color theme.

github.com/erkyrath/lectrote/releases

I just downloaded Lectrote-0.2.3-win32-x64.zip and tried to run a game in Windows 7. If I click Help > IF Reference Card, the window with the reference card does not open. A preview of it appears if I hover over the Lectrote icon in my task bar at the bottom of the screen, but if I try to select it, it doesn’t open.

Hrm. Did it work with a previous version? Which?

I believe it worked with 0.1.0. That’s the version in my recycle bin. I don’t know if I downloaded any of the versions in between, sorry!

Follow up: I pulled the 0.1.0 folder out of the recycle bin, and ran that version, and ran into the same problem. But I’m quite sure the IF Reference Card window was opening correctly at some point, based on my comments upthread. So for whatever reason, it used to open, and now it doesn’t anymore. Maybe something is up with this computer. I don’t know.

Possibly the position preference for the window has gotten off-screen? (I haven’t tested, I don’t know if Windows forces windows to open in visible positions.)

If so, you could delete the lectrote-prefs.json file to reset it.

I did a search for a file called lectrote-prefs.json and did not find one. The only place where that name turned up was within the main.js file.

I tried deleting a “prefs” js file and a “prefs” html file, and that did not fix the problem.

(It’s not a big deal for me–I know how to play IF. I was just mentioning in case it might be helpful.)