home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / JBuilder8.iso / Solaris / resource / jre / demo / plugin / jfc / Font2DTest / README.txt < prev   
Encoding:
Text File  |  2002-09-06  |  6.1 KB  |  141 lines

  1. Font2DTest
  2. -----------
  3.  
  4. To run Font2DTest:
  5.  
  6. % java -jar Font2DTest.jar
  7.     or 
  8. % appletviewer Font2DTest.html
  9.  
  10. These instructions assume that the 1.4 versions of the java
  11. and appletviewer commands are in your path.  If they aren't,
  12. then you should either specify the complete path to the commands
  13. or update your PATH environment variable as described in the
  14. installation instructions for the Java 2 SDK.
  15.  
  16. To view Font2DTest within a web browser with Java Plugin,
  17. load Font2DTestPlugin.html.
  18.  
  19. If you wish to modify any of the source code, you may want to extract
  20. the contents of the Font2DTest.jar file by executing this command:
  21.  
  22. % jar -xvf Font2DTest.jar
  23.  
  24. NOTE:
  25.  
  26. When Font2DTest is ran as an applet, the browser plugin/viewer needs
  27. following permissions given in order to run properly:
  28.  
  29. AWTPermission     "showWindowWithoutWarningBanner"
  30. RuntimePermission "queuePrintJob"
  31.  
  32. The program will run without these properties set,
  33. but some of its features will be limited.
  34. To enable all features, please add these permissions with policytool.
  35.  
  36. -----------------------------------------------------------------------
  37. Introduction
  38. -----------------------------------------------------------------------
  39.  
  40. Font2DTest is an encompassing application for testing various fonts
  41. found on the user's system.  A number of controls are available to 
  42. change many attributes of the current font including style, size, and
  43. rendering hints.  The user can select from multiple display modes,
  44. such as one Unicode range at a time, all glyphs of a particular font, 
  45. user-edited text, or text loaded from a file. 
  46. In addition, the user can control which Java2D method will
  47. be used to render the text to the screen (or to be printed out).
  48.  
  49. -----------------------------------------------------------------------
  50. Tips on usage 
  51. ----------------------------------------------------------------------- 
  52.  
  53. - For the "Font Size" field to have an effect, it is necessary to press
  54. ENTER when finished inputting data in those fields.
  55.  
  56. - When "Unicode Range" or "All Glyphs" is selected for Text to Use,
  57. the status bar will show the range of the characters that is
  58. currently being displayed. If mouse cursor is pointed to one of
  59. the character drawn, the message will be changed to indicate
  60. what character the cursor is pointing to.
  61. By clicking on a character displayed, one can also "Zoom" a character.
  62. Options can be set to show grids around each character,
  63. or force the number of characters displayed across the screen to be 16.
  64. These features are not available in "User Text" or "File Text" mode.
  65.  
  66. - The default number of columns in a Unicode Range or All Glyphs drawing
  67. is "fit as many as possible". If this is too hard to read, then you
  68. can force number of columns to be 16. However, this will not resize the
  69. window to fit all 16 columns, so if the font size is too big, this will
  70. overflow the canvas. (Unfortunately, I could not add horizontal space
  71. bar due to design restrictions)
  72.  
  73. - If font size is too large to fit a character, then a message will
  74. inform that smaller font size or larger canvas size is needed.
  75.  
  76. - Custom Unicode Range can be displayed by selecting "Other..."
  77. at the bottom of the Unicode Range menu. This will bring up
  78. a dialog box to specify the starting and ending index
  79. of the unicode characters to be drawn.
  80.  
  81. - To enter a customized text, select "User Text" from Text to Use menu.
  82. A dialog box with a text area will come up. Enter any text here,
  83. and then press update; the text on screen will then be redrawn to
  84. draw the text just entered. To hide the user text dialog box,
  85. switch to different selection in Text to Use menu.
  86. (Closing the dialog box will not work...)
  87. If a escape sequence of form \uXXXX is entered, it is will be
  88. converted into the character that it maps to.
  89.  
  90. - drawBytes will only work for characters in Unicode range 0x00-0xFF
  91. by its method definition. This program will warn when such text is
  92. being drawn in "Range Text" mode. But since there is no way to detect
  93. this from User Text, the warning will not be given even though
  94. wrong text seems to be drawn on screen when it contains any character
  95. beyond 0xFF.
  96.  
  97. - In the "All Glyphs" mode which displays all available  glyphs for the
  98. current font, only drawGlyphVector is available as the draw method.
  99. Similary, when "Text File" mode is used, the file will always be wrapped
  100. to canvas width using LineBreakMeasurer, so TextLayout.draw is used.
  101.  
  102. - With "User Text" mode, no text wrapping operation is done.
  103. When displaying or printing text that does not fit in a given canvas,
  104. the text will overflow to the right side of the page.
  105.  
  106. - It is also possible to display a text loaded from a file.
  107. Font2DTest will handle is UTF-16 and the platform default encoding.
  108. The text will then be reformatted to fit in the screen with
  109. LineBreakMeasurer, and drawn with TextLayout.draw.
  110. Most major word processor softwares support this format.
  111.  
  112. - When printing, the program will ask to select 1 of 3 options.
  113. First "Print one full page..." will print as much
  114. characters/lines of text as it can fit in one page, starting from
  115. the character/line that is currently drawn at the top of the page.
  116. Second option, "Print all characters..." will print all characters
  117. that are within the selected range. Third option, "Print all text..."
  118. is similar, and it will print all lines of text that user has put in.
  119.  
  120. ====================================================================
  121.  
  122. Known Problems:
  123.  
  124. - When a PostScript font is used, the characters may extend beyond the
  125. enclosing grid or zoom rectangle. This is due to the problem with
  126. FontMetrics.getMaxAscent() and getMaxDescent() functions; the functions
  127. do not always return the right values for PostScript fonts.
  128.  
  129. - There are still some bugs around the error handling.
  130. Most of these problems will usually get fixed when some parameters
  131. are changed, or the screen is refreshed.
  132.  
  133. - Many fonts on Solaris fails to retrieve outlines properly,
  134. and as the result, they do not align within the grid properly.
  135. These are mainly F3 and fonts that was returned by X server.
  136.  
  137. - When showWindowWithoutWarningBanner AWTPermission is not given,
  138. the "zoom" window will look really bad because of the
  139. Applet warning label tacked at the bottom of the zoom window.
  140. To remove this, follow the "NOTE:" instruction at the top.
  141.