gnu.java.awt.peer.gtk.FreetypeGlyphVector.getGlyphPosition(int glyphIndex) should not throw an exception when glyphIndex is equal to the number of glyphs in the vector (see the GlyphVector javadocs). It should instead return the position after the last glyph in the vector.
Created attachment 12219 [details] Patch to make getGlyphPosition work as advertised. This patch makes the glyphTransforms array bigger by one and stores the transform representing the position after the final glyph in it. getGlyphTransform now performs an explicit check that throws if the passed glyphIndex is equal to nGlyphs.
Created attachment 12298 [details] fix for getGlyphPosition and support for vertical fonts whoops, once again I didn't check the bugzilla before working on something. This patch takes a slightly different approach, and stores all the glyphPositions instead of storing all the transforms; it makes a bit more sense this way (instead of converting from position to transform, and back to position). It also adds support for vertical fonts. Do you mind if I commit this one instead? Sorry about that!
That's ok, as long as it is fixed. :)
Subject: Bug 29011 CVSROOT: /cvsroot/classpath Module name: classpath Changes by: Francis Kung <fkung> 06/09/20 18:26:24 Modified files: . : ChangeLog gnu/java/awt/peer/gtk: FreetypeGlyphVector.java Log message: 2006-09-20 Francis Kung <fkung@redhat.com> PR 29011 * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java: (constructor): Expanded glyphPositions array to accomodate Y-coordinates. (getGlyphOutline): Call getGylphTransform to generate transform. (getGylphPosition): Read position directly out of array. (getGlyphPositions): Read positions directly out of array. (getGlyphTransform): Generate transform based on gylphPositions array. (performDefaultLayout): Populate glyphPositions array instead of transforms. (setGlyphPosition): Set position directly into array. (setGlyphTransform): Update positions array as well. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.8576&r2=1.8577 http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java?cvsroot=classpath&r1=1.7&r2=1.8
Subject: Bug 29011 CVSROOT: /cvsroot/classpath Module name: classpath Changes by: Francis Kung <fkung> 06/09/20 21:50:01 Modified files: . : ChangeLog gnu/java/awt/peer/gtk: FreetypeGlyphVector.java Log message: 2006-09-20 Francis Kung <fkung@redhat.com> PR 29011 * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java: (getGlyphTransform): Use translation instead of scale. (performDefaultLayout): Increment position values instead of resetting, and pre-increment instead of post-increment. (setGlyphTransform): Handle null case with identity transform. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.8579&r2=1.8580 http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java?cvsroot=classpath&r1=1.8&r2=1.9
fixed