[PHP-CVS] cvs: php-src(PHP_5_3) /ext/gd/libgd gdft.c /ext/gd/tests Tuffy.ttf bug48555.phpt

2009-06-21 Thread Takeshi Abe
tabeSun Jun 21 06:09:46 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/gd/tests   Tuffy.ttf bug48555.phpt 

  Modified files:  
/php-src/ext/gd/libgd   gdft.c 
  Log:
  MFH: 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.36.4.9.2.2r2=1.36.4.9.2.3diff_format=u
Index: php-src/ext/gd/libgd/gdft.c
diff -u php-src/ext/gd/libgd/gdft.c:1.36.4.9.2.2 
php-src/ext/gd/libgd/gdft.c:1.36.4.9.2.3
--- php-src/ext/gd/libgd/gdft.c:1.36.4.9.2.2Wed Mar 18 00:29:42 2009
+++ php-src/ext/gd/libgd/gdft.c Sun Jun 21 06:09:46 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/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®Ø$Ln¤À
Ø:p¦àþJfŽ¤ÂÞ*‚ŽæV”Üp¤ú(2 ®àî...@†´ÒÜèô

þ$;IyO¤â*P\GP*.D$ +6W„V›Â  ý°ÅuZ9Q4ÈþŒjT€
°‰”t°j†yT»©Çнª¦þJÛÒþ]
-?1$

Bs¯e¦ë  /;N›˜%g‡´u!f~¯ɛ+3N›~N͓*-:snDd   H
3SQ)“  êq»„ nƒ¥ŽoŒóVb‚qQa„¥ƒ -Ïn'”l((ÕwÍ 4,N†Y9V'0ŸÖ
)Pm’Q¦ì1Aþ¼¨#f‡³vf€°ýìɛ2-~pW3Γ,+:rrmý²
Ù


Ù
  š|R‹H’ô©Vœ~KJI21±@,':?,':õ‘-P6=9  
$}‰Z|9¤ß2`œaa“?7'4Gþ9-?1$,?0%


×
13HNf8‚·TÄ
z...@um;ƒÓu(Pm”Tr«6)2cï¶Âí#60M)HA˜›V£j=za
ŒpLwuLH …3Ñv‚ÁabÀ‚ažc4\‘Ñlà` kM7cv™þú”[—ºeI
{ª1ûϋ?g?+
,9F'+Z.Y,'F:,
(Ùf}–w‡ P-M³¼ŸŽ§+ ‡ '...@w¾
,:F',Y.?Z+'F9,

Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/gd/libgd gdft.c

2009-03-17 Thread Ilia Alshanetsky

MFB52?

Ilia Alshanetsky




On 17-Mar-09, at 8:29 PM, Pierre-Alain Joye wrote:


pajoye  Wed Mar 18 00:29:42 2009 UTC

 Modified files:  (Branch: PHP_5_3)
   /php-src/ext/gd/libgdgdft.c
 Log:
 - #43073, TrueType bounding box is wrong for angle0

http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.36.4.9.2.1r2=1.36.4.9.2.2diff_format=u
Index: php-src/ext/gd/libgd/gdft.c
diff -u php-src/ext/gd/libgd/gdft.c:1.36.4.9.2.1 php-src/ext/gd/ 
libgd/gdft.c:1.36.4.9.2.2

--- php-src/ext/gd/libgd/gdft.c:1.36.4.9.2.1Wed Jan  9 01:51:17 2008
+++ php-src/ext/gd/libgd/gdft.c Wed Mar 18 00:29:42 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);



--
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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/gd/libgd gdft.c

2008-01-08 Thread Pierre-Alain Joye
pajoye  Wed Jan  9 01:51:17 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/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.36.4.9r2=1.36.4.9.2.1diff_format=u
Index: php-src/ext/gd/libgd/gdft.c
diff -u php-src/ext/gd/libgd/gdft.c:1.36.4.9 
php-src/ext/gd/libgd/gdft.c:1.36.4.9.2.1
--- php-src/ext/gd/libgd/gdft.c:1.36.4.9Mon Apr 23 15:17:47 2007
+++ php-src/ext/gd/libgd/gdft.c Wed Jan  9 01:51:17 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