Creates a default markup renderer for the specified resolution.
Rather than constructing a MarkupBox directly, they are usually
created with the markupBox(sheet)
helper function.
the target resolution, in pixels per inch
Returns the "gender" value, that is, the index of which text segment will be selected.
Sets the "gender" value by specifying which text segment to use: 0 (before first slash), 1 (after first slash), 2 (after second slash), and so on.
the gender value to assign
An alternative way of setting the "gender" value if only two values are used.
Passing false
is equivalent to 0
, while passing true
is
equivalent to 1
.
if true, the text after the slash is used
A markup box that includes a "gender" attribute represented by an integer number. Tags that consist of two or more segments separated by slashes will be replaced with the text from the segment corresponding to the current gender value. For example, if the markup contains the tag
<this/that>
, then if "gender" is set to 0, the tag will producethis
, while if the "gender" is 1, the tag will producethat
. This is commonly used to allow users to write markup that adapts automatically to a character's gender. For example, they might write a sentence like<He/She/It/They> ate <his/her/its/their> apple.
Note that since closing tags start with a slash, to avoid confusion a dash must be used to indicate an empty string, as inwords of the prophet<-/ess>
.For backwards compatibility, tags can also be written in the form
<capital option1/option2>
which has the same effect as<option1/option2>
except that the first letter will be capitalized.