The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Add default characters if they are not present in font

These changes was commited to the Birdfont repository Thu, 30 Jun 2016 11:46:28 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Thu, 30 Jun 2016 11:46:28 +0000]

Updated Files

libbirdfont/Font.vala
--- a/libbirdfont/Font.vala +++ b/libbirdfont/Font.vala @@ -188,8 +188,19 @@ } public void add_default_characters () { - add_glyph_collection (get_notdef_character ()); - add_glyph_collection (get_space ()); + GlyphCollection notdef, space; + + notdef = get_notdef_character (); + + if (!has_glyph (notdef.get_name ()) { + add_glyph_collection (notdef); + } + + space = get_space (); + + if (!has_glyph (space.get_name ()) { + add_glyph_collection (space); + } } public Alternate? get_alternate (string glyph_name, string tag) {