[I7] Glulx, fixed letter spacing, gargoyle, and 'fi'

My game (Inform 7, Glulx) starts with a menu in fixed letter spacing, where the player types one of several letters in order to start a game, restore, change the difficulty setting, and so on. By adding the correct amount of spaces to all menu options, one can line this out perfectly.

Except for the fact that gargoyle (and maybe other interpreters, but not all of them) choose to represent the combination ‘fi’ as a single letter. This is, in fact, a long-standing typographical convention, but I am very surprised to see it pop up in a fixed letter font. And of course, this leads to problems for my menu: if the items line out in gargoyle, they don’t line out in other interpreters, and vice versa.

Does anybody know a way to work around this? And should I report this as a bug to the gargoyle maintainers?

I don’t think that monospaced fonts should ever choose the “fi” ligature, unless perhaps the font itself actually contains a glyph with a width equivalent to two characters. That sort of defeats the purpose of a ligature, though. Are you sure that the interpreter is actually displaying a monospace font? If I’m not mistaken, Gargoyle uses its own display library and bypasses the OS’s text rendering, so that any given font should be displayed similarly if not identically across platforms. I believe that by default Gargoyle attempts to use the same monospace font (Liberation Mono) on all platforms, and on OS X I don’t get any ligatures.

Regardless of the ligature question, you may want to know that Kerkerkruip beta 3’s “Skip to Normal Difficulty” line is still out of alignment with all the others (which do align as they should). It seems to have one space too many. Copied and pasted:

 OPTIONS:
   Start a new game             :    (SPACE)
   Skip to Normal difficulty     :       N
   Display help menu            :       M
   Quit                         :       Q

–Erik

It certainly looks like a monospace font – except that it shows a weird compressed ‘fi’ glyph that takes up only one space.

Yes, that’s because I made it work on my Windows gargoyle, which needs an additional space in order to compensate for the compressed ‘fi’. Once I found out that this was the cause of the problem, I made this topic. :slight_smile:

Are you using the latest release of Gargoyle (2010.1) for Windows? Barring customizations in the config file, it should use the same fonts and handle ligatures the same way on all platforms.

gli_draw_string will disable ligature substitution if the font is fixed width, or if the font does not contain the required ligatures.

You are using Glulx, right? There were a few bugs with fixed width output in Z-Machine / frotz that I fixed shortly after the last release.

Yes, I am using Gargoyle 2010.1 on Windows 7. As far as I know, I have not changed the config file. (I’l upload a screenshot later if this is useful.)

Are you using the installer or the zip file?

A screenshot would be great.

I suspect I have used the installer. I could do a reinstall if that is useful to you.

Here is a screenshot:

Check the “fi” in “difficulty”.

Very weird. I’ll take a look at the code and track this down.

Have you tried with another monospace font? I had the same issue a while back, and I dug into the garglk source to find out what was happening. It turned out that garglk was fine; it does not use ligatures with monospace fonts. However, my font (which was intended to be monospace) reported itself as proportional, which of course garglk believed.

I can’t remember which font I was using, although I’m pretty sure it was DejaVu or Liberation. I’m currently using Liberation, but I might have changed it fairly recently. At any rate, the current version of whichever font it was has the fixed-width flag set properly, because I do remember it being fixed.

Edit: Just noticed you haven’t changed the config file, which means you haven’t changed the font. I’d recommend giving that a try, using something like Courier New as the font. I’d be willing to bet that the font you have (and I’m not sure if Windows Gargoyle 2010.1 uses an included font) is buggy.

Good catch, it looks like Liberation Mono was incorrectly marked as a proportional font in its 1.02 release. I’ve merged 1.07 into trunk and the font seems to work properly now.

I need to figure out how to get the installer to replace an installed font. The current NSIS script only installs the font files if they are not already present.