summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/kitfox/svg/xml/XMLParseUtil.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/com/kitfox/svg/xml/XMLParseUtil.java b/src/main/java/com/kitfox/svg/xml/XMLParseUtil.java
index b9cbec0..8763e3c 100644
--- a/src/main/java/com/kitfox/svg/xml/XMLParseUtil.java
+++ b/src/main/java/com/kitfox/svg/xml/XMLParseUtil.java
@@ -151,7 +151,15 @@ public class XMLParseUtil
{
retVal = Double.parseDouble(val);
- float pixPerInch = (float)Toolkit.getDefaultToolkit().getScreenResolution();
+ float pixPerInch;
+ try {
+ pixPerInch = (float)Toolkit.getDefaultToolkit().getScreenResolution();
+ }
+ catch (NoClassDefFoundError err)
+ {
+ //Default value for headless X servers
+ pixPerInch = 72;
+ }
final float inchesPerCm = .3936f;
final String units = fpMatch.group(6);