Text format et. al.

#1

Hello, all:

Can’t find in the documentation the following items – if you could give me a push, greatly appreciated:

Changing text color
Changing text type (underline, italics)

Printing the description of a room (for example, when executing a rule).

Thank you!

0 Likes

(Hanon Ondricek) #2

Emily Short’s “Basic Screen Effects” enables color effects in a Zcode project. That extension should be in the Public LIbrary inside of Inform.

Tag your “[italic type]italic[roman type] text” in tags.
dhayton.haverford.edu/wp-content … I_5_9.html
I make abbreviations for everything:

[spoiler]

[code]Text Abbreviations by Hanon Ondricek begins here.

“Provides shorter text formatting substitutions.”

To say i: say “[italic type]”.
To say b: say “[bold type]”.
to say f: say “[fixed letter spacing]”.
to say v: say “[variable letter spacing]”.
to say p: say “[paragraph break]”.
to say l: say “[line break]”.
to say /: say “[roman type]”.
to say lb: say “[bracket]”.
to say rb: say “[close bracket]”.

Text Abbreviations ends here.

---- DOCUMENTATION ----

This tiny bit of code adds shortcuts for common text formatting to save typing out common formatting such as [bracket]paragraph break[close bracket] hundreds of times. The code goes within brackets inside quotation marks as a text substitution.

i is italic type.

b is bold type.

f is fixed letter spacing. (usually will display as Courier, or the preferred monospace font in an interpreter)

v is variable letter spacing. (normal variable with font, the default)

p is paragraph break

l is line break

/ is roman type (cancel formatting - standard text display)

lb is left bracket (bracket)- “[bracket]”

rb is right bracket (close bracket) - “[close bracket]”

*: “Formatting Test”

Include Text Abbreviations by Hanon Ondricek

Test Room is a room. "[one of]Type LOOK.[or]You are in the [b]Test Room[/]. It is [i]quite[/] deserted in here except for a screen reading [f]THIS ROOM IS UNIMPLEMENTED[l]-Do not even try to examine this screen-[/].[p][lb]You feel as if you are being [i]watched[/][rb]...[p]Here are your literal formatting codes, because I was too lazy to type 'bracket/close bracket' nine times in a row (yes, I know, [i]copy/paste[/]):[p][lb]i[rb][l][lb]b[rb][l][lb]f[rb][l][lb]v[rb][l][lb]p[rb][l][lb]l[rb][l][lb]/[rb][l][lb]lb[rb][l][lb]rb[rb][l][stopping]"

Test me with "look". 

[/code][/spoiler]
Text Abbreviations.i7x (1.73 KB)

0 Likes

#3

Thank you, kindly. How about different colors?

0 Likes

(Hanon Ondricek) #4
0 Likes

#5

I’ve pursued that, but how about for GLUX. I’m trying to revise “Bronze” by Emily Short to run under Inform 7 v 6M62 to run in that environment and things like “say white letters” generates a compiler error. BSE explicitly indicates that such features don’t work for GLUX, and even Glulx Text Effects doesn’t provide a solution.

0 Likes

(Hanon Ondricek) #6

I’m not aware of any similar method to control colors in a standard Glulx project. The only thing that comes to mind would be something like Vorple, but that is a hosted solution and I don’t believe there’s a standalone interpreter that runs it for offline play. I haven’t done any in-depth research whether it’s possible to bind up a Vorple-game-website as a standalone app.
vorple-if.com/

0 Likes

(Nathanaël Marion) #7

It is possible to bind a Vorple game into a standalone app. In fact, I wrote an Electron boilerplate to do just that. However, it’s not yet documented, and it’s not entirely trivial to set up if you’re not familiar with JavaScript development.

But if you don’t want to mess with Vorple, Glulx Text Effects can do the job, depending on the number of colours you want. You can define two custom styles if you only need two colours. If you need more, you can overwrite other styles if some features are not used in the game (for example, you can use the note style if the game don’t have score).

If you need colours in the status bar, I’ve written an extension that do the same thing as Glulx Text Effects, but for the status bar.

0 Likes

#8

Thanks for the responses! I’m too new at this to take on another platform! :slight_smile: I realize that Inform hasn’t had a major release in some time, but I sure hope that =someday= it will be enhanced to the point that it supports the full complement of functions contained in Emily Short’s “Basic Screen Effects”.

0 Likes

#9

There’s also the Glk Text Formatting extension: github.com/i7/extensions/blob/m … atting.i7x

Currently only supported in Windows Glk, but will be supported in Gargoyle when it has a new release.

0 Likes