Clone in a terminal:
Commit 5949cad
Johan Mattsson - 2015-05-20T11:19:12+00:00
5949cad5dbf1b781152401263d3d7de30328481fjohan.mattsson.m@gmail.com

Use the SVG stroke style

Changed files (3)

Diff

diff --git a/README.md b/README.mdindex 9a4dade..16ae001 100644--- a/README.md+++ b/README.md@@ -22,6 +22,7 @@ packages with a -dev or -devel affix:     python-gtk2-dev     libwebkitgtk-3.0-dev      libnotify-dev+    libsqlite3-dev     unicode-data (unicode character database)  BirdFont have two build systems, one python script that builds alldiff --git a/libbirdfont/SvgParser.vala b/libbirdfont/SvgParser.valaindex 68e255d..2a51279 100644--- a/libbirdfont/SvgParser.vala+++ b/libbirdfont/SvgParser.vala@@ -534,7 +534,12 @@ public class SvgParser { 		pl.paths.append (path_list); 	 		foreach (Path p in path_list.paths) {-			p.stroke = style.get_stroke_width ();+			if (style.has_stroke ()) {+				p.stroke = style.get_stroke_width ();+			} else {+				p.stroke = 0;+			}+			 			p.line_cap = style.get_line_cap (); 			p.reset_stroke (); 			p.update_region_boundaries ();		diff --git a/libbirdfont/SvgStyle.vala b/libbirdfont/SvgStyle.valaindex a1aac05..9a459c9 100644--- a/libbirdfont/SvgStyle.vala+++ b/libbirdfont/SvgStyle.vala@@ -43,6 +43,16 @@ public class SvgStyle { 		return LineCap.BUTT; 	 	} 	+	public bool has_stroke () {+		bool s = true;+		+		if (style.has_key ("stroke")) {+			s = style.get ("stroke") != "none";+		}+				+		return get_stroke_width () > 0 && s;+	}+		 	public double get_stroke_width () { 		if (!style.has_key ("stroke-width")) { 			return 0;

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112