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 he...@apache.org on 2010/09/12 20:30:04 UTC

svn commit: r996358 - in /xmlgraphics/batik/trunk: CHANGES documentation-sources/content/xdocs/tools/font-converter.xml sources/org/apache/batik/svggen/font/SVGFont.java

Author: helder
Date: Sun Sep 12 18:30:04 2010
New Revision: 996358

URL: http://svn.apache.org/viewvc?rev=996358&view=rev
Log:
Bug fix:
  Avoid NPE when resolving substitutions for Arabic script
    (submitted by Tor Arne Vestbø <to...@gmail.com>);
    (closes bug 48182).

General:
  Document -autorange option of ttf2svg.
    (see bug 48182 comment 7).
  Change default output character range to ASCII printable characters.

Modified:
    xmlgraphics/batik/trunk/CHANGES
    xmlgraphics/batik/trunk/documentation-sources/content/xdocs/tools/font-converter.xml
    xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/font/SVGFont.java

Modified: xmlgraphics/batik/trunk/CHANGES
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/CHANGES?rev=996358&r1=996357&r2=996358&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/CHANGES (original)
+++ xmlgraphics/batik/trunk/CHANGES Sun Sep 12 18:30:04 2010
@@ -11,7 +11,7 @@ Bug fixing is an on-going task, so it is
 
     43411, 43847, 44553, 44590, 44919, 44936, 44966, 45112, 45114,
     45117, 45397, 45520, 45883, 45958, 46072, 46124, 46430, 46431,
-    46855, 46871, 47201, 47202, 48411
+    46855, 46871, 47201, 47202, 48182, 48411
 
 
 2. New features

Modified: xmlgraphics/batik/trunk/documentation-sources/content/xdocs/tools/font-converter.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/documentation-sources/content/xdocs/tools/font-converter.xml?rev=996358&r1=996357&r2=996358&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/documentation-sources/content/xdocs/tools/font-converter.xml (original)
+++ xmlgraphics/batik/trunk/documentation-sources/content/xdocs/tools/font-converter.xml Sun Sep 12 18:30:04 2010
@@ -52,7 +52,7 @@
       <p>
         In both cases, the options are the same:
       </p>
-      <source><em>ttf-path</em> <em>[</em><strong>-l</strong> <em>range-begin] [</em><strong>-h</strong> <em>range-end] [</em><strong>-ascii</strong><em>] [</em><strong>-id</strong> <em>id] [</em><strong>-o</strong> <em>output-path] [</em><strong>-testcard</strong><em>]</em></source>
+      <source><em>ttf-path</em> <em>[</em><strong>-l</strong> <em>range-begin] [</em><strong>-h</strong> <em>range-end] [</em><strong>-autorange</strong><em>] [</em><strong>-ascii</strong><em>] [</em><strong>-id</strong> <em>id] [</em><strong>-o</strong> <em>output-path] [</em><strong>-testcard</strong><em>]</em></source>
       <p>
         where:
       </p>
@@ -67,6 +67,11 @@
           <p>specifies the range of characters (by codepoint, in decimal) to be
             converted,</p>
         </dd>
+        <dt><strong>-autorange</strong></dt>
+        <dd>
+          <p>automatically determines the available character range, instead of using the
+            default, ASCII printable characters (ranging from 32 to 126),</p>
+        </dd>
         <dt><strong>-ascii</strong></dt>
         <dd>
           <p>forces usage of the ASCII character map in the font, instead of the

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/font/SVGFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/font/SVGFont.java?rev=996358&r1=996357&r2=996358&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/font/SVGFont.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/font/SVGFont.java Sun Sep 12 18:30:04 2010
@@ -51,7 +51,7 @@ public class SVGFont implements XMLConst
     static final String PROPERTY_LINE_SEPARATOR_DEFAULT = "\n";
 
     static final int DEFAULT_FIRST = 32;
-    static final int DEFAULT_LAST = 128;
+    static final int DEFAULT_LAST = 126;
 
     static {
         String  temp;
@@ -339,12 +339,18 @@ public class SVGFont implements XMLConst
                     Feature medi = gsub.getFeatureList().findFeature(ls, FEATURE_TAG_MEDI);
                     Feature fina = gsub.getFeatureList().findFeature(ls, FEATURE_TAG_FINA);
 
-                    initialSubst = (SingleSubst)
-                        gsub.getLookupList().getLookup(init, 0).getSubtable(0);
-                    medialSubst = (SingleSubst)
-                        gsub.getLookupList().getLookup(medi, 0).getSubtable(0);
-                    terminalSubst = (SingleSubst)
-                        gsub.getLookupList().getLookup(fina, 0).getSubtable(0);
+                    if (init != null) {
+                        initialSubst = (SingleSubst)
+                            gsub.getLookupList().getLookup(init, 0).getSubtable(0);
+                    }
+                    if (medi != null) {
+                        medialSubst = (SingleSubst)
+                            gsub.getLookupList().getLookup(medi, 0).getSubtable(0);
+                    }
+                    if (fina != null) {
+                        terminalSubst = (SingleSubst)
+                            gsub.getLookupList().getLookup(fina, 0).getSubtable(0);
+                    }
                 }
             }
         }