Clone in a terminal:
Commit 677fec0
Johan Mattsson - 2013-06-23T13:57:29+00:00
677fec0b400d4b4b90fcca740a53f78b0462a8e6johan.mattsson.m@gmail.com

fix some test cases

Changed files (7)

Diff

diff --git a/libbirdfont/BirdFontFile.vala b/libbirdfont/BirdFontFile.valaindex 0b23510..5529d36 100644--- a/libbirdfont/BirdFontFile.vala+++ b/libbirdfont/BirdFontFile.vala@@ -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";+				} 			} 		} 		diff --git a/libbirdfont/ImportSvg.vala b/libbirdfont/ImportSvg.valaindex 1d1a083..312a001 100644--- a/libbirdfont/ImportSvg.vala+++ b/libbirdfont/ImportSvg.vala@@ -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 (); 			} 			diff --git a/libbirdfont/MenuTab.vala b/libbirdfont/MenuTab.valaindex e21f175..c474d5a 100644--- a/libbirdfont/MenuTab.vala+++ b/libbirdfont/MenuTab.vala@@ -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 ();diff --git a/libbirdfont/OverView.vala b/libbirdfont/OverView.valaindex efc70c1..14c2cbd 100644--- a/libbirdfont/OverView.vala+++ b/libbirdfont/OverView.vala@@ -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;diff --git a/libbirdfont/Path.vala b/libbirdfont/Path.valaindex b83e6e6..be77712 100644--- a/libbirdfont/Path.vala+++ b/libbirdfont/Path.vala@@ -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; 		diff --git a/libbirdfont/TestCases.vala b/libbirdfont/TestCases.valaindex 1551534..94092c1 100644--- a/libbirdfont/TestCases.vala+++ b/libbirdfont/TestCases.vala@@ -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 ();diff --git a/libbirdfont/VersionList.vala b/libbirdfont/VersionList.valaindex bd1c9f7..4b697c3 100644--- a/libbirdfont/VersionList.vala+++ b/libbirdfont/VersionList.vala@@ -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; 			} 			

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112