0N/AFont2DTest
0N/A-----------
0N/A
0N/ATo run Font2DTest:
0N/A
0N/A% java -jar Font2DTest.jar
0N/A or
0N/A% appletviewer Font2DTest.html
0N/A
3801N/AThese instructions assume that the 1.7 versions of the java
0N/Aand appletviewer commands are in your path. If they aren't,
0N/Athen you should either specify the complete path to the commands
0N/Aor update your PATH environment variable as described in the
0N/Ainstallation instructions for the Java(TM) SE Development Kit.
0N/A
0N/ATo view Font2DTest within a web browser with Java Plugin,
0N/Aload Font2DTest.html.
0N/A
0N/AIf you wish to modify any of the source code, you may want to extract
0N/Athe contents of the Font2DTest.jar file by executing this command:
0N/A
0N/A% jar -xvf Font2DTest.jar
0N/A
0N/ANOTE:
0N/A
0N/AWhen Font2DTest is ran as an applet, the browser plugin/viewer needs
0N/Afollowing permissions given in order to run properly:
0N/A
0N/AAWTPermission "showWindowWithoutWarningBanner"
0N/ARuntimePermission "queuePrintJob"
0N/A
0N/AThe program will run without these properties set,
0N/Abut some of its features will be limited.
0N/ATo enable all features, please add these permissions with policytool.
0N/A
0N/A-----------------------------------------------------------------------
0N/AIntroduction
0N/A-----------------------------------------------------------------------
0N/A
0N/AFont2DTest is an encompassing application for testing various fonts
0N/Afound on the user's system. A number of controls are available to
0N/Achange many attributes of the current font including style, size, and
0N/Arendering hints. The user can select from multiple display modes,
0N/Asuch as one Unicode range at a time, all glyphs of a particular font,
0N/Auser-edited text, or text loaded from a file.
0N/AIn addition, the user can control which method will
0N/Abe used to render the text to the screen (or to be printed out).
0N/A
0N/A-----------------------------------------------------------------------
0N/ATips on usage
0N/A-----------------------------------------------------------------------
0N/A
0N/A- The "Font" combobox will show a tick mark if some of the characters in
0N/Aselected unicode range can be displayed by this font. No tick is shown,
0N/Aif none of the characters can be displayed. A tooltip is shown with this
0N/Ainformation. This indication is available only if "Unicode Range" is
0N/Aselected in "Text to use" combobox.
0N/A
0N/AThis feature is enabled by default. For disabling this feature, use
0N/Acommand line flag -disablecandisplaycheck or -dcdc.
0N/A
0N/Ajava -jar Font2DTest.jar -dcdc
0N/A
0N/A- For the "Font Size" field to have an effect, it is necessary to press
0N/AENTER when finished inputting data in those fields.
0N/A
0N/A- When "Unicode Range" or "All Glyphs" is selected for Text to Use,
0N/Athe status bar will show the range of the characters that is
0N/Acurrently being displayed. If mouse cursor is pointed to one of
0N/Athe character drawn, the message will be changed to indicate
0N/Awhat character the cursor is pointing to.
0N/ABy clicking on a character displayed, one can also "Zoom" a character.
0N/AOptions can be set to show grids around each character,
0N/Aor force the number of characters displayed across the screen to be 16.
0N/AThese features are not available in "User Text" or "File Text" mode.
0N/A
0N/A- The default number of columns in a Unicode Range or All Glyphs drawing
0N/Ais "fit as many as possible". If this is too hard to read, then you
0N/Acan force number of columns to be 16. However, this will not resize the
0N/Awindow to fit all 16 columns, so if the font size is too big, this will
0N/Aoverflow the canvas. (Unfortunately, I could not add horizontal space
0N/Abar due to design restrictions)
0N/A
0N/A- If font size is too large to fit a character, then a message will
0N/Ainform that smaller font size or larger canvas size is needed.
0N/A
0N/A- Custom Unicode Range can be displayed by selecting "Custom..."
0N/Aat the bottom of the Unicode Range menu. This will bring up
0N/Aa dialog box to specify the starting and ending index
0N/Aof the unicode characters to be drawn.
0N/A
0N/A- To enter a customized text, select "User Text" from Text to Use menu.
0N/AA dialog box with a text area will come up. Enter any text here,
0N/Aand then press update; the text on screen will then be redrawn to
0N/Adraw the text just entered. To hide the user text dialog box,
0N/Aswitch to different selection in Text to Use menu.
0N/A(Closing the dialog box will not work...)
0N/AIf a escape sequence of form \uXXXX is entered, it is will be
0N/Aconverted into the character that it maps to.
0N/A
0N/A- drawBytes will only work for characters in Unicode range 0x00-0xFF
0N/Aby its method definition. This program will warn when such text is
0N/Abeing drawn in "Range Text" mode. But since there is no way to detect
0N/Athis from User Text, the warning will not be given even though
0N/Awrong text seems to be drawn on screen when it contains any character
0N/Abeyond 0xFF.
0N/A
0N/A- In the "All Glyphs" mode which displays all available glyphs for the
0N/Acurrent font, only drawGlyphVector is available as the draw method.
0N/ASimilary, when "Text File" mode is used, the file will always be wrapped
0N/Ato canvas width using LineBreakMeasurer, so TextLayout.draw is used.
0N/A
0N/A- With "User Text" mode, no text wrapping operation is done.
0N/AWhen displaying or printing text that does not fit in a given canvas,
0N/Athe text will overflow to the right side of the page.
0N/A
0N/A- It is also possible to display a text loaded from a file.
0N/AFont2DTest will handle is UTF-16 and the platform default encoding.
0N/AThe text will then be reformatted to fit in the screen with
0N/ALineBreakMeasurer, and drawn with TextLayout.draw.
0N/AMost major word processor softwares support this format.
0N/A
0N/A- When printing, the program will ask to select 1 of 3 options.
0N/AFirst "Print one full page..." will print as much
0N/Acharacters/lines of text as it can fit in one page, starting from
0N/Athe character/line that is currently drawn at the top of the page.
0N/ASecond option, "Print all characters..." will print all characters
0N/Athat are within the selected range. Third option, "Print all text..."
0N/Ais similar, and it will print all lines of text that user has put in.
0N/A
0N/A====================================================================
0N/A
0N/AKnown Problems:
0N/A
0N/A- When a PostScript font is used, the characters may extend beyond the
0N/Aenclosing grid or zoom rectangle. This is due to the problem with
0N/AFontMetrics.getMaxAscent() and getMaxDescent() functions; the functions
0N/Ado not always return the right values for PostScript fonts.
0N/A
0N/A- There are still some bugs around the error handling.
0N/AMost of these problems will usually get fixed when some parameters
0N/Aare changed, or the screen is refreshed.
0N/A
0N/A- Many fonts on Solaris fails to retrieve outlines properly,
0N/Aand as the result, they do not align within the grid properly.
0N/AThese are mainly F3 and fonts that was returned by X server.
0N/A
0N/A- When showWindowWithoutWarningBanner AWTPermission is not given,
0N/Athe "zoom" window will look really bad because of the
0N/AApplet warning label tacked at the bottom of the zoom window.
0N/ATo remove this, follow the "NOTE:" instruction at the top.