diff src/java/de/intevation/mxd/writer/SymbolWriter.java @ 93:3993b5adf67c

Write the character symbol correctly to the mapfile and the symbolset.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 01 Jun 2011 11:48:57 +0200
parents 82a1f39214fd
children c285ed08b72c
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/writer/SymbolWriter.java	Wed Jun 01 10:24:10 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/SymbolWriter.java	Wed Jun 01 11:48:57 2011 +0200
@@ -99,10 +99,13 @@
     private void writeCharacter(symbolObj symbol, Element symbolElement) {
         logger.debug("writeCharacter(symbolObj, Element)");
         //TODO Write the symbol correctly. See Issue 3885 on trac.osgeo.org
-        symbol.setFont(symbolElement.getAttribute("font"));
+        String font = symbolElement.getAttribute("font");
+        //Remove all blank character to match the mapserver fonts.txt.
+        font = font.replaceAll(" ", "");
+        symbol.setFont(font);
         symbol.setType(MS_SYMBOL_TYPE.MS_SYMBOL_TRUETYPE.swigValue());
         symbol.setAntialias(1);
-        symbol.setCharacter("#&" + symbolElement.getAttribute("char") + ";");
+        symbol.setCharacter("&#" + symbolElement.getAttribute("char") + ";");
     }
 
     public boolean canWrite(String type) {
@@ -118,12 +121,12 @@
 
     private void saveSymbolSet(symbolSetObj symbols)
     throws Exception {
-        String path = "";// TODO Get the correct path. Mapfile path or symbolset path
+        String path = this.map.getMappath();
         if(path.equals("")) {
             return;
         }
-        else if(path.endsWith(".map")) {
-            path.replace(".map", ".sym");
+        else {
+            path += "symbols.sym";
         }
         symbols.save(path);
     }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)