Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4117502

Win32: MenuItems rendered in italic fonts are chopped off when printed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.1.7
    • 1.2.0
    • client-libs
    • b01
    • sparc
    • solaris_2.6
    • Verified

        A menu title which is rendered in Times Italic will have the last few pixels
        of the string chopped off when printed.


        import java.awt.*;
        import java.awt.event.*;
        import java.applet.Applet;


        public class ButtonTest extends Applet {
            public static void main(String[] args) {
                new ButtonTest().start();
            }
          
            public void start() {
                new ButtonTestFrame();
            }
        }

        class ButtonTestFrame extends Frame implements ActionListener {
            public ButtonTestFrame() {
                super("ButtonTest");
        MenuBar mb = new MenuBar();
        Menu file = new Menu("File");
        file.setFont(new Font("Times", Font.ITALIC, 15));
        mb.add(file);
        Button button = new Button("Print");
        button.setActionCommand("print");
        button.addActionListener(this);
        add(button);
        setMenuBar(mb);
        setLayout(new GridLayout());
        setSize(200, 200);
        setVisible(true);
            }

            public void actionPerformed(ActionEvent evt) {
                String cmd = evt.getActionCommand();

        if (cmd.equals("print")) {
        PrintJob pjob = getToolkit().getPrintJob(this,
        "ButtonTest",
        null);
        if (pjob != null) {
        Graphics pg = pjob.getGraphics();

        if (pg != null) {
        printAll(pg);
        pg.dispose();
        }

        pjob.end();
        }
        }
            }
        }

              dmendenhsunw David Mendenhall (Inactive)
              dmendenhsunw David Mendenhall (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: