h6. [[Programmer's Reference Manuals]] h6(. » [[File Formats]] h6((. » DrawFile A DrawFile consists of a File Header block, followed by zero or more Object blocks. h3(#header). Header Block |_<^{width:4em}. Offset |_<^{width:4em}. Length |_<^. Contents | |<^. 0 |<^. 4 |<^. "Draw" | |<^. 4 |<^. 4 |<^. Major version, 201 at present | |<^. 8 |<^. 4 |<^. Minor version | |<^. 12 |<^. 12 |<^. Name of producing program, padded with spaces | |<^. 24 |<^. 4 |<^. X low bounding box | |<^. 28 |<^. 4 |<^. Y low bounding box | |<^. 32 |<^. 4 |<^. X high bounding box | |<^. 36 |<^. 4 |<^. Y high bounding box | h3(#object). Object Block |_<^{width:4em}. Offset |_<^{width:4em}. Length |_<^. Contents | |<^. 0 |<^. 4 |<^. Object Type Identifier: | |\2<^. |<^. 0 "Font table":#fonttable | |\2<^. |<^. 1 "Text object":#textobject | |\2<^. |<^. 2 "Path object":#pathobject | |\2<^. |<^. 3 (unimplemented Rectangle object) | |\2<^. |<^. 4 (unimplemented Rectangle object) | |\2<^. |<^. 5 "Sprite object":#spriteobject | |\2<^. |<^. 6 "Group object":#groupobject | |\2<^. |<^. 7 "Tagged object":#taggedobject | |\2<^. |<^. 8 Not used | |\2<^. |<^. 9 "Text area object":#textareaobject | |\2<^. |<^. 10 "Text column object":#textcolumnobject | |\2<^. |<^. 11 "Options object":#optionsobject | |\2<^. |<^. 12 "Transformed text object":#transtextobject | |\2<^. |<^. 13 "Transformed sprite object":#transspriteobject | |\2<^. |<^. 14 Not used | |\2<^. |<^. 15 Not used | |\2<^. |<^. 16 "JPEG object":#jpegobject | |\2<^. |<^. 17 Grid options object | |<^. 4 |<^. 4 |<^. Word aligned size, including header | |<^. 8 |<^. 16 |<^. Bounding box (not all types have this) | |<^. n |<^. n |<^. Object specific data, if any | h6. Controlling sources: "Hdr:DrawObj":https://gitlab.riscosopen.org/RiscOS/Sources/Programmer/HdrSrc/-/blob/master/hdr/DrawObj managed by the "allocations manager":/content/allocate h3(#fonttable). Font Table Object (Object Type 0) This object has no bounding box. It should only appear once, and before any text objects. It consists of: * a series of data items, where each data item consists of ** a font number (byte), followed immediately by ** a null terminated fontname * Then the table itself is padded to the word boundary with nulls. h3(#textobject). Text Object (Object Type 1) |_<^{width:4em}. Offset |_<^{width:4em}. Length |_<^. Contents | |<^. 24 |<^. 4 |<^. Text colour | |<^. 28 |<^. 4 |<^. Background hint | |<^. 32 |<^. 4 |<^. "Text style":#textstyle | |<^. 36 |<^. 4 |<^. X-size (in 1/640's of a point) | |<^. 40 |<^. 4 |<^. Y-size (ie draw units) | |<^. 44 |<^. 4 |<^. X coord of start of baseline | |<^. 48 |<^. 4 |<^. Y coord of it | |<^. 52 |<^. 4 |<^. Zero terminated string padding | h3(#pathobject). Path Object (Object Type 2) |_<^{width:4em}. Offset |_<^{width:4em}. Length |_<^. Contents | |<^. 24 |<^. 4 |<^. Fill colour (-1 for none) | |<^. 28 |<^. 4 |<^. Outline col (-1 for none) | |<^. 32 |<^. 4 |<^. Outline width | |<^. 36 |<^. 4 |<^. "Path style":#pathstyle | |/2<^. 40 |<^. n |<^. Optional [[Draw Dash Block|dash pattern]] | |<^. n |<^. Path components (consists of a Tag Identifier) | h4(#tagid). Tag Identifier |_<^{width:4em}. Offset |_<^{width:4em}. Length |_<^. Value |_<^. Meaning | |<^. +0 |<^. 4 |<^. |<^. Tag ID: | |\2<^. |<^. 0 |<^. End of Path | |\2<^. |<^. 2 |<^. Move, one point | |\2<^. |<^. 5 |<^. Close sub-path | |\2<^. |<^. 6 |<^. Bezier, three points | |\2<^. |<^. 8 |<^. Line, one point | |<^. +4 |<^. n |<^. 0 - 3 |<^. sets of (x,y) dependant on tag | h3(#spriteobject). Sprite Object (Object Type 5) This is followed by a [[Format Of Sprite|sprite]], which is scaled to fill bounding box. h3(#groupobject). Group Object (Object Type 6) |_<^{width:4em}. Offset |_<^{width:4em}. Length |_<^. Contents | |<^. 0 |<^. 12 |<^. Group object name (padded with spaces) | and then a sequence of objects. These will all lie within the bounding box of this. h3(#groupobject). Tagged Object (Object Type 7) |_<^{width:4em}. Offset |_<^{width:4em}. Length |_<^. Contents | |<^. 0 |<^. 4 |<^. Tagged identifier | and then followed by an object and optional word-aligned data. h3(#textareaobject). Text Area Object (Object Type 9) First, 1 or more "text columns":#textcolumnobject and then: |_<^{width:4em}. Offset |_<^{width:4em}. Length |_<^. Contents | |<^. 0 |<^. 4 |<^. Zero to mark end of columns | |<^. 4 |<^. 4 |<^. Reserved | |<^. 8 |<^. 4 |<^. Reserved | |<^. 12 |<^. 4 |<^. Initial foreground colour | |<^. 16 |<^. 4 |<^. Initial background hint | |<^. 20 |<^. n |<^. Zero terminated "body of text":#escapesequence | |\3<^. padding | h3(#textcolumnobject). Text Column Object (Object Type 10) No data other than the standard 6 word header - the bounding box in the header gives the location of the column. Text column objects can only occur in "Text area objects":#textareaobject. h3(#optionsobject). Options Object (Object Type 11) This object has space for a bounding box, but the 4 words should be set to zero. |_<^{width:4em}. Offset |_<^{width:4em}. Length |_<^. Contents | |<^. 0 |<^. 4 |<^. "Paper size":#papersize | |<^. 4 |<^. 4 |<^. "Paper limits":#paperlimits | |<^. 8 |<^. 8 |<^. Grid spacing (floating point) | |<^. 16 |<^. 4 |<^. Grid division | |<^. 20 |<^. 4 |<^. "Grid type":#gridtype | |<^. 24 |<^. 4 |<^. "Grid auto-adjust":#gridauto | |<^. 28 |<^. 4 |<^. "Grid visible":#gridvisible | |<^. 32 |<^. 4 |<^. "Grid units":#gridunits | |<^. 36 |<^. 4 |<^. Zoom multiplier (1 - 8) | |<^. 40 |<^. 4 |<^. Zoom divider (1 - 8) | |<^. 44 |<^. 4 |<^. "Zoom locking":#zoomlocking | |<^. 48 |<^. 4 |<^. "Toolbox Presence":#toolboxpresence | |<^. 52 |<^. 4 |<^. "Initial entry mode":#entrymode | |<^. 56 |<^. 4 |<^. Undo buffer (size in bytes) | h4(#papersize). Paper Size |_<^{width:4em}. Value |_<^. Meaning | |<^. &100 |<^. A0 | |<^. &200 |<^. A1 | |<^. &300 |<^. A2 | |<^. &400 |<^. A3 | |<^. &500 |<^. A4 | |<^. &600 |<^. A5 | |<^. &700 |<^. A6 | |<^. &800 |<^. A7 | h4(#paperlimits). Paper Limits |_<^{width:4em}. Bit |_<^. Meaning when set | |<^. 0 |<^. Show limits | |<^. 1 - 3 |<^. Reserved | |<^. 4 |<^. Landscape (otherwise Portrait) | |<^. 5 - 7 |<^. Reserved | |<^. 8 |<^. Default to printer limits | |<^. 9 - 31 |<^. Reserved | h4(#gridtype). Grid Type |_<^{width:4em}. Value |_<^. Meaning | |<^. 0 |<^. Rectangular grid | |<^. <> 0 |<^. Isometric grid | h4(#gridauto). Grid Auto-adjust |_<^{width:4em}. Value |_<^. Meaning | |<^. 0 |<^. Auto-adjust is disabled | |<^. <> 0 |<^. Auto-adjust is enabled | h4. Grid Visible |_<^{width:4em}. Value |_<^. Meaning | |<^. 0 |<^. Grid is not visible | |<^. <> 0 |<^. Grid is visible | h4(#gridunits). Grid Units |_<^{width:4em}. Value |_<^. Meaning | |<^. 0 |<^. Grid units is inches | |<^. <> 0 |<^. Grid units is cm | h4(#zoomlocking). Zoom Locking |_<^{width:4em}. Value |_<^. Meaning | |<^. 0 |<^. Zoom locking is set to none | |<^. <> 0 |<^. Zoom locking is set to powers of 2 | h4(#toolboxpresence). Toolbox Presence |_<^{width:4em}. Value |_<^. Meaning | |<^. 0 |<^. Toolbox is absent | |<^. <> 0 |<^. Toolbox is present | h4(#entrymode). Initial Entry Mode |_<^{width:4em}. Bit |_<^. Meaning when set | |<^. 0 |<^. Line | |<^. 1 |<^. Closed line | |<^. 2 |<^. Curve | |<^. 3 |<^. Closed curve | |<^. 4 |<^. Rectangle | |<^. 5 |<^. Ellipse | |<^. 6 |<^. Text line | |<^. 7 |<^. Select | h3(#transtextobject). Transformed Text Object (Object Type 12) |_<^{width:4em}. Offset |_<^{width:4em}. Length |_<^. Contents | |<^. 24 |<^. 24 |<^. [[Transformation Matrix|Transformation matrix]] | |<^. 48 |<^. 4 |<^. "Font flags":#fontflags | |<^. 52 |<^. 4 |<^. Text colour | |<^. 56 |<^. 4 |<^. Background hint | |<^. 60 |<^. 4 |<^. "Text style":#textstyle | |<^. 64 |<^. 4 |<^. X-size (in 1/640's of a point) | |<^. 68 |<^. 4 |<^. Y-size (ie draw units) | |<^. 72 |<^. 4 |<^. X coord of start of baseline | |<^. 76 |<^. 4 |<^. Y coord of it | |<^. 80 |<^. 4 |<^. Zero terminated string padding | |\3<^. padding| h4(#fontflags). Font Flags |_<^{width:4em}. Bit |_<^. Meaning when set | |<^. 0 |<^. Kern text | |<^. 1 |<^. Right to left | h3(#transspriteobject). Transformed Sprite Object (Object Type 13) |_<^{width:4em}. Offset |_<^{width:4em}. Length |_<^. Contents | |<^. 24 |<^. 24 |<^. [[Transformation Matrix|Transformation matrix]] | |<^. 48 |<^. - |<^. [[Format Of Sprite|Format of sprite]] | This is scaled to fill the bounding box. h3(#jpegobject). JPEG Object (Object Type 16) |_<^{width:4em}. Offset |_<^{width:4em}. Length |_<^. Contents | |<^. 24 |<^. 4 |<^. Height (draw units)| |<^. 28 |<^. 4 |<^. Width | |<^. 32 |<^. 4 |<^. x DPI (90 for a normal square pixel mode) | |<^. 36 |<^. 4 |<^. Y DPI | |<^. 40 |<^. 24 |<^. [[Transformation Matrix|Transformation matrix]] | |<^. 64 |<^. 4 |<^. Length of JPEG data | |<^. 68 |<^. n |<^. Embedded JPEG (strictly JFIF) file | |<^. .. |<^. 0 - 3 |<^. Padding to next word | Currently it seems that the 6 word transformation matrix is used only to scale the JPEG image and translate it from (0,0),(height,width) to the required position on the page. It is not known whether this object can contain JPEG data in any format other than a JFIF file. h3(#textstyle). Text Style First (lowest) byte is fontnumber, and refers to font in font table. The rest of word is reserved, and should be zero. h3(#pathstyle). Path Style |_<^{width:4em}. Bit |_<^. Value |_<^. Meaning | |/4<^. 0 - 1 |<^. |<^. Join style:| |<^. 0 |<^. Mitred | |<^. 1 |<^. Round | |<^. 2 |<^. Bevelled | |/5<^. 2 - 3 |<^. |<^. Start cap: | |<^. 0 |<^. Butt | |<^. 1 |<^. Round | |<^. 2 |<^. Square | |<^. 3 |<^. Triangle | |<^. 4 - 5 |<^. |<^. End cap| |/3<^. 6 |<^. |<^. Winding rule: | |<^. 0 |<^. Non-zero | |<^. 1 |<^. Even-odd | |/3<^. 7 |<^. |<^. Dash pattern | |<^. 0 |<^. None | |<^. 1 |<^. Present | |<^. 16 - 23 |<^. |<^. Triangle cap width | |<^. 24 - 31 |<^. |<^. Triangle cap length | h3(#escapesequence). Escape Sequence in Draw Text Area |_<^ Sequence |_<^. Meaning | |<^. \!<version>/ |<^. Version must be 1 | |<^. \A<code> |<^. Alignment: L, R, C, D | |<^. \B<R> <G> <B>/ |<^. Set background hint | |<^. \C<R> <G> <B>/ |<^. Set foreground colour | |<^. \D<number>/ |<^. Number of columns | |<^. \F<digit><name> <size> [<width>]/ |<^. Declare a font | |<^. \<digit> |<^. Select a font | |<^. \L<value>/ |<^. Leading | |<^. \M<left> <right>/ |<^. Sets margins | |<^. \P<value>/ |<^. Paragraph leading | |<^. \U<pos> <thickness>/ |<^. Turn on underline | |<^. \V[-]<digit> |<^. Vertical move | |<^. \- |<^. Soft hyphen | |<^. \<newline> |<^. Force line break | |<^. \\ |<^. "\" | |<^. \;<text> <newline> |<^. Comment | h4. See also * [[DrawFile]] * [[DrawFile_BBox]] * [[DrawFile_Render]] * [[Format Of Sprite]] * [[Service_DrawObjectDeclareFonts]]