Clone in a terminal:
Commit d5e1fdc
Johan Mattsson - 2014-07-11T19:29:42+00:00
d5e1fdce4145e190d77675d251c0d59614286bf3johan.mattsson.m@gmail.com

Fix TTF export and SVG font import

Changed files (4)

Diff

diff --git a/libbirdfont/OpenFontFormat/load_font.c b/libbirdfont/OpenFontFormat/load_font.cindex 7026824..de8822e 100644--- a/libbirdfont/OpenFontFormat/load_font.c+++ b/libbirdfont/OpenFontFormat/load_font.c@@ -1,5 +1,5 @@ /*-    Copyright (C) 2013 Johan Mattsson+    Copyright (C) 2013 2014 Johan Mattsson      This library is free software; you can redistribute it and/or modify      it under the terms of the GNU Lesser General Public License as @@ -129,7 +129,7 @@ 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.+	// is one of the more interesting fonts I have seen. 	int i; 	int j; 	guint prev_is_curve;@@ -828,7 +828,7 @@ GString* load_freetype_font (char* file, int* err) {  	error = FT_Select_Charmap (face , FT_ENCODING_UNICODE); 	if (error) {-		g_warning ("Freetype can not use unicode, error: %d\n", error);+		g_warning ("Freetype can not use Unicode, error: %d\n", error); 		*err = error; 		return bf; 	}diff --git a/libbirdfont/Path.vala b/libbirdfont/Path.valaindex 31adf01..3d6a1d0 100644--- a/libbirdfont/Path.vala+++ b/libbirdfont/Path.vala@@ -1240,7 +1240,7 @@ public class Path {  		if (right == PointType.DOUBLE_CURVE || left == PointType.DOUBLE_CURVE) { 			double_bezier_vector (position, start.x, start.get_right_handle ().x, stop.get_left_handle ().x, stop.x, out x0, out x1);-			double_bezier_vector (position, start.y, start.get_right_handle ().x, stop.get_left_handle ().y, stop.y, out y0, out y1);+			double_bezier_vector (position, start.y, start.get_right_handle ().y, stop.get_left_handle ().y, stop.y, out y0, out y1);  			ep.get_left_handle ().set_point_type (PointType.DOUBLE_CURVE);	 			ep.get_right_handle ().set_point_type (PointType.DOUBLE_CURVE);@@ -1251,7 +1251,7 @@ public class Path { 			ep.type = PointType.DOUBLE_CURVE; 		} else if (right == PointType.QUADRATIC) {		 			x0 = quadratic_bezier_vector (1 - position, stop.x, start.get_right_handle ().x, start.x);-			y0 = quadratic_bezier_vector (1 - position, stop.y, start.get_right_handle ().x, start.y);+			y0 = quadratic_bezier_vector (1 - position, stop.y, start.get_right_handle ().y, start.y); 			ep.get_right_handle ().move_to_coordinate (x0, y0); 			 			ep.get_left_handle ().set_point_type (PointType.QUADRATIC);	@@ -1262,7 +1262,7 @@ public class Path { 			ep.type = PointType.QUADRATIC;				 		} else if (right == PointType.CUBIC || left == PointType.CUBIC) { 			bezier_vector (position, start.x, start.get_right_handle ().x, stop.get_left_handle ().x, stop.x, out x0, out x1);-			bezier_vector (position, start.y, start.get_right_handle ().x, stop.get_left_handle ().y, stop.y, out y0, out y1);+			bezier_vector (position, start.y, start.get_right_handle ().y, stop.get_left_handle ().y, stop.y, out y0, out y1);  			ep.get_left_handle ().set_point_type (PointType.CUBIC); 			ep.get_left_handle ().move_to_coordinate (x0, y0);diff --git a/libbirdfont/SvgFont.vala b/libbirdfont/SvgFont.valaindex e9946a1..6e3bd8c 100644--- a/libbirdfont/SvgFont.vala+++ b/libbirdfont/SvgFont.vala@@ -236,6 +236,8 @@ class SvgFont : GLib.Object { 		string ligature = ""; 		SvgParser parser = new SvgParser (); +		parser.set_format (SvgFormat.INKSCAPE);+ 		for (Xml.Attr* prop = node->properties; prop != null; prop = prop->next) { 			attr_name = prop->name; 			attr_content = prop->children->content;diff --git a/libbirdfont/SvgParser.vala b/libbirdfont/SvgParser.valaindex b0a87ff..d1448c4 100644--- a/libbirdfont/SvgParser.vala+++ b/libbirdfont/SvgParser.vala@@ -213,6 +213,9 @@ public class SvgParser { 		} 	} +	/** @param path a path in the cartesian coordinate system+	 * The other parameters are in the SVG coordinate system.+	 */ 	public void apply_matrix (Path path, double a, double b, double c,  		double d, double e, double f){ 		

Contact

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