Commit 44c4109
Remove sodipoidi extensions from SVG files
Changed files (4)
modifiedlibbirdfont/DefaultCharactersSet.valamodifiedlibbirdfont/ExportTool.valamodifiedlibbirdfont/SvgFontFormatWriter.valamodifiedlibbirdfont/SvgParser.vala
Diff
@@ -1,5 +1,5 @@ /*- Copyright (C) 2013 Johan Mattsson+ Copyright (C) 2013, 2014 Johan Mattsson This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -54,9 +54,9 @@ public class DefaultCharacterSet { if (language == "PRIVATE_USE") { use_private_area (gr);- } else if (language.has_prefix ("la")) {+ } else if (language.has_prefix ("ja")) { use_default_range_japanese (gr);- } else if (language.has_prefix ("latin")) {+ } else if (language.has_prefix ("la")) { use_default_range_latin (gr); } else if (language.has_prefix ("zh")) { // TODO: not just simplified chinese use_default_range_chinese (gr);@@ -32,7 +32,6 @@ public class ExportTool : GLib.Object { Font font = BirdFont.get_current_font (); string name; StringBuilder s;- double baseline; name = glyph.get_name (); s = new StringBuilder ();@@ -48,12 +47,6 @@ public class ExportTool : GLib.Object { width="""" + @"$(glyph.get_width ())" + """px" height="""" + @"$(glyph.get_height ())" + """px"> """);-- baseline = glyph.get_height () - font.get_height (); // guides uses a different coordinate system- s.append ("<sodipodi:namedview>\n");- s.append (@"\t<sodipodi:guide orientation=\"0,1\" position=\"0,$baseline\" id=\"baseline\" />\n");- s.append ("</sodipodi:namedview>\n");- s.append (@"\n"); s.append (@"<g id=\"$(name)\">\n"); @@ -1,5 +1,5 @@ /*- Copyright (C) 2012 2014 Johan Mattsson+ Copyright (C) 2012, 2014 Johan Mattsson This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -91,8 +91,6 @@ public class SvgParser { xml_document = replace (xml_document, "<g", ">", "<g>"); xml_document = xml_document.replace ("sodipodi:", ""); - print (xml_document);- // parse the file if (!has_format) { stderr.printf ("No format identifier found.\n");@@ -1057,6 +1055,7 @@ public class SvgParser { return_if_fail (b.length != 0); return_if_fail (b[0].type != 'z');+ return_if_fail (num_b < b.length); for (int i = start_index; i < num_b; i++) { switch (b[i].type) {@@ -1258,7 +1257,12 @@ public class SvgParser { bool first_point = true; double first_left_x, first_left_y; Gee.ArrayList<EditPoint> smooth_points = new Gee.ArrayList<EditPoint> ();- + + if (num_b > b.length) {+ warning ("num_b > b.length: $num_b > $(b.length)");+ return path_list;+ }+ path = new Path (); if (num_b == 0) {