Paste format

From Our World of Text Wiki
Revision as of 12:43, 24 March 2025 by Itac85v2 (talk | contribs) (Initial draft)
Jump to navigation Jump to search

The purpose of this article is to document how Our World of Text's paste format works, which refers to the structure and composition of Unicode characters produced by the built-in area selection tool.

Note: This article does not document the pasting mechanic itself; for that information, see Pasting.

Escape characters

With the exception of text decorations, all character attribute changes (i.e. links, colors) are prefixed by an escape character (U+001B), followed by an escape code. After an escape code is written, it must either be followed by a segment of text, or followed by another escape code. The list of all possible escape codes can be seen below.

Changing colors

Important: For best performance, you may (optionally) write the escape codes listed below by each change, rather than by each character. This condition only applies for setting/resetting colors.

Text colors

To change the current text color, you'd write an escape character (\x1B), followed by the capital letter F, followed by a hex-encoded RGB value.

Example: To change the current text color to a pure green, you'd write the sequence \x1BF00ff00.

Cell colors

Changing the cell color works very similarly to changing the text color. The formatting begins with an escape character (\x1B), followed by the lowercase letter b, finally ending with a hex-encoded RGB value.

Example: To set the current background color to a pure magenta, you'd write the sequence \x1Bbff00ff.

Resetting colors

To reset the currently set color, you'd simply write an escape character (\x1B), immediately followed by the lowercase letter x. Keep in mind that this will reset all colors (including text and cell colors) to the default text color, as defined in the world's configuration settings.

Links & protections

Important: The escape codes listed here must be applied to each character in a text.

In order to apply a link to some text, you first write an escape character (\x1B), then the characters $u, and ending with stringified text, including the quotes, containing the contents of your link.

Example: If you wanted to apply the link http://owot.me to the text "hi", you would write \x1B$u"http://a"h\x1B$u"http://a"i.

Protections

To apply protections to some text, you start by writing an escape character (\x1B), followed by a protection value. The protection value can be one of P0 (public), P1 (members-only), or P2 (owner-only).

Example: To apply an owner-only protection to the text "sample", you'd write \x1BP2s\x1BP2a\x1BP2m\x1BP2p\x1BP2l\x1BP2e.

Text decorations

Text decorations (such as bold, italics, underline, and strikethrough), are stored differently than colors & links. Instead of using escape codes, text decorations utilize Unicode combining characters to store a single character's state. Unlike escape codes, combining characters succeed a character, rather than preceding it.

OWOT uses the Unicode code point range U+20F1 to U+20FF to store text decorations. The specific code point to be used is determined by encoding a character's formatting in binary (offset by a hex value of 0x20F0). The bit order for each decoration is the same as it appears on the official client's text decorations menu, and setting a bit to 1 enables a decoration.

Example: If I wanted to make the character "A" appear bold and italicized, I would write A\u20FC.