See my post form earlier today for details on the patch.

-- 
Do fish get thirsty?

Fredrik Öhrn                               Chalmers University of Technology
[EMAIL PROTECTED]                                                  Sweden


Index: cpdf.c
===================================================================
RCS file: /repository/php4/ext/cpdf/cpdf.c,v
retrieving revision 1.22
diff -u -r1.22 cpdf.c
--- cpdf.c      2001/02/15 14:48:56     1.22
+++ cpdf.c      2001/03/17 21:11:26
@@ -97,6 +97,8 @@
        PHP_FE(cpdf_text, NULL)
        PHP_FE(cpdf_continue_text, NULL)
        PHP_FE(cpdf_set_font, NULL)
+       PHP_FE(cpdf_set_font_directories, NULL)
+       PHP_FE(cpdf_set_font_map_file, NULL)
        PHP_FE(cpdf_set_leading, NULL)
        PHP_FE(cpdf_set_text_rendering, NULL)
        PHP_FE(cpdf_set_horiz_scaling, NULL)
@@ -810,6 +812,61 @@
        }
 */
        cpdf_setFont(pdf, arg2->value.str.val, arg4->value.str.val, (float) 
arg3->value.dval);
+
+       RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto void cpdf_set_font_directories(int pdfdoc, string pfmdir, string pfbdir)
+   Set directories to search when using external fonts. */
+PHP_FUNCTION(cpdf_set_font_directories) {
+       pval *arg1, *arg2, *arg3;
+       int id, type;
+       CPDFdoc *pdf;
+       CPDF_TLS_VARS;
+
+       if (ZEND_NUM_ARGS() != 3 || getParameters(ht, 3, &arg1, &arg2, &arg3) == 
+FAILURE) {
+               WRONG_PARAM_COUNT;
+       }
+
+       convert_to_long(arg1);
+       convert_to_string(arg2);
+       convert_to_string(arg3);
+       id=arg1->value.lval;
+       pdf = zend_list_find(id,&type);
+       if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) {
+               php_error(E_WARNING,"Unable to find identifier %d",id);
+               RETURN_FALSE;
+       }
+
+       cpdf_setFontDirectories(pdf, arg2->value.str.val, arg3->value.str.val);
+
+       RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto void cpdf_set_font_map_file(int pdfdoc, string filename)
+   Set fontname to filename translation map when using external fonts. */
+PHP_FUNCTION(cpdf_set_font_map_file) {
+       pval *arg1, *arg2;
+       int id, type;
+       CPDFdoc *pdf;
+       CPDF_TLS_VARS;
+
+       if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
+               WRONG_PARAM_COUNT;
+       }
+
+       convert_to_long(arg1);
+       convert_to_string(arg2);
+       id=arg1->value.lval;
+       pdf = zend_list_find(id,&type);
+       if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) {
+               php_error(E_WARNING,"Unable to find identifier %d",id);
+               RETURN_FALSE;
+       }
+
+       cpdf_setFontMapFile(pdf, arg2->value.str.val);

        RETURN_TRUE;
 }

Index: php_cpdf.h
===================================================================
RCS file: /repository/php4/ext/cpdf/php_cpdf.h,v
retrieving revision 1.6
diff -u -r1.6 php_cpdf.h
--- php_cpdf.h  2000/07/02 23:46:38     1.6
+++ php_cpdf.h  2001/03/17 21:11:36
@@ -60,6 +60,8 @@
 PHP_FUNCTION(cpdf_continue_text);
 PHP_FUNCTION(cpdf_text);
 PHP_FUNCTION(cpdf_set_font);
+PHP_FUNCTION(cpdf_set_font_directories);
+PHP_FUNCTION(cpdf_set_font_map_file);
 PHP_FUNCTION(cpdf_set_leading);
 PHP_FUNCTION(cpdf_set_text_rendering);
 PHP_FUNCTION(cpdf_set_horiz_scaling);

cpdf.tgz

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to