CVS update: php3/functions
| From: | steinm | Date: | Thu, 27 May 1999 18:11:07 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6093@lists.php.net to get a copy of this message | ||
Date: Thursday May 27, 1999 @ 14:11
Author: steinm
Update of /repository/php3/functions
In directory php:/tmp/cvs-serv19557/functions
Modified Files:
cpdf.c pdf.c php3_cpdf.h
Log Message:
- some bugfixes
Index: php3/functions/cpdf.c
diff -u php3/functions/cpdf.c:1.6 php3/functions/cpdf.c:1.7
--- php3/functions/cpdf.c:1.6 Thu May 27 11:00:50 1999
+++ php3/functions/cpdf.c Thu May 27 14:11:06 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: cpdf.c,v 1.6 1999/05/27 15:00:50 steinm Exp $ */
+/* $Id: cpdf.c,v 1.7 1999/05/27 18:11:06 steinm Exp $ */
/* cpdflib.h -- C language API definitions for ClibPDF library
* Copyright (C) 1998 FastIO Systems, All Rights Reserved.
*/
@@ -74,7 +74,7 @@
# define CPDF_GLOBAL(a) a
# define CPDF_TLS_VARS
int le_cpdf;
-CPDFoutlineEntry *le_outline;
+int le_outline;
#endif
function_entry cpdf_functions[] = {
@@ -99,6 +99,7 @@
{"cpdf_set_text_rise", php3_cpdf_set_text_rise, NULL},
{"cpdf_set_text_matrix", php3_cpdf_set_text_matrix, NULL},
{"cpdf_set_text_pos", php3_cpdf_set_text_pos, NULL},
+ {"cpdf_rotate_text", php3_cpdf_rotate_text, NULL},
{"cpdf_set_char_spacing", php3_cpdf_set_char_spacing, NULL},
{"cpdf_set_word_spacing", php3_cpdf_set_word_spacing, NULL},
{"cpdf_stringwidth", php3_cpdf_stringwidth, NULL},
@@ -648,34 +649,48 @@
case 5:
convert_to_double(argv[2]);
convert_to_double(argv[3]);
- convert_to_double(argv[4]);
if(mode == 1)
cpdf_rawText((float) argv[2]->value.dval,
(float) argv[3]->value.dval,
- (float) argv[4]->value.dval,
+ 0.0,
argv[1]->value.str.val);
else
cpdf_text((float) argv[2]->value.dval,
(float) argv[3]->value.dval,
- (float) argv[4]->value.dval,
+ 0.0,
argv[1]->value.str.val);
break;
case 6:
convert_to_double(argv[2]);
convert_to_double(argv[3]);
- convert_to_double(argv[4]);
convert_to_double(argv[5]);
if(mode == 1)
+ cpdf_rawText((float) argv[2]->value.dval,
+ (float) argv[3]->value.dval,
+ (float) argv[5]->value.dval,
+ argv[1]->value.str.val);
+ else
+ cpdf_text((float) argv[2]->value.dval,
+ (float) argv[3]->value.dval,
+ (float) argv[5]->value.dval,
+ argv[1]->value.str.val);
+ break;
+ case 7:
+ convert_to_double(argv[2]);
+ convert_to_double(argv[3]);
+ convert_to_double(argv[5]);
+ convert_to_long(argv[6]);
+ if(mode == 1)
cpdf_rawTextAligned((float) argv[2]->value.dval,
(float) argv[3]->value.dval,
- (float) argv[4]->value.dval,
(float) argv[5]->value.dval,
+ argv[6]->value.lval,
argv[1]->value.str.val);
else
cpdf_textAligned((float) argv[2]->value.dval,
(float) argv[3]->value.dval,
- (float) argv[4]->value.dval,
(float) argv[5]->value.dval,
+ argv[5]->value.lval,
argv[1]->value.str.val);
break;
}
@@ -868,22 +883,24 @@
RETURN_FALSE;
}
- pdfmatrixptr = (float *) pdfmatrix;
+ pdfmatrixptr = pdfmatrix;
_php3_hash_internal_pointer_reset(matrix);
for(i=0; i<_php3_hash_num_elements(matrix); i++) {
_php3_hash_get_current_data(matrix, (void *) &data);
switch(data->type) {
case IS_DOUBLE:
*pdfmatrixptr++ = (float) data->value.dval;
+ break;
default:
*pdfmatrixptr++ = 0.0;
+ break;
}
_php3_hash_move_forward(matrix);
}
cpdf_setTextMatrix(pdfmatrix[0], pdfmatrix[1],
pdfmatrix[2], pdfmatrix[3],
- pdfmatrix[4], pdfmatrix[4]);
+ pdfmatrix[4], pdfmatrix[5]);
RETURN_TRUE;
}
@@ -921,6 +938,33 @@
cpdf_rawSetTextPosition((float) argv[1]->value.dval, (float) argv[2]->value.dval);
else
cpdf_setTextPosition((float) argv[1]->value.dval, (float) argv[2]->value.dval);
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto void cpdf_rotate_text(int pdfdoc, double angle)
+ Sets character spacing */
+void php3_cpdf_rotate_text(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *arg1, *arg2;
+ int id, type;
+ int *pdf;
+ CPDF_TLS_VARS;
+
+ if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ convert_to_long(arg1);
+ convert_to_double(arg2);
+ id=arg1->value.lval;
+ pdf = php3_list_find(id,&type);
+ if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) {
+ php3_error(E_WARNING,"Unable to find file identifier %d",id);
+ RETURN_FALSE;
+ }
+
+ cpdf_rotateText((float) arg2->value.dval);
RETURN_TRUE;
}
Index: php3/functions/pdf.c
diff -u php3/functions/pdf.c:1.28 php3/functions/pdf.c:1.29
--- php3/functions/pdf.c:1.28 Thu May 20 15:21:52 1999
+++ php3/functions/pdf.c Thu May 27 14:11:06 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdf.c,v 1.28 1999/05/20 19:21:52 steinm Exp $ */
+/* $Id: pdf.c,v 1.29 1999/05/27 18:11:06 steinm Exp $ */
/* pdflib 0.6 is subject to the ALADDIN FREE PUBLIC LICENSE.
Copyright (C) 1997 Thomas Merz. */
@@ -724,8 +724,10 @@
switch(data->type) {
case IS_DOUBLE:
*pdfmatrixptr++ = (float) data->value.dval;
+ break;
default:
*pdfmatrixptr++ = 0.0;
+ break;
}
_php3_hash_move_forward(matrix);
}
Index: php3/functions/php3_cpdf.h
diff -u php3/functions/php3_cpdf.h:1.5 php3/functions/php3_cpdf.h:1.6
--- php3/functions/php3_cpdf.h:1.5 Thu May 27 11:00:50 1999
+++ php3/functions/php3_cpdf.h Thu May 27 14:11:06 1999
@@ -26,7 +26,7 @@
| Authors: Uwe Steinmann |
+----------------------------------------------------------------------+
*/
-/* $Id: php3_cpdf.h,v 1.5 1999/05/27 15:00:50 steinm Exp $ */
+/* $Id: php3_cpdf.h,v 1.6 1999/05/27 18:11:06 steinm Exp $ */
#ifndef _PHP3_CPDF_H
#define _PHP3_CPDF_H
@@ -64,6 +64,7 @@
extern void php3_cpdf_set_text_rise(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_cpdf_set_text_matrix(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_cpdf_set_text_pos(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_cpdf_rotate_text(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_cpdf_set_char_spacing(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_cpdf_set_word_spacing(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_cpdf_continue_text(INTERNAL_FUNCTION_PARAMETERS);
--
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