summaryrefslogtreecommitdiff
path: root/ext/cpdf/cpdf.c
diff options
context:
space:
mode:
authorUwe Steinmann <steinm@php.net>1999-11-25 07:00:27 +0000
committerUwe Steinmann <steinm@php.net>1999-11-25 07:00:27 +0000
commit7e3563c1c25df7ca124154424078dff029c82721 (patch)
tree4814112b130a1880a9e9a38d40e4c79acb111c41 /ext/cpdf/cpdf.c
parent5d3ae9c2b2ecc46e0c41a9c68994a43c0cbc857f (diff)
downloadphp-git-7e3563c1c25df7ca124154424078dff029c82721.tar.gz
- changed encoding parameter of cpdf_set_font to string on advice from
fastio to better support asian fonts.
Diffstat (limited to 'ext/cpdf/cpdf.c')
-rw-r--r--ext/cpdf/cpdf.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/ext/cpdf/cpdf.c b/ext/cpdf/cpdf.c
index a991412845..2be6d57fc6 100644
--- a/ext/cpdf/cpdf.c
+++ b/ext/cpdf/cpdf.c
@@ -183,7 +183,7 @@ PHP_RINIT_FUNCTION(cpdf)
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 @@ PHP_FUNCTION(cpdf_text) {
}
/* }}} */
-/* {{{ 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 @@ PHP_FUNCTION(cpdf_set_font) {
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 @@ PHP_FUNCTION(cpdf_set_font) {
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;
}