CVS update: php3/functions
| From: | jah | Date: | Fri, 28 May 1999 19:18:46 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6203@lists.php.net to get a copy of this message | ||
Date: Friday May 28, 1999 @ 15:18
Author: jah
Update of /repository/php3/functions
In directory php:/tmp/cvs-serv5589/functions
Modified Files:
gd.c
Log Message:
Getting BoundingBox almost right.
Index: php3/functions/gd.c
diff -u php3/functions/gd.c:1.117 php3/functions/gd.c:1.118
--- php3/functions/gd.c:1.117 Fri May 28 10:12:09 1999
+++ php3/functions/gd.c Fri May 28 15:18:45 1999
@@ -29,7 +29,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.117 1999/05/28 14:12:09 jah Exp $ */
+/* $Id: gd.c,v 1.118 1999/05/28 19:18:45 jah Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -2049,7 +2049,10 @@
unsigned long aa_greys[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
gdImagePtr bg_img;
GLYPH *str_img;
+#ifdef HAVE_LIBT1_OUTLINE
T1_OUTLINE *char_path, *str_path;
+ T1_TMATRIX *transform = NULL;
+#endif
switch(ARG_COUNT(ht)) {
case 8:
@@ -2146,14 +2149,22 @@
#ifdef HAVE_LIBT1_OUTLINE
dy = 0;
dx = width;
- str_path = T1_GetCharOutline(*f_ind, str->value.str.val[0], sz->value.lval, NULL);
+ /*
+ if (angle) {
+ transform = T1_RotateMatrix(NULL, angle);
+ }
+ */
+ str_path = T1_GetCharOutline(*f_ind, str->value.str.val[0], sz->value.lval, transform);
for (i = 1; i < str->value.str.len; i++) {
amount_kern = T1_GetKerning(*f_ind, str->value.str.val[i-1], str->value.str.val[i]);
amount_kern += str->value.str.val[i-1] == ' ' ? space : 0;
- char_path = T1_GetMoveOutline(*f_ind, dx+amount_kern, dy, 0, sz->value.lval, NULL);
+ char_path = T1_GetMoveOutline(*f_ind, amount_kern, dy, 0, sz->value.lval, transform);
str_path = T1_ConcatOutlines(str_path, char_path);
- char_path = T1_GetCharOutline(*f_ind, str->value.str.val[i], sz->value.lval, NULL);
+ /* Should scale according to the extend? And how to get it? */
+ char_path = T1_GetMoveOutline(*f_ind, width, dy, 0, sz->value.lval, transform);
str_path = T1_ConcatOutlines(str_path, char_path);
+ char_path = T1_GetCharOutline(*f_ind, str->value.str.val[i], sz->value.lval, transform);
+ str_path = T1_ConcatOutlines(str_path, char_path);
}
str_img = T1_AAFillOutline(str_path, 0);
@@ -2251,16 +2262,16 @@
if (str->value.str.val[i] == ' ') {
char_bbox.llx = char_bbox.lly = char_bbox.ury = 0;
char_bbox.urx = space;
+ str_bbox.urx += space;
} else {
char_bbox = T1_GetCharBBox(*f_ind, str->value.str.val[i]);
+ str_bbox.urx += i != str->value.str.len-1 ? T1_GetCharWidth(*f_ind,
str->value.str.val[i]) : char_bbox.urx;
}
- str_bbox.urx += T1_GetCharWidth(*f_ind, str->value.str.val[i]);
- str_bbox.urx += width;
+ str_bbox.urx += i != str->value.str.len-1 ? width : 0;
if (!i) {
str_bbox.llx = char_bbox.llx;
- }
- if (i < str->value.str.len-1) {
- amount_kern = T1_GetKerning(*f_ind, str->value.str.val[i], str->value.str.val[i+1]);
+ } else {
+ amount_kern = T1_GetKerning(*f_ind, str->value.str.val[i-1], str->value.str.val[i]);
str_bbox.urx += amount_kern;
}
str_bbox.lly = str_bbox.lly > char_bbox.lly ? char_bbox.lly : str_bbox.lly;
@@ -2269,7 +2280,6 @@
printf("%d %d %d '%c'\n", char_bbox.llx, char_bbox.urx, str_bbox.urx,
str->value.str.val[i]);
*/
}
- str_bbox.urx += str_bbox.llx;
} else {
str_bbox = T1_GetStringBBox(*f_ind, str->value.str.val, str->value.str.len, space,
T1_KERNING);
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net