You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by ca...@apache.org on 2006/04/28 07:31:20 UTC

svn commit: r397766 - in /xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt: font/AWTGVTGlyphVector.java font/GVTGlyphVector.java font/Glyph.java font/SVGGVTGlyphVector.java text/ArabicTextHandler.java

Author: cam
Date: Thu Apr 27 22:31:19 2006
New Revision: 397766

URL: http://svn.apache.org/viewcvs?rev=397766&view=rev
Log:
1. Fixed SVGTextContentElement.getExtentOfChar to use glyph metrics rather 
   than the glyph shape bounding box.

Modified:
    xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/AWTGVTGlyphVector.java
    xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/GVTGlyphVector.java
    xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/Glyph.java
    xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/SVGGVTGlyphVector.java
    xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/text/ArabicTextHandler.java

Modified: xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/AWTGVTGlyphVector.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/AWTGVTGlyphVector.java?rev=397766&r1=397765&r2=397766&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/AWTGVTGlyphVector.java (original)
+++ xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/AWTGVTGlyphVector.java Thu Apr 27 22:31:19 2006
@@ -209,7 +209,7 @@
     }
 
     /**
-     *  Returns the logical bounds of this GlyphVector.
+     * Returns the logical bounds of this GlyphVector.
      * This is a bound useful for hit detection and highlighting.
      */
     public Rectangle2D getLogicalBounds() {
@@ -221,8 +221,8 @@
     }
 
     /**
-     *  Returns the logical bounds of the specified glyph within this
-     *  GlyphVector.
+     * Returns the logical bounds of the specified glyph within this
+     * GlyphVector.
      */
     public Shape getGlyphLogicalBounds(int glyphIndex) {
         if (glyphLogicalBounds[glyphIndex] == null &&
@@ -521,6 +521,15 @@
     // that are positioned (otherwise they are always at 0,0).
     static boolean outlinesPositioned() {
         return outlinesPositioned;
+    }
+
+    /**
+     * Returns the bounding box of the specified glyph, considering only the
+     * glyph's metrics (ascent, descent, advance) rather than the actual glyph
+     * shape.
+     */
+    public Rectangle2D getGlyphCellBounds(int glyphIndex) {
+        return (Rectangle2D) getGlyphLogicalBounds(glyphIndex).getBounds2D();
     }
 
     /**

Modified: xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/GVTGlyphVector.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/GVTGlyphVector.java?rev=397766&r1=397765&r2=397766&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/GVTGlyphVector.java (original)
+++ xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/GVTGlyphVector.java Thu Apr 27 22:31:19 2006
@@ -81,6 +81,13 @@
     Shape getGlyphOutline(int glyphIndex);
 
     /**
+     * Returns the bounding box of the specified glyph, considering only the
+     * glyph's metrics (ascent, descent, advance) rather than the actual glyph
+     * shape.
+     */
+    Rectangle2D getGlyphCellBounds(int glyphIndex);
+
+    /**
      * Returns the position of the specified glyph within this GlyphVector.
      */
     Point2D getGlyphPosition(int glyphIndex);
@@ -103,10 +110,10 @@
     Shape getGlyphVisualBounds(int glyphIndex);
 
     /**
-     *  Returns the logical bounds of this GlyphVector.  This is a
-     *  good bound for hit detection and highlighting it is not tight
-     *  in any sense, and in some (rare) * cases may exclude parts of
-     *  the glyph.
+     * Returns the logical bounds of this GlyphVector.  This is a
+     * good bound for hit detection and highlighting it is not tight
+     * in any sense, and in some (rare) cases may exclude parts of
+     * the glyph.
      */
     Rectangle2D getLogicalBounds();
 

Modified: xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/Glyph.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/Glyph.java?rev=397766&r1=397765&r2=397766&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/Glyph.java (original)
+++ xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/Glyph.java Thu Apr 27 22:31:19 2006
@@ -127,7 +127,7 @@
      * Returns the orientation of this glyph.
      * Indicates what inline-progression-direction this glyph
      * can be used in. Should be either "h" for horizontal only, "v" for vertical
-     * only, or empty which indicates that the glpyh can be use in both.
+     * only, or empty which indicates that the glyph can be used in both.
      *
      * @return The glyph orientation.
      */

Modified: xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/SVGGVTGlyphVector.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/SVGGVTGlyphVector.java?rev=397766&r1=397765&r2=397766&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/SVGGVTGlyphVector.java (original)
+++ xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/font/SVGGVTGlyphVector.java Thu Apr 27 22:31:19 2006
@@ -402,6 +402,15 @@
     }
 
     /**
+     * Returns the bounding box of the specified glyph, considering only the
+     * glyph's metrics (ascent, descent, advance) rather than the actual glyph
+     * shape.
+     */
+    public Rectangle2D getGlyphCellBounds(int glyphIndex) {
+        return (Rectangle2D) getGlyphLogicalBounds(glyphIndex).getBounds2D();
+    }
+
+    /**
      * Returns the position of the specified glyph within this GlyphVector.
      */
     public Point2D getGlyphPosition(int glyphIndex) {

Modified: xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/text/ArabicTextHandler.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/text/ArabicTextHandler.java?rev=397766&r1=397765&r2=397766&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/text/ArabicTextHandler.java (original)
+++ xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/text/ArabicTextHandler.java Thu Apr 27 22:31:19 2006
@@ -59,7 +59,7 @@
 
     }
 
-    /*
+    /**
      * If the AttributedString contains any arabic chars, assigns an
      * arabic form attribute, i.e. initial|medial|terminal|isolated,
      * to each arabic char.