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

JEditorPane html font sizes incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 5.0
    • client-libs

      Name: rmT116609 Date: 02/10/2004


      FULL PRODUCT VERSION :
      java version "1.5.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
      Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Windows DPI setting is 150% (144 dpi)

      A DESCRIPTION OF THE PROBLEM :
      In a JEditorPane with html content, I'm seeing font sizes for
      <FONT SIZE="x"> that seem to be based on a size much smaller
      than the actual base font. <FONT SIZE="+1"> is smaller than the
      base font and <FONT SIZE="4"> is smaller yet (they should be
      the same, and both slightly larger than the base font). This may
      have something to do with my system DPI setting (150% or
      144 dpi). I have placed a screencap at
      http://www.jgrasp.org/tmp/jep_bug.png


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run code

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expect font of second and third lines to be the same size, and
      slightly larger than the font of line one.
      ACTUAL -
      Font of second line is smaller than first, and font of third line is
      smaller still. See http://www.jgrasp.org/tmp/jep_bug.png .

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
         import javax.swing.*;

          public class JEditorPaneBug4 {
             public static void main(String args[]) {
               JFrame frame = new JFrame();
               JEditorPane jep = new JEditorPane();
               jep.setContentType("text/html;");
               jep.setEditable(false);
               frame.getContentPane().add(jep);
               frame.setSize(400, 400);
               frame.setVisible(true);
            
               jep.setText("<HTML>\n" +
                     "Base Font<BR>\n" +
                     "<FONT SIZE=\"+1\">Font Size = +1</FONT><BR>\n" +
                     "<FONT SIZE=\"4\">Font Size = 4</FONT><BR>\n" +
                     "</HTML>");
            }
         }


      ---------- END SOURCE ----------
      (Incident Review ID: 237799)
      ======================================================================
      ###@###.### 10/13/04 17:46 GMT

            idk Igor Kushnirskiy (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: