Clone in a terminal:
Commit e8fd745
Johan Mattsson - 2017-11-28T12:04:42+00:00
e8fd7451c080340060e4664ce6872694101c2f34johan.mattsson.m@gmail.com

Check if a loaded font contains color glyphs

Changed files (3)

Diff

diff --git a/libbirdfont/BirdFontFile.vala b/libbirdfont/BirdFontFile.valaindex 966cf5e..8f7f32e 100644--- a/libbirdfont/BirdFontFile.vala+++ b/libbirdfont/BirdFontFile.vala@@ -28,6 +28,8 @@ class BirdFontFile : GLib.Object { 	 	public static const int MIN_FORMAT_MAJOR = 0; 	public static const int MIN_FORMAT_MINOR = 0;++	public bool has_svg_glyphs = false;	 		 	public BirdFontFile (Font f) { 		font = f;@@ -1439,6 +1441,10 @@ class BirdFontFile : GLib.Object { 				path = parse_path (t); 				layer.add_path (path); 			}+			+			if (t.get_name () == "embedded") {+				font.has_svg = true;+			} 		} 		 		return layer;diff --git a/libbirdfont/Font.vala b/libbirdfont/Font.valaindex 038fd35..deb61a3 100644--- a/libbirdfont/Font.vala+++ b/libbirdfont/Font.vala@@ -126,7 +126,8 @@ public class Font : GLib.Object { 	public int format_minor = 0; 	 	public int units_per_em = 1024;-+	public bool has_svg = false;+	 	public Font () { 		KerningClasses kerning_classes; 		diff --git a/libbirdfont/LoadCallback.vala b/libbirdfont/LoadCallback.valaindex 979d391..22b1e35 100644--- a/libbirdfont/LoadCallback.vala+++ b/libbirdfont/LoadCallback.vala@@ -35,6 +35,11 @@ public class LoadCallback : GLib.Object { 						+ " " + t_("You need an older version of Birdfont to open it.")); 				} 			}+			+			if (f.has_svg) {+				MainWindow.show_message (t_("This font has color glyphs but your version of BirdFont does not have color support.")+						+ " " + t_("Check birdfont.org for other versions."));+			} 		}); 	} 

Contact

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