Projects/Liberty/File Formats/Janome Embroidery Format

From KDE Community Wiki
Revision as of 22:01, 28 July 2012 by Dboddie (talk | contribs)

Janome Embroidery Format

The Janome Embroidery Format .jef (and .sow) files contain a header and stitch instructions, but does not contain any obvious signature bytes. The only signature is to see if the thread change table is the correct size and the file length is right for the number of thread changes and the number of stitches. For the .jef+ format there is extra data after the thread tables, then the 32bit aligned string "JANO", "ME\0\0", then a 32bit number (1 for a 1 thread pattern), then a 32bit bitmap-start offset which ruins the .jef 'signature', but now we have the string "JANOME".

The header contains a date, number of thread changes, number of stitches, stitch extent rectangle, other optional rectangles, and two thread change tables (the first is thread colour). The stitch instructions are pairs of 8 bit offsets (starting from the centre of the design) with an escape sequence for move, thread change, and end of pattern.

Offset Description
0x0000 Stitch-start offset
0x0004 Flags, domain: 0x1, 0xa
0x0008 Date ASCII YYYY
0x000C Date ASCII MMDD
0x0010 TIME ASCII HHMM
0x0014 TIME ASCII SS00
0x0018 Thread-load-count
0x001C Stitch-count
0x0020 Hoop-code, domain: 0 "A 126mm x 110mm", 1 "C 50mm x 50mm", 2 "B 140mm x 200mm", 3, 4
0x0024 Stitch-extent-left 0.1mm units from centre
0x0028 Stitch-extent-top
0x002C Stitch-extent-right
0x0030 Stitch-extent-bottom
0x0034 box2-left -- minus 1 appears to indicate not used
0x0038 box2-top
0x003C box2-right
0x0040 box2-bottom
0x0044 box3-left
0x0048 box3-top
0x004C box3-right
0x0050 box3-bottom
0x0054 box4-left
0x0058 box4-top
0x005C box4-right
0x0060 box4-bottom
0x0064 box5-left
0x0068 box5-top
0x006C box5-right
0x0070 box5-bottom
0x0074 thread-colour-table, domain: 0x01 - 0x4e -- there are **79** colours in the Janome catalogue
+ Thread-load-count * 4
+ 0x0000 thread-type-table, domain: 0xd
+ Thread-load-count * 4
+ 0x0000 jef plus zero
+ 0x0004 jef plus zero
+ 0x0008 jef plus "JANO"
+ 0x000C jef plus "ME"
+ 0x0010 jef plus bitmap-count (may be)
+ 0x0014 jef plus bitmap-start offset
...
Stitch- start stitch-table pairs of signed 8bit values, either 0x80 and command or dx and dy
...
bitmap- start jef plus bitmap