Description of .WP format used by Sharp Font Writer =================================================== (Mostly from files created by a Font Writer FW-750) Contents -------- A. File Layout B. Data Structures C. Things I Don't Know D. Conversion Notes A. File Layout ============== Preliminary section ------------------- Address Content ------- ------- 0000 Byte: Oxff 0001-0029 Text: (Model name?) zero-padded "SCFWS-187FW-750 SHARP FontWriter7" "SCFWS-174FW-700 SHARP FontWriter3" 002a-002c Locale string I have seen the following: "UK"+0x00 and "GM". 002d-002f Text: "WP"+0x00 0030-0047 Text: (Version number three times) "Ver.1.10" or "Ver.1.00" 0048-0049 Word: Start of text = Start of Text Section + 4 (see later) 004a-00fd Zeros Global data section ------------------- Address Content ------- ------- 00fe-00ff UNKNOWN Seems to be connected with amount of formatting. Files with no formatting have this as 0x12b8 Files with one Character formatting chunk have: 0x12be (=0x12b8+6) Files with one Paragraph formatting chunk have: 0x12c8 (=0x12b8+0x10) But seems to loop round - files with large amount formatting go through 0x1300s, but then back into to 0x1200s (modulo 512?) 0100-0101 Total file length in bytes 0102-010d UNKNOWN 0x0102 0x0000 0x0104 0x0000 0x0106 0x0000 0x0108 0x0000 0x010a 0x001e 0x010c 0x0000 010e-0111 Information about paragraph formatting (format 90) section 0x010e = Byte-length of format90 section, including leading 0x8383 0x0110 = Number of format90 blocks, so this *16+2 equals value at 0x010e 0112-0115 Information about tab formatting (format 94) section 0x0112 = Byte-length of format94 section, including leading 0x8383 0x0114 = Number of format94 blocks, so this *50+2 equals value at 0x0112 0116-0119 Information about character formatting (format 92) section 0x0116 = Byte-length of format92 section including leading 0x8383 (not including trailing 4*6=0x18) 0x0118 = Number of format 92 blocks so this *6+2 equals value at 0x0116 011a-011d Information about header/footer formatting data 0x011a = Byte-length of header/footer section (always 0x0134) 0x011c = Number of header/footer formatting sections (always 0x0002) 011e-011f Length of text block, including leading 0x8383 (Same as word at beginning of text block) 0120-0121 Length of frame (format 99) data section 0122-0123 Number of frames. 0124-0127 Number of frame row and column lines, (16 bit) twice 0128-0197 Zeros (sometimes has some UNKNOWN data in here) 0198-01df Default formatting information Structure of these sections is described in Part B. 0x0198-0x01a7 - Default paragraph (90) data 0x01a8-0x01d9 - Default tab (94) data 0x01da-0x01df - Default character (92) data 01e0-01ff Name of address-book file (for mail-merge) Zeros 0200-020f Paper size and margins + other data: (!!See note on distance units in section D!!) A3 portrait: 00 00 1a 73 c5 a2 d8 09 d8 09 4a 0d 4a 0d 01 02 A4 portrait: 00 01 63 51 1a 73 d8 09 d8 09 d8 09 d8 09 01 02 A4 landscape: 00 02 1a 73 63 51 d8 09 d8 09 4a 0d 4a 0d 01 02 Letter portrait: 00 03 ac 53 48 6c d8 09 d8 09 d8 09 d8 09 01 02 Letter landscape: 00 04 48 6c ac 53 d8 09 d8 09 d8 09 d8 09 01 02 A5 portrait: 00 06 5b 39 63 51 d8 09 d8 09 d8 09 d8 09 01 02 A5 landscape: 00 07 63 51 5b 39 d8 09 d8 09 d8 09 d8 09 01 02 Invoice portrait: 00 08 0c 36 ac 53 d8 09 d8 09 d8 09 d8 09 01 02 Invoice landscape: 00 09 ac 53 0c 36 d8 09 d8 09 d8 09 d8 09 01 02 System portrait: 00 0a d1 24 45 42 d8 09 d8 09 d8 09 d8 09 01 02 System landscape: 00 0b 45 42 d1 24 d8 09 d8 09 d8 09 d8 09 01 02 Custom: 00 0c 60 27 5c 67 d8 09 d8 09 d8 09 d8 09 01 02 \___/ \___/ \___/ \___/ \___/ \___/ \___/ id width height top bot left? right? (in 100ths of mms) 0x73a1 = 29466 -> 294.66mm (297 - 2.34) A-series 0x5163 = 20835 -> 208.35mm (210 - 1.65) 0x395b = 14683 -> 146.83mm 0x6c48 = 27720 -> 277.20mm (279.4 - 2.2) Letter 0x53ac = 21420 -> 214.20mm (215.9 - 1.7) 0x360c = 13836 -> 138.36mm Invoice 0x53ac = 21420 -> 214.20mm 0x24d1 = 9425 -> 94.25mm System 0x4245 = 16965 -> 169.65mm 0x03e0 = 992 0x05d0 = 1488 0x0762 = 1890 (0.75 inch) 0x09d8 = 2520 (1 inch) 0x0d4a = 3402 (1.35 inch) 0210-021d 0x01, followed by 0x00 13times Formatting section (format90/92/94/headfooter) ---------------------------------------------- (Variable length) Format of all these is in Part B. Address Content ------- ------- 021e-021f 0x8383 0220- var Paragraph (format90) data (variable length, stored at 0x010e) Each chunk has length 0x10 variable 0x8383 var Tab (format94) data (variable length, stored at 0x0112) Each chunk has length decimal 50 var 0x8383 var Character (format 92) data (variable length, stored at 0x0116) Each chunk has length 6 var Header/footer data (length fixed, but also stored at 0x011a) Text section ------------ (Start address +4 stored at 0x0048. Variable length) Offset Content ------ ------- 0000-0001 Bytes 0x83,83 0002-0003 Word: Length of upcoming text-4?? (same as 0x011e) 0004- ? Text + control chars (variable length) Frames section -------------- 0000- ? Frames (format 99) data (each is 64 bytes, total length at 0x0120) ? - ? Line-type bytes. For each frame, hor lines, then vert lines. 00=none, 01=bold, 02=normal, 03=dotted, 04=dashed ? - Zero padding (not always present) B. Data Structures ================== Format 90 data (paragraph) -------------------------- In blocks of 8 16-bit words: 0x00: Line spacing: 0=Solid; 1=1.0; 2=1.5; 3=2.0; 4=3.0; 5=custom. Default 1. See (6) for custom. 0x02: LSB: Alignment: 0x00-left, 0x01-centred, 0x02-right 0x03-justified (default: justified) MSB: Shading: 0x01-shading 4 (diag lines); 0x02,0x05,0x03-shading 1-3 (dots); 0x04=shading 5 (trellis) 0x04: Left indent (100ths of mm) 0x06: Right indent 0x08: 1st-line indent 0x0a: 0x0000 0x0c: Custom line-spacing * 10. Default: 0x0a = 1.0 x 10 0x0e: 0x0000 Format 92 data (character) -------------------------- In blocks of 3 16-bit words (little-endian): 0x00: Font size in 10ths of pts 0x02: Typeface: 0x03 - swiss (sans-serif) 0x04 - dutch (serif, default) 0x05 - futura (sans-serif) 0x06 - courier 0x07 - script OR with 0x1000 to give condensed 0x04: Formatting flags: 0x0000 - normal 0x0010 - underline (thick) 0x0020 - underline (normal) 0x0030 - underline (dotted) 0x0050 - underline (dashed) 0x0080 - underline (double) 0x0100 - outline 0x0400 - italic 0x1000 - bold 0x4000 - superscript 0x8000 - subscript Format 94 data (tabs) --------------------- In blocks of 25 16-bit words First word is number of tabs. Remaining 24 words: First two bits tell what type 0-left, 1-centre, 2-right, 3-decimal Remaining bits are position (10ths of mm) Format 99 data (frames) ----------------------- In blocks of 64 bytes. 0x0000 - no of rows (= no of horizontal lines -1) 0x0002 - no of columns (= no of vertical lines -1) 0x0004 - 0x0000? 0x0006 - 0x09d8? (1 inch!) 0x0008 - No of horizontal + vertial lines 0x000a - Offset into frame line data for this frame 0x000c - 0x0000? 0x000e - No of vertical lines ? 0x0010 - posns of vertical lines in 100ths of mms (16 bits each, then zeros) Vertical lines: 24 Header/footer data ------------------ headfoot.wp - header + footer (default) 0000, 0762, 0000, 0101, 0064, 0004, 0000, 0000, 0000, 0000, 0000, 0000, 0000 headfoot2.wp - header 0000, 09d8, 0200, 0102, 0064, 0004, 0000, 0000, 0000, 0000, 0000, 0000, 0000 headfoot2.wp - footer 0000, 05d0, 0100, 0103, 0050, 0006, 0020, 0000, 0000, 0000, 0000, 0000, 0000 \__/ \__/ \______________/ Header margin Page Format 92 data 100ths of mm Offset? (font size, face, decor) \__/ Alignment? Page offset: 1: 0101 2: 0102 3: 0103 -80: 01b0 Control sequences used in text section -------------------------------------- 0x08 - Tab (ASCII) 0x0c - Page-break (ASCII FF) 0x0d - New-line (ASCII CR) 0x9a - Hard space (non-breaking) 0x9b - Soft hyphen (ie optional) 0x90 ... 0x91 Marks formatted text corresponding to Paragraph formatting data above 0x92 ... 0x93 Marks formatted text corresponding to Character formatting data above 0x94 - New tab settings 0x95 ... 0x96 Marks text corresponding to merge code fields 0x99 - Frame indicator Character set ------------- Extended characters are represented by byte-pairs, the first byte being in the range e1-ed, the second in the range a0-df. e1/a0 A-acute b0 D-bar c0 G-breve d0 K-comma-below a1 A-grave b1 D-comma-above c1 G-dot d1 L-acute a2 A-circumflex b2 D-apostrophe c2 d2 L-caron a3 A-umlaut b3 D-stroke or ETH c3 H-circ d3 L-comma-below a4 A-tilde b4 E-acute c4 H-stroke d4 L-apostrophe a5 A-bar b5 E-grave c5 I-acute d5 L-stroke a6 A-breve b6 E-circ c6 I-grave d6 L-middle-dot a7 A-ring b7 E-uml c7 I-circ d7 N-acute a8 A-ogonek b8 E-caron c8 I-uml d8 N-tilde a9 AE-ligature b9 E-bar c9 I-tilde d9 N-caron aa C-acute ba E-breve ca I-bar da N-bar ab C-circumflex bb E-ogonek cb I-dot db N-breve ac C-caron bc G-acute cc I-ogonek dc N-comma-below ad C-cedilla bd G-grave cd dd N-comma-above ae C-dot be G-caron ce IJ-ligature de af D-caron bf G-comma-below cf J-circuflex df O-acute e2/a0 O-grave b0 S-caron c0 U-double-acute d0 acute a1 O-circ b1 S-bar c1 U-ogonek d1 grave a2 O-umlaut b2 S-comma-below c2 U-comma-above d2 circumflex a3 O-tilde b3 T-caron c3 W-circumflex d3 umlaut a4 O-bar b4 T-bar c4 Y-acute d4 tilde a5 O-breve b5 T-comma-below c5 Y-grave d5 caron a6 O-double-acute b6 T-apostrope c6 Y-circumflex d6 cedilla a7 O-comma-abov b7 T-stroke c7 Y-umlaut d7 bar a8 O-stroke b8 U-acute c8 Y-breve d8 breve a9 OE-ligature b9 U-grave c9 Z-acute d9 ring aa R-acute ba U-circumflex ca Z-caron da dot ab R-grave bb U-umlaut cb Z-ring db double-acute ac R-caron bc U-tilde cc Z-dot dc comma-below ad R-comma-below bd U-bar cd dd ogonek ae S-acute be U-breve ce Thorn de comma-above af S-circ bf U-ring cf df apostrophe e3/a0 a-acute b0 d-bar c0 g-breve d0 k-comma-below a1 a-grave b1 d-comma-above c1 g-dot d1 l-acute a2 a-circumflex b2 d-apostrophe c2 g-comma-above d2 l-caron a3 a-umlaut b3 d-stroke or eth c3 h-circ d3 l-comma-below a4 a-tilde b4 e-acute c4 h-stroke d4 l-apostrophe a5 a-bar b5 e-grave c5 i-acute d5 l-stroke a6 a-breve b6 e-circ c6 i-grave d6 l-middle-dot a7 a-ring b7 e-uml c7 i-circ d7 n-acute a8 a-ogonek b8 e-caron c8 i-uml d8 n-tilde a9 ae-ligature b9 e-bar c9 i-tilde d9 n-caron aa c-acute ba e-breve ca i-bar da n-bar ab c-circumflex bb e-ogonek cb db n-breve ac c-caron bc g-acute cc i-ogonek dc n-comma-below ad c-cedilla bd g-grave cd i-no-dot dd n-comma-above ae c-dot be g-caron ce ij-ligature de apostrophe-n af d-caron bf cf j-circuflex df o-acute e4/a0 o-grave b0 s-caron c0 u-double-acute d0 a1 o-circ b1 s-bar c1 u-ogonek d1 a2 o-umlaut b2 s-comma-below c2 u-comma-above d2 a3 o-tilde b3 t-caron c3 w-circumflex d3 a4 o-bar b4 t-bar c4 y-acute d4 a5 o-breve b5 t-comma-below c5 y-grave d5 a6 o-double-acute b6 t-apostrope c6 y-circumflex d6 a7 o-comma-abov b7 t-stroke c7 y-umlaut d7 a8 o-stroke b8 u-acute c8 y-breve d8 a9 oe-ligature b9 u-grave c9 z-acute d9 aa r-acute ba u-circumflex ca z-caron da ab r-grave bb u-umlaut cb z-ring db ac r-caron bc u-tilde cc z-dot dc ad r-comma-below bd u-bar cd z,l-stroke dd ae s-acute be u-breve ce thorn de af s-circ bf u-ring cf ss-ligature df Greek: e5/a0 ALPHA b0 RHO c0 alpha d0 rho a1 BETA b1 SIGMA c1 beta d1 sigma a2 GAMMA b2 TAU c2 gamma d2 tau a3 DELTA b3 UPSILON c3 delta d3 upsilon a4 EPSILON b4 PHI c4 epsilon d4 phi a5 ZETA b5 CHI c5 zeta d5 chi a6 ETA b6 PSI c6 eta d6 psi a7 THETA b7 OMEGA c7 theta d7 omega a8 IOTA b8 c8 iota d8 var-epsilon a9 KAPPA b9 c9 kappa d9 var-theta aa LAMBDA ba ca lambda da var-pi (omega-pi) ab MU bb cb mu db var-sigma ac NU bc cc nu dc var-kappa ad XI bd cd xi dd var-phi ae OMICRON be ce omicron de af PI bf cf pi df Typographic: e6/a0 centre-dot b0 open-s-quote c0 ffl d0 sup-6 a1 degree b1 close-s-quote c1 fi d1 sup-7 a2 black-degree b2 open-d-quote c2 fl d2 sup-8 a3 paragraph b3 close-d-quote c3 Pounds d3 sup-9 a4 section b4 low-d-quote c4 Yen d4 1/2 a5 inverted-! b5 low-d-quote c5 Pesetas d5 1/4 a6 inverted-? b6 en-dash c6 Francs d6 3/4 a7 feminine-ord b7 em-dash c7 cents d7 1/8 a8 masculine-ord b8 open-s-guill c8 f d8 3/8 a9 currency b9 close-s-guill c9 0-slash d9 5/8 aa copyright ba open-d-guill ca sup-0 da 7/8 ab registered-tm bb close-d-guill cb sup-1 db broken-pipe ac dagger bc double-uline cc sup-2 dc ad double-dagger bd !! cd sup-3 dd ae TM be ff ce sup-4 de af elipsis (...) bf ffi cf sup-5 df Symbol: e7/a0 small-circle b0 small-club c0 circle-10 d0 black-smile a1 circle b1 small-diamond c1 circle-1 d1 white-bullet a2 big-circle b2 small-spade c2 circle-2 d2 inverted-bullet a3 small-square b3 heart c3 circle-3 d3 inverted-circle-bullet a4 square b4 club c4 circle-4 d4 compass a5 big-square b5 diamond c5 circle-5 d5 inverted-not a6 small-r-tria b6 spade c6 circle-6 d6 house a7 right-triang b7 circle-1 c7 circle-7 d7 thick-dash a8 small-diamond b8 circle-2 c8 circle-8 d8 right-triangle a9 diamond b9 circle-3 c9 circle-9 d9 left-triangle aa triangle-up ba circle-4 ca circle-10 da down-triangle ab triangle-down bb circle-5 cb quaver db up-triangle ac thin-v-bar bc circle-6 cc semi-quavers dc ad v-bar bd circle-7 cd male dd ae thick-v-bar be circle-8 ce female de af small-heart bf circle-9 cf white-smile df Ornament and Ornament 2: e8/a0 tick b0 aeroplane c0 l-brace d0 maltese-cross a1 tick b1 scissors c1 r-brace d1 four-leaved-clover a2 arrow -> b2 pisces c2 floral d2 heavy-x a3 arrow -> b3 aquarius c3 floral d3 heavy-asterisk a4 squat-arrow b4 capricorn c4 floral d4 heavy-asterisk-white-circle a5 white-arrow b5 sagittarius c5 floral d5 eight-point-star a6 white-arrow b6 scorpio c6 floral d6 twelve-point-star a7 white-fin-arrow b7 libra c7 ~-ornament d7 heavy-teardrop-spoked-asterisk a8 ne-block-arrow b8 virgo c8 ~-ornament d8 teardrop-spoked-asterisk a9 e-block-arrow b9 leo c9 white-star d9 fleur-de-lys aa se-ablock-arrow ba cancer ca black-star da pumpkin-head ab white-fist bb gemini cb white-6-star db white-star-with-shadow ac black-fist bc taurus cc black-6-star dc eight-petalled-florette ad phone-handset bd aries cd whte-star-blk-circ dd snowflake ae black-phone be l-brace ce diamond-white-x de twelve-teardrop-spoked-asterisk af envelope bf r-brace cf heavy-greek-cross df xmas-tree Ornament 2 continued: e9/a0 xmas-tree b0 black-block c0 d0 a1 bell b1 c1 d1 a2 xmas-wreath b2 c2 d2 a3 l-brace b3 c3 d3 a4 r-brace b4 c4 d4 a5 l-holly? b5 c5 d5 a6 r-holly? b6 c6 d6 a7 candle b7 c7 d7 a8 light-shade b8 c8 d8 a9 mid-shade b9 c9 d9 aa dark-shade ba ca da ab solid-block bb cb db ac left-half-block bc cc dc ad top-half-block bd cd dd ae right-half-bloc be ce de af bottom-half-blo bf cf df Arrows: ea/a0 right-arrow b0 sw-arrow c0 {-top d0 a1 left-arrow b1 l-r-arrow c1 {-middle d1 a2 up-arrow b2 u-d-arrow c2 {-bottom d2 a3 down-arrow b3 c3 }-top d3 a4 l-r-arrow b4 c4 }-middle d4 a5 u-d-arrow b5 c5 }-bottom d5 a6 u-d-arrow b6 c6 [-top d6 a7 Right-arrow b7 c7 | d7 a8 Left-arrow b8 c8 ]-top d8 a9 Up-arrow b9 c9 [-bottom d9 aa Down-arrow ba ca ]-bottom da ab L-R-arrow bb cb l-angle-brac db ac U-D-arrow bc cc r-angle-brac dc ad ne-arrow bd cd / dd ae se-arrow be ce \ de af nw-arrow bf cf || df Box drawing: (u=single-up, U=double-up) eb/a0 u-d b0 u-d-r c0 U-r d0 a1 u-d-l b1 l-r c1 u-R d1 a2 u-d-L b2 u-d-l-r c2 d-R d2 a3 U-D-l b3 u-d-R c3 D-r d3 a4 D-l b4 U-D-r c4 U-D-l-r d4 a5 d-L b5 U-R c5 u-d-L-R d5 a6 U-D-L b6 D-R c6 l-u d6 a7 U-D b7 U-L-R c7 d-r d7 a8 D-L b8 D-L-R c8 d8 a9 U-L b9 U-D-R c9 d9 aa U-l ba L-R ca da ab u-L bb U-D-L-R cb db ac d-l bc u-L-R cc dc ad u-r bd U-l-r cd dd ae u-l-r be d-L-R ce de af d-l-r bf D-l-r cf df Math 1, Math 2: ec/a0 minus b0 ~ c0 contains d0 curly-d a1 multiply b1 approx-equals c1 not-element-of d1 nabla a2 divide b2 ~-equals c2 union d2 infinity a3 plus-minus b3 proportional-to c3 intersection d3 lazy-s a4 / b4 multiply-circle c4 subset d4 angle a5 <= b5 plus-circle c5 superset d5 perpendicular a6 >= b6 l-angle-bracket c6 not-subset d6 curly-l a7 curly-< b7 r-angle-bracket c7 not-superset d7 imaginary-part a8 curly-> b8 therefore c8 subset-eq d8 real-part a9 normal-< b9 because c9 superset-eq d9 Aleph aa normal-> ba there-exists ca prime da power-set ab not-equal bb for-all cb double-prime db planck-const/2pi ac not-equal bc not cc upper-dot dc surd ad dots-equal bd and cd upper-dbl-dot dd SIGMA-sum ae identical be or ce superscript-n de integral af not-identical bf element-of cf lozenge df integral-o ed/a0 PI-product b0 c0 d0 a1 surd-part? b1 c1 d1 a2 integral-top b2 c2 d2 a3 integal-middle b3 c3 d3 a4 integral-o-mid b4 c4 d4 a5 integral-bottom b5 c5 d5 a6 surd-part? b6 c6 d6 a7 surd-part? b7 c7 d7 a8 backwards-not b8 c8 d8 a9 b9 c9 d9 aa ba ca da ab bb cb db ac bc cc dc ad bd cd dd ae be ce de af bf cf df C. Things I Don't Know ====================== How tab-position marks interact with char/para formatting marks. How frames interact with formatting. D. Conversion Notes =================== Distance units -------------- The distance units used in the file are typically 100ths or 10ths of a mm. However, there seems to have been some sort of confusion. Setting a value to 1inch typically sets it to 2.52cm - this is slightly short of the true value of 2.54cm. This effects paper size, margins, indents and tab settings. Font match suggestions ---------------------- Courier -> Courier New Dutch (serif) -> Times New Roman Swiss (Sans-serif) -> Arial Script (Cursive) -> MT Corsiva (only default Windows script font?) (Better match is "Shelley Allegro Script", but this is not generally available.) Futura (sans-serif) -> MS sans-serif Order of formatting codes ------------------------- In files that I have looked at, a 0x90 (para formating begin code) is always either a: Preceded by 0x0d (ie end of para) b: Preceded by 0x91 (case i or ii below) c: Preceded by 0x93, which is preceded by 0x0d d: At the beginning of the file ? Other possibilities interacting with 0x94 ? a 0x91 is always either i: Preceded by 0x0d ii: Preceded by 0x93, which is preceded by 0x0d iii: At the end of the file ? Other possibilities interacting with 0x94 ? E. From FW-760 Manual ===================== page 63: Page 84: Max number of frames in a page is 50 Max number of rows in a frame is 99 Max number of vertical lines in a frame is 24 Page 86: It is not possible to have clip art images in a document including merge codes. A maximum of eight Clip Art images can besaved onto one document Page 100: