home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / h / hldevkit.zip / IFF_DOC.TEX < prev    next >
Text File  |  1992-04-28  |  30KB  |  880 lines

  1.  
  2. IFF Document Outline v0.1 Beta
  3.  
  4.  
  5. What is this format for?
  6.  
  7. This document contains a proposed IFF Document FORM. This structure is in it's early days and still requires some pampering. While I can easily ensure that this document structure will fill the needs of Soft-Logik products (and I will ensure that future versions of PageStream are compatible) I can not speak for others. While it would be nice to get other information programs to support this format in the future, a more immediate need is to ensure they CAN support this format in the future. Other points of interest would be add on products. For example Grammar Checkers, Indexers, Automated Layout, etc...
  8.  
  9. What spurred this one? HotLinks! For those of you who are unaware of what HotLinks is, let me explain. It's the exchange of Live Data. It's the ability to do work group editing. It's the ability to edit pieces of a large project in smaller pieces and have them assembled automatically. It's Publish/Subscribe on the Mac. It's DDE/OLE on the IBM. It's neat.
  10.  
  11. What exactly does it do? It merely is a database of sorts of all project pieces, keeping track of owner, privileges, name, description, version, who is editing the piece, etc. When one program wants to edit a piece, it asks for permission to edit, edits it if it got the write lock and then updates the piece if desired, and then frees the lock. If that piece is in use elsewhere, then that copy will be updated instantly if it's loaded, or updated the next time it's loaded.
  12.  
  13. What does this have to do with the document structure? Everything! For this to work, then programs must write everything they read, and agree on a format to exchange. If a user writes out a publication, edits in another program, and then goes back to the originating program and it can't read the file or changes that he had made (formatting, colorizing, sound score, whatever) is gone, the whole thing failed and should be thrown in the trash.
  14.  
  15. This applies to all information passed about. The DOC structure contained below also contains several subFORMs, and these FORMS are generally pieces that can be edited in other programs wanting to deal with those piece types. For example, subFORM ILBM of course can be published from within PageStream, edited in a bitmap editor, and then updated automatically in PageStream. Same for FORM DTXT and text editors, FORM DR2D and drawing programs, and standards not yet proposed such as Graphs, Tables, Crossword puzzles....
  16.  
  17. The current FORMs that are well on their way are ILBM (of course :-) and DTXT. These are supported by BME and PageLiner respectively, and PageStream supports both. Do to the nature of IFF and the way text commands and tags are implemented in DTXT, these formats can and will be extended to support new data. However, they must be backwards compatible with the following chunks.
  18.  
  19. The current ILBM chunks that are considered legal and valid are:
  20. BMHD - this has been extended to include picture type (CMYK, RGB, Greyscale,etc) and x&ydpi.
  21. CMAP
  22. BODY
  23. HLID - this is only used when writing a local copy of the data that has also been published via HotLinks. it is valid inside a HotLinks file, but redundant, and possible outdated.
  24. XBMI - this also is only used when writing a local copy of the data for compatibility with naughty ILBM readers. It is redundant considering that this info is now inside the BMHD (where it should be !)
  25.  
  26. The current DTXT chunks that are considered legal are valid are:
  27. CSET
  28. DTAG
  29. DTXT
  30. HLID - same as above for ILBMs
  31.  
  32. Now, let's get on with some round one definitions. If you run across something
  33. you have a problem with, post it on BIX, fax me, what ever. I will try and sort everything out so that everyone can support everything. Also, if it's not in this document, others won't know to support it. EVERYTHING must be here, and as accurate as possible.
  34.  
  35. Deron Kazmaier
  36. Soft-Logik Publishing Corp.
  37.  
  38. BIX:        dKazmaier
  39. GEnie:        Deron.K
  40. CIS:        76317,3633
  41. Soft-Logik BBS:    1-314-894-0057 Account #1
  42. U.S.Mail:        11131 F South Town Sq., St. Louis MO 63123
  43.  
  44.  
  45. IFF Standard's 101: The basics
  46.  
  47. This document structure tries to adhere to as much of the IFF 85 standard as possible. If you notice something that is wrong or being done by someone else in a different way, let us know. I am not trying to reinvent the wheel, only extend it!
  48.  
  49. each chunk is defined as follows:
  50. ChunkType        4 byte ID that is unique within a specific FORM
  51. Length        4 byte length of the data inside this block
  52. Data        series of bytes with a pad byte at the end if the length is odd
  53.  
  54. Forms are a special chunk where the ID is FORM and the first 4 bytes of the data in the FORM is the FORM type.
  55.  
  56. ChunkType is a four byte ID that is unique within the specific FORM definition.
  57. In other words, in a FORM of TYPE_TEXT, a chunk of ID "CMAP" might be a character
  58. map of some sort, where in a FORM of TYPE_PIC, a chunk by the same ID of
  59. "CMAP" but contain a color table.
  60.  
  61. If length is odd, an extra byte should be written at the end of the data so
  62. that the next ID would padded out to fall on a word boundary. The length of the chunk should not reflect this pad byte, but all FORMS that encapsulate the chuck should count it in their lengths. Also, in chunks that have punks (smaller yet chunks with a 2 byte ID and a 2 byte Length), they too would not include the pad length in the punk, but would include the pad byte(s) in the chunk.
  63.  
  64. Inside the data should be a group of closely related items. Also, it
  65. would be very verbose to define point size and attribute changes such as those
  66. as a new chunk when they would take up less data then the 8 byte header.
  67. And to break things like invisible hyphens or kerning amounts into their
  68. own chunks might cause some text to increase dramatically in size.
  69.  
  70. However, some items, such as possible Rulers or Graphics contained inside of
  71. a text block to indicate their location should probably be broken into
  72. something like TextBlock, RuleBlock, TextBlock. You get the idea.
  73.  
  74. If your HotLinks Read routines finds something that it doesn't understand,
  75. don't throw the data out. The data should be wrapped up in the same
  76. position it was in the original, and should be saved with the document
  77. to disk, as well as re-output by the HotLinks Write routines.
  78. (Note: this non-standard IFF as defined in the EA IFF 85, but important if the user wishes to get back everything he put in!!!!)
  79.  
  80.  
  81. All defined chunks should be extensible. Remember that even if you have fully processed a chunk, you should respect it's chunks size, even if it's larger than you expected. (Page 3 from the EA IFF 85 intro)
  82.  
  83. One problem through out this is managing relationships between Forms or Chunks or even just data. For example, we are calling tags up by their name, and this is fine because they are created by the user visually. Also, by using a name and looking it up, we can guarantee indexing to the right tags without having to worry about offsets that need fixing up. Reason for this is that if an applications is editing the file that does not support tags and it's related indexing, then and index would get out of sink with the data and would corrupt the data. Now you ask why do I mention this? It's because some indexes need to be done visually or internally, and to ask the user to enter a unique name would be a bit tedious. We need some way of dolling out unique numbers. Problem is if you break a file off and edit it and then bring it back, you have problems with duplicate numbers. Very bad also. Anybody got an elegant solution I'm missing?
  84.  
  85. Document Structure FORMs
  86.  
  87. These forms may need to be LISTs. There purpose is often to define the scope of the sub-forms/objects. For example, the PAGE FORM will contain objects that are on that page, and could be in a chapter/section form.
  88.  
  89. The MasterPage FORM contains Objects, and can be defined in a Document,Section or Chapter Form, and this defines it's scope. The Page Forms defined within it's scope must be able to reference a MasterPage by it's unique name. This allows several master pages to be defined, and used nearly randomly (as long as its scope is valid)
  90.  
  91. Those chunks in braces {} (or italics) below are optional. This mean that they would use the previously defined chunk in the layer above or use a default that is defined for the chunk.
  92.  
  93.  
  94.  
  95. Document Form (DOC )
  96.     {Publish Chunk}
  97.     {Desc Chunk}
  98.     {Section # Style Chunk}
  99.     {Chapter # Style Chunk}
  100.     {Page # Style Chunk}
  101.     {PageDim Chunk}
  102.     {ColumnGuides Chunk}
  103.     {Guides Chunk}
  104.     {Grid Chunk}
  105.  
  106.     Document Name
  107.  
  108. The DOC FORM contains all sub forms. (Section,Chapter,MasterPage,Page,Objects)
  109.  
  110.  
  111. Section Form (SECT)  scope: Document
  112.     {Publish Chunk}
  113.     {Desc Chunk}
  114.     {Section # Style Chunk}
  115.     {Chapter # Style Chunk}
  116.     {Page # Style Chunk}
  117.     {PageDim Chunk}
  118.     {ColumnGuides Chunk}
  119.     {Guides Chunk}
  120.     {Grid Chunk}
  121.  
  122.     Section Name
  123.     Section Number
  124.     Flag (AutoNumberSections)
  125.     Flag (OddPageAlignment)
  126.     Chapter Range (begin,#)
  127.  
  128.  
  129. Chapter Form (CHAP)  scope: Document,Section
  130.     {Publish Chunk}
  131.     {Desc Chunk}
  132.     {Chapter # Style Chunk}
  133.     {Page # Style Chunk}
  134.     {PageDim Chunk}
  135.     {ColumnGuides Chunk}
  136.     {Guides Chunk}
  137.     {Grid Chunk}
  138.  
  139.     Chapter Name
  140.     Chapter Number
  141.     Flag (AutoNumberChapters)
  142.     Flag (OddPageAlignment)
  143.     Page Range (begin,#)
  144.  
  145.  
  146. MasterPage Form (MPAG)  scope:Document,Section,Chapter
  147.     {Publish Chunk}
  148.     {Desc Chunk}
  149.     {ColumnGuides Chunk}
  150.     {Guides Chunk}
  151.     {Grid Chunk}
  152.     {PageDim Chunk}
  153.     {Page # Style Chunk}
  154.  
  155.     Type (Left / Right / Single)
  156.     MasterPage Name
  157.  
  158. Page Form (PAGE)  scope: Document,Section,Chapter
  159.     {Publish Chunk}
  160.     {Desc Chunk}
  161.     {ColumnGuides Chunk}
  162.     {Guides Chunk}
  163.     {Grid Chunk}
  164.     {PageDim Chunk}
  165.     {Page # Style Chunk}
  166.  
  167.     From MasterPage Name
  168.     Page Number
  169.  
  170.  
  171.  
  172. Document/Page Layout Chunks
  173.  
  174. PageDim Chunk
  175.     Upper Left Coordinate
  176.     Lower Right Coordinate
  177.     Flag (orientation (Landscape/Portrait))
  178. extend DRHD chunk. Perhaps should call it as such
  179.  
  180.  
  181. ColumnGuide Chunk
  182.     Inside Margin
  183.     Outside Margin
  184.     Top Margin
  185.     Bottom Margin
  186.     Horizontal # of Columns
  187.     Horizontal Space Between Columns
  188.     Vertical # of Columns
  189.     Vertical Space Between Columns
  190. this is to define a magnetic guides around the column locations. Perhaps this should just be a list of boxes? At the least, this definition should be repetitive so you can create newspaper format where the top half will have a different layout than the bottom (pure randomness actually)
  191.  
  192. Grid Chunk
  193.     XOffset
  194.     YOffset
  195.     Grid Width
  196.     Grid Height
  197.     Snap Strength
  198.     Flag (On/Off)
  199. grid snap definition. Perhaps a box range this exists in. ie deferent grids in different locations. what about diagonal grids.(ha ha)
  200.  
  201. Guide Chunk
  202.     # Horizontal
  203.     X1,X2,X3,X4...,XN
  204.     # Vertical
  205.     Y1,Y2,Y3,Y4...,YN
  206.     Snap Strength
  207.     Flag (On/Off)
  208. guide snap locations. similar to column but for non-columnar layout portions. diagonal?
  209.  
  210. General Chunks
  211.  
  212. Publish Chunk
  213.     Hotlink I.D.
  214.     Version #
  215.  
  216.     ULONG    type,HLID
  217.     ULONG    chunk length
  218.  
  219.     STRUCT,8    lock, 0=unpublished
  220.     ULONG    version
  221.  
  222. Description Chunk
  223.     Creation Date
  224.     Modification Date
  225.     Name
  226.     Comment
  227.     Author
  228.  
  229.     ULONG    type,DESC
  230.     ULONG    chunk length
  231.  
  232.     ULONG    creation date
  233.     ULONG    mod date
  234.     STRING    name,0
  235.     STRING    comment,0
  236.     STRING    author,0
  237.  
  238.  
  239. NAME Chunk
  240.     ULONG    type,NAME
  241.     ULONG    chunk length
  242.  
  243.     STRING    name,0
  244.  
  245.  
  246. ANNO Chunk
  247.     ULONG    type,ANNO
  248.     ULONG    chunk length
  249.  
  250.     STRING    annotations,0
  251.  
  252.  
  253. AUTH Chunk
  254.     ULONG    type,AUTH
  255.     ULONG    chunk length
  256.  
  257.     STRING    author,0
  258.  
  259.  
  260. (C) Chunk
  261.     ULONG    type,(C) 
  262.     ULONG    chunk length
  263.  
  264.     STRING    copyright text, 0
  265. by the way, (c) is not a legal representation for copyright.
  266.  
  267.  
  268.  
  269.  
  270. Tag Chunk Definitions
  271.  
  272. Tag Chunk (scope: Document, Section, Chapter, MasterPage, Page)
  273. Tags can recursivly call previously defined tags.
  274.  
  275.     ULONG    type,DTAG
  276.     ULONG    chunk length
  277.  
  278.         UWORD    length
  279.         UBYTE    type
  280.         UBYTE    flag
  281.         STRING    name, 0
  282.         STRING    attribute data
  283.  
  284.  
  285. Types are of the groups:
  286. TAG_TEXT        0    ;used for text tags
  287. TAG_FILL        1    ;used for filling objects
  288. TAG_LINE        2    ;used for stroking objects
  289. TAG_COLOR    3    ;used for coloring text/fills/lines
  290. TAG_WITHTEXT    4    ;for text insertion (chap heads/db merge)
  291. TAG_TEXTMACRO    5    ;should be flag for a true insertion?
  292.  
  293. These are attributes that can be defined for text & objects. To name them just put them in a DTAG and assign the DTAG. This can be for any of these effects.
  294.  
  295.  
  296.  
  297. Display Attributes
  298.  
  299.  
  300. Fill Attributes
  301.     Style
  302.         Solid
  303.         Pattern
  304.         Graduated Fill
  305.         Log Fill
  306.         Radial Fill
  307.         Fractal
  308.         Complex
  309.     Color
  310.     Halftone
  311.     PutMode
  312.  
  313. Line
  314.     Offset (>o = to the right)
  315.     Width
  316.     Style (dash pattern)
  317.     BeginStyle
  318.     EndStyle
  319.     Fill Attributes
  320.  
  321. LineEnd
  322.     (arrows,rounded, tapered, etc...)
  323.     polygon shape
  324.     need distance to subtract from end of line
  325.     need scale method/factor (width/height min./max.)
  326.     extend DR2D structure?
  327.  
  328.  
  329. Color
  330.     Type
  331.         Gray
  332.         RGB
  333.         HLS
  334.         HSV
  335.         CMYK
  336.         CIE
  337.         YCC
  338.         TekColor
  339.         Pantone
  340.     CMYK Equivalent value for display & 4 color sep
  341.     Transparency
  342.     Flag (Spot color)
  343.  
  344. ??Halftone
  345.     (for Yellow,Magenta,Cyan,Black,Custom)
  346.     SpotFunction
  347.         TrueSpot
  348.         Round
  349.         Elliptical
  350.         Square
  351.         Cross
  352.         Line
  353.         Custom
  354.     Frequency
  355.     Angle
  356.     DotGain Function
  357.  
  358. Trapping
  359.     Spreads/Chokes
  360.     Auto/Manual
  361.     Amount (.0001 increments) .003-.006 good defaults
  362.     Trap Type
  363.         No Trap
  364.         No Knockout (specific)
  365.         Trap with common
  366.         Trap with uncommon
  367.         Trap with Black (with color?)
  368.  
  369. Need provisions for:
  370.     gamma correction / UCR / GCR
  371.     max. ink coverage (300% usually 250-260% for web presses)
  372.  
  373. Object Types
  374. These are some of the forms one can expect to find on a page. These forms may have chunks that could be defined outside the scope of the form. For example, tags for a documents DTXT could be stored in the first nest level of the DOC structure. This would then be used by all subsequent DTXT forms. Same for others. Also, all drawn object on a page do not need to belong to a drawing. For example a simple rule drawn across or down a page. This would belong to the page form as part of it's description? Also, each of these forms can stand by its self as a file. For example, a DTXT form is used by PageLiner for it's native file format as well as the means of exchange text with PageStream. The DTXT would contain copies of all chunks whose scope is valid within the DTXT and are/could be used by the DTXT.
  375.  
  376. Text Form
  377. This is DTXT. The chunks CSET, DTAG, & DTXT are currently defined and valid.
  378.  
  379. Bitmap Form
  380. This is ILBM. The chunks BMHD, CMAP, & BODY are currently defined and valid.
  381.  
  382. Drawing Form
  383. This is DR2D. We need a LOT of extensions to build this into something that can represent a drawing even created in PageStream, much less one done in ArtExpression. Needed extensions include box/circle/arc objects, pattern fill, CMYK & named colors, etc... DTAG chunks are also includable to allow named fills/etc.
  384.  
  385. Music Form
  386. Since I know so little about this, I will leave this alone.
  387.  
  388. Sound Form
  389. Hey, why not 8SVX? :-)
  390.  
  391. Animations Form
  392. Hey, why not ANIM? :-)
  393.  
  394. Equations Form
  395. This is a must if we are to get products like TeX to write out in this format. Should contain the actual formula, as well as the information needed to regenerate the formula.  (as a CAT with DR2D to provide display info?)
  396.  
  397. Table Form
  398. For spreadsheets and other forms of columnar data. Should be full form enough that spreadsheets can save in this format as their native format.
  399.  
  400. Graph Form
  401. For spreadsheets and other forms of columnar data. Should contain the actual graph , as well as the information needed to regenerate the graph.  (as a CAT with DR2D to provide display info?)
  402.  
  403. EPS Form
  404. Encapsulated PostScript. Not very useful, but it's a must for DTP applications that support non-Amiga drawing programs. It would be nice if ANY eps drawing/effect could be converted in an IFF structure. That to me would indicate success in the drawing field.
  405.  
  406.     Scale
  407.     Bitmap Chunk
  408.     ComplexPolygon Chunk
  409.     EPS Data Chunk
  410.  
  411.  
  412. Notes: In review of the above, it seems imperative that we have a standard that allows for generic drawing/descriptions to be attached to complex data that will allow any program to provide basic display/manipulation (sizing/moving/etc...) while still keeping the original body of info. For data of a complex nature, this display info should be better then a generic bitmap. If someone does a graph in a spreadsheet, and print it out from another program to a lino, they probably want something better than a bitmap. Same if it's a presentations package displaying on a 24-bit device. The user would be unhappy with a B/W or 8 color dithered picture.
  413.  
  414. Note:
  415. Most of the forms that follow will need addition info if they are inside of another drawing/document. For example, the text alone is enough for some word processors, but a complex WP/DTP program will need to know where it is on which pages, etc. Which brings up an interesting problem. Text can exist on several pages in PageStream, but would generally be place on a single page like any other form. Perhaps DTXT should exist outside of the pages scope if it spans more than one page.
  416.  
  417.  
  418.  
  419. IFF DTXT Form
  420.  
  421. Columns Chunk  scope: Masterpage,Page
  422.     Publish Chunk
  423.     AnchorTo Chunk
  424.     TextFlow Chunk (standoff / posted flow polygon)
  425.     Bounding Box
  426.     Rotation
  427.     Line Chunk
  428.     Fill Chunk
  429.     Flag (floating right edge)
  430.     Article Chunk
  431. Article Chunk
  432.     Text Chunk
  433.     List of Object Chunks to flow in
  434. Outlines Chunk
  435. Index Chunk
  436. TableOfContents Chunk
  437.  
  438.  
  439.  
  440. CSET Chunk
  441.  
  442. This chunk is to define the character set used in text. Any 1 byte character set you choose will not have certain special characters in it. This is guaranteed due to the fact that their are more than 256 unique glyphs used through out the world. To overcome this, we have created a sort of mapping table that will take an arbitrary character number, and map it to a fixed number. This fixed number is the Unicode character set right now. As luck would have it we needed this for PageStream right away as the Amiga character set does not support many of the typographical characters that PageStream does like  ,   , em  and en ¡ dash, bullets, etc. So, if you intend on reading PageLiners native DTXT files, or HotLinking text with PageStream, better support this!
  443.  
  444. Note: This table is to help a program determine how to display and edit the text. A program reading this data should NOT throw out character it doesn't understand or can't display. Either make a good guess as to what to use (for example, if you lookup a character in the table and determine that it is an open quote, display it as inch marks) or display a character reserved for unknown characters. (for example, PageLiner uses the box character)
  445.  
  446. Note: You do not need to scan this table every time the user enters a character or you display a character. We build a 256 byte array to go from internal to Amiga, and another 256 byte array to go from Amiga keyboard entries to internal. You may also want them to be able to enter standard Unicode numbers, and then search the table for the appropriate character.
  447.  
  448. The CSET chunk is comprised of several Punks or small chunks. These punks are like a chunk but they use 2 bytes for the ID, and 2 bytes for the length, as opposed to chunks which use 4 bytes for both.
  449.  
  450. NM Punk
  451.   character set name (null terminated C string)
  452.     string\0
  453.  
  454. To reference defaults for Amiga / IBM  / Mac / ST / Adobe Standard Encoding how about character set names of
  455. Amiga    Latin1
  456. IBM    IBM
  457. Mac    Mac
  458. Adobe    Adobe
  459.  
  460. Example:
  461. NM,0x0007,Latin1,0x00, followed by a pad byte 0x00
  462.  
  463. UC Punk
  464. Internal character set to Unicode mapping table.
  465.  
  466.   source / destination size
  467.   number of entries
  468.   array of source character to destination Unicode
  469.  
  470.  UBYTE    CharSize;
  471.  UBYTE    UnicodeSize;
  472.  UWORD    NumberEntries;
  473.  
  474. where (source/destination) type is
  475.     0- vnum
  476.     1- 1 byte
  477.     2- 2 byte
  478.     3- 3 byte
  479.     4- 4 byte (hey, it sounds crazy, but ANSI / ISO was talking about it)
  480.  
  481. A character set which uses only 1 byte to depict it's glyphs will have a CharSize of 1. Anyone using the current Unicode standard will be using a CharSize of 2 (or possible vnum, which will save you a few bytes in size, but this is unsupported in the current release of PageStream/PageLiner)
  482.  
  483. Example:
  484. UC,0x0000+4+252*3
  485.    0x01,0x02,0x00fc
  486.      0x01,0x2625
  487.      0x20,0x0020
  488.                ....
  489.      0x7e,0x007e
  490.      0x7f,0x00a0
  491.      0x80,0x221a
  492.                ....
  493.  
  494.     LI Punk
  495. Because Unicode does not support Ligatures (they are typographical glyphs, not language glyphs is their reasoning) we needed a way to depict ligatures that are representing in a character set. (such as fi or fl ligatures)
  496.  
  497.   source / destination size
  498.   number of entries
  499.   array of struct {
  500.     character number
  501.     number of Unicode entries
  502.     array of Unicode entries
  503. }
  504.  
  505.  UBYTE    CharSize;
  506.  UBYTE    UnicodeSize;
  507.  UWORD    NumberEntries;
  508.  
  509.  CharSize    Character number
  510.  UBYTE    number of Unicode entries
  511.  UnicodeSize*number of Unicode entries    Unicode entries
  512.  
  513. where (source/destination) type is same as for UC Punk.
  514.  
  515. Example:
  516.  
  517.  LI,0x0016
  518.     0x01,0x02,0x0003
  519.       0xb0,0x02,0x0066,0x0069
  520.       0xb1,0x02,0x0066,0x006c
  521.       0xb2,0x02,0x0050,0x0074
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528. You need the current Unicode specs! Get it! We realize it's still changing, but not where it counts. The details are:
  529.  
  530. The Unicode Standard: Worldwide Character Encoding, Version 1.0, Volume 1
  531. by The Unicode Consortium
  532. published by Addison-Wesley
  533. ISBN 0-201-56788-1
  534. $32.95 US
  535. $42.94 Cnd
  536.  
  537.  
  538. Font Chunk
  539.     Full Name String
  540.     Family Name String
  541.     Attributes String
  542.     Desc (Serif, SanSerif, Block, etc?)
  543.     Type  (Adobe Type 1, CompuGraphic Intellifont, BitStream Speedo, etc..)
  544.     character map (important!)
  545.     kerning pair table
  546.     composition table
  547. This chunk would normally be to indicate which fonts the document uses, and any pertinate info for the document. Most programs would need to interpret the font anyway, and could derive most of this info that way.
  548.  
  549. Full Name is the complete name of the font. This would be the FontName in Adobe Type 1 fonts. (ex, Helvetica-Bold)
  550. Family Name is the same for all fonts in the same family (ex, Helvetica)
  551. Attributes is the styles specific to this font (ex, Bold)
  552. characterset map would be mapping from internal numbers to Unicode. similar to Character Map chunk. from internal to Unicode
  553. Kerning pair table 
  554.  
  555.  
  556. DTXT Chunk
  557.  
  558. This chunk is the actual text data filled in with characters and commands. Basically, if you grab a byte in the data stream, and it's not a 0, then you can display it, assuming you take into account the CSET. If it is a zero, then to just skip the command, you read the next 3 vnums and then skip the last vnums worth of bytes. If you don't even care about the command or it's flags, you can skip those vnums without actually processing them. Just skip until you come to a character <0x80 (high bit is not set) and you have that last character in the vnum.
  559.  
  560.  
  561. Text/Tag Attributes
  562.  
  563. Attribute Commands follow the format:
  564. (BYTE) 0, (VNum) Command, (VNum) Flags, (VNum) Length, (Length) Data
  565.  
  566. where VNum is a number encoded as,
  567.     value=0
  568.     while (*byte>127)
  569.         value<<7
  570.         value+= *byte++ - 128 ;
  571.     value+=*byte++
  572.  
  573. SVNum is like VNum, only that bit 6 of the first byte indicates whether or not the number is negative. If this bit is set, then negate the number after processing it. Bit 7 always indicates whether or not to get another byte just like another VNum.
  574.  
  575. flags are
  576. xxx00 - no displayable data
  577. xxx01 - non-editable displayable data
  578. xxx10 - editable displayable data
  579.  
  580. x00xx - keep last occurance of command
  581. x01xx - delete it
  582. x10xx - leave it
  583.  
  584. 0xxxx - not white space
  585. 1xxxx - white space (possible word break)
  586.  
  587. TEXT_TAB        1    ;tab (data is position?)
  588. TEXT_NEWLINE    2
  589. TEXT_EOC        3    ;forced end of column
  590. TEXT_EOP        4    ;forced end of page
  591. TEXT_BCCB        5    ;begin conditional column break
  592. TEXT_ECCB        6    ;end conditional column break
  593. TEXT_BCPB        7    ;begin conditional page break
  594. TEXT_ECPB        8    ;end conditional page break
  595.  
  596. TEXT_PARANUM    9    ;paragraph number command (auto inc?)
  597. TEXT_PAGENUM    10    ;page number command (text of #,format)
  598. TEXT_CHAPNUM    12    ;chapter number command (text of #,format)
  599. TEXT_SECTNUM    13    ;section number command (text of #,format)
  600.  
  601. TEXT_MARK        14    ;mark point
  602. TEXT_BRANGE    15    ;begin range point
  603. TEXT_ERANGE    16    ;end range point
  604. TEXT_FOOTNOTE    17    ;footnote. (data includes #, location,(&text?))
  605. TEXT_RULER    18    ;ruler. (data is tab stop locations & type)
  606.                 (vnum)type,(vnum),offset
  607. TEXT_AKERN    19    ;auto kern (data is table#?) 
  608. TEXT_AHYPHEN    20    ;auto hyphen (data is languagetable#?)
  609. TEXT_TRACKRANGE    21    ;tracking range (10000em, Min,Max,Opt)
  610.  
  611. TEXT_DROPCAP    22    ;drop cap. (mode,lines tall)
  612. Date (flag, DATA)
  613. Time (flag, DATA)
  614.  
  615. TEXT_CSET        23    ;set character set (name)
  616. TEXT_MULTIBYTE    24    ;multibyte mode (0=vnum,1=1byte,2=2 byte...)
  617.  
  618. TEXT_TAG        30    ;tag. (tag name)
  619. TEXT_FONT        31    ;font (font name)
  620. TEXT_ATTRB    32    ;attribute (chars identifing attribute)
  621. TEXT_POINT    33    ;point size (point,{ypoint})
  622. TEXT_JUSTIFY    34    ;justification ( mode)
  623. TEXT_PARAGRAPH    35    ;paragraph format (VNUM) 1/10000pt
  624. TEXT_INDENT    36    ;left/right indent (VNUM) Left,(VNUM) right)
  625. TEXT_LEADING    37    ;leading (VNUM) flag-auto/fixed, (VNUM) value)
  626. TEXT_PARALEAD    38    ;paragraph leading (VNUM) flag- auto/fixed, (SVNUM) value
  627. TEXT_TRACKING    39    ;intercharacter tracking (SVNUM) 1/10000em
  628. TEXT_BASELINE    40    ;super/subscript (SVNUM) offset,(SVNUM) % size
  629.  
  630. TEXT_MKERN    50    ;manual kern. (SVNUM) 1/10000em
  631. TEXT_AKERN    51    ;auto inserted kern. (SVNUM) 1/10000em
  632. TEXT_MHYPHEN    52    ;manual soft hyphen. {(VNUM) priority value}
  633. TEXT_AHYPHEN    53    ;auto soft inserted kern. { (VNUM) priority value}
  634.  
  635.  
  636. ATTRB_NORMAL    "N"
  637. ATTRB_BOLD    "B"
  638. ATTRB_LIGHT    "L"
  639. ATTRB_ITALIC    "I"
  640. ATTRB_SHADOW    "S"
  641. ATTRB_OUTLINE    "O"
  642. ATTRB_UNDERLINE    "U"
  643. ATTRB_WEIGHT    "w"    ;following byte is weight value
  644. ATTRB_SPECIAL    \    ;string of style ending with \
  645.  
  646. JUSTIFY_LEFT    0
  647. JUSTIFY_CENTER    1
  648. JUSTIFY_RIGHT    2
  649. JUSTIFY_CHAR    3
  650. JUSTIFY_WORD    4
  651. JUSTIFY_AUTO    5
  652.  
  653.  
  654. Some things left to sort out and define:
  655.     Tab Ruler
  656.         Left,Center,Right,Decimal
  657.         Leader
  658.     Footnote
  659.     Continued From/On
  660.     Line Attributes
  661.     Fill Attributes
  662.     directions (up/down/left/right)
  663.  
  664.     multibyte systems
  665.  
  666.  
  667. IFF ILBM Form
  668.  
  669. Some generic chunks that could be part of it.
  670.  
  671. Publish Chunk
  672. AnchorTo Chunk
  673. TextFlow Chunk (standoff / posted flow polygon)
  674. Bounding Box
  675. Rotation
  676. Line Chunk
  677. Fill Chunk
  678.  
  679. Scale
  680. Translation
  681. Flag (mechanical)
  682. Clip Chunk
  683. Halftone
  684. Transformation Function (contrast/inversion/tonal boost...)
  685.  
  686. This stuff is part of the standard bitmap header.
  687. X/Y Dpi
  688. Width in Pixels
  689. Width in Bytes
  690. Height in Pixels
  691. Bitplanes
  692. Compression
  693. Type (RGB PALETTE, B/W, RGB, RGBW, CMY, CMYK)
  694. Palette
  695. Bitmap
  696.  
  697.  
  698. Bitmap Header (BMHD) Chunk
  699.     ULONG    type, BMHD
  700.     ULONG    chunk length
  701.  
  702.     UWORD    w,h
  703.      WORD    x,y
  704.     UBYTE    nPlanes
  705.     UBYTE    masking
  706.     UBYTE    compression
  707.     UBYTE    picType
  708.     UWORD    transparentColor
  709.      UBYTE    xAspect,yAspect
  710.      WORD    pageWidth,pageHeight
  711.     UWORD    xdpi,ydpi
  712.  
  713.  
  714. where picType is:
  715. 0 = ILBM_PALETTE - this makes for backward compatability since this byte was supposed to have been written as a zero anyway. This type will also have a CMAP in the file.
  716. 1 = ILBM_GREY - This is used for grey scale images. No CMAP is needed in the file. Number of shades will be 2^nPlanes.
  717. 2 = ILBM_RGB - This is used for rgb images, that is images that have no CMAP and are defined as triplets as rgb in the data.
  718. 3 = ILBM_RGBA - This is used for rgb images that also have some alpha data included int the BODY. No CMAP is needed.
  719. 4 = ILBM_CMYK - This is used for cmyk images. No CMAP is needed.
  720. 5 = ILBM_CMYKA - This is used for cmyk images that also have some alpha data included in the BODY.
  721.  
  722. CMAP
  723.     ULONG    type, CMAP
  724.     ULONG    chunk length
  725.  
  726. CLUT
  727.     ULONG    type, CLUT
  728.     ULONG    chunk length
  729.  
  730. BODY
  731.     ULONG    type, BODY
  732.     ULONG    chunk length
  733.  
  734.  
  735.  
  736.  
  737. IFF DR2D FORM
  738.  
  739.  
  740. Group List  scope: Masterpage, Page
  741.     Publish Chunk
  742.     AnchorTo Chunk
  743.     TextFlow Chunk (standoff / posted flow polygon)
  744.     Bounding Box
  745.     Rotation
  746.     Scale
  747.  
  748.     Flag (Drawing?)
  749.  
  750. Lines Chunk  scope: Masterpage,Page
  751.     Line Chunk
  752.     Flag (maintain horizontal/vertical)
  753.     Begin X,Y / End X,Y
  754.  
  755. Boxes Chunk  scope: Masterpage,Page
  756.     Line Chunk
  757.     Fill Chunk
  758.  
  759.     Flag (Maintain Box)
  760.     Upper Left / Lower Right
  761.     Rounded Corner X / Y Radius
  762.  
  763. Circles Chunk  scope: Masterpage,Page
  764.     Line Chunk
  765.     Fill Chunk
  766.  
  767.     Flag (Maintain Circle / Pie lines)
  768.     Center X,Y
  769.     Radius X,Y
  770.     Beginning / Ending Angle
  771.  
  772.  
  773. Polygons Chunk (Masterpage,Page)
  774.     Publish Chunk
  775.     AnchorTo Chunk
  776.     TextFlow Chunk (standoff / posted flow polygon)
  777.     Bounding Box
  778.     Rotation
  779.     Line Chunk
  780.     Fill Chunk
  781.  
  782.     Original Width / Height
  783.     Current X/Y scale (relative to actual size)
  784.     Current X/Y offset
  785.     Clip Polygon (usually fullsize box)
  786.     Article Chunk
  787.  
  788.     # of Commands
  789.     Commands
  790.         Newpath
  791.         Moveto (x,y)
  792.         Lineto (x,y)
  793.         Curveto (cx1,cy1,cx2,cy2,x,y)
  794.         ArcTo (cx,cy,ba,ea,rx,ry)
  795.         ArcNTo (cx,cy,ba,ea,rx,ry)
  796.         Closepath
  797.         Fillpath
  798.         Strokepath
  799.         cubic
  800.         b-spline
  801.  
  802.  
  803. Drawing Form  (Masterpage,Page)
  804. Should be DR2D, or some such
  805.  
  806.     Publish Chunk
  807.     AnchorTo Chunk
  808.     TextFlow Chunk (standoff / posted flow polygon)
  809.     Bounding Box
  810.     Rotation
  811.     Line Chunk
  812.     Fill Chunk
  813.  
  814.     Original Width / Height
  815.     Current X/Y scale (relative to actual size)
  816.     Current X/Y offset
  817.     Clip Polygon (usually fullsize box)
  818.     # of Commands
  819.     Commands
  820.         SetLine (Line Chunk/Style)
  821.         SetFill (Fill Chunk/Style)
  822.         SetRotation (Twist/Slant/cx/cy)
  823.         Box (ulx,uly,lrx,lry)
  824.         RBox (ulx,uly,lrx,lry,rx,ry)
  825.         Line (x1,y1,x2,y2)
  826.         Circle (cx,cy,r)
  827.         Ellipse (cx,cy,rx,ry)
  828.         Arc (cx,cy,r,ba,ea)
  829.         EllipticalArc (cx,cy,rx,ry,ba,ea)
  830.         Polygon
  831.             Newpath
  832.             Moveto (x,y)
  833.             Lineto (x,y)
  834.             Curveto (cx1,cy1,cx2,cy2,x,y)
  835.             ArcTo (cx,cy,ba,ea,rx,ry)
  836.             ArcNTo (cx,cy,ba,ea,rx,ry)
  837.             Closepath
  838.             Fillpath
  839.             Strokepath
  840.  
  841.  
  842.  
  843. Definitions
  844. Coordinate
  845.     2 Long Words, x DPI?
  846.     2 Long, Fixed point, measure
  847.     2 Long, IEEE (egads, yuk, barf, but then again it is in DR2D)
  848.  
  849. NumberStyle (for section, chapter, page numbers)
  850.     Style
  851.         Arabic
  852.         Roman
  853.         One,Two,Three.... (language dependent)
  854.         A,B,C,D,...,AA,AB,AC...
  855.         what about user definable? foreign?
  856.     Case
  857.         UPPER
  858.         lower
  859.         Capitilized
  860.  
  861. Measure
  862.     Inches
  863.     Centimeters
  864.     Millimeters
  865.     Points
  866.     Picas
  867.     Decipoints
  868.     Millipoints
  869.  
  870. Language
  871.     American
  872.     English
  873.     French
  874.     German
  875.     Spanish
  876.     Italian
  877.     Swiss-German
  878.     Swiss-French
  879.     ...
  880.