[-] Core: Fix TCPDF encoding for some languages like japan #PSCFV-8096

This commit is contained in:
Rémi Gaillard
2013-03-04 14:38:51 +01:00
parent dc93425e57
commit ac8e96dd4f
3 changed files with 11 additions and 4 deletions

View File

@@ -54,7 +54,7 @@ class PDFCore
public function render($display = true)
{
$render = false;
$this->pdf_renderer->setFontForLang('fr');
$this->pdf_renderer->setFontForLang(Context::getContext()->language->iso_code);
foreach ($this->objects as $object)
{
$template = $this->getTemplateObject($object);

View File

@@ -39,7 +39,7 @@ class PDFGeneratorCore extends TCPDF
public $content;
public $font;
public $font_by_lang = array('jp' => 'cid0jp');
public $font_by_lang = array('ja' => 'cid0jp');
public function __construct($use_cache = false)
@@ -93,11 +93,12 @@ class PDFGeneratorCore extends TCPDF
public function setFontForLang($iso_lang)
{
$this->font = PDFGenerator::DEFAULT_FONT;
$this->setHeaderFont(array(PDFGenerator::DEFAULT_FONT, '', PDF_FONT_SIZE_MAIN));
$this->setFooterFont(array(PDFGenerator::DEFAULT_FONT, '', PDF_FONT_SIZE_MAIN));
if (array_key_exists($iso_lang, $this->font_by_lang))
$this->font = $this->font_by_lang[$iso_lang];
$this->setHeaderFont(array($this->font, '', PDF_FONT_SIZE_MAIN));
$this->setFooterFont(array($this->font, '', PDF_FONT_SIZE_MAIN));
$this->setFont($this->font);
}

File diff suppressed because one or more lines are too long