Clone in a terminal:
Commit ea8f1e7
Johan Mattsson - 2015-11-05T20:57:12+00:00
ea8f1e774c761660cda8ec4b60f57d70aec4525ejohan.mattsson.m@gmail.com

Export open paths Special fonts needs this.

Changed files (2)

Diff

diff --git a/libbirdfont/OpenFontFormat/load_font.c b/libbirdfont/OpenFontFormat/load_font.cindex b349bdd..1d1531a 100644--- a/libbirdfont/OpenFontFormat/load_font.c+++ b/libbirdfont/OpenFontFormat/load_font.c@@ -180,7 +180,8 @@ void create_contour (guint unicode, FT_Vector* points, char* flags, int* length, 		i++;		 	}  	-	if (len > 2 && is_quadratic (flags[0]) && !is_quadratic (flags[1])) { // first point is of curve but it is not part of a double curve+	// first point is of curve but it is not part of a double curve+	if (len > 2 && is_quadratic (flags[0]) && !is_quadratic (flags[1])) {  		first_normal_off_curve = TRUE; 	} 	@@ -385,11 +386,13 @@ GString* get_bf_contour_data (guint unicode, FT_Vector* points, char* flags, int 	gchar* coordinate = (gchar*) &coordinate_buffer; 	double units = get_units (units_per_em); 	guint prev_is_curve;+	int points_length;  	if (length == 0) { 		return bf; 	} 	+	points_length = length; 	create_contour (unicode, points, flags, &length, &new_points, &new_flags, err); 	 	x0 = new_points[0].x * units;diff --git a/libbirdfont/PointConverter.vala b/libbirdfont/PointConverter.valaindex 278c266..2dc4561 100644--- a/libbirdfont/PointConverter.vala+++ b/libbirdfont/PointConverter.vala@@ -47,13 +47,15 @@ public class PointConverter { 				PenTool.convert_point_segment_type (e, e.get_next (), PointType.DOUBLE_CURVE); 			} 		}-	-		if (quadratic_path.get_last_point ().get_right_handle ().type == PointType.CUBIC) {-			PenTool.convert_point_segment_type (quadratic_path.get_last_point (),-				quadratic_path.get_first_point (),-				PointType.DOUBLE_CURVE);+		+		if (!original_path.is_open ()) {+			if (quadratic_path.get_last_point ().get_right_handle ().type == PointType.CUBIC) {+				PenTool.convert_point_segment_type (quadratic_path.get_last_point (),+					quadratic_path.get_first_point (),+					PointType.DOUBLE_CURVE);+			} 		}-	+		 		quadratic_path.add_hidden_double_points (); 					 		return quadratic_path;@@ -76,6 +78,11 @@ public class PointConverter {  		size = quadratic_path.points.size; 		segment_start = quadratic_path.get_first_point ();+		+		if (original_path.is_open ()) {+			size--;+		}+		 		for (int i = 0; i < size; i++) { 			segment_stop = (i == size -1)  				? quadratic_path.get_first_point () 

Contact

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