Clone in a terminal:
Commit 732485d
Johan Mattsson - 2013-03-09T11:26:01+00:00
732485d57207fca25cbaa1d636214a6f8c06627cjohan.mattsson.m@gmail.com

tool box icon for double curve

Changed files (3)

Diff

diff --git a/icons/double_points.png b/icons/double_points.pngnew file mode 100644index 0000000..9848c9bBinary files /dev/null and b/icons/double_points.png differdiff --git a/libbirdfont/OpenFontFormat/load_font.c b/libbirdfont/OpenFontFormat/load_font.cindex 9f7750c..8a32735 100644--- a/libbirdfont/OpenFontFormat/load_font.c+++ b/libbirdfont/OpenFontFormat/load_font.c@@ -69,7 +69,7 @@ guint is_hidden (char flag) { 	return flag & HIDDEN_CURVE; } -/** Convert every second hidden curve to a double curve and keep the +/** Convert every second hidden curve to a double curve and keep   * other points as on curve points.  */  void set_double_curves (char* flag, int length) {@@ -131,6 +131,8 @@ double remove_hidden_points (FT_Vector* points, char* flags, guint length, guint  /** Add extra point where two ore more off curve points follow each other. */ void create_contour (guint unicode, FT_Vector* points, char* flags, int* length, FT_Vector** new_points, char** new_flags, int* err) {+	// This function has been tested with many fonts. ElsieSwashCaps-Regular+	// is one of the more interesting fonts. 	int i; 	int j; 	guint prev_is_curve;diff --git a/libbirdfont/Toolbox.vala b/libbirdfont/Toolbox.valaindex 2695eca..b300254 100644--- a/libbirdfont/Toolbox.vala+++ b/libbirdfont/Toolbox.vala@@ -104,46 +104,12 @@ public class Toolbox : GLib.Object  { 		}); 		draw_tool_modifiers.add_tool (tie_handles); -		// adjust precision-		string precision_value = Preferences.get ("precision");-		-		precision = new SpinButton ("precision", _("Set precision"));-		-		if (precision_value != "") {-			precision.set_value (precision_value);-		} else {-			precision.set_value_round (1);-		}-		-		precision.new_value_action.connect ((self) => {-			select_tool (precision);-			-			Preferences.set ("precision", self.get_display_value ());-			redraw ((int) precision.x, (int) precision.y, 70, 70);-		});--		precision.select_action.connect((self) => {-			pen_tool.set_precision (((SpinButton)self).get_value ());-		});-		-		precision.set_min (0.001);-		precision.set_max (1);-		-		draw_tool_modifiers.add_tool (precision);-		 		// quadratic Bézier points 		Tool quadratic_points = new Tool ("quadratic_points", _("Create quadratic Bézier curves")); 		quadratic_points.select_action.connect ((self) => { 			point_type = PointType.QUADRATIC; 		}); 		draw_tool_modifiers.add_tool (quadratic_points);		-		-		// cubic Bézier points-		Tool cubic_points = new Tool ("cubic_points", _("Create cubic Bézier curves"));-		cubic_points.select_action.connect ((self) => {-			point_type = PointType.CUBIC;-		});-		draw_tool_modifiers.add_tool (cubic_points);  		// two quadratic points off curve for each quadratic control point 		Tool double_points = new Tool ("double_points", _("Quadratic double point"));@@ -151,6 +117,13 @@ public class Toolbox : GLib.Object  { 			point_type = PointType.DOUBLE_CURVE; 		}); 		draw_tool_modifiers.add_tool (double_points);+				+		// cubic Bézier points+		Tool cubic_points = new Tool ("cubic_points", _("Create cubic Bézier curves"));+		cubic_points.select_action.connect ((self) => {+			point_type = PointType.CUBIC;+		});+		draw_tool_modifiers.add_tool (cubic_points); 		 		// path tools 		Tool union_paths_tool = new MergeTool ("union_paths");@@ -178,6 +151,33 @@ public class Toolbox : GLib.Object  { 			} 		}); 		path_tool_modifiers.add_tool (move_layer);++		// adjust precision+		string precision_value = Preferences.get ("precision");+		+		precision = new SpinButton ("precision", _("Set precision"));+		+		if (precision_value != "") {+			precision.set_value (precision_value);+		} else {+			precision.set_value_round (1);+		}+		+		precision.new_value_action.connect ((self) => {+			select_tool (precision);+			+			Preferences.set ("precision", self.get_display_value ());+			redraw ((int) precision.x, (int) precision.y, 70, 70);+		});++		precision.select_action.connect((self) => {+			pen_tool.set_precision (((SpinButton)self).get_value ());+		});+		+		precision.set_min (0.001);+		precision.set_max (1);+		+		path_tool_modifiers.add_tool (precision); 		 		// Character set tools 		Tool full_unicode = new Tool ("utf_8", _("Show full unicode characters set"), 'f', CTRL);

Contact

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