summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-05-09 17:33:50 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-05-09 17:33:50 +0000
commit6e9c4b31250e5c81b617145c7eeb53760c957db4 (patch)
tree042732ed7e998e4a91d5c5733d6529699a025a90 /ext/gd
parentf8518cc83a85d818295bee41fbefa3cff735a886 (diff)
downloadphp-git-6e9c4b31250e5c81b617145c7eeb53760c957db4.tar.gz
Upgrade bundled GD library to 2.0.23.
Fixed bug #28175 (build problem for people using FreeType 2.1.0-2.1.2).
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/gd.c2
-rw-r--r--ext/gd/libgd/gdft.c20
2 files changed, 18 insertions, 4 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index ae835a8db7..42e8cb7d65 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -453,7 +453,7 @@ PHP_RSHUTDOWN_FUNCTION(gd)
/* }}} */
#if HAVE_GD_BUNDLED
-#define PHP_GD_VERSION_STRING "bundled (2.0.22 compatible)"
+#define PHP_GD_VERSION_STRING "bundled (2.0.23 compatible)"
#elif HAVE_LIBGD20
#define PHP_GD_VERSION_STRING "2.0 or higher"
#elif HAVE_GDIMAGECOLORRESOLVE
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index acd5ea2bde..f6d9eae004 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -434,7 +434,7 @@ static void *fontFetch (char **error, void *key)
encoding = charmap->encoding_id;
/* EAM DEBUG - Newer versions of libfree2 make it easier by defining encodings */
-#if (defined(FREETYPE_MAJOR) && (FREETYPE_MAJOR >=2 ) && (FREETYPE_MINOR >= 1))
+#if (defined(FREETYPE_MAJOR) && ((FREETYPE_MAJOR == 2 && ((FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3) || FREETYPE_MINOR > 1) || FREETYPE_MAJOR > 2)))
if (charmap->encoding == FT_ENCODING_MS_SYMBOL
|| charmap->encoding == FT_ENCODING_ADOBE_CUSTOM
|| charmap->encoding == FT_ENCODING_ADOBE_STANDARD) {
@@ -443,7 +443,7 @@ static void *fontFetch (char **error, void *key)
a->face->charmap = charmap;
return (void *)a;
}
-#endif /* Freetype 2.1 or better */
+#endif /* Freetype 2.1.3 or better */
/* EAM DEBUG */
if ((platform == 3 && encoding == 1) /* Windows Unicode */
@@ -773,6 +773,8 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
* colorindexes. -- 27.06.2001 <krisku@arrak.fi>
*/
gdCache_head_t *tc_cache;
+ /* Tuneable horizontal and vertical resolution in dots per inch */
+ int hdpi, vdpi;
if (strex && ((strex->flags & gdFTEX_LINESPACE) == gdFTEX_LINESPACE)) {
linespace = strex->linespacing;
@@ -802,7 +804,19 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
face = font->face; /* shortcut */
slot = face->glyph; /* shortcut */
- if (FT_Set_Char_Size (face, 0, (FT_F26Dot6) (ptsize * 64), GD_RESOLUTION, GD_RESOLUTION)) {
+ /*
+ * Added hdpi and vdpi to support images at non-screen resolutions, i.e. 300 dpi TIFF,
+ * or 100h x 50v dpi FAX format. 2.0.23.
+ * 2004/02/27 Mark Shackelford, mark.shackelford@acs-inc.com
+ */
+ hdpi = GD_RESOLUTION;
+ vdpi = GD_RESOLUTION;
+ if (strex && (strex->flags & gdFTEX_RESOLUTION)) {
+ hdpi = strex->hdpi;
+ vdpi = strex->vdpi;
+ }
+
+ if (FT_Set_Char_Size(face, 0, (FT_F26Dot6) (ptsize * 64), hdpi, vdpi)) {
gdCacheDelete(tc_cache);
gdMutexUnlock(gdFontCacheMutex);
return "Could not set character size";