Commit e8fd745
Check if a loaded font contains color glyphs
Changed files (3)
modifiedlibbirdfont/BirdFontFile.valamodifiedlibbirdfont/Font.valamodifiedlibbirdfont/LoadCallback.vala
Diff
@@ -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;@@ -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; @@ -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."));+ } }); }