cvs: /php4/ext/cpdf cpdf.c
| From: | Uwe Steinmann | Date: | Thu, 25 Nov 1999 07:00:57 +0000 |
| Subject: | cvs: /php4/ext/cpdf cpdf.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-6883@lists.php.net to get a copy of this message | ||
steinm Thu Nov 25 02:00:57 1999 EDT
Modified files:
/php4/ext/cpdf cpdf.c
Log:
- changed encoding parameter of cpdf_set_font to string on advice from
fastio to better support asian fonts.
Index: php4/ext/cpdf/cpdf.c
diff -u php4/ext/cpdf/cpdf.c:1.1 php4/ext/cpdf/cpdf.c:1.2
--- php4/ext/cpdf/cpdf.c:1.1 Mon Nov 22 10:28:26 1999
+++ php4/ext/cpdf/cpdf.c Thu Nov 25 02:00:27 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: cpdf.c,v 1.1 1999/11/22 15:28:26 steinm Exp $ */
+/* $Id: cpdf.c,v 1.2 1999/11/25 07:00:27 steinm Exp $ */
/* cpdflib.h -- C language API definitions for ClibPDF library
* Copyright (C) 1998 FastIO Systems, All Rights Reserved.
*/
@@ -183,7 +183,7 @@
PHP_MINFO_FUNCTION(cpdf) {
/* need to use a PHPAPI function here because it is external module in windows */
- php3_printf("ClibPDF");
+ php3_printf("Version %s", cpdf_version());
}
PHP_MSHUTDOWN_FUNCTION(cpdf){
@@ -749,7 +749,7 @@
}
/* }}} */
-/* {{{ proto void cpdf_set_font(int pdfdoc, string font, double size, int encoding)
+/* {{{ proto void cpdf_set_font(int pdfdoc, string font, double size, string encoding)
Select the current font face, size and encoding */
PHP_FUNCTION(cpdf_set_font) {
pval *arg1, *arg2, *arg3, *arg4;
@@ -764,7 +764,7 @@
convert_to_long(arg1);
convert_to_string(arg2);
convert_to_double(arg3);
- convert_to_long(arg4);
+ convert_to_string(arg4);
id=arg1->value.lval;
pdf = php3_list_find(id,&type);
if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) {
@@ -776,20 +776,7 @@
php3_error(E_WARNING,"Font encoding set to 5");
arg4->value.lval = 5;
}
- switch(arg4->value.lval) {
- case 2:
- cpdf_setFont(pdf, arg2->value.str.val, "MacRomanEncoding", (float)
arg3->value.dval);
- break;
- case 3:
- cpdf_setFont(pdf, arg2->value.str.val, "MacExpertEncoding", (float)
arg3->value.dval);
- break;
- case 4:
- cpdf_setFont(pdf, arg2->value.str.val, "WinAnsiEncoding", (float)
arg3->value.dval);
- break;
- default:
- cpdf_setFont(pdf, arg2->value.str.val, NULL, (float) arg3->value.dval);
- break;
- }
+ cpdf_setFont(pdf, arg2->value.str.val, arg4->value.str.val, (float) arg3->value.dval);
RETURN_TRUE;
}