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

TextLayout.getCaretInfo(hit) not returning correct xAdvances

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.2.0
    • 1.2.0
    • client-libs
    • 2d
    • 1.2beta4
    • sparc
    • solaris_2.6
    • Verified

      TextLayout.getCaretInfo(hit) is not returning the correct xAdvances that are listed when doing a TextLayout.toString. Here's info gleaned from such a call :

      font=java.awt.Font[family=Helvetica,name=Helvetica,style=plain,size=18]
      xAdvances={10.010742,12.005859,10.010742,5.0009766,12.005859,5.0009766,10.010742,12.005859,10.511719}

      TextHitInfo hit = new TextHitInfo(curPos[i], true);
      float[] cInfo = tl.getCaretInfo(hit);

      hit=0 position=89.55176
      hit=1 position=0.0
      hit=2 position=11.008301

      Should hit=0 return 89.55, this has been reported in #4086514. I'm expecting the difference from hit 1 to hit 2 to be the xAdvance of 10.010742.

      Source code has been attached.

      java full version "thanh:10/20/97-22:58"
      setenv JAVA_FONTS /usr/openwin/lib/X11/fonts/TrueType

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: