Skip to content

Commit

Permalink
Fixed issue: Ugly default font for PDF output
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Nov 15, 2014
1 parent 8d1ea96 commit 935d632
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions application/config/tcpdf.php
Expand Up @@ -194,9 +194,9 @@
* HTML <small> font size ratio
***********************************************************/

$tcpdf['page_font'] = 'freemono';
$tcpdf['page_font'] = 'freesans';
$tcpdf['page_font_size'] = 9;
$tcpdf['data_font'] = 'freemono';
$tcpdf['data_font'] = 'freesans';
$tcpdf['data_font_size'] = 8;
$tcpdf['mono_font'] = 'freemono';

Expand Down
4 changes: 2 additions & 2 deletions application/helpers/pdfHelper.php
Expand Up @@ -36,8 +36,7 @@ public static function getPdfLanguageSettings($language)
{
$pdffont=PDF_FONT_NAME_DATA;
}
$pdfcorefont=array("courier","helvetica","symbol","times","zapfdingbats");
$pdffontsize=Yii::app()->getConfig('pdffontsize');
$pdfcorefont=array("freesans","dejavusans","courier","helvetica","freemono","symbol","times","zapfdingbats");

This comment has been minimized.

Copy link
@Shnoulle

Shnoulle Nov 16, 2014

Collaborator

freesans and dejavusans are not in PDF standard ? courier , helvetica , symbol , times and zapfdingbats. Here, i think set default to helvetica is OK ? no ? and monofont to courier.

Then the OS use system font : see http://www.tcpdf.org/fonts.php

if (in_array($pdffont,$pdfcorefont))
{
$alternatepdffontfile=Yii::app()->getConfig('alternatepdffontfile');
Expand All @@ -46,6 +45,7 @@ public static function getPdfLanguageSettings($language)
$pdffont = $alternatepdffontfile[$language];// Actually use only core font
}
}
$pdffontsize=Yii::app()->getConfig('pdffontsize');
if ($pdffontsize=='auto')
{
$pdffontsize=PDF_FONT_SIZE_MAIN;
Expand Down

0 comments on commit 935d632

Please sign in to comment.