FSX Code Reference

Reading the Reference

Codes are three bytes or more. Text starting with a # sign (e.g., #27) indicates a binary byte; for example, #27 FB indicates the three bytes (in hexadecimal) 1B 46 42. Generally, #27 (character 27, hex 1B) indicates a "start" command, and #28 (character 28, hex 1C) indicates an "end" command.

Three special notations are used here:

[int] indicates a byte holding a binary value. For internal reasons, the value of the [int] is not its pure binary value, but rather its binary value minus 29; 1 would be #30, 2 would be #31, etc. Thus, to extract the value, take the ASCII value of the byte and subtract 29.

[string] indicates an [int] holding the length of the string, followed by the string itself.

[longstring] indicates a 32-bit binary integer value (x86 little-endian) holding the length of the string, followed by the string itself.


3-Byte Codes

Text Formatting
#27 FB Turns on bold (translation of <b>)
#28 FB Turns off bold (translation of </b>)
#27 FI Turns on italics (translation of <i>)
#28 FI Turns off italics (translation of </i>)
#27 FU Turns on underlining (translation of <u>)
#28 FU Turns off underlining (translation of </u>)
#27 FS Turns on strikethrough (translation of <strike>)
#28 FS Turns off strikethrough (translation of </strike>)
#27 Fa Turns on superscript (translation of <super>)
#28 Fa Turns off superscript (translation of </super>)
#27 Fb Turns on subscript (translation of <sub>)
#28 Fb Turns off subscript (translation of </sub>)
#27 HD Turns on text shadow (translation of <shadow>)
#28 HD Turns off text shadow (translation of </shadow>)
#27 HY Turns on hyperlinking (translation of <url>)
#28 HY Turns off hyperlinking (translation of </url>)
#27 T[int] Sets the font size of the following text to [int] (translation of <size#>)
#28 T[int] Reverts to the previous font size (translation of </size#>)

Paragraph Styles
#27 FO Turns on paragraph border (translation of <box>)
#28 FO Turns off paragraph border (translation of </box>)
#27 P[int] Sets the indent level of the following text to [int] eighth-inches (translation of <indent#>)
#28 P[int] Reverts to the previous indent level (translation of </indent#>)
#27 ME Turns on page locking - following paragraphs until a #28 ME code will stay on the same page as each other (translation of <lock>)
#28 ME Turns off page locking (translation of </lock>)
#27 MP Turns on paragraph keep - paragraphs until a #28 MP code will not cross pages (translation of <keep>)
#28 MP Turns off paragraph keep (translation of </keep>)
#27 p[int] Sets the top margin of the following paragraphs to [int] 32nd-inches (translation of <margintop#>)
#27 b[int] Sets the bottom margin of the following paragraphs to [int] 32nd-inches (translation of <marginbottom#>)
#27 s[int] Sets the line height of the following paragraphs to [int] percent (translation of <spacing#>)

Justification
#27 JL Sets the justification of the following text to left-justfied (translation of <jleft>)
#28 JL Reverts to the previous justification style (translation of </jleft>)
#27 JR Sets the justification of the following text to right-justfied (translation of <jright>)
#28 JR Reverts to the previous justification style (translation of </jright>)
#27 JC Sets the justification of the following text to centered (translation of <jcenter>)
#28 JC Reverts to the previous justification style (translation of </jcenter>)

List Formatting
#27 LU Turns on unordered (bullet point) list formatting (translation of <ul>)
#28 LU Reverts to the previous list style (or no list) (translation of </ul>)
#27 LO Turns on unordered (numbered) list formatting (translation of <ol>)
#28 LO Reverts to the previous list style (or no list) (translation of </ol>)
#27 LI Starts a list item (translation of <li>)
#28 LI Ends a list item (translation of </li>)

Item Inserts
#27 BR Inserts an artificial end-of-line, interpreted like a normal line break (translation of <break>)
#27 BH Inserts a half-height blank line (translation of <halfbreak>)
#27 BP Starts a new page (translation of <pagebreak>)
#27 BD Single page break if the current page number is even; double page break if it's odd (for duplexed bulk exports)
#27 IP Inserts the current page number (translation of <pagenum>)
#27 IC Inserts the total number of pages (translation of <pagecount>)
#27 IQ Inserts a tab (translation of <tab>)
#27 IM Inserts a center-justified tab (rest of line will be centered) (translation of <mtab>)
#27 IT Inserts a tab to the right margin (rest of line will be right-justified) (translation of <rtab>)
#27 IL Inserts a dotted leader line to the right margin (rest of line will be right-justified) (translation of <leader>)
#27 IB Inserts a page-wide horizontal line (translation of <line>)

Markers
#27 MT Marks the start of a tagline/section header
#28 MT Marks the end of a tagline/section header
#27 MC Marks the start of a card
#28 MC Marks the end of a card
#27 MI Marks the start of the table of contents
#28 MI Marks the end of the table of contents
#27 MA Marks the start of a section header's entry in the table of contents
#28 MA Marks the end of a section header's entry in the table of contents


String Codes

#27 ST[string] Resets all formatting and sets the following paragraphs to style [string] from the stylesheet (translation of <style=NAME>)

#27 SC[string] Sets the following text to character style [string] from the character stylesheet (translation of <charstyle=NAME>)

#27 IG[longstring] Inserts an image. [longstring] is a PNG file encoded as hexadecimal.

#27 FT[string] Sets the font of the following text to [string] (translation of <font=NAME>)
#28 FT[string] Reverts to the previous font (translation of </font=NAME>)
#27 CF[string] Sets the color of the following text to [string] (translation of <color=NAME>)
#28 CF[string] Reverts to the previous text color (translation of </color=NAME>)
#27 CB[string] Sets the background color of the following text to [string] (translation of <bcolor=NAME>)
#28 CB[string] Reverts to the previous background text color (translation of </bcolor=NAME>)

#27 IR[string] Inserts a reference to a tagline (marked by a #27 MT code); used for dynamic table-of-contents entries. Visually, this will display a copy of the referenced text, usually with a hyperlink to it. The format of [string] is:

[tagnumber]=[tagtext]

[tagnumber] is the number of the #27 MT code being referenced (starting with 1); [tagtext] is the text between the referenced #27 MT and #28 MT codes, for use by file formats that do not support full text references.