The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Substitutions for space character

These changes was commited to the Birdfont repository Sun, 20 Dec 2015 08:14: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
author Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 20 Dec 2015 08:14:28 +0000 (09:14 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 20 Dec 2015 08:49:46 +0000 (09:49 +0100)
commit 1ef9d7150d28f4a1e5946a1245a98095f7068e77
tree b3382e2a0ecfecb5d8bb0274b934e18f44ed883c
parent 8591fe5b387305062e1c1fce6d0600e846ef8ea7
Substitutions for space character

libbirdfont/GlyphSequence.vala
libbirdfont/Ligatures.vala
libbirdfont/OpenFontFormat/ContextualLigature.vala
--- a/libbirdfont/GlyphSequence.vala +++ b/libbirdfont/GlyphSequence.vala @@ -100,7 +100,16 @@ foreach (Alternate a in alternates) { GlyphSequence old = new GlyphSequence (); - Glyph? g = font.get_glyph_by_name (a.glyph_name); + string name; + Glyph? g; + + name = a.glyph_name; + + if (name == "space") { + name = " "; + } + + g = font.get_glyph_by_name (name); if (g != null) { old.add (g);
--- a/libbirdfont/Ligatures.vala +++ b/libbirdfont/Ligatures.vala @@ -58,6 +58,10 @@ lig = new GlyphSequence (); foreach (string n in font.get_names (ligature)) { + if (n == "space") { + n = " "; + } + gc = font.get_glyph_collection_by_name (n); if (gc == null) { @@ -69,6 +73,10 @@ gs = new GlyphSequence (); foreach (string s in subst_names) { + if (s == "space") { + s = " "; + } + gc = font.get_glyph_collection_by_name (s); if (gc == null) {
--- a/libbirdfont/OpenFontFormat/ContextualLigature.vala +++ b/libbirdfont/OpenFontFormat/ContextualLigature.vala @@ -169,6 +169,11 @@ gs = new GlyphSequence (); foreach (string s in font.get_names (context)) { + + if (s == "space") { + s = " "; + } + gc = font.get_glyph_collection_by_name (s); if (gc == null) {