cvs: /php3/functions pdf.c

From: Date: Thu, 09 Sep 1999 06:19:15 +0000
Subject: cvs: /php3/functions pdf.c
Groups: php.dev 
Request: Send a blank email to php-dev+get-10746@lists.php.net to get a copy of this message
steinm Thu Sep 9 02:19:15 1999 EDT Modified files: /php3/functions pdf.c Log: pdf_setfont got optional parameter to embed fonts Index: php3/functions/pdf.c diff -u php3/functions/pdf.c:1.48 php3/functions/pdf.c:1.49 --- php3/functions/pdf.c:1.48 Sat Aug 28 18:49:23 1999 +++ php3/functions/pdf.c Thu Sep 9 02:19:14 1999 @@ -27,7 +27,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pdf.c,v 1.48 1999/08/28 22:49:23 jah Exp $ */ +/* $Id: pdf.c,v 1.49 1999/09/09 06:19:14 steinm Exp $ */ /* pdflib 0.6 is subject to the ALADDIN FREE PUBLIC LICENSE. Copyright (C) 1997 Thomas Merz. */ @@ -696,12 +696,26 @@ /* {{{ 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; } @@ -724,23 +738,23 @@ #if HAVE_PDFLIB2 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) {

« previous php.dev (#10746) next »