summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkitfox2008-04-28 11:07:37 +0200
committerkitfox2008-04-28 11:07:37 +0200
commit567f3ef0b8920798023222c49621d2256394a6c0 (patch)
tree1a89d8c4cde0d42f133a962794f0f97d77819085
parentFixed problem with rendering patterns based on images set with 0 width or hei... (diff)
downloadsvg-salamander-core-567f3ef0b8920798023222c49621d2256394a6c0.tar.gz
svg-salamander-core-567f3ef0b8920798023222c49621d2256394a6c0.tar.xz
svg-salamander-core-567f3ef0b8920798023222c49621d2256394a6c0.zip
Added fix for calculating screen units while running on a headless server
git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@57 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b
-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);