Commit aac21f7
do not export path with only one point chrome does not load the font if a path has less than 2 points
Changed files (4)
modifiedlibbirdfont/Glyph.valamodifiedlibbirdfont/OpenFontFormat/GlyfData.valamodifiedlibbirdfont/OpenFontFormat/GposTable.valamodifiedlibbirdfont/Path.vala
Diff
@@ -455,7 +455,7 @@ public class Glyph : FontDisplay { public void remove_empty_paths () { foreach (Path p in path_list) {- if (p.points.length () == 0) {+ if (p.points.length () < 2) { delete_path (p); remove_empty_paths (); return;@@ -54,10 +54,18 @@ class GlyfData : GLib.Object { private static double UNITS = HeadTable.UNITS; public GlyfData (Glyph g) { + Path q;+ glyph = g; foreach (Path p in g.path_list) {- paths.append (p.get_quadratic_points ());+ q = p.get_quadratic_points ();+ + if (q.points.length () < 2) {+ warning (@"A path in $(g.get_name ()) contains less than three points, it will not be exported.");+ } else {+ paths.append (q);+ } } process_end_points ();@@ -91,6 +99,11 @@ class GlyfData : GLib.Object { continue; } + if (quadratic.points.length () < 2) {+ warning ("A path contains less than three points, it will not be exported.");+ continue;+ }+ foreach (EditPoint e in quadratic.points) { end_point++; type = e.get_right_handle ().type;@@ -202,8 +202,6 @@ class GposTable : Table { return; } - print (@"kerning: $left $right $kerning\n");- pair_index = get_pair_index (gid1); if (pair_index == -1) { pair = new PairFormat1 ();@@ -1094,6 +1094,7 @@ public class Path { } if (points.length () < 2) {+ warning ("Less than 2 points in path."); return quadratic_path; }