Commit 176b8c46 authored by Glen Low's avatar Glen Low

Quartz: more bitmap formats, better text for iOS

* 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.
parent 0c80d34d
......@@ -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"
......
......@@ -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)
{
......
......@@ -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
......
......@@ -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}
};
......@@ -21,7 +21,11 @@
#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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment