Hello!

Let's try again, this time I'm sure the functionality doesn't
already exist. :)



void cpdf_set_font_directories(int pdfdoc, string pfmdir, string pfbdir)

Set the directories in which PFM and PFB files are located. See the
ClibPDF Manual for further details.


void cpdf_set_font_map_file(int pdfdoc, string filename)

Set a fontname to PFM and PFB file translation map. See the ClibPDF Manual
for details on the map file format.



Please CC any comments directly to me, I'm not subscribed to the list.


Regards,
Fredrik

-- 
Do fish get thirsty?

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




*** cpdf.c.orig Sat Mar 17 12:22:35 2001
--- cpdf.c      Sat Mar 17 12:52:24 2001
***************
*** 97,102 ****
--- 97,104 ----
        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,815 ****
--- 812,872 ----
        }
  */
        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;
  }
*** php_cpdf.h.orig     Sat Mar 17 12:22:42 2001
--- php_cpdf.h  Sat Mar 17 12:44:32 2001
***************
*** 60,65 ****
--- 60,67 ----
  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