Login
Remember
IF Answers
Ask a Question

# 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?

- inform7
- programming
- extensions
- formatting
- glulx

## 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.)

## Related questions

- Using the Flexible Windows extension, how can I depict a scaled image in my graphics window?
- Are there any shortcuts for typing character formatting in Inform?
- How does one change the User Style for hyperlinks when using Flexible Windows?
- With Flexible Windows by Jon Ingold, is there a way to make the text display at the top of the window, even in Gargoyle? (Inform 7)
- How do you use a hyperlink to paste text without (in effect) pressing enter? (Flexible Windows, Inform 7)

...