The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Check if a loaded font contains color glyphs

These changes was commited to the Birdfont repository Tue, 28 Nov 2017 12:04:42 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 28 Nov 2017 12:04:42 +0000 (13:04 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 28 Nov 2017 12:04:42 +0000 (13:04 +0100)
commit e8fd7451c080340060e4664ce6872694101c2f34
tree c614788c2e6cdaf824f546c7e8fe356a65980348
parent ba2e653e65b59040f72f49d8c3dfc85479afe841
Check if a loaded font contains color glyphs

libbirdfont/BirdFontFile.vala
libbirdfont/Font.vala
libbirdfont/LoadCallback.vala
--- a/libbirdfont/BirdFontFile.vala +++ b/libbirdfont/BirdFontFile.vala @@ -28,6 +28,8 @@ 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; @@ -1438,6 +1440,10 @@ if (t.get_name () == "path") { path = parse_path (t); layer.add_path (path); + } + + if (t.get_name () == "embedded") { + font.has_svg = true; } }
--- a/libbirdfont/Font.vala +++ b/libbirdfont/Font.vala @@ -126,7 +126,8 @@ public int format_minor = 0; public int units_per_em = 1024; - + public bool has_svg = false; + public Font () { KerningClasses kerning_classes;
--- a/libbirdfont/LoadCallback.vala +++ b/libbirdfont/LoadCallback.vala @@ -34,6 +34,11 @@ MainWindow.show_message (t_("This font was made with an old version of Birdfont.") + " " + 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.")); } }); }