Foros del Web » Programando para Internet » PHP »

ayuda con fuente Arial y tcpdf

Estas en el tema de ayuda con fuente Arial y tcpdf en el foro de PHP en Foros del Web. Hola amigos tengo un grave problema y quiero que alguien me ayude a corregirlo, estoy haciendo un pdf con la clase tcpdf ,pero no me ...
  #1 (permalink)  
Antiguo 19/01/2010, 11:55
 
Fecha de Ingreso: noviembre-2007
Mensajes: 533
Antigüedad: 16 años, 5 meses
Puntos: 1
ayuda con fuente Arial y tcpdf

Hola amigos tengo un grave problema y quiero que alguien me ayude a corregirlo,

estoy haciendo un pdf con la clase tcpdf ,pero no me coge la letra Arial, y no se porque no...indico los archivos de configuracion para ver si me podeis ayudar.

en el fichero tcpdf_config.php
Código PHP:

 
* default main font name
     
*/
    
define ('PDF_FONT_NAME_MAIN''helvetica');
    
    
/**
     * default main font size
     */
    
define ('PDF_FONT_SIZE_MAIN'10);
    
    
/**
     * default data font name
     */
    
define ('PDF_FONT_NAME_DATA''helvetica');
    
    
/**
     * default data font size
     */
    
define ('PDF_FONT_SIZE_DATA'8);
    
    
/**
     * default monospaced font name
     */
    
define ('PDF_FONT_MONOSPACED''courier'); 
En el fichero tcpdf.php tengo lo siguiente


Código PHP:
function TCPDF($orientation='P'$unit='mm'$format='A4'$unicode=true$encoding='UTF-8'$diskcache=false) {
            
/* Set internal character encoding to ASCII */
            
if (function_exists('mb_internal_encoding') AND mb_internal_encoding()) {
                
$this->internal_encoding mb_internal_encoding();
                
mb_internal_encoding('ASCII');
            }
            
// set disk caching
            
$this->diskcache $diskcache true false;
            
// set language direction
            
$this->rtl $this->l['a_meta_dir']=='rtl' true false;
            
$this->tmprtl false;
            
//Some checks
            
$this->_dochecks();
            
//Initialization of properties
            
$this->isunicode $unicode;
            
$this->page 0;
            
$this->transfmrk[0] = array();
            
$this->pagedim = array();
            
$this->2;
            
$this->buffer '';
            
$this->pages = array();
            
$this->state 0;
            
$this->fonts = array();
            
$this->FontFiles = array();
            
$this->diffs = array();
            
$this->images = array();
            
$this->links = array();
            
$this->gradients = array();
            
$this->InFooter false;
            
$this->lasth 0;
            
$this->FontFamily 'helvetica';
            
$this->FontStyle '';
            
$this->FontSizePt 12;
            
$this->underline false;
            
$this->linethrough false;
            
$this->DrawColor '0 G';
            
$this->FillColor '0 g';
            
$this->TextColor '0 g';
            
$this->ColorFlag false;
            
// encryption values
            
$this->encrypted false;
            
$this->last_rc4_key '';
            
$this->padding "\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A";
            
//Standard Unicode fonts
            
$this->CoreFonts = array(
                
'courier'=>'Courier',
                
'courierB'=>'Courier-Bold',
                
'courierI'=>'Courier-Oblique',
                
'courierBI'=>'Courier-BoldOblique',
                
'helvetica'=>'Helvetica',
                
'helveticaB'=>'Helvetica-Bold',
                
'helveticaI'=>'Helvetica-Oblique',
                
'helveticaBI'=>'Helvetica-BoldOblique',
                
'times'=>'Times-Roman',
                
'timesB'=>'Times-Bold',
                
'timesI'=>'Times-Italic',
                
'timesBI'=>'Times-BoldItalic',
                
'symbol'=>'Symbol',
                
'zapfdingbats'=>'ZapfDingbats'
            
);
             ..... ...... 

tengo tambien en tcpdf.php lo siguiente:


Código PHP:

function AddFont($family$style=''$fontfile='') {
            if (
$this->empty_string($family)) {
                if (!
$this->empty_string($this->FontFamily)) {
                    
$family $this->FontFamily;
                } else {
                    
$this->Error('Empty font family');
                }
            }
            
$family strtolower($family);
            if ((!
$this->isunicode) AND ($family == 'arial')) {
                
$family 'helvetica';
            }
            if ((
$family == 'symbol') OR ($family == 'zapfdingbats')) {
                
$style '';
            } 
ahi no se encuentra la Arial? entonces como la tomo?...como puedo hacer para coger la letra Arial?

Última edición por pacorubio77; 19/01/2010 a las 12:15 Razón: me dejé una funcion para la ayuda..
  #2 (permalink)  
Antiguo 19/01/2010, 12:00
 
Fecha de Ingreso: noviembre-2007
Mensajes: 533
Antigüedad: 16 años, 5 meses
Puntos: 1
Respuesta: ayuda con fuente Arial y tcpdf

y he probado una cosa...cuando cambio

define ('PDF_FONT_NAME_MAIN', 'helvetica');

por

define ('PDF_FONT_NAME_MAIN', 'arial');

me sale el siguiente error

TCPDF ERROR: Could not include font definition file: arial

Etiquetas: arial, tcpdf, fuentes
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:07.