How does one properly format italics/bold text in title entries in Menus by Emily Short?

0 votes
75 views
asked May 9 in Authoring by Joseph Geipel (207 points)

I'm noticing some odd behavior when italicizing and bolding text in the title entries of a menu created by the Menus extension in Glulx. Consider this code:

Include Menus by Emily Short.

Blank is a room.

When play begins:
    now the current menu is the Table of Issue;
    carry out the displaying activity;
    clear the screen.

Table of Issue
title   subtable    description toggle
"Foo"   --  ""  --
"[italic type]Bar[roman type]"  --  ""  --
"Baz"   --  ""  --
"Qux"   --  ""  --

In the game proper, the menu titles after the italicized one have a different style and aren't indented properly. This also happens for bold text.

Is there are a way to use italics or bold text in titles while having the formatting remain consistent?

1 Answer

+1 vote
answered May 10 by Ryan Veeder (290 points)
selected May 10 by Joseph Geipel
 
Best answer

The menu format relies on a fixed-width font to match up indentations. In your example, "Foo" does appear in fixed letter spacing. Inform doesn't have a font that's both fixed-width and italic, though, so "Bar" appears in variable-spaced italics.

When you say "[roman type]" you're telling the game to write in variable-spaced type from that point on, so that's how "Baz" and "Qux" appear. The indentation is messed up because it consists of a certain number of spaces, which are thinner in the variable-spaced type than they are in the fixed-width type used above.

If you replace "[roman type]" with "[fixed letter spacing]" in your example, the table is indented properly.

commented May 11 by Dannii (329 points)
Or in other words, the extension assumes at the start of each line that it is set to fixed letter spacing. The extension should probably be updated to remove this assumption and just change the font itself each time. (It's what I did with my rewrite of Menus.)
This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...