home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d01xx / d0185.lha / TP_IFF_Specs / WORD < prev   
Text File  |  1988-12-13  |  7KB  |  241 lines

  1. TITLE:  WORD  (word processing FORM used by ProWrite)
  2.  
  3. IFF FORM / CHUNK DESCRIPTION
  4. ============================
  5.  
  6. Form/Chunk IDs:
  7.    FORM   WORD
  8.    Chunks FONT,COLR,DOC,HEAD,FOOT,PCTS,PARA,TABS,PAGE,TEXT,FSCC,PINF
  9.  
  10. Date Submitted: 03/87
  11. Submitted by:   James Bayless - New Horizons Software, Inc.
  12.  
  13.  
  14. FORM
  15. ====
  16.  
  17. FORM ID:  WORD
  18.  
  19. FORM Purpose:  Document storage (supports color, fonts, pictures)
  20.  
  21. FORM Description:
  22.  
  23. This include file describes FORM WORD and its Chunks
  24.  
  25. /*
  26.  *      IFF Form WORD structures and defines
  27.  *      Copyright (c) 1987 New Horizons Software, Inc.
  28.  *
  29.  *      Permission is hereby granted to use this file in any and all
  30.  *      applications.  Modifying the structures or defines included
  31.  *      in this file is not permitted without written consent of
  32.  *      New Horizons Software, Inc.
  33.  */
  34.  
  35. #include ":IFF/ILBM.h"        /* Makes use of ILBM defines */
  36.  
  37. #define ID_WORD      MakeID('W','O','R','D')      /* Form type */
  38.  
  39. #define ID_FONT      MakeID('F','O','N','T')      /* Chunks */
  40. #define ID_COLR      MakeID('C','O','L','R')
  41. #define ID_DOC       MakeID('D','O','C',' ')
  42. #define ID_HEAD      MakeID('H','E','A','D')
  43. #define ID_FOOT      MakeID('F','O','O','T')
  44. #define ID_PCTS      MakeID('P','C','T','S')
  45. #define ID_PARA      MakeID('P','A','R','A')
  46. #define ID_TABS      MakeID('T','A','B','S')
  47. #define ID_PAGE      MakeID('P','A','G','E')
  48. #define ID_TEXT      MakeID('T','E','X','T')
  49. #define ID_FSCC      MakeID('F','S','C','C')
  50. #define ID_PINF      MakeID('P','I','N','F')
  51.  
  52. /*
  53.  *   Special text characters for page number, date, and time
  54.  *   Note:  ProWrite currently supports only PAGENUM_CHAR, and only in
  55.  *      headers and footers
  56.  */
  57.  
  58. #define PAGENUM_CHAR   0x80
  59. #define DATE_CHAR      0x81
  60. #define TIME_CHAR      0x82
  61.  
  62. /*
  63.  *   Chunk structures follow
  64.  */
  65.  
  66. /*
  67.  *   FONT - Font name/number table
  68.  *   There are one of these for each font/size combination
  69.  *   These chunks should appear at the top of the file (before document data)
  70.  */
  71.  
  72. typedef struct {
  73.    UBYTE   Num;         /* 0 .. 255 */
  74.    UWORD   Size;
  75. /* UBYTE   Name[];      */   /* NULL terminated, without ".font" */
  76. } FontID;
  77.  
  78. /*
  79.  *   COLR - Color translation table
  80.  *   Translates from color numbers used in file to ISO color numbers
  81.  *   Should be at top of file (before document data)
  82.  *   Note:  Currently ProWrite only checks these values to be its current map,
  83.  *      it does no translation as it does for FONT chunks
  84.  */
  85.  
  86. typedef struct {
  87.    UBYTE   ISOColors[8];
  88. } ISOColors;
  89.  
  90. /*
  91.  *   DOC - Begin document section
  92.  *   All text and paragraph formatting following this chunk and up to a
  93.  *   HEAD, FOOT, or PICT chunk belong to the document section
  94.  */
  95.  
  96. #define PAGESTYLE_1   0      /* 1, 2, 3 */
  97. #define PAGESTYLE_I   1      /* I, II, III */
  98. #define PAGESTYLE_i   2      /* i, ii, iii */
  99. #define PAGESTYLE_A   3      /* A, B, C */
  100. #define PAGESTYLE_a   4      /* a, b, c */
  101.  
  102. typedef struct {
  103.    UWORD   StartPage;      /* Starting page number */
  104.    UBYTE   PageNumStyle;   /* From defines above */
  105.    UBYTE   pad1;
  106.    LONG    pad2;
  107. } DocHdr;
  108.  
  109. /*
  110.  *   HEAD/FOOT - Begin header/footer section
  111.  *   All text and paragraph formatting following this chunk and up to a
  112.  *   DOC, HEAD, FOOT, or PICT chunk belong to this header/footer
  113.  *   Note:  This format supports multiple headers and footers, but currently
  114.  *      ProWrite only allows a single header and footer per document
  115.  */
  116.  
  117. #define PAGES_NONE   0
  118. #define PAGES_LEFT   1
  119. #define PAGES_RIGHT  2
  120. #define PAGES_BOTH   3
  121.  
  122. typedef struct {
  123.    UBYTE   PageType;       /* From defines above */
  124.    UBYTE   FirstPage;      /* 0 = Not on first page */
  125.    LONG   pad;
  126. } HeadHdr;
  127.  
  128. /*
  129.  *   PCTS - Begin picture section
  130.  *   Note:  ProWrite currently requires NPlanes to be three (3)
  131.  */
  132.  
  133. typedef struct {
  134.    UBYTE   NPlanes;      /* Number of planes used in picture bitmaps */
  135.    UBYTE   pad;
  136. } PictHdr;
  137.  
  138. /*
  139.  *   PARA - New paragraph format
  140.  *   This chunk should be inserted first when a new section is started (DOC,
  141.  *      HEAD, or FOOT), and again whenever the paragraph format changes
  142.  */
  143.  
  144. #define SPACE_SINGLE   0
  145. #define SPACE_DOUBLE   0x10
  146.  
  147. #define JUSTIFY_LEFT    0
  148. #define JUSTIFY_CENTER  1
  149. #define JUSTIFY_RIGHT   2
  150. #define JUSTIFY_FULL    3
  151.  
  152. #define MISCSTYLE_NONE   0
  153. #define MISCSTYLE_SUPER  1      /* Superscript */
  154. #define MISCSTYLE_SUB    2      /* Subscript */
  155.  
  156. typedef struct {
  157.    UWORD   LeftIndent;    /* In decipoints (720 dpi) */
  158.    UWORD   LeftMargin;
  159.    UWORD   RightMargin;
  160.    UBYTE   Spacing;       /* From defines above */
  161.    UBYTE   Justify;       /* From defines above */
  162.    UBYTE   FontNum;       /* FontNum, Style, etc. for first char in para*/
  163.    UBYTE   Style;         /* Standard Amiga style bits */
  164.    UBYTE   MiscStyle;     /* From defines above */
  165.    UBYTE   Color;         /* Internal number, use COLR to translate */
  166.    LONG    pad;
  167. } ParaFormat;
  168.  
  169. /*
  170.  *   TABS - New tab stop types/locations
  171.  *   Use an array of values in each chunk
  172.  *   Like the PARA chunk, this should be inserted whenever the tab settings
  173.  *      for a paragraph change
  174.  *   Note:  ProWrite currently does not support TAB_CENTER
  175.  */
  176.  
  177. #define TAB_LEFT     0
  178. #define TAB_CENTER   1
  179. #define TAB_RIGHT    2
  180. #define TAB_DECIMAL  3
  181.  
  182. typedef struct {
  183.    UWORD   Position;      /* In decipoints */
  184.    UBYTE   Type;
  185.    UBYTE   pad;
  186. } TabStop;
  187.  
  188. /*
  189.  *   PAGE - Page break
  190.  *   Just a marker -- this chunk has no data
  191.  */
  192.  
  193. /*
  194.  *   TEXT - Paragraph text (one block per paragraph)
  195.  *   Block is actual text, no need for separate structure
  196.  *   If the paragraph is empty, this is an empty chunk -- there MUST be
  197.  *   a TEXT block for every paragraph
  198.  *   Note:  The only ctrl characters ProWrite can currently handle in TEXT
  199.  *   chunks are Tab and PAGENUM_CHAR, ie no Return's, etc.
  200.  */
  201.  
  202. /*
  203.  *   FSCC - Font/Style/Color changes in previous TEXT block
  204.  *   Use an array of values in each chunk
  205.  *   Only include this chunk if the previous TEXT block did not have
  206.  *      the same Font/Style/Color for all its characters
  207.  */
  208.  
  209. typedef struct {
  210.    UWORD   Location;      /* Character location in TEXT chunk of change */
  211.    UBYTE   FontNum;
  212.    UBYTE   Style;
  213.    UBYTE   MiscStyle;
  214.    UBYTE   Color;
  215.    UWORD   pad;
  216. } FSCChange;
  217.  
  218. /*
  219.  *   PINF - Picture info
  220.  *   This chunk must only be in a PCTS section
  221.  *   Must be followed by ILBM BODY chunk
  222.  *   Pictures are treated independently of the document text (like a
  223.  *      page-layout system), this chunk includes information about what
  224.  *      page and location on the page the picture is at
  225.  *   Note:  ProWrite currently only supports mskTransparentColor and
  226.  *      mskHasMask masking
  227.  */
  228.  
  229. typedef struct {
  230.    UWORD         Width, Height;   /* In pixels */
  231.    UWORD         Page;         /* Which page picture is on (0..max) */
  232.    UWORD         XPos, YPos;      /* Location on page in decipoints */
  233.    Masking       Masking;      /* Like ILBM format */
  234.    Compression   Compression;   /* Like ILBM format */
  235.    UBYTE         TransparentColor;   /* Like ILBM format */
  236.    UBYTE         pad;
  237. } PictInfo;
  238.  
  239. /* end */
  240.  
  241.