]> granicus.if.org Git - graphviz/commitdiff
Quartz: more bitmap formats, better text for iOS
authorGlen Low <glen.low@pixelglow.com>
Thu, 5 Dec 2013 16:16:43 +0000 (00:16 +0800)
committerGlen Low <glen.low@pixelglow.com>
Thu, 5 Dec 2013 23:12:54 +0000 (07:12 +0800)
* Support was already present on Mac OS X, so we only need to judiciously re-enable for iOS.

* iOS 2.0 and later now uses Image I/O for more bitmap formats.

* iOS 3.2 or later now uses CoreText for better text layout and rendering.

plugin/quartz/GVTextLayout.m
plugin/quartz/gvplugin_quartz.c
plugin/quartz/gvplugin_quartz.h
plugin/quartz/gvrender_quartz.c
plugin/quartz/gvtextlayout_quartz.c

index a61c59fc7ff2ceba8a4daebda41efd5641514982..392654cef4f666a556fad1d9835bc84f6db69297 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "gvplugin_quartz.h"
 
-#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000 && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 30200
 
 #import "GVTextLayout.h"
 
index 1e1fa6da6a80b563433e5e9358b216ec470bc3ba..fc945bb6258ca40e680634ebd91ad27f417c63a5 100644 (file)
@@ -40,7 +40,7 @@ CGDataConsumerCallbacks device_data_consumer_callbacks = {
        NULL
 };
 
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040 || __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000
 
 CFStringRef format_to_uti(format_type format)
 {
index 6aa810be0d0d9cb5af21b293c75eee91f68569b8..03af8049b98bc6034c5a89fed0bce412a91a8c03 100644 (file)
@@ -49,7 +49,7 @@ static const int BYTE_ALIGN = 15;                     /* align to 16 bytes */
 static const int BITS_PER_COMPONENT = 8;       /* bits per color component */
 static const int BYTES_PER_PIXEL = 4;          /* bytes per pixel */
 
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040 || __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000
 CFStringRef format_to_uti(format_type format);
 #endif
 
index a12f3a3b01cfddc6c033fcc4aafcce92bbb8fded..5a7c6433df07f78d5adf2b25e66716759a03b684 100644 (file)
@@ -78,7 +78,7 @@ static void quartzgen_end_job(GVJ_t * job)
                *((CGImageRef *) job->window) = CGBitmapContextCreateImage(context);
            break;
 
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040 || __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000
        default:                /* bitmap formats */
            {
                /* create an image destination */
@@ -494,24 +494,26 @@ gvplugin_installed_t gvdevice_quartz_types[] = {
 #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040 || __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000
     {FORMAT_CGIMAGE, "cgimage:quartz", 8, NULL, &device_features_quartz},
 #endif
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040 || __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000
     {FORMAT_BMP, "bmp:quartz", 8, NULL, &device_features_quartz},
     {FORMAT_GIF, "gif:quartz", 8, NULL, &device_features_quartz},
-    {FORMAT_EXR, "exr:quartz", 8, NULL, &device_features_quartz},
-    {FORMAT_ICNS, "icns:quartz", 8, NULL, &device_features_quartz},
     {FORMAT_ICO, "ico:quartz", 8, NULL, &device_features_quartz},
     {FORMAT_JPEG, "jpe:quartz", 8, NULL, &device_features_quartz},
     {FORMAT_JPEG, "jpeg:quartz", 8, NULL, &device_features_quartz},
     {FORMAT_JPEG, "jpg:quartz", 8, NULL, &device_features_quartz},
     {FORMAT_JPEG2000, "jp2:quartz", 8, NULL, &device_features_quartz},
-    {FORMAT_PICT, "pct:quartz", 8, NULL, &device_features_quartz},
-    {FORMAT_PICT, "pict:quartz", 8, NULL, &device_features_quartz},
     {FORMAT_PNG, "png:quartz", 8, NULL, &device_features_quartz},
-    {FORMAT_PSD, "psd:quartz", 8, NULL, &device_features_quartz},
-    {FORMAT_SGI, "sgi:quartz", 8, NULL, &device_features_quartz},
     {FORMAT_TIFF, "tif:quartz", 8, NULL, &device_features_quartz},
     {FORMAT_TIFF, "tiff:quartz", 8, NULL, &device_features_quartz},
     {FORMAT_TGA, "tga:quartz", 8, NULL, &device_features_quartz},
+#endif
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040
+    {FORMAT_EXR, "exr:quartz", 8, NULL, &device_features_quartz},
+    {FORMAT_ICNS, "icns:quartz", 8, NULL, &device_features_quartz},
+    {FORMAT_PICT, "pct:quartz", 8, NULL, &device_features_quartz},
+    {FORMAT_PICT, "pict:quartz", 8, NULL, &device_features_quartz},
+    {FORMAT_PSD, "psd:quartz", 8, NULL, &device_features_quartz},
+    {FORMAT_SGI, "sgi:quartz", 8, NULL, &device_features_quartz},
 #endif
     {0, NULL, 0, NULL, NULL}
 };
index 0c8ddf4a001f5aa11d8438377d51737be155b11a..ec758660b25a75ceb4625f539e77e394d2921634 100644 (file)
 #include "gvplugin_textlayout.h"
 #include "gvplugin_quartz.h"
 
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 30200
+#include <CoreText/CoreText.h>
+#endif
+
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 || __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 30200
 
 void *quartz_new_layout(char* fontname, double fontsize, char* text)
 {