Brendan Lane Larson wrote:
I compiled and ran your attached Test and results on my Mac laptop running Mac OS X 10.2.6 with JDK
java -cp . Test
Exception in thread "main" java.lang.NullPointerException
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphi csEnvironment.java:327)
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphi csEnvironment.java:359)
at Test.main(Test.java:13)
Thanks, this is (unfortunately) what I expected. It appears that
certain fonts are causing the JDK problems. As long as you don't
touch those fonts the JDK is happy. Unfortunately in order to properly
handle text in SVG (well really CSS) we need to get the list of fonts
that are available on the system, this causes the JDK to examine all installed fonts this then fails. It is possible to put some try catch
blocks around this call so if it fails we get no list of system fonts, but I think this is likely to cause other issues down the road for
font matching.
Also, on this other Mac that I have access to, I had not previously installed Batik 1.5 final release -- I did install Batik 15. beta 5 and was able to successfully run squiggle on that machine.
Whereas, on my laptop configured with OS X / JDK as aforementioned, I was able to originally install 1.5 beta 5 and run squiggle successfully. After having downloaded the final 1.5 release and having run it *unsuccessfully* on my laptop (with the problems I noted in Vancouver), I then tried to switch back to Batik-1.5beta5 this past weekend -- and I unable to successfully revert to beta 5 (I receive different errors than release 1.5).
I think what really happened is that between 1.5b5 running and 1.5
failing you installed some new fonts and these fonts are killing the JDK. The best route would be to uninstall the offending fonts. You can use the list from the Mac that it ran on as a list of 'good' fonts for
your laptop (i.e. they are probably safe to leave alone). If you can
determine the font and where the font came from I would be interested
in hearing.
Does Batik, when attempting to run squiggle, create any other additional directories and/or write to additional files in the user's home directory (or elsewhere?) that I need to know about for cleaning purposes (so I can gracefully move back and forth between 1.5 release and 1.5 beta 5)? Is it possible that release 1.5 corrupted any files on my laptop and thus am now unable to switch back to beta 5?
The only 'state' that Batik keeps is the ~/.batik directory. Feel free to delete this directory and try again, however I am 99% certain that this is not the source of the error.
Best regards,
-Brendan
On Monday, July 21, 2003, at 01:36 AM, Thomas DeWeese wrote:
Brendan Lane Larson wrote:
Thomas and Vincent,
Good to meet both of you at SVG Open in Vancouver last week. As I noted a few days ago at the conference, the 1.5 Batik release fails on Mac OS X 10.2.6 when I attempt to run Squiggle to view SVG documents (the previous version of 1.5 beta worked fine). The version of Apple's JDK that I have installed on my Mac is as >> follows:
This has all the appearence of a JDK issue. Can you tell me if the attached sample Java test file fails?
You should be able to run it with: % javac -g Test.java % java -cp . Test
java -version java version "1.4.1_01" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-39) Java HotSpot(TM) Client VM (build 1.4.1_01-14, mixed mode)
When I run squiggle, as it is loading its various resources during start-up, I receive an error message in a panel that states, "SVG Error: null" with Show Details stating:
java.lang.Exception
at org.apache.batik.swing.svg.GVTTreeBuilder.run(GVTTreeBuilder.java:114 )
Per Thomas' suggestion after the Batik Panel discussion at SVG Open, I compiled the source of Batik release 1.5 in the xml-batik directory with the debug=on switch set in the build.properties document that I created, and then I ran './build.sh squiggle' with the following output (see below) which I hope if useful. Please let me know if I can be of further assistance with respect to Batik and Mac OS X 10.2.x.
Cheers,
-Brendan Lane Larson
./build.sh squiggle Buildfile: build.xml
init-args:
init:
compile:
Created dir: /Users/xyz/Batik.v1.5/xml-batik/classes
debug on, optimize on, deprecation on
/Users/xyz/Batik.v1.5/xml-batik/sources/org/apache/batik/apps/ svgbrowser/Main.java:812: warning: encode(java.lang.String) in java.net.URLEncoder has been deprecated
lastVisitedBuffer.append(URLEncoder.encode(lastVisited.elementAt(i).t oS tring()));
^
/Users/xyz/Batik.v1.5/xml-batik/sources/org/apache/batik/apps/ svgbrowser/Main.java:858: warning: decode(java.lang.String) in java.net.URLDecoder has been deprecated
lastVisited.addElement(URLDecoder.decode(st.nextToken()));
^
2 warnings
squiggle:
2003-07-20 13:51:00.120 java[4629] Font GB18030Bitmap: in _readBasicMetricsForSize, claims 0 max advance but is fixed-pitch.
2003-07-20 13:51:02.440 java[4629] Warning: Font LucidaSans-TypewriterBold claims fixed-pitch with 0 max advance!
2003-07-20 13:51:04.112 java[4629] Warning: Font LucidaSans-TypewriterBold claims fixed-pitch with 0 max advance!
java.lang.ExceptionInInitializerError
at org.apache.batik.gvt.renderer.StrokingTextPainter.createModifiedACIFo rF ontMatching(StrokingTextPainter.java:439)
at org.apache.batik.gvt.renderer.StrokingTextPainter.getTextRuns(Strokin gT extPainter.java:196)
at org.apache.batik.gvt.renderer.StrokingTextPainter.getOutline(Stroking Te xtPainter.java:1029)
at org.apache.batik.gvt.renderer.BasicTextPainter.getGeometryBounds(Basi cT extPainter.java:81)
at org.apache.batik.gvt.TextNode.getGeometryBounds(TextNode.java:229)
at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedGeometryBound s( AbstractGraphicsNode.java:841)
at org.apache.batik.gvt.CompositeGraphicsNode.getGeometryBounds(Composit eG raphicsNode.java:231)
at org.apache.batik.bridge.SVGUtilities.convertRegion(SVGUtilities.java: 10 07)
at org.apache.batik.bridge.SVGUtilities.convertFilterChainRegion(SVGUtil it ies.java:612)
at org.apache.batik.bridge.SVGFilterElementBridge.createFilter(SVGFilter El ementBridge.java:66)
at org.apache.batik.bridge.CSSUtilities.convertFilter(CSSUtilities.java: 66 1)
at org.apache.batik.bridge.AbstractGraphicsNodeBridge.buildGraphicsNode( Ab stractGraphicsNodeBridge.java:118)
at org.apache.batik.bridge.SVGUseElementBridge.buildGraphicsNode(SVGUseE le mentBridge.java:317)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java: 18 6)
at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:144 )
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java: 18 4)
at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:144 )
at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:116)
at org.apache.batik.bridge.SVGUseElementBridge.buildCompositeGraphicsNod e( SVGUseElementBridge.java:167)
at org.apache.batik.bridge.SVGUseElementBridge.createGraphicsNode(SVGUse El ementBridge.java:76)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java: 17 8)
at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:144 )
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java: 18 4)
at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:144 )
at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:116)
at org.apache.batik.bridge.SVGUseElementBridge.buildCompositeGraphicsNod e( SVGUseElementBridge.java:167)
at org.apache.batik.bridge.SVGUseElementBridge.createGraphicsNode(SVGUse El ementBridge.java:76)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java: 17 8)
at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:144 )
at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:66)
at org.apache.batik.swing.svg.GVTTreeBuilder.run(GVTTreeBuilder.java:94)
Caused by: java.lang.NullPointerException
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGrap hi csEnvironment.java:327)
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGrap hi csEnvironment.java:359)
at org.apache.batik.gvt.font.FontFamilyResolver.<clinit>(FontFamilyResol ve r.java:62)
... 31 more
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
/ *********************************************************************** *******
*
* Copyright 2003, Eastman Kodak Company, All rights reserved
*
*********************************************************************** ******/
import java.awt.*;
public class Test { public static void main(String [] args) { GraphicsEnvironment env; env = GraphicsEnvironment.getLocalGraphicsEnvironment(); String fontNames[] = env.getAvailableFontFamilyNames();
int nFonts = fontNames != null ? fontNames.length : 0; for(int i=0; i<nFonts; i++) System.err.println("Font: " + fontNames[i]);
Font f = new Font("SansSerif", 0, 12); } };
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]