NameDateSize

..12-Dec-201711

Font2DTest.htmlH A D12-Dec-20171.1 KiB

Font2DTest.javaH A D12-Dec-201746.2 KiB

Font2DTestApplet.javaH A D12-Dec-20173.5 KiB

FontPanel.javaH A D12-Dec-201752.1 KiB

RangeMenu.javaH A D12-Dec-20179.5 KiB

README.txtH A D12-Dec-20176.6 KiB

README.txt

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