cvs: gd /gd-pango gd_pango.c /gd-pango/tests/pango CMakeLists.txt

[email protected] ("Takeshi Abe") Wed, 10 Sep 2008 17:21:21 -0000
Newsgroups php.gd.cvs
Message-ID <cvstabe1221067281@cvsserver>
tabe		Wed Sep 10 17:21:21 2008 UTC

  Modified files:              
    /gd/gd-pango	gd_pango.c 
    /gd/gd-pango/tests/pango	CMakeLists.txt 
  Log:
  * prefer to dtostr rather than to round by cast
  * EXECUTABLE_OUTPUT_PATH should no longer be used as of CMake 2.6
  * cosmetic fixes
  
  
http://cvs.php.net/viewvc.cgi/gd/gd-pango/gd_pango.c?r1=1.12&r2=1.13&diff_format=u
Index: gd/gd-pango/gd_pango.c
diff -u gd/gd-pango/gd_pango.c:1.12 gd/gd-pango/gd_pango.c:1.13
--- gd/gd-pango/gd_pango.c:1.12	Sun Aug 31 17:07:08 2008
+++ gd/gd-pango/gd_pango.c	Wed Sep 10 17:21:20 2008
@@ -15,7 +15,7 @@
   | Authors: Pierre-A. Joye <[email protected]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: gd_pango.c,v 1.12 2008/08/31 17:07:08 tabe Exp $ */
+/* $Id: gd_pango.c,v 1.13 2008/09/10 17:21:20 tabe Exp $ */
 /**
  * @file
  * @brief Pango support for GD
@@ -24,7 +24,7 @@
  *
  * @author Pierre-Alain Joye
  * @date   2006/12/19
- * $Id: gd_pango.c,v 1.12 2008/08/31 17:07:08 tabe Exp $
+ * $Id: gd_pango.c,v 1.13 2008/09/10 17:21:20 tabe Exp $
  */
 /**
  * \mainpage
@@ -344,7 +344,7 @@
 	gdImagePtr surface,
 	PangoLayoutIter *iter,
 	gint x,
-    gint y)
+	gint y)
 {
 	PangoLayoutLine *line;
 	PangoRectangle line_logical_rect;
@@ -593,7 +593,7 @@
 	pango_layout_get_extents(context->layout, NULL, &logical_rect);
 
 	brect = logical_rect; /* copy in pango units */
-	pango_extents_to_pixels (&logical_rect, NULL); 
+	pango_extents_to_pixels (&logical_rect, NULL);
 
 	rotated = (pango_context_get_matrix(context->context) != NULL);
 
@@ -644,13 +644,13 @@
 		if (angle > 0. && angle < G_PI/2) {
 			layout_x =  brect.y * sin(angle);
 			layout_y = -brect.y * cos(angle);
-		} else if (angle >= -G_PI/2 && angle <= 0.) { 
+		} else if (angle >= -G_PI/2 && angle <= 0.) {
 			layout_x =  -brect.x * cos(angle);
 			layout_y =  -brect.x * sin(angle);
-		} else if (angle >= G_PI/2 && angle <= G_PI) { 
+		} else if (angle >= G_PI/2 && angle <= G_PI) {
 			layout_x = -logical_rect.width + logical_rect.height * cos(angle) * sin(angle);
 			layout_y = -logical_rect.height * cos(angle) * cos(angle);
-		} else if (angle >= -G_PI && angle < -G_PI/2) { 
+		} else if (angle >= -G_PI && angle < -G_PI/2) {
 			layout_x = -logical_rect.width * cos(angle) * cos(angle);
 			layout_y = -logical_rect.height - (logical_rect.width * cos(angle) * sin(angle));
 		} else {
@@ -779,8 +779,8 @@
  * Set DPI to context.
  *
  * @param *context	Context
- * @param dpi_x 		Horizontal dpi
- * @param dpi_y		Vertical dpi
+ * @param dpi_x 	Horizontal dpi
+ * @param dpi_y 	Vertical dpi
  */
 void gdPangoSetDpi(gdPangoContext *context,
 	double dpi_x, double dpi_y)
@@ -817,7 +817,7 @@
 	FcValue fcFamilyName;
 	FcResult fcResult;
 	int numFonts;
-	char *font_desc;
+	char *font_desc, buf[G_ASCII_DTOSTR_BUF_SIZE];
 	int r;
 
 	fcBlanks = FcBlanksCreate();
@@ -834,7 +834,8 @@
 		goto fail1;
 	}
 
-	font_desc = g_strdup_printf("%s %d", fcFamilyName.u.s, (int) ptsize);
+	g_ascii_dtostr(buf, sizeof(buf), ptsize);
+	font_desc = g_strconcat(fcFamilyName.u.s, " ", buf, NULL);
 	context->font_desc = pango_font_description_from_string(font_desc);
 	g_free(font_desc);
 	gdPangoSetDpi(context, ptsize, ptsize);
http://cvs.php.net/viewvc.cgi/gd/gd-pango/tests/pango/CMakeLists.txt?r1=1.1&r2=1.2&diff_format=u
Index: gd/gd-pango/tests/pango/CMakeLists.txt
diff -u gd/gd-pango/tests/pango/CMakeLists.txt:1.1 gd/gd-pango/tests/pango/CMakeLists.txt:1.2
--- gd/gd-pango/tests/pango/CMakeLists.txt:1.1	Sun Aug 31 17:07:09 2008
+++ gd/gd-pango/tests/pango/CMakeLists.txt	Wed Sep 10 17:21:20 2008
@@ -7,5 +7,5 @@
 foreach(test_name ${TESTS_FILES})
   add_executable(${test_name} "${test_name}.c")
   target_link_libraries(${test_name} gd_pango)
-  add_test(${test_name} "${EXECUTABLE_OUTPUT_PATH}/${test_name}")
+  add_test(${test_name} "${test_name}")
 endforeach(test_name)