Commit a25a9c8
ignore invalid kerning in export
Changed files (4)
modifiedlibbirdfont/Font.valamodifiedlibbirdfont/GlyphTable.valamodifiedlibbirdfont/Path.valamodifiedlibbirdfont/SvgFontFormatWriter.vala
Diff
@@ -571,8 +571,13 @@ public class Font : GLib.Object { } glyph_cache.for_each ((gc) => {+ bool selected;+ + if (is_null (gc)) {+ warning ("No glyph collection");+ }+ try {- bool selected; foreach (Glyph g in gc.get_version_list ().glyphs) { selected = (g == gc.get_current ()); write_glyph (g, selected, os);@@ -584,16 +589,19 @@ public class Font : GLib.Object { }); glyph_cache.for_each ((gc) => {+ Glyph glyph;+ try {- Glyph glyph = gc.get_current ();+ glyph = gc.get_current (); foreach (Kerning k in glyph.kerning) { string l, r; Glyph? gr = get_glyph (k.glyph_right); Glyph glyph_right;- + if (gr == null) {- warning ("kerning glyph that does not exist.");+ warning ("kerning a glyph that does not exist. (" + glyph.name + " -> " + k.glyph_right + ")");+ continue; } glyph_right = (!) gr;@@ -35,7 +35,17 @@ class GlyphTable : GLib.Object { } public void @for_each (Func<GlyphCollection> func) {+ if (unlikely (is_null (data))) {+ warning ("No data in table");+ return;+ }+ data.foreach ((v) => {+ if (unlikely (is_null (v))) {+ warning ("No value found in GlyphTable.");+ return;+ }+ func (v.glyph_collection); }); }@@ -970,7 +970,7 @@ public class Path { eh.length = 0; eh = ((!)quadratic_path.points.last ().prev).data.get_right_handle ();- eh.set_point_type (PointType.QUADRATIC);+ eh.set_point_type (PointType.CURVE); eh.length *= 1.6; return quadratic_path;@@ -990,7 +990,7 @@ public class Path { eh.length = 0; eh = start.get_right_handle ();- eh.set_point_type (PointType.QUADRATIC);+ eh.set_point_type (PointType.CURVE); eh.move_to_coordinate (curve_x, curve_y); } @@ -105,6 +105,7 @@ class SvgFontFormatWriter : Object { if (gr == null) { warning ("kerning glyph that does not exist.");+ continue; } glyph_right = (!) gr;