home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 8 / boot-disc-1997-04.iso / PDA_Soft / Psion / patches / Rtf227 / EXTRA.TXT < prev    next >
Text File  |  1994-07-08  |  8KB  |  188 lines

  1. ADVANCED RTF FONT AND STYLE TRANSFER
  2. ------------------------------------
  3.  
  4. You can more accurately control the way that fonts and style names
  5. are transferred in RTF by using an RTF map file, which is a plain
  6. text file, with the name 'rtfmap.txt', in any \WDR subdirectory of
  7. the root directory of a local drive (the drive search order is
  8. M:, A:, B:). 
  9.  
  10. The contents of a typical map file could be:
  11.  
  12. :STYLES
  13.  BT      9       Normal;
  14.  HA      1       heading 1;
  15.  HB      2       heading 2; 
  16. :FONTS
  17.  00      fmodern;        pica;
  18.  24      froman;         Times New Roman;
  19.  
  20. The keywords :STYLES and :FONTS introduce style and font mappings
  21. respectively. They may occur in any order and may be repeated.
  22.  
  23. Whitespace before an item is generally ignored, as is any text
  24. following the final semicolon (;). Long labels are truncated to 15
  25. (style labels) or 19 (font names) characters, not counting the
  26. terminating semicolon. Illegal entries are ignored, without
  27. generating any error notification.
  28.  
  29. Style mapping
  30.  
  31. Each line represents the correspondence between the shortcode,
  32. outline level and a style label. The style labels should correspond
  33. with those used by Microsoft Word (or any other word processor that
  34. understands the RTF format). You can determine these names from the
  35. stylesheet section of an RTF file generated by the word processor
  36. (see the later 'RTF files' section).
  37.  
  38. There is no checking for duplicate shortcodes or labels, so be
  39. warned. Total duplicates are wasteful of memory but otherwise
  40. harmless. Pairs of entries that match in either their shortcode or
  41. their label, but not both, should be avoided.
  42.  
  43. To prevent any possibility of error in bi-directional mapping, one-
  44. or two-character labels (particularly if they start with X, Y or Z)
  45. should be avoided.
  46.  
  47. Font mapping
  48.  
  49. Each line represents the correspondence between a font ID, the RTF
  50. font class and a font name.
  51.  
  52. The font IDs should be unique and must lie in the range 0 to 63
  53. inclusive. The font IDs used by the Psion word processor vary from
  54. printer to printer. You can find which font IDs are used in a
  55. particular printer driver by examining the font table in an RTF file
  56. that was saved from the Psion word processor with that printer driver
  57. installed, and with no font mapping (see the later 'RTF files'
  58. section).
  59.  
  60. There is no harm in mapping a font to an ID that is not supported by
  61. a particular printer driver, but it will be displayed and printed in
  62. the printer's default (monospaced) font. The following table
  63. indicates the preferred general allocation scheme for font IDs used
  64. in Psion printer drivers:
  65.  
  66.   0 COURIER            22 OPTIONAL_SB          44 RUSSIAN
  67.   1 PICA               23 OPTIONAL_SC          45 OPTIONAL_B
  68.   2 ELITE              24 TIMES_ROMAN          46 OPTIONAL_C
  69.   3 PRESTIGE           25 CENTURY              47 OPTIONAL_D
  70.   4 LETTER_GOTHIC      26 PALATINO             48 NARRATOR
  71.   5 GOTHIC             27 SOUVENIR             49 EMPHASIS
  72.   6 CUBIC              28 GARAMOND             50 ZAPF_CHANCERY
  73.   7 LINEPRINTER        29 CALEDONIA            51 OPTIONAL_DA
  74.   8 HELVETICA          30 BODONI               52 OLD_ENGLISH
  75.   9 AVANT_GARDE        31 UNIVERSITY           53 OPTIONAL_DB
  76.   10 SPARTAN           32 SCRIPT               54 OPTIONAL_DC
  77.   11 METRO             33 SCRIPT_PS            55 COOPER_BLACK
  78.   12 PRESENTATION      34 OPTIONAL_SCA         56 SYMBOL
  79.   13 APL               35 OPTIONAL_SCB         57 LINE_DRAW
  80.   14 OCR_A             36 COMMERCIAL_SCRIPT    58 MATH_7
  81.   15 OCR_B             37 PARK_AVENUE          59 MATH_8
  82.   16 STANDARD_ROMAN    38 CORONET              60 DINGBATS
  83.   17 EMPEROR           39 OPTIONAL_SCC         61 EAN
  84.   18 MADELEINE         40 GREEK                62 PC_LINE
  85.   19 ZAPF_HUMANIST     41 KANA                 63 OPTIONAL_SYA
  86.   20 CLASSIC           42 HEBREW
  87.   21 OPTIONAL_SA       43 OPTIONAL_A
  88.  
  89. The RTF font class must be one of:
  90.      fnil            Unknown or default
  91.      froman          Roman; proportional serif
  92.      fswiss          Swiss; proportional sans serif
  93.      fmodern         Monospaced serif and sans serif
  94.      fscript         Script
  95.      fdecor          Decorative
  96.      ftech           Technical, symbol and mathematical
  97.  
  98. The font names should be those present in the font table of a
  99. Microsoft Word (or other word processor) RTF file and do not need to
  100. match the names of Psion printer driver fonts.
  101.  
  102. Open (RTF)
  103.  
  104. If a map file is located, and contains valid style entries, the list
  105. is scanned for a match with an incoming label and, if found, the
  106. style is given the corresponding shortcode and outline level. This
  107. style will overwrite any existing style with the same shortcode.
  108.  
  109. Styles with non-matching labels have their style labels preserved.
  110. They are given an outline level of 9 and a shortcode consisting of
  111. the first two letters of the label (a preceding X is added if the
  112. label contains only one character). If this shortcode is illegal or
  113. matches an existing style, a unique shortcode is generated. These
  114. styles, therefore, never overwrite existing styles.
  115.  
  116. If there are no valid style map entries, incoming style labels
  117. "Normal" and "heading n" (1 <= n <= 8) are handled explicitly,
  118. generating shortcodes of BT, and HA to HH, with outline levels of 9
  119. for BT and 1 to 8 for the headings. These styles always overwrite any
  120. existing style of the same shortcode.
  121.  
  122.  
  123. All incoming fonts whose names match an entry in the map file are
  124. allocated the corresponding ID, regardless of whether this is
  125. supported by the current printer driver.
  126.  
  127. Non-matching incoming fonts are converted to those supported by the
  128. current printer driver. Fonts are preserved only if they are an exact
  129. match, by both name and RTF font family (the Psion word processor
  130. currently only supports fonts in the fmodern, fswiss and froman
  131. families - see above). Otherwise an attempt is made to convert the
  132. font to a supported font in the same family. If this is not possible,
  133. the font is converted to the current default (monospaced) font.
  134.  
  135. Save as (RTF)
  136.  
  137. If a map file is located, and contains valid entries, the list is
  138. scanned for a match with an outgoing shortcode and, if found, the
  139. style is given the corresponding label. Styles with non-matching
  140. shortcodes are given labels equal to their shortcodes, irrespective
  141. of the text of their current labels.
  142.  
  143. If there are no style map entries, the first style of outline level 9
  144. to be saved (usually BT) is saved with the label "Normal". Similarly,
  145. the first styles of outline level 1 to 5 (usually HA etc.) are saved
  146. with labels from "heading 1" to "heading 5". All other styles are
  147. saved with labels consisting of their shortcodes, irrespective of the
  148. text of their current labels.
  149.  
  150. The font table includes all fonts listed in the map file, together
  151. with any additional fonts supported by the current printer driver
  152. (provided their font IDs do not match with IDs present in the map
  153. file).
  154.  
  155. In the absence of any font mappings, only those fonts supported by
  156. the current printer driver are included in the RTF file.
  157.  
  158. RTF files
  159.  
  160. An RTF file is a plain text file containing the text of a document,
  161. together with plain text encoding of style and formatting
  162. information.
  163.  
  164. A Psion map file affects the content of the RTF file font table and
  165. stylesheet sections which can be found near the beginning of the RTF
  166. file.
  167.  
  168. The font table contains a list of font entries, enclosed by:
  169.  
  170.         { \fonttbl                      }
  171.  
  172. Each font entry consists of a font number (ID), a font family and a
  173. font name, for example:
  174.  
  175.         { \f0  \fmodern  pica; }
  176.  
  177. The stylesheet section contains a list of stylesheet entries,
  178. enclosed by:
  179.  
  180.         {  \stylesheet                  }
  181.  
  182. Each stylesheet entry consists of a variety of style instructions,
  183. terminated by the style label, for example:
  184.  
  185.         { \s244 \li270 \f3 \fs20 \ul heading 4; }
  186.  
  187. In this example the label is "heading 4".
  188.