[-] Core: Fix TCPDF encoding for some languages like japan #PSCFV-8096
This commit is contained in:
+1
-1
@@ -54,7 +54,7 @@ class PDFCore
|
|||||||
public function render($display = true)
|
public function render($display = true)
|
||||||
{
|
{
|
||||||
$render = false;
|
$render = false;
|
||||||
$this->pdf_renderer->setFontForLang('fr');
|
$this->pdf_renderer->setFontForLang(Context::getContext()->language->iso_code);
|
||||||
foreach ($this->objects as $object)
|
foreach ($this->objects as $object)
|
||||||
{
|
{
|
||||||
$template = $this->getTemplateObject($object);
|
$template = $this->getTemplateObject($object);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class PDFGeneratorCore extends TCPDF
|
|||||||
public $content;
|
public $content;
|
||||||
public $font;
|
public $font;
|
||||||
|
|
||||||
public $font_by_lang = array('jp' => 'cid0jp');
|
public $font_by_lang = array('ja' => 'cid0jp');
|
||||||
|
|
||||||
|
|
||||||
public function __construct($use_cache = false)
|
public function __construct($use_cache = false)
|
||||||
@@ -93,11 +93,12 @@ class PDFGeneratorCore extends TCPDF
|
|||||||
public function setFontForLang($iso_lang)
|
public function setFontForLang($iso_lang)
|
||||||
{
|
{
|
||||||
$this->font = PDFGenerator::DEFAULT_FONT;
|
$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))
|
if (array_key_exists($iso_lang, $this->font_by_lang))
|
||||||
$this->font = $this->font_by_lang[$iso_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);
|
$this->setFont($this->font);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user