TextLayout.getBlackBoxBounds() values questionable

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 1.2.0
    • Affects Version/s: 1.2.0
    • Component/s: client-libs
    • 2d
    • 1.2beta4
    • sparc
    • solaris_2.6
    • Verified

      The values that are getting returned for the TextLayout.getBlackBoxBounds api are questionable. I'm created a layout with the TimesRoman font size 24 and the getBlackBoxBounds is returning (116.0625, -21.7265625, 86.70703125, 16.640625).

      Font f = new Font("TimesRoman",Font.BOLD,24);
      TextLayout tls = new TextLayout("TextLayout", f);
      g2.setColor(Color.black);
      g2.drawString(tls, 10.0f, tls.getAscent() );
      g2.draw(tls.getBlackBoxBounds(0, 4));
      Rectangle2D r = tls.getBlackBoxBounds(0, 4).getBounds2D();
      System.out.println("BoxBounds=( " + r.getX() + "," + r.getY() + "," +
                         r.getWidth() + "," + r.getHeight() + ")");

            Assignee:
            Jeet Kaul (Inactive)
            Reporter:
            Brian Lichtenwalter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: