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 de...@apache.org on 2006/03/27 16:10:02 UTC

svn commit: r389151 - in /xmlgraphics/batik/trunk/sources/org/apache/batik: bridge/SVGGVTFont.java gvt/font/AWTGVTFont.java gvt/font/GVTFont.java gvt/renderer/StrokingTextPainter.java gvt/text/GlyphLayout.java

Author: deweese
Date: Mon Mar 27 06:10:01 2006
New Revision: 389151

URL: http://svn.apache.org/viewcvs?rev=389151&view=rev
Log:
1) Use 'getAttribute' instead of 'getAttributes().get'

2) Added interface to get font family name from GVTFont.


Modified:
    xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGGVTFont.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/AWTGVTFont.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/GVTFont.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/renderer/StrokingTextPainter.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/text/GlyphLayout.java

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGGVTFont.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGGVTFont.java?rev=389151&r1=389150&r2=389151&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGGVTFont.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGGVTFont.java Mon Mar 27 06:10:01 2006
@@ -716,6 +716,10 @@
                               hkernElements, vkernElements, textElement);
     }
 
+    public String getFamilyName() {
+        return fontFace.getFamilyName();
+    }
+
     protected GVTLineMetrics getLineMetrics(int beginIndex, int limit) {
         if (lineMetrics != null) 
             return lineMetrics;

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/AWTGVTFont.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/AWTGVTFont.java?rev=389151&r1=389150&r2=389151&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/AWTGVTFont.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/AWTGVTFont.java Mon Mar 27 06:10:01 2006
@@ -210,6 +210,10 @@
         return new AWTGVTFont(awtFont, size/this.size);
     }
 
+    public String getFamilyName() {
+        return awtFont.getFamily();
+    }
+
     /**
      *  Returns a LineMetrics object created with the specified arguments.
      */

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/GVTFont.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/GVTFont.java?rev=389151&r1=389150&r2=389151&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/GVTFont.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/GVTFont.java Mon Mar 27 06:10:01 2006
@@ -83,6 +83,11 @@
     public GVTFont deriveFont(float size);
 
     /**
+     * Returns the font family name of this font.
+     */
+    public String getFamilyName();
+
+    /**
      *  Returns a GVTLineMetrics object created with the specified arguments.
      */
     public GVTLineMetrics getLineMetrics(char[] chars, int beginIndex,

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/renderer/StrokingTextPainter.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/renderer/StrokingTextPainter.java?rev=389151&r1=389150&r2=389151&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/renderer/StrokingTextPainter.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/renderer/StrokingTextPainter.java Mon Mar 27 06:10:01 2006
@@ -422,11 +422,11 @@
             int aciLength = end-start;
 
             List fonts;
-            fonts = (List)aci.getAttributes().get(GVT_FONTS);
+            fonts = (List)aci.getAttribute(GVT_FONTS);
 
 
             float fontSize = 12;
-            Float fsFloat = (Float)aci.getAttributes().get(TextAttribute.SIZE);
+            Float fsFloat = (Float)aci.getAttribute(TextAttribute.SIZE);
             if (fsFloat != null)
                 fontSize = fsFloat.floatValue();
 
@@ -464,7 +464,8 @@
                     int displayUpToIndex = font.canDisplayUpTo
                         (aci, currentIndex, end);
 
-                    Object altGlyphElement = aci.getAttributes().get(ALT_GLYPH_HANDLER);
+                    Object altGlyphElement;
+                    altGlyphElement = aci.getAttribute(ALT_GLYPH_HANDLER);
                     if ( altGlyphElement != null ){
                         //found all the glyph to be displayed
                         //consider the font matching done

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/text/GlyphLayout.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/text/GlyphLayout.java?rev=389151&r1=389150&r2=389151&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/text/GlyphLayout.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/text/GlyphLayout.java Mon Mar 27 06:10:01 2006
@@ -970,7 +970,7 @@
      */
     protected GVTFont getFont() {
         aci.first();
-        GVTFont gvtFont = (GVTFont)aci.getAttributes().get(GVT_FONT);
+        GVTFont gvtFont = (GVTFont)aci.getAttribute(GVT_FONT);
 
         if (gvtFont != null) 
             return gvtFont;