From fb9a3a598ee9b59ace10f5874c62f2cd1c77ccdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 17 Nov 2006 08:49:30 +0000 Subject: Check before commit! --- pdf_schema.php | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) (limited to 'pdf_schema.php') diff --git a/pdf_schema.php b/pdf_schema.php index 7d95d09f1d..86c27da995 100644 --- a/pdf_schema.php +++ b/pdf_schema.php @@ -33,20 +33,12 @@ if (!$cfgRelation['pdfwork']) { } /** - * Gets the "fpdf" libraries and defines the pdf font path, use unicode version for unicode. + * Font used in PDF. + * + * @todo Make this configuratble (at least Sans/Serif). */ -define('FPDF_FONTPATH', './libraries/fpdf/font/'); -if ($charset == 'utf-8') { - define('PMA_PDF_FONT', 'FreeSans'); - require_once('./libraries/fpdf/ufpdf.php'); - class PMA_FPDF extends UFPDF { - }; -} else { - define('PMA_PDF_FONT', 'Arial'); - require_once('./libraries/fpdf/fpdf.php'); - class PMA_FPDF extends FPDF { - }; -} +define('PMA_PDF_FONT', 'DejaVuSans'); +require_once('./libraries/tcpdf/tcpdf.php'); /** * Extends the "FPDF" class and prepares the work @@ -54,7 +46,7 @@ if ($charset == 'utf-8') { * @access public * @see FPDF */ -class PMA_PDF extends PMA_FPDF { +class PMA_PDF extends TCPDF { /** * Defines private properties */ @@ -86,7 +78,7 @@ class PMA_PDF extends PMA_FPDF { function PMA_PDF($orientation = 'L', $unit = 'mm', $format = 'A4') { $this->Alias = array() ; - $this->FPDF($orientation, $unit, $format); + $this->TCPDF($orientation, $unit, $format); } // end of the "PMA_PDF()" method function SetAlias($name, $value) { @@ -98,7 +90,7 @@ class PMA_PDF extends PMA_FPDF { $nb = $this->page; foreach ($this->Alias AS $alias => $value) { for ($n = 1;$n <= $nb;$n++) - $this->pages[$n] = $this->_strreplace($alias, $value, $this->pages[$n]); + $this->pages[$n]=str_replace($alias, $value, $this->pages[$n]); } } parent::_putpages(); @@ -980,20 +972,11 @@ class PMA_RT { $pdf->SetAuthor('phpMyAdmin ' . PMA_VERSION); $pdf->AliasNbPages(); - if ($GLOBALS['charset'] == 'utf-8') { - // Force FreeSans for utf-8 - $this->ff = 'FreeSans'; - $pdf->AddFont('FreeSans', '', 'FreeSans.php'); - $pdf->AddFont('FreeSans', 'B', 'FreeSansBold.php'); - } elseif ($GLOBALS['charset'] == 'iso-8859-2') { - // fonts added to phpMyAdmin and considered non-standard by fpdf - // (Note: those tahoma fonts are iso-8859-2 based) - $this->ff == 'tahoma'; - $pdf->AddFont('tahoma', '', 'tahoma.php'); - $pdf->AddFont('tahoma', 'B', 'tahomab.php'); - } else { - $this->ff == 'helvetica'; - } + $pdf->AddFont('DejaVuSans', '', 'dejavusans.php'); + $pdf->AddFont('DejaVuSans', 'B', 'dejavusans-bold.php'); + $pdf->AddFont('DejaVuSerif', '', 'dejavuserif.php'); + $pdf->AddFont('DejaVuSerif', 'B', 'dejavuserif-bold.php'); + $this->ff = PMA_PDF_FONT; $pdf->SetFont($this->ff, '', 14); $pdf->SetAutoPageBreak('auto'); // Gets tables on this page -- cgit v1.2.3