Commit 677fec0
fix some test cases
Changed files (7)
modifiedlibbirdfont/BirdFontFile.valamodifiedlibbirdfont/ImportSvg.valamodifiedlibbirdfont/MenuTab.valamodifiedlibbirdfont/OverView.valamodifiedlibbirdfont/Path.valamodifiedlibbirdfont/TestCases.valamodifiedlibbirdfont/VersionList.vala
Diff
@@ -111,13 +111,9 @@ class BirdFontFile { // this a backup of another font if (backup) {- if (unlikely (font.font_file == null)) {- warning ("No file name is set, write backup file name to font file.");- } else {- os.put_string ("\n");- os.put_string (@"<!-- This is a backup of the following font: -->\n"); - os.put_string (@"<backup>$((!) font.font_file)</backup>\n"); - }+ os.put_string ("\n");+ os.put_string (@"<!-- This is a backup of the following font: -->\n"); + os.put_string (@"<backup>$((!) font.get_path ())</backup>\n"); } os.put_string ("\n");@@ -651,6 +647,10 @@ class BirdFontFile { b = new StringBuilder (); b.append_unichar (unicode); name = b.str;+ + if (name == "") {+ name = ".null";+ } } } @@ -727,14 +727,16 @@ public class ImportSvg { ep1 = path.points.last ().data; ep1.recalculate_linear_handles (); ep1.get_right_handle ().type = PointType.QUADRATIC;- ep1.get_right_handle ().move_to_coordinate (x0, y0); + ep1.get_right_handle ().move_to_coordinate (x0, y0);+ ep1.type = PointType.QUADRATIC; path.add (x1, y1); ep2 = path.points.last ().data; ep2.recalculate_linear_handles (); ep2.get_left_handle ().type = PointType.QUADRATIC;- ep2.get_left_handle ().move_to_coordinate (x0, y0); + ep2.get_left_handle ().move_to_coordinate (x0, y0);+ ep2.type = PointType.QUADRATIC; } if (command[i] == "C") {@@ -753,6 +755,7 @@ public class ImportSvg { // start with line handles ep1 = path.points.last ().data; ep1.get_right_handle ().type = PointType.LINE_CUBIC;+ ep1.type = PointType.LINE_CUBIC; lx = ep1.x + ((x2 - ep1.x) / 3); ly = ep1.y + ((y2 - ep1.y) / 3);@@ -764,7 +767,9 @@ public class ImportSvg { ep1 = path.points.last ().data; ep1.recalculate_linear_handles (); ep1.get_right_handle ().type = PointType.CUBIC;- ep1.get_right_handle ().move_to_coordinate (x0, y0); + ep1.get_right_handle ().move_to_coordinate (x0, y0);+ ep1.type = PointType.CUBIC;+ path.add (x2, y2); @@ -772,7 +777,8 @@ public class ImportSvg { ep2.recalculate_linear_handles (); ep2.get_left_handle ().type = PointType.CUBIC; ep2.get_left_handle ().move_to_coordinate (x1, y1);- + ep2.type = PointType.CUBIC;+ ep1.recalculate_linear_handles (); } @@ -406,7 +406,7 @@ c.append (""" f.delete_backup (); - fn = (!) f.font_file;+ fn = f.get_path (); if (f.font_file != null && fn.has_suffix (".bf")) { f.background_scale = MainWindow.get_toolbox ().background_scale.get_display_value ();@@ -96,25 +96,12 @@ public class OverView : FontDisplay { g.close_path (); g.default_zoom (); z.store_current_view ();- - print (@"CHARDB: $(CharDatabase.get_unicode_database_entry (new_char))\n"); } }); update_scrollbar (); } - void scroll_bottom () {- Font f;- - if (all_available) {- f = BirdFont.get_current_font ();- scroll_to_position (f.length () - items_per_row * rows);- } else {- scroll_to_position (glyph_range.length () - items_per_row * rows);- }- }- public double get_height () { double l; Font f;@@ -1099,7 +1099,7 @@ public class Path { return false; } - private bool split_cubic_curves (Path cubic) requires (points.length () > 2) {+ private bool split_cubic_curves (Path cubic) requires (points.length () > 1) { EditPoint start = points.last ().data; bool n = false; @@ -85,7 +85,7 @@ class TestCases { } if (data == null) {- warning ("No svg data.");+ warning ("No bf data."); return; } @@ -385,7 +385,7 @@ class TestCases { MenuTab.preview (); - // TODO: run this many times on big font+ // TODO: run this many times on big fonts for (int i = 0; i < 10; i++) { ExportTool.export_all (); Tool.yield ();@@ -123,7 +123,6 @@ public class VersionList : DropMenu { ug = font.get_glyph (uni.str); if (ug == null) {- warning (@"display is null for tab $(tab.get_label ())"); return; }