Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8205138: Remove Applet references from Font2DTest #4831

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

This file was deleted.

@@ -133,7 +133,7 @@ public final class Font2DTest extends JPanel
private static boolean canDisplayCheck = true;

/// Initialize GUI variables and its layouts
public Font2DTest( JFrame f, boolean isApplet ) {
public Font2DTest( JFrame f) {
parent = f;

rm = new RangeMenu( this, parent );
@@ -165,8 +165,8 @@ public Font2DTest( JFrame f, boolean isApplet ) {
contrastSlider.setPaintLabels(true);
contrastSlider.addChangeListener(this);
setupPanel();
setupMenu( isApplet );
setupDialog( isApplet );
setupMenu();
setupDialog();

if(canDisplayCheck) {
fireRangeChanged();
@@ -256,7 +256,7 @@ private void addLabeledComponentToGBL( String name,
}

/// Sets up menu entries
private void setupMenu( boolean isApplet ) {
private void setupMenu() {
JMenu fileMenu = new JMenu( "File" );
JMenu optionMenu = new JMenu( "Option" );

@@ -268,11 +268,7 @@ private void setupMenu( boolean isApplet ) {
fileMenu.add( new MenuItemV2( "Page Setup...", this ));
fileMenu.add( new MenuItemV2( "Print...", this ));
fileMenu.addSeparator();
if ( !isApplet )
fileMenu.add( new MenuItemV2( "Exit", this ));
Copy link
Contributor

@prsadhuk prsadhuk Jul 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is not Applet, should we not retain this line?

Copy link
Contributor Author

@prrace prrace Aug 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oopsy. I did not mean to do that. I will restore.

else
fileMenu.add( new MenuItemV2( "Close", this ));

fileMenu.add( new MenuItemV2( "Exit", this ));
displayGridCBMI = new CheckboxMenuItemV2( "Display Grid", true, this );
force16ColsCBMI = new CheckboxMenuItemV2( "Force 16 Columns", false, this );
showFontInfoCBMI = new CheckboxMenuItemV2( "Display Font Info", false, this );
@@ -326,11 +322,8 @@ private void setupMenu( boolean isApplet ) {
}

/// Sets up the all dialogs used in Font2DTest...
private void setupDialog( boolean isApplet ) {
if (!isApplet)
filePromptDialog = new JFileChooser( );
else
filePromptDialog = null;
private void setupDialog() {
filePromptDialog = new JFileChooser();

/// Prepare user text dialog...
userTextDialog = new JDialog( parent, "User Text", false );
@@ -432,8 +425,6 @@ public void fireRangeChanged() {

/// Changes the message on the status bar
public void fireChangeStatus( String message, boolean error ) {
/// If this is not ran as an applet, use own status bar,
/// Otherwise, use the appletviewer/browser's status bar
statusBar.setText( message );
if ( error )
fp.showingError = true;
@@ -1030,7 +1021,7 @@ public static void main(String[] argv) {

UIManager.put("swing.boldMetal", Boolean.FALSE);
final JFrame f = new JFrame( "Font2DTest" );
final Font2DTest f2dt = new Font2DTest( f, false );
final Font2DTest f2dt = new Font2DTest( f);
f.addWindowListener( new WindowAdapter() {
public void windowOpening( WindowEvent e ) { f2dt.repaint(); }
public void windowClosing( WindowEvent e ) { System.exit(0); }
@@ -4,35 +4,17 @@ Font2DTest
To run Font2DTest:

% java -jar Font2DTest.jar
or
% appletviewer Font2DTest.html

These instructions assume that the 1.7 versions of the java
and appletviewer commands are in your path. If they aren't,
then you should either specify the complete path to the commands
These instructions assume that the java command is in your path.
If they aren't, then you should either specify the complete path to the commands
or update your PATH environment variable as described in the
installation instructions for the Java(TM) SE Development Kit.

To view Font2DTest within a web browser with Java Plugin,
load Font2DTest.html.

If you wish to modify any of the source code, you may want to extract
the contents of the Font2DTest.jar file by executing this command:

% jar -xvf Font2DTest.jar

NOTE:

When Font2DTest is ran as an applet, the browser plugin/viewer needs
following permissions given in order to run properly:

AWTPermission "showWindowWithoutWarningBanner"
RuntimePermission "queuePrintJob"

The program will run without these properties set,
but some of its features will be limited.
To enable all features, please add these permissions.

-----------------------------------------------------------------------
Introduction
-----------------------------------------------------------------------
@@ -129,23 +111,3 @@ that are within the selected range. Third option, "Print all text..."
is similar, and it will print all lines of text that user has put in.

====================================================================

Known Problems:

- When a PostScript font is used, the characters may extend beyond the
enclosing grid or zoom rectangle. This is due to the problem with
FontMetrics.getMaxAscent() and getMaxDescent() functions; the functions
do not always return the right values for PostScript fonts.

- There are still some bugs around the error handling.
Most of these problems will usually get fixed when some parameters
are changed, or the screen is refreshed.
Copy link
Contributor

@prsadhuk prsadhuk Jul 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the 1st 2 known problems are not there now?

Copy link
Contributor Author

@prrace prrace Aug 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know of problems with getting metrics for Postscript fonts and I have no idea what the 2nd comment means and it may be ancient history which is why I want to clean it up.


- Many fonts on Solaris fails to retrieve outlines properly,
and as the result, they do not align within the grid properly.
These are mainly F3 and fonts that was returned by X server.

- When showWindowWithoutWarningBanner AWTPermission is not given,
the "zoom" window will look really bad because of the
Applet warning label tacked at the bottom of the zoom window.
To remove this, follow the "NOTE:" instruction at the top.