home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / demos / cardshop / !Fonts / ReadMe < prev    next >
Text File  |  1989-05-09  |  10KB  |  187 lines

  1. Getting the best from the Acorn Outline Font Manager
  2. ====================================================
  3.  
  4. This document describes some aspects of RISC OS' new Outline Font Manager,
  5. and contains some hints as to how to get the best from it. The font manager
  6. is a complex piece of software which must sometimes make delicate tradeoffs
  7. between speed, space, and font quality. Getting this completely optimal
  8. involves reading the user's mind and predicting the future, both of which
  9. most computers still find a little tricky.
  10.  
  11. The fonts controlled by the Font Manager live in files in some filing
  12. system, usually inside a directory called !Fonts. Although it can still read
  13. the font files used in the old Font Manager, the recommended form in which
  14. they now exist defines each character by its *outline*. This can then be
  15. scaled to any desired size, when rendering the character on a printer or on
  16. the screen.
  17.  
  18. Two sophisticated tricks are used to improve the quality of the rendered
  19. fonts, and one sophisticated trick to improve the speed of the overall
  20. system.
  21.  
  22. The first is called *anti-aliasing*: rather than just rendering the
  23. characters using black and white pixels, grey pixels are also used to make
  24. curves look smoother, and to provide a better approximation to the desired
  25. image when few pixels are available. This results in an astonishing jump in
  26. quality when few pixels are available, such as on the screen. The old Arthur
  27. 1.20 Font Manager also used this.
  28.  
  29. The second is called *hinting*. This means subtly altering the outline of
  30. the character being rendered in ways that depend on the target pixel grid.
  31. This allows properties concerning the symmetry of the character to be
  32. accurately preserved when the character is arbitrarily scaled. This is
  33. particularly useful when grey pixels are not available (such as on most
  34. printers). This is the major innovation of the new Outline Font Manager,
  35. previously such algorithms have only been in general use inside expensive
  36. PostScript printers. Acorn's implementation of this is so effective that
  37. many people find hinted character quality on the screen perfectly acceptable
  38. even without anti-alasing.
  39.  
  40. The performance trick is called *cacheing*. Unfortunately, loading a
  41. character's outline from a file and computing a bitmap from it (using
  42. hinting and/or anti-aliasing) takes time. In order to get round this, such
  43. bitmaps are retained in the font manager when they have been computed, in
  44. case they are needed again. This is where predicting the future comes in: of
  45. the many hundreds and thousands of characters and sizes that the font
  46. manager must cache (e.g. retain), which ones are worth keeping? All that the
  47. Font Manager can do is to keep as many as it has space for, discarding ones
  48. that have not been used for some time.
  49.  
  50. As the user of this system you can provide input to this process in the
  51. following way (this is where the Font Manager's inability at mind-reading is
  52. annoying).
  53.  
  54. First, only you can decide how much memory the Font Manager may use for
  55. cacheing, and how much you need for other things. This is done by setting
  56. the Font cache size in the Task Window, or via *Configure FontSize (the
  57. latter will set the power-on default value).
  58.  
  59. You can also spend disc memory to main certain operations faster. It's
  60. possible to save extra files inside !Fonts that contain prescaled,
  61. anti-aliased files
  62.  
  63. Second, only you can decide how important character quality is to you, and
  64. how much time and memory you are prepared to spend on the quality of the
  65. results you see on the screen. Different people have different perceptions
  66. of "quality" too.
  67.  
  68. You can control this using several new *Configure commands, as follows. If
  69. you do not touch these values then you will find that reasonable defaults
  70. are set up.
  71.  
  72. *Configure FontMax2
  73. This sets the maximum size of anti-aliased characters, in pixels. If a
  74. character is larger than this value then anti-aliasing will not be used.
  75. Anti-aliasing quadruples the size of retained bitmaps in the cache, and
  76. slows down conversion from outlines too. Set this to 0 to turn anti-aliasing
  77. off entirely.
  78.  
  79. *Configure FontMax3
  80. This sets of the maximum size of any form of retained bitmap. If a character
  81. to be drawn is larger than this then the outline will be drawn directly to
  82. the screen (or printer) with no cacheing happening at all. This is so that
  83. document headings, etc., where a few larger characters appear, do not flush
  84. everything else out of the font cache.
  85.  
  86. The value is set in pixels (rather than points) because it is the pixel size
  87. that affects cache usage. This corresponds to different point sizes on the
  88. screen and on the printer.
  89.  
  90. *Configure FontMax4
  91. If this is non-zero then *sub-pixel anti-aliasing* is used. This is a
  92. refinement of anti-aliasing in which four separate versions of each
  93. character are retained, depending on the placement of the character at
  94. sub-pixel accuracy. This can have a noticeable effect on character quality
  95. at small sizes but for most users the delay involved is unacceptable. Thus,
  96. most users leave this at the default value of 0.
  97.  
  98. *Configure FontMax5
  99. If this is non-zero then sub-pixel anti-alaiasing is used in the vertical
  100. direction as well as the horizontal direction. This is even rarer than use
  101. of FontMax4. Almost all users leave this at the default value of 0.
  102.  
  103. (Do not use *Configure FontMax1, it is for controlling the mixed use of
  104. outline and bitmap files and is of little importance to most users.)
  105.  
  106. Troubleshooting
  107. ---------------
  108.  
  109. If every repaint on the screen causes intensive disc and hourglass activity
  110. then you may be having trouble with the font cache *thrashing* (e.g. it's
  111. too small to hold the range of fonts you are using at the moment). There may
  112. be other causes, e.g. the DTP program can cause disc activity without the
  113. font manager being involved.
  114.  
  115. Try the following things:
  116.  
  117. 1. Change the size of the font cache using the Task Window. Does slightly
  118. more memory make it work better?
  119.  
  120. 2. Change FontMax2 to zero (reconfiguring these values takes immediate
  121. effect, you do not have to reboot). Is the quality of characters still
  122. acceptable? Does performance improve?
  123.  
  124. 3. Change FontMax3 to a lower value, or even 0. This should sharply reduce
  125. thrashing, but the action of painting on the screen will become much slower.
  126.  
  127. Remember that these values will survive a reset or power-on.
  128.  
  129. Miscellaneous Notes
  130. -------------------
  131.  
  132. The above should be enough information to allow the typical user to get the
  133. most out of the Outline Font Manager. Here is some additional information on
  134. various related subjects, and some more advanced tips for effective use.
  135.  
  136. The technology in the Outline Font Manager really is state-of-the-art. The
  137. hinting gives outstanding quality at low resolutions. No competing system
  138. has enough processor power to be able to use anti-aliasing effectively. The
  139. generation of screen and printer fonts from the same source (with precisely
  140. matching metrics) makes it easy to distribute new fonts, and solves many
  141. problems in creating powerful WYSIWYG applications. Unlike some other
  142. companies with similar technology, Acorn encourages the creation of new
  143. fonts by third parties and does not attempt to encrypt the fonts themselves.
  144.  
  145. The default FontMax settings are designed for a user of a small system. A
  146. system with more than 1MB on which DTP-like applications are used
  147. intensively, would typically be configured with slightly larger values.
  148.  
  149. A font is actually cached in blocks of 32 characters, with adjacent ASCII
  150. codes. Thus, just painting a single character will typically pull in 31
  151. others. This is because each disc operation has a subtantial start-up time.
  152.  
  153. It's possible to save precomputed bitmaps from the cache into the filing
  154. system, this can speed up the use of certain sizes of font at the cost of
  155. disc space. *Configure FontMax 1 is used to control this.
  156.  
  157. What is sub-pixel anti-aliasing? The width of each character is stored to
  158. greater accuracy than the pixels on the screen. Thus, in !Edit in mode 12,
  159. create a line consisting of lots of lower-case Trinity.Medium 'l's. See how
  160. they bunch up in groups of about 6 characters, with an extra pixel gap
  161. between bunches? This is because the width of t