Re: [PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c /ext/gd/tests Tuffy.ttf bug48555.phpt
Hi, Done, sorry for the delay. Cheers, -- Takeshi Abe On Sun, 21 Jun 2009 18:36:06 +0200, Pierre Joye pierre@gmail.com wrote: yes, I already asked Tabe to MFH :) Cheers, On Sun, Jun 21, 2009 at 5:26 PM, Ilia Alshanetskyi...@prohost.org wrote: Does this need to go into 5.2? Ilia Alshanetsky On 21-Jun-09, at 1:59 AM, Takeshi Abe wrote: tabe Sun Jun 21 05:59:26 2009 UTC Added files: /php-src/ext/gd/tests bug48555.phpt Tuffy.ttf Modified files: /php-src/ext/gd/libgd gdft.c Log: fixed bug #48555 (ImageFTBBox() differs from previous versions for texts with new lines) tabe-20090621055926.txt-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c /ext/gd/tests Tuffy.ttf bug48555.phpt
Does this need to go into 5.2? Ilia Alshanetsky On 21-Jun-09, at 1:59 AM, Takeshi Abe wrote: tabeSun Jun 21 05:59:26 2009 UTC Added files: /php-src/ext/gd/testsbug48555.phpt Tuffy.ttf Modified files: /php-src/ext/gd/libgdgdft.c Log: fixed bug #48555 (ImageFTBBox() differs from previous versions for texts with new lines) tabe-20090621055926.txt-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c /ext/gd/tests Tuffy.ttf bug48555.phpt
yes, I already asked Tabe to MFH :) Cheers, On Sun, Jun 21, 2009 at 5:26 PM, Ilia Alshanetskyi...@prohost.org wrote: Does this need to go into 5.2? Ilia Alshanetsky On 21-Jun-09, at 1:59 AM, Takeshi Abe wrote: tabe Sun Jun 21 05:59:26 2009 UTC Added files: /php-src/ext/gd/tests bug48555.phpt Tuffy.ttf Modified files: /php-src/ext/gd/libgd gdft.c Log: fixed bug #48555 (ImageFTBBox() differs from previous versions for texts with new lines) tabe-20090621055926.txt-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c /ext/gd/tests Tuffy.ttf bug48555.phpt
tabeSun Jun 21 05:59:26 2009 UTC Added files: /php-src/ext/gd/tests bug48555.phpt Tuffy.ttf Modified files: /php-src/ext/gd/libgd gdft.c Log: fixed bug #48555 (ImageFTBBox() differs from previous versions for texts with new lines) http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.47r2=1.48diff_format=u Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.47 php-src/ext/gd/libgd/gdft.c:1.48 --- php-src/ext/gd/libgd/gdft.c:1.47Wed Mar 25 16:15:18 2009 +++ php-src/ext/gd/libgd/gdft.c Sun Jun 21 05:59:25 2009 @@ -784,6 +784,7 @@ double cos_a = cos (angle); int len, i = 0, ch; int x1 = 0, y1 = 0; + int xb = x, yb = y; font_t *font; fontkey_t fontkey; char *next; @@ -924,8 +925,8 @@ /* carriage returns */ if (ch == '\r') { penf.x = 0; - x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64; - y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64; + x1 = (int)(- penf.y * sin_a + 32) / 64; + y1 = (int)(- penf.y * cos_a + 32) / 64; pen.x = pen.y = 0; previous = 0; /* clear kerning flag */ next++; @@ -937,8 +938,10 @@ penf.x = 0; penf.y -= (long)(face-size-metrics.height * linespace); penf.y = (penf.y - 32) -64; /* round to next pixel row */ - x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64; - y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64; + x1 = (int)(- penf.y * sin_a + 32) / 64; + y1 = (int)(- penf.y * cos_a + 32) / 64; + xb = x + x1; + yb = y + y1; pen.x = pen.y = 0; previous = 0; /* clear kerning flag */ next++; @@ -1088,7 +1091,7 @@ /* now, draw to our target surface */ bm = (FT_BitmapGlyph) image; - gdft_draw_bitmap(tc_cache, im, fg, bm-bitmap, x + x1 + ((pen.x + 31) 6) + bm-left, y - y1 + ((pen.y + 31) 6) - bm-top); + gdft_draw_bitmap(tc_cache, im, fg, bm-bitmap, x + x1 + ((pen.x + 31) 6) + bm-left, y + y1 + ((pen.y + 31) 6) - bm-top); } /* record current glyph index for kerning */ @@ -1127,14 +1130,14 @@ brect[7] = (int) (normbox.xMin * sin_a + normbox.yMax * cos_a); /* scale, round and offset brect */ - brect[0] = x + gdroundupdown(brect[0], d2 0); - brect[1] = y - gdroundupdown(brect[1], d1 0); - brect[2] = x + gdroundupdown(brect[2], d1 0); - brect[3] = y - gdroundupdown(brect[3], d2 0); - brect[4] = x + gdroundupdown(brect[4], d2 0); - brect[5] = y - gdroundupdown(brect[5], d1 0); - brect[6] = x + gdroundupdown(brect[6], d1 0); - brect[7] = y - gdroundupdown(brect[7], d2 0); + brect[0] = xb + gdroundupdown(brect[0], d2 0); + brect[1] = yb - gdroundupdown(brect[1], d1 0); + brect[2] = xb + gdroundupdown(brect[2], d1 0); + brect[3] = yb - gdroundupdown(brect[3], d2 0); + brect[4] = xb + gdroundupdown(brect[4], d2 0); + brect[5] = yb - gdroundupdown(brect[5], d1 0); + brect[6] = xb + gdroundupdown(brect[6], d1 0); + brect[7] = yb - gdroundupdown(brect[7], d2 0); } if (tmpstr) { http://cvs.php.net/viewvc.cgi/php-src/ext/gd/tests/bug48555.phpt?view=markuprev=1.1 Index: php-src/ext/gd/tests/bug48555.phpt +++ php-src/ext/gd/tests/bug48555.phpt --TEST-- Bug #48555 (ImageFTBBox() differs from previous versions for texts with new lines) --SKIPIF-- ?php if(!extension_loaded('gd')){ die('skip gd extension not available'); } ? --FILE-- ?php $cwd = dirname(__FILE__); $font = $cwd/Tuffy.ttf; $box = ImageFTBBox(13, 0, $font, Text without line-break); echo 'Top without line-break: ' . $box[7] . \n; $box = ImageFTBBox(13, 0, $font, Text with\nline-break\none more); echo 'Top with line-break: ' . $box[7] . \n; ? --EXPECTF-- Top without line-break: -15 Top with line-break: -15 http://cvs.php.net/viewvc.cgi/php-src/ext/gd/tests/Tuffy.ttf?view=markuprev=1.1 Index: php-src/ext/gd/tests/Tuffy.ttf +++ php-src/ext/gd/tests/Tuffy.ttf !#$%'()*+,-./0123456789:;=?...@abcdefghijklmnopqrstuvwxyz[\]^_`a 0 @ R d p Ö...@v®Ø$Ln¤À Ø:p¦àþJf¤ÂÞ*æVÜp¤ú(2 ®àî...@´ÒÜèô þ$;IyO¤â*P\GP*.D$ +6WVÂ
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c /ext/gd/tests bug43073.phpt
tabeWed Mar 25 16:15:18 2009 UTC Added files: /php-src/ext/gd/tests bug43073.phpt Modified files: /php-src/ext/gd/libgd gdft.c Log: MFB: #43073, TrueType bounding box is wrong for angle0 http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.46r2=1.47diff_format=u Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.46 php-src/ext/gd/libgd/gdft.c:1.47 --- php-src/ext/gd/libgd/gdft.c:1.46Wed Jan 9 01:52:03 2008 +++ php-src/ext/gd/libgd/gdft.c Wed Mar 25 16:15:18 2009 @@ -1108,15 +1108,23 @@ double d1 = sin (angle + 0.78539816339744830962); double d2 = sin (angle - 0.78539816339744830962); + /* make the center of rotation at (0, 0) */ + FT_BBox normbox; + + normbox.xMin = 0; + normbox.yMin = 0; + normbox.xMax = bbox.xMax - bbox.xMin; + normbox.yMax = bbox.yMax - bbox.yMin; + /* rotate bounding rectangle */ - brect[0] = (int) (bbox.xMin * cos_a - bbox.yMin * sin_a); - brect[1] = (int) (bbox.xMin * sin_a + bbox.yMin * cos_a); - brect[2] = (int) (bbox.xMax * cos_a - bbox.yMin * sin_a); - brect[3] = (int) (bbox.xMax * sin_a + bbox.yMin * cos_a); - brect[4] = (int) (bbox.xMax * cos_a - bbox.yMax * sin_a); - brect[5] = (int) (bbox.xMax * sin_a + bbox.yMax * cos_a); - brect[6] = (int) (bbox.xMin * cos_a - bbox.yMax * sin_a); - brect[7] = (int) (bbox.xMin * sin_a + bbox.yMax * cos_a); + brect[0] = (int) (normbox.xMin * cos_a - normbox.yMin * sin_a); + brect[1] = (int) (normbox.xMin * sin_a + normbox.yMin * cos_a); + brect[2] = (int) (normbox.xMax * cos_a - normbox.yMin * sin_a); + brect[3] = (int) (normbox.xMax * sin_a + normbox.yMin * cos_a); + brect[4] = (int) (normbox.xMax * cos_a - normbox.yMax * sin_a); + brect[5] = (int) (normbox.xMax * sin_a + normbox.yMax * cos_a); + brect[6] = (int) (normbox.xMin * cos_a - normbox.yMax * sin_a); + brect[7] = (int) (normbox.xMin * sin_a + normbox.yMax * cos_a); /* scale, round and offset brect */ brect[0] = x + gdroundupdown(brect[0], d2 0); http://cvs.php.net/viewvc.cgi/php-src/ext/gd/tests/bug43073.phpt?view=markuprev=1.1 Index: php-src/ext/gd/tests/bug43073.phpt +++ php-src/ext/gd/tests/bug43073.phpt --TEST-- Bug #43073 (TrueType bounding box is wrong for angle0) --SKIPIF-- ?php if(!extension_loaded('gd')){ die('skip gd extension not available'); } ? --FILE-- ?php $cwd = dirname(__FILE__); $font = $cwd/test8859.ttf; $delta_t = 360.0 / 16; # Make 16 steps around $g = imagecreate(800, 800); $bgnd = imagecolorallocate($g, 255, 255, 255); $black = imagecolorallocate($g, 0, 0, 0); $x = 100; $y = 0; $cos_t = cos(deg2rad($delta_t)); $sin_t = sin(deg2rad($delta_t)); for ($angle = 0.0; $angle 360.0; $angle += $delta_t) { $bbox = imagettftext($g, 24, $angle, 400+$x, 400+$y, $black, $font, 'ABCDEF'); $s = vsprintf((%d, %d), (%d, %d), (%d, %d), (%d, %d)\n, $bbox); echo $s; $temp = $cos_t * $x + $sin_t * $y; $y= $cos_t * $y - $sin_t * $x; $x= $temp; } ? --EXPECTF-- (500, 400), (579, 400), (579, 370), (500, 370) (492, 361), (575, 327), (564, 301), (480, 335) (470, 329), (540, 260), (521, 242), (451, 312) (438, 307), (478, 210), (461, 204), (420, 301) (400, 300), (400, 193), (383, 193), (383, 300) (361, 307), (319, 207), (297, 216), (338, 317) (329, 329), (254, 254), (233, 275), (307, 351) (307, 361), (215, 323), (203, 354), (294, 392) (300, 400), (203, 400), (203, 431), (300, 431) (307, 438), (219, 474), (229, 501), (318, 465) (329, 470), (263, 535), (281, 553), (347, 489) (361, 492), (326, 575), (343, 582), (378, 499) (400, 500), (400, 584), (416, 584), (416, 500) (438, 492), (468, 567), (490, 559), (460, 483) (470, 470), (523, 525), (545, 505), (491, 449) (492, 438), (560, 467), (572, 436), (504, 408) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
pajoye Wed Jan 9 01:52:03 2008 UTC Modified files: /php-src/ext/gd/libgd gdft.c Log: - MFB: #43790, fix crash when no family name has been found http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.45r2=1.46diff_format=u Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.45 php-src/ext/gd/libgd/gdft.c:1.46 --- php-src/ext/gd/libgd/gdft.c:1.45Mon Apr 23 15:06:13 2007 +++ php-src/ext/gd/libgd/gdft.c Wed Jan 9 01:52:03 2008 @@ -947,7 +947,8 @@ /* EAM DEBUG */ #if (defined(FREETYPE_MAJOR) ((FREETYPE_MAJOR == 2 ((FREETYPE_MINOR == 1 FREETYPE_PATCH = 3) || FREETYPE_MINOR 1) || FREETYPE_MAJOR 2))) - if (font-face-charmap-encoding == FT_ENCODING_MS_SYMBOL strcmp(font-face-family_name, Symbol) == 0) { + if (font-face-family_name font-face-charmap-encoding + font-face-charmap-encoding == FT_ENCODING_MS_SYMBOL strcmp(font-face-family_name, Symbol) == 0) { /* I do not know the significance of the constant 0xf000. * It was determined by inspection of the character codes * stored in Microsoft font symbol. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
nlopess Wed Apr 4 14:26:04 2007 UTC Modified files: /php-src/ext/gd/libgd gdft.c Log: MFB: fix race condition on font cache shutdown http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.43r2=1.44diff_format=u Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.43 php-src/ext/gd/libgd/gdft.c:1.44 --- php-src/ext/gd/libgd/gdft.c:1.43Wed Apr 4 00:44:38 2007 +++ php-src/ext/gd/libgd/gdft.c Wed Apr 4 14:26:04 2007 @@ -715,13 +715,15 @@ void gdFontCacheShutdown() { + gdMutexLock(gdFontCacheMutex); + if (fontCache) { - gdMutexLock(gdFontCacheMutex); gdCacheDelete(fontCache); fontCache = NULL; - gdMutexUnlock(gdFontCacheMutex); FT_Done_FreeType(library); } + + gdMutexUnlock(gdFontCacheMutex); } void gdFreeFontCache() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
nlopess Thu Mar 1 18:41:45 2007 UTC Modified files: /php-src/ext/gd/libgd gdft.c Log: MFB http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.41r2=1.42diff_format=u Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.41 php-src/ext/gd/libgd/gdft.c:1.42 --- php-src/ext/gd/libgd/gdft.c:1.41Sun Feb 25 02:56:03 2007 +++ php-src/ext/gd/libgd/gdft.c Thu Mar 1 18:41:45 2007 @@ -721,6 +721,7 @@ gdMutexLock(gdFontCacheMutex); gdCacheDelete(fontCache); fontCache = NULL; + gdMutexUnlock(gdFontCacheMutex); gdMutexShutdown(gdFontCacheMutex); FT_Done_FreeType(library); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
pajoye Sun Feb 25 02:56:04 2007 UTC Modified files: /php-src/ext/gd/libgd gdft.c Log: - MFB: sync with libgd.org, patch from Kees Cook http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.40r2=1.41diff_format=u Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.40 php-src/ext/gd/libgd/gdft.c:1.41 --- php-src/ext/gd/libgd/gdft.c:1.40Fri Feb 23 01:02:57 2007 +++ php-src/ext/gd/libgd/gdft.c Sun Feb 25 02:56:03 2007 @@ -986,7 +986,7 @@ } else { ch = c 0xFF; /* don't extend sign */ } - next++; + if (*next) next++; } break; case gdFTEX_Big5: { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
pajoye Fri Feb 23 01:02:57 2007 UTC Modified files: /php-src/ext/gd/libgd gdft.c Log: - MFB: #40578, fix the 2nd race condition on shutdown when the cache is freed http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.39r2=1.40diff_format=u Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.39 php-src/ext/gd/libgd/gdft.c:1.40 --- php-src/ext/gd/libgd/gdft.c:1.39Wed Feb 21 14:59:36 2007 +++ php-src/ext/gd/libgd/gdft.c Fri Feb 23 01:02:57 2007 @@ -718,9 +718,10 @@ void gdFontCacheShutdown() { if (fontCache) { - gdMutexShutdown(gdFontCacheMutex); + gdMutexLock(gdFontCacheMutex); gdCacheDelete(fontCache); fontCache = NULL; + gdMutexShutdown(gdFontCacheMutex); FT_Done_FreeType(library); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
tony2001Wed Feb 21 14:59:36 2007 UTC Modified files: /php-src/ext/gd/libgd gdft.c Log: fix #40578 (imagettftext() multithreading issue) http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.38r2=1.39diff_format=u Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.38 php-src/ext/gd/libgd/gdft.c:1.39 --- php-src/ext/gd/libgd/gdft.c:1.38Fri Sep 15 16:14:57 2006 +++ php-src/ext/gd/libgd/gdft.c Wed Feb 21 14:59:36 2007 @@ -192,6 +192,16 @@ #include jisx0208.h #endif +extern int any2eucjp (char *, char *, unsigned int); + +/* Persistent font cache until explicitly cleared */ +/* Fonts can be used across multiple images */ + +/* 2.0.16: thread safety (the font cache is shared) */ +gdMutexDeclare(gdFontCacheMutex); +static gdCache_head_t *fontCache = NULL; +static FT_Library library; + #define Tcl_UniChar int #define TCL_UTF_MAX 3 static int gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr) @@ -688,8 +698,10 @@ } else { /* find antialised color */ tc_key.bgcolor = *pixel; + gdMutexLock(gdFontCacheMutex); tc_elem = (tweencolor_t *) gdCacheGet(tc_cache, tc_key); *pixel = tc_elem-tweencolor; + gdMutexUnlock(gdFontCacheMutex); } } } @@ -703,16 +715,6 @@ return (!updown) ? (v1 0 ? ((v1 - 63) 6) : v1 6) : (v1 0 ? ((v1 + 63) 6) : v1 6); } -extern int any2eucjp (char *, char *, unsigned int); - -/* Persistent font cache until explicitly cleared */ -/* Fonts can be used across multiple images */ - -/* 2.0.16: thread safety (the font cache is shared) */ -gdMutexDeclare(gdFontCacheMutex); -static gdCache_head_t *fontCache = NULL; -static FT_Library library; - void gdFontCacheShutdown() { if (fontCache) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
nlopess Fri Sep 15 16:14:57 2006 UTC Modified files: /php-src/ext/gd/libgd gdft.c Log: MFB http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.37r2=1.38diff_format=u Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.37 php-src/ext/gd/libgd/gdft.c:1.38 --- php-src/ext/gd/libgd/gdft.c:1.37Wed Aug 23 20:21:34 2006 +++ php-src/ext/gd/libgd/gdft.c Fri Sep 15 16:14:57 2006 @@ -534,7 +534,7 @@ pixel = a-pixel = b-pixel; bg = a-bgcolor = b-bgcolor; fg = a-fgcolor = b-fgcolor; - im = b-im; + im = a-im = b-im; /* if fg is specified by a negative color idx, then don't antialias */ if (fg 0) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
pajoye Wed Aug 23 20:21:35 2006 UTC Modified files: /php-src/ext/gd/libgd gdft.c Log: - add support for entities in hexadecimal format, like copy; can be passed as #169 or #xA9; http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.36r2=1.37diff_format=u Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.36 php-src/ext/gd/libgd/gdft.c:1.37 --- php-src/ext/gd/libgd/gdft.c:1.36Sat Nov 20 13:09:45 2004 +++ php-src/ext/gd/libgd/gdft.c Wed Aug 23 20:21:34 2006 @@ -207,12 +207,28 @@ byte = *((unsigned char *) (str + 1)); if (byte == '#') { - for (i = 2; i 8; i++) { - byte = *((unsigned char *) (str + i)); - if (byte = '0' byte = '9') { - n = (n * 10) + (byte - '0'); - } else { - break; + byte = *((unsigned char *) (str + 2)); + if (byte == 'x' || byte == 'X') { + for (i = 3; i 8; i++) { + byte = *((unsigned char *) (str + i)); + if (byte = 'A' byte = 'F') + byte = byte - 'A' + 10; + else if (byte = 'a' byte = 'f') + byte = byte - 'a' + 10; + else if (byte = '0' byte = '9') + byte = byte - '0'; + else + break; + n = (n * 16) + byte; + } + } else { + for (i = 2; i 8; i++) { + byte = *((unsigned char *) (str + i)); + if (byte = '0' byte = '9') { + n = (n * 10) + (byte - '0'); + } else { + break; + } } } if (byte == ';') { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
pajoye Sat Nov 20 08:09:46 2004 EDT Modified files: /php-src/ext/gd/libgd gdft.c Log: - Attempt to fix #28598, bug introduced in GD (around php 4.3.4) The way they fix MS Symbol are wrong, multiple faces support hould added later, safer. Please test it with your weird fonts, if it works, MFH will be done. http://cvs.php.net/diff.php/php-src/ext/gd/libgd/gdft.c?r1=1.35r2=1.36ty=u Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.35 php-src/ext/gd/libgd/gdft.c:1.36 --- php-src/ext/gd/libgd/gdft.c:1.35Wed Jun 9 10:50:05 2004 +++ php-src/ext/gd/libgd/gdft.c Sat Nov 20 08:09:45 2004 @@ -915,10 +915,12 @@ /* EAM DEBUG */ #if (defined(FREETYPE_MAJOR) ((FREETYPE_MAJOR == 2 ((FREETYPE_MINOR == 1 FREETYPE_PATCH = 3) || FREETYPE_MINOR 1) || FREETYPE_MAJOR 2))) - if (font-face-charmap-encoding == FT_ENCODING_MS_SYMBOL) { + if (font-face-charmap-encoding == FT_ENCODING_MS_SYMBOL strcmp(font-face-family_name, Symbol) == 0) { /* I do not know the significance of the constant 0xf000. * It was determined by inspection of the character codes * stored in Microsoft font symbol. +* Added by Pierre ([EMAIL PROTECTED]): +* Convert to the Symbol glyph range only for a Symbol family member */ len = gdTcl_UtfToUniChar (next, ch); ch |= 0xf000; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
iliaa Wed Jun 9 10:50:05 2004 EDT Modified files: /php-src/ext/gd/libgd gdft.c Log: Fixed bug #28175 (Allow bundled GD to compile against freetype 2.1.2). http://cvs.php.net/diff.php/php-src/ext/gd/libgd/gdft.c?r1=1.34r2=1.35ty=u Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.34 php-src/ext/gd/libgd/gdft.c:1.35 --- php-src/ext/gd/libgd/gdft.c:1.34Sun May 9 13:33:50 2004 +++ php-src/ext/gd/libgd/gdft.c Wed Jun 9 10:50:05 2004 @@ -914,7 +914,7 @@ } /* EAM DEBUG */ -#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 (font-face-charmap-encoding == FT_ENCODING_MS_SYMBOL) { /* I do not know the significance of the constant 0xf000. * It was determined by inspection of the character codes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
iliaa Sat Mar 6 13:24:42 2004 EDT Modified files: /php-src/ext/gd/libgd gdft.c Log: Fixed bug #27437 (wrong freetype include inside GD library). http://cvs.php.net/diff.php/php-src/ext/gd/libgd/gdft.c?r1=1.31r2=1.32ty=u Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.31 php-src/ext/gd/libgd/gdft.c:1.32 --- php-src/ext/gd/libgd/gdft.c:1.31Sun Dec 28 15:11:08 2003 +++ php-src/ext/gd/libgd/gdft.c Sat Mar 6 13:24:41 2004 @@ -63,7 +63,7 @@ #include gdcache.h #include ft2build.h #include FT_FREETYPE_H -#include freetype/ftglyph.h +#include FT_GLYPH_H /* number of fonts cached before least recently used is replaced */ #define FONTCACHESIZE 6 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
wez Fri Dec 19 07:41:25 2003 EDT Modified files: /php-src/ext/gd/libgd gdft.c Log: be slightly nicer when defining R_OK Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.28 php-src/ext/gd/libgd/gdft.c:1.29 --- php-src/ext/gd/libgd/gdft.c:1.28Wed Dec 17 17:47:02 2003 +++ php-src/ext/gd/libgd/gdft.c Fri Dec 19 07:41:24 2003 @@ -16,7 +16,9 @@ #include unistd.h #else #include io.h -#define R_OK 04/* Needed in Windows */ +#ifndef R_OK +# define R_OK 04 /* Needed in Windows */ +#endif #endif #ifdef WIN32 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
rasmus Wed Dec 17 17:47:02 2003 EDT Modified files: /php-src/ext/gd/libgd gdft.c Log: MFB compile fix Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.27 php-src/ext/gd/libgd/gdft.c:1.28 --- php-src/ext/gd/libgd/gdft.c:1.27Tue Dec 16 12:23:15 2003 +++ php-src/ext/gd/libgd/gdft.c Wed Dec 17 17:47:02 2003 @@ -60,7 +60,8 @@ #else #include gdcache.h -#include freetype/freetype.h +#include ft2build.h +#include FT_FREETYPE_H #include freetype/ftglyph.h /* number of fonts cached before least recently used is replaced */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
iliaa Tue Dec 16 12:23:16 2003 EDT Modified files: /php-src/ext/gd/libgd gdft.c Log: ZTS fix. Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.26 php-src/ext/gd/libgd/gdft.c:1.27 --- php-src/ext/gd/libgd/gdft.c:1.26Tue Dec 16 01:29:01 2003 +++ php-src/ext/gd/libgd/gdft.c Tue Dec 16 12:23:15 2003 @@ -349,7 +349,7 @@ return (strcmp (a-fontlist, b-fontlist) == 0); } -static void *fontFetch (char **error, void *key TSRMLS_DC) +static void *fontFetch (char **error, void *key) { font_t *a; fontkey_t *b = (fontkey_t *) key; @@ -394,6 +394,7 @@ } for (dir = strtok (path, PATHSEPARATOR); dir; dir = strtok (0, PATHSEPARATOR)) { if (!strcmp(dir, .)) { + TSRMLS_FETCH(); #if HAVE_GETCWD dir = VCWD_GETCWD(cur_dir, MAXPATHLEN); #elif HAVE_GETWD -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
iliaa Mon Dec 15 15:34:48 2003 EDT Modified files: /php-src/ext/gd/libgd gdft.c Log: Fixed bug #26635 (fixed look up for fonts in the current directory w/ZTS) Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.24 php-src/ext/gd/libgd/gdft.c:1.25 --- php-src/ext/gd/libgd/gdft.c:1.24Tue Jun 17 09:37:43 2003 +++ php-src/ext/gd/libgd/gdft.c Mon Dec 15 15:34:48 2003 @@ -357,7 +357,7 @@ int font_found = 0; unsigned short platform, encoding; char *fontsearchpath, *fontlist; - char *fullname = NULL; + char fullname[MAXPATHLEN], cur_dir[MAXPATHLEN]; char *name, *path=NULL, *dir; char *strtok_ptr; FT_Error err; @@ -383,38 +383,43 @@ for (name = gd_strtok_r (fontlist, LISTSEPARATOR, strtok_ptr); name; name = gd_strtok_r (0, LISTSEPARATOR, strtok_ptr)) { /* make a fresh copy each time - strtok corrupts it. */ path = gdEstrdup (fontsearchpath); - - /* - * Allocate an oversized buffer that is guaranteed to be - * big enough for all paths to be tested. - */ - fullname = gdRealloc (fullname, strlen (fontsearchpath) + strlen (name) + 6); - + /* if name is an absolute filename then test directly */ if (*name == '/' || (name[0] != 0 name[1] == ':' (name[2] == '/' || name[2] == '\\'))) { - sprintf(fullname, %s, name); + snprintf(fullname, sizeof(fullname) - 1, %s, name); if (access(fullname, R_OK) == 0) { font_found++; break; } } for (dir = strtok (path, PATHSEPARATOR); dir; dir = strtok (0, PATHSEPARATOR)) { - sprintf(fullname, %s/%s, dir, name); - if (access (fullname, R_OK) == 0) { + if (!strcmp(dir, .)) { +#if HAVE_GETCWD + dir = VCWD_GETCWD(cur_dir, MAXPATHLEN); +#elif HAVE_GETWD + dir = VCWD_GETWD(cur_dir); +#endif + if (!dir) { + continue; + } + } + + snprintf(fullname, sizeof(fullname) - 1, %s/%s, dir, name); + if (access(fullname, R_OK) == 0) { font_found++; break; } - sprintf(fullname, %s/%s.ttf, dir, name); - if (access (fullname, R_OK) == 0) { + snprintf(fullname, sizeof(fullname) - 1, %s/%s.ttf, dir, name); + if (access(fullname, R_OK) == 0) { font_found++; break; } - sprintf(fullname, %s/%s.pfa, dir, name); + snprintf(fullname, sizeof(fullname) - 1, %s/%s.pfa, dir, name); if (access(fullname, R_OK) == 0) { font_found++; break; } - sprintf (fullname, %s/%s.pfb, dir, name); + snprintf(fullname, sizeof(fullname) - 1, %s/%s.pfb, dir, name); if (access(fullname, R_OK) == 0) { font_found++; break; @@ -436,9 +441,6 @@ if (!font_found) { gdPFree(a-fontlist); gdPFree(a); - if (fullname) { - gdFree(fullname); - } *error = Could not find/open font; return NULL; } @@ -447,13 +449,9 @@ if (err) { gdPFree(a-fontlist); gdPFree(a); - if (fullname) { - gdFree(fullname); - } *error = Could not read font; return NULL; } - gdFree(fullname); /* FIXME - This mapping stuff is imcomplete - where is the spec? */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c
sebastian Tue Dec 16 01:29:02 2003 EDT Modified files: /php-src/ext/gd/libgd gdft.c Log: Fix ZTS build. Index: php-src/ext/gd/libgd/gdft.c diff -u php-src/ext/gd/libgd/gdft.c:1.25 php-src/ext/gd/libgd/gdft.c:1.26 --- php-src/ext/gd/libgd/gdft.c:1.25Mon Dec 15 15:34:48 2003 +++ php-src/ext/gd/libgd/gdft.c Tue Dec 16 01:29:01 2003 @@ -349,7 +349,7 @@ return (strcmp (a-fontlist, b-fontlist) == 0); } -static void *fontFetch (char **error, void *key) +static void *fontFetch (char **error, void *key TSRMLS_DC) { font_t *a; fontkey_t *b = (fontkey_t *) key; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php