Using fixed letter spacing to create the look of an email issue

I’ve created some “emails” in my game and they look great but I can’t write a lot of them. As a result I want to create emails randomly by using [one of] and then a bunch of options in several places so that it creates, potentially thousands of different emails.

Creating an email graphic is easy to get right when you can get them character perfect using [fixed letter spacing] but with the randomisers in there this is not possible. Is there some simple trick I’m not seeing that doesn’t just involve making all the options of exactly equal length?

I suspect not but I thought I would ask.

1 Like

So the issue is making the lines be of equal length, when the text itself is randomized? (Or, equivalently, having Inform insert a line break every N characters?)

You can do it by saving the randomized text into a buffer with Text Capture by Eric Eve (or Formatting Capture by Daniel Stelzer!), then dividing that buffer into slices of equal length with Inform’s text processing functions, and printing those slices out one at a time.

Be warned—this will be rather slow. But if there aren’t too many emails, it should be fine.

2 Likes

Some versions of the Z-machine also have a way to have the interpreter divide the text at a certain fixed width, but this isn’t widely supported to my knowledge.

1 Like