The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix spacing classes

These changes was commited to the Birdfont repository Sat, 29 Aug 2015 12:52:54 +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>
Sat, 29 Aug 2015 12:52:54 +0000 (14:52 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sat, 29 Aug 2015 12:52:54 +0000 (14:52 +0200)
commit 6265761469029fbdfdaa8925aa890600ecab7bed
tree 04d4a20051f38a973933887a8162cc05d8cdce69
parent 01c03d93b09afecca0ddea454a00565d12a0f0f5
Fix spacing classes
Always copy side bearings from the first glyph to the next glyph (never
the other way around) when new spacing classes are added to a font.

libbirdfont/SpacingData.vala
--- a/libbirdfont/SpacingData.vala +++ b/libbirdfont/SpacingData.vala @@ -99,22 +99,22 @@ GlyphCollection? g; GlyphCollection gc; - if (s.next != "?") { - kerning_classes.update_space_class (s.next); - g = font.get_glyph_collection (s.next); - if (g != null) { - gc = (!) g; - gc.get_current ().update_spacing_class (); - } + if (s.next == "?" || s.first == "?") { + return; } - - if (s.first != "?") { - kerning_classes.update_space_class (s.first); - g = font.get_glyph_collection (s.first); - if (g != null) { - gc = (!) g; - gc.get_current ().update_spacing_class (); - } + + kerning_classes.update_space_class (s.next); + g = font.get_glyph_collection (s.next); + if (g != null) { + gc = (!) g; + gc.get_current ().update_spacing_class (); + } + + kerning_classes.update_space_class (s.first); + g = font.get_glyph_collection (s.first); + if (g != null) { + gc = (!) g; + gc.get_current ().update_spacing_class (); } KerningTools.update_spacing_classes ();