Login
Remember
IF Answers
Ask a Question

# How do I update code to use version 5 of Glulx Text Effects?

+2 votes
112 views
asked Apr 5 in Authoring by anonymous
edited Apr 6 by Dannii

I'm using Inform 7 version 6L38, Glulx Text Effects version 5 by Emily Short, rewritten by Dannii Willis, and Keyword Interface version Version 9/140501 by Aaron Reed, which is the version available through the Inform IDE in the Public Library.

I tried compiling the "Gnome's Holiday" example that comes with Aaron Reed's Keyword Interface extension, but got the following errors.

First, a discrepancy between the "Table of User Styles" in Glulx Text Effects and the "Table of User Styles (continued)" in Keyword Interface:

> Problem. The table 'Table of User Styles (continued)' won't work as
> a continuation, because it contains columns not found in the original
> 'Table of User Styles' .

> The old table has columns: style name, background color, color, first
> line indentation, fixed width, font weight, indentation, italic,
> justification, relative size, reversed.

> The new table has columns: style name, fixed width, boldness, relative
> size, glulx color.

Second error: Keyword Interface has a "Table of Common Color Values (continued)" but the original table doesn't seem to appear anywhere.

> Problem. It looks as if 'Table of Common Color Values (continued)'
> is meant to be related to an existing table, but I can't find one if
> it is.

> Perhaps you've put the new part before the original? The original has
> to be earlier in the source text.

Here is the table from Glulx Text Effects:

    [ This table is given its own section so that it can be replaced to add extra columns needed by other extensions (such as Flexible Windows) ]

    Table of User Styles
    style name (a glulx text style) background color (a text)   color (a text)  first line indentation (a number)   fixed width (a truth state) font weight (a font weight) indentation (a number)  italic (a truth state)  justification (a text justification)    relative size (a number)    reversed (a truth state)
    with 1 blank row

Here are the tables from Keyword Interface:

    Table of User Styles (continued)
    style name  fixed width boldness    relative size   glulx color
    special-style-1 proportional-font   bold-weight 0   g-color1
    special-style-2 proportional-font   bold-weight 0   g-color2

    Table of Common Color Values (continued)
    glulx color value   assigned number
    g-color1    255 [blue]
    g-color2    3381555 [green]

- inform7
- glulx-text-effects

## 1 Answer

+1 vote
answered Apr 6 by Dannii (329 points)

There are a few changes for how styles should be specified in version 5, but, I think, they are all simpler than the old version.

The relevant ones for those used by that example are:

- fixed width has changed to a truth state
- boldness has been renamed to font weight
- colours are now specified as texts

So here is the updated code:

    Table of User Styles (continued)
    style name  fixed width font weight relative size   color
    special-style-1 false   bold-weight 0   "#0000FF"
    special-style-2 false   bold-weight 0   "#339933"

## Related questions

- The inform IDE is only so flexible for text editing. Do I have to use it?
- How do you use a hyperlink to paste text without (in effect) pressing enter? (Flexible Windows, Inform 7)
- How to get rid of a rule that's blocking what I want the player to do? (Inform 7)
- How do I organize events / sets of actions to execute when play begins?
- In a Gamebook, how do I fix that the text processor is not working properly on my version of Quest (I think)?

...