Pre-formatted text

I’m trying to show some preformatted text. This is the text in question:

┌┬┴┘ ┌─┼┤ ┌┬┴┐ ┌┬─┐ ├─┴┘ ├┬─┤ ├┬┬┐ ├──┐ ├─┴┤ ├┬─┘ ├─┼┤ ├┬─┘ └┬┴┐ └─┴┐ ├─┴┤ └┴─┐ └┬┴┘ ┌─┴┤ ┌┬┴┘ ┌┬┴┐ └┬┴┐ ├─┬┘ ┌─┴┤ ├─┬┘ ├┬┼┤ ├┬─┘ ├─┴┐ ┌┬┴┐ └┬┴┘ ├┬┴┘ ├┬─┐ ├┬─┤ └┬─┤ ├─┬┘ ├┬─┐ ├┬─┘ └─┬┘ ├┬┴┘ ├┬┴┐ └─── (In case it doesn’t look right here either: … tfile1-txt )

Unfortunately inform is stripping all the excess spaces. I thought it might just be the output in the inform ide doing it, but alas by time the text makes it out of inform in the javascript virtual machine the spaces are gone. I’d settle for it not working in the IDE, but working in the browser, so long as it worked.

Does anyone know how I can make it stop stripping spaces?

If you’re using the Parchment that is included in Inform 7, it won’t preserve all white space. The updated one from should.

For the stat tables in Orphanorium I ended using Unicode substitutions: a non-breaking space is Unicode 160, so you print it with

say "blah blah[unicode 160]blah";

although you can make that less cumbersome by using substitutions, like so,

To say nbsp: say "[unicode 160]";
This may not be an optimal solution, but it worked for me.

I should have mentioned this in the first place but it didn’t even occur to me. I’m using glulx.

Thanks maga, that worked. The odd thing is when I originally copy-and-pasted non-breaking spaces into the source they didn’t work. I guess the compiler converted them to regular spaces. The text his hideous in the source -

┌┬┴┘[usd]┌─┼┤[usd]┌┬┴┐[usd]┌┬─┐[usd][line break]├─┴┘[usd]├┬─┤[usd]├┬┬┐[usd]├──┐[usd][line break]├─┴┤[usd]├┬─┘[usd]├─┼┤[usd]├┬─┘[usd][line break]└┬┴┐[usd]└─┴┐[usd]├─┴┤[usd]└┴─┐[usd][line break][usq][usd][usq][usd]└┬┴┘[usd][usq][usd][line break]┌─┴┤[usd]┌┬┴┘[usd][usq][usd]┌┬┴┐[usd][line break]└┬┴┐[usd]├─┬┘[usd]┌─┴┤[usd]├─┬┘[usd][line break][usq][usd]├┬┼┤[usd]├┬─┘[usd]├─┴┐[usd][line break]┌┬┴┐[usd]└┬┴┘[usd]├┬┴┘[usd]├┬─┐[usd][line break]├┬─┤[usd][usq][usd]└┬─┤[usd]├─┬┘[usd][line break]├┬─┐[usd][usq][usd][usq][usd]├┬─┘[usd][line break]└─┬┘[usd][usq][usd][usq][usd]├┬┴┘[usd][line break][usq][usd][usq][usd][usq][usd]├┬┴┐[usd][line break][usq][usd][usq][usd][usq][usd]└───[usd][line break]

but it works in game.

You could try adding this to the Quixe style sheet:

body { white-space: pre-wrap; }

That, and a mono-space font, are also required for it to look correct in the browser. I overloaded the subheader style for it.

Since you’re using glulx anyway, you might consider displaying the cypher as a png or jpg ‘figure’.

Quixe already maintains correct whitespace in the output, by silently converting spaces to non-breaking spaces as necessary. You don’t need to alter the stylesheet.

You do need to set a monospace font, though.

This will work in Quixe as-is. It looks messy, but mostly because of the line-break substitutions, not the symbols. The code contains ordinary spaces, not nbsps.

To say br -- running on: (- new_line; -).
The Kitchen is a room. The description is "You see a sign:[fixed letter spacing][br]  ├─┴┤  ├┬─┘  ├─┼┤  ├┬─┘[br]  └┬┴┐  └─┴┐  ├─┴┤  └┴─┐[br]              └┬┴┘        [variable letter spacing][br]Not bad."