summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorUwe Steinmann <steinm@php.net>1999-09-09 06:19:01 +0000
committerUwe Steinmann <steinm@php.net>1999-09-09 06:19:01 +0000
commit6bcb8eb1be18fd58a90d63a7939bbddfb95ce6f2 (patch)
tree79a1d2fda9bafcc0e423ed3ed306d56e8b3abd0f /ext
parent67daaa7aacfb3e5052177d645a5993e8e34388de (diff)
downloadphp-git-6bcb8eb1be18fd58a90d63a7939bbddfb95ce6f2.tar.gz
pdf_setfont got optional parameter to embed fonts
Diffstat (limited to 'ext')
-rw-r--r--ext/pdf/pdf.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/ext/pdf/pdf.c b/ext/pdf/pdf.c
index 39973ad6eb..beac4d2257 100644
--- a/ext/pdf/pdf.c
+++ b/ext/pdf/pdf.c
@@ -515,12 +515,26 @@ PHP_FUNCTION(pdf_show_xy) {
/* {{{ proto void pdf_set_font(int pdfdoc, string font, double size, int encoding)
Select the current font face, size and encoding */
PHP_FUNCTION(pdf_set_font) {
- pval *arg1, *arg2, *arg3, *arg4;
- int id, type, font;
+ pval *arg1, *arg2, *arg3, *arg4, *arg5;
+ int id, type, font, embed;
PDF *pdf;
PDF_TLS_VARS;
- if (ARG_COUNT(ht) != 4 || getParameters(ht, 4, &arg1, &arg2, &arg3, &arg4) == FAILURE) {
+ switch (ARG_COUNT(ht)) {
+ case 4:
+ if (getParameters(ht, 4, &arg1, &arg2, &arg3, &arg4) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ embed = 0;
+ break;
+ case 5:
+ if (getParameters(ht, 5, &arg1, &arg2, &arg3, &arg4, &arg5) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long(arg5);
+ embed = arg5->value.lval;
+ break;
+ default:
WRONG_PARAM_COUNT;
}
@@ -542,23 +556,23 @@ PHP_FUNCTION(pdf_set_font) {
switch(arg4->value.lval) {
case 0:
- font = PDF_findfont(pdf, arg2->value.str.val, "builtin", 1);
+ font = PDF_findfont(pdf, arg2->value.str.val, "builtin", embed);
break;
case 1:
- font = PDF_findfont(pdf, arg2->value.str.val, "pdfdoc", 1);
+ font = PDF_findfont(pdf, arg2->value.str.val, "pdfdoc", embed);
break;
case 2:
- font = PDF_findfont(pdf, arg2->value.str.val, "macroman", 1);
+ font = PDF_findfont(pdf, arg2->value.str.val, "macroman", embed);
break;
case 3:
- font = PDF_findfont(pdf, arg2->value.str.val, "macexpert", 1);
+ font = PDF_findfont(pdf, arg2->value.str.val, "macexpert", embed);
break;
case 4:
- font = PDF_findfont(pdf, arg2->value.str.val, "winansi", 1);
+ font = PDF_findfont(pdf, arg2->value.str.val, "winansi", embed);
break;
default:
php3_error(E_WARNING,"Encoding out of range, using 0");
- font = PDF_findfont(pdf, arg2->value.str.val, "builtin", 1);
+ font = PDF_findfont(pdf, arg2->value.str.val, "builtin", embed);
}
if (font < 0) {