5.9. Text with type styles

| Chapter 5: Text |

| 5.9. Text with type styles

Inform does not go in for the use of fonts: a work of IF will be rendered with different fonts on different machines anyway, from tiny personal organisers up to huge workstations. However, it does allow for a modest amount of styling.

say "[bold type]"

This text substitution produces no text. It's used only for a side-effect: to make the text following it appear in bold face. "[roman type]" should be used to switch back to normal. Example: "Jane looked down. [bold type]Danger[roman type], the sign read."

say "[italic type]"

This text substitution produces no text. It's used only for a side-effect: to make the text following it appear in italics. "[roman type]" should be used to switch back to normal. Example: "This is [italic type]very suspicious[roman type], said Peter."

say "[roman type]"

This text substitution produces no text. It's used only for a side-effect: to return to ordinary Roman type after a previous use of "[bold type]" or "[italic type]".

but there is one other effect we can employ:

say "[fixed letter spacing]"

This text substitution produces no text. It's used only for a side-effect: to make the text following it appear with fixed letter spacing. In variable letter spacing, a lower case "m" is much wider than an "l", which is natural to the eye since it has been printing practice since the Renaissance. Fixed letter spacing is more like typewriting, and it is best used to reproduce typewritten text or printed notices; it can also be convenient for making simple diagrams. Example: "On the door is written: [fixed letter spacing]J45--O-O-O[variable letter spacing]."

say "[variable letter spacing]"

This text substitution produces no text. It's used only for a side-effect: to return to ordinary letter spacing after a previous use of "[fixed letter spacing]".

Whichever effect we use (and they can be combined), we should be careful to ensure that we return to normal -- roman type and variable letter spacing -- after any specially-treated text has been printed.

69
| Example Garibaldi 2 Adding coloured text to the example of door-status readouts. |
RB

Previous | Contents | Next