Czarekplpl Posted June 11, 2014 Share Posted June 11, 2014 Hello. My Presta 1,5 display small squares instead Chinese characters. In the back office Chinese fonts are displayed OK. Is there anybody having the same problem? Czarek. Link to comment Share on other sites More sharing options...
tuk66 Posted June 11, 2014 Share Posted June 11, 2014 You have no Chinese fonts installed. Link to comment Share on other sites More sharing options...
Czarekplpl Posted June 11, 2014 Author Share Posted June 11, 2014 (edited) It could be. Can you tell me how to do it??? Edited June 11, 2014 by Czarekplpl (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted June 11, 2014 Share Posted June 11, 2014 Search the forum. I think someone had the same problem. Link to comment Share on other sites More sharing options...
Czarekplpl Posted June 11, 2014 Author Share Posted June 11, 2014 (edited) I already searched the newest topic is from 2011 Presta 1.2 I think I should implement 'kozminproregular'; But I do not know what encoding should I use? Edited June 11, 2014 by Czarekplpl (see edit history) Link to comment Share on other sites More sharing options...
Czarekplpl Posted June 12, 2014 Author Share Posted June 12, 2014 Hello. I found solution myself. For Presta 1,6 and 1,5 Go to Classes>Pdf>PdfGenerator.php and find this place: class PDFGeneratorCore extends TCPDF { const DEFAULT_FONT = 'helvetica'; public $header; public $footer; public $content; public $font; public $font_by_lang = array( 'ja' => 'cid0jp', 'bg' => 'freeserif', 'ru' => 'freeserif', 'uk' => 'freeserif', 'mk' => 'freeserif', 'el' => 'freeserif', 'en' => 'dejavusans', 'vn' => 'dejavusans', 'pl' => 'dejavusans', 'ar' => 'dejavusans', 'fa' => 'dejavusans', 'ur' => 'dejavusans', 'az' => 'dejavusans', 'ca' => 'dejavusans', 'gl' => 'dejavusans', 'hr' => 'dejavusans', 'sr' => 'dejavusans', 'si' => 'dejavusans', 'cs' => 'dejavusans', 'sk' => 'dejavusans', 'ka' => 'dejavusans', 'he' => 'dejavusans', 'lo' => 'dejavusans', 'lv' => 'dejavusans', 'tr' => 'dejavusans', 'ko' => 'cid0kr', 'zh' => 'cid0cs', 'tw' => 'cid0cs', 'th' => 'freeserif' ); public function __construct($use_cache = false) { parent::__construct('P', 'mm', 'A4', true, 'UTF-8', $use_cache, false); $this->setRTL(Context::getContext()->language->is_rtl); } Than change it like this: class PDFGeneratorCore extends TCPDF { const DEFAULT_FONT = 'cid0cs'; public $header; public $footer; public $content; public $font; public $font_by_lang = array( 'zh' => 'cid0cs', ); public function __construct($use_cache = false) { parent::__construct('P', 'mm', 'A4', true, 'gb2312', $use_cache, false); $this->setRTL(Context::getContext()->language->is_rtl); } Generally: Change helvetica font. Delete useless languages, leave only 'zh' => 'cid0cs', Change encoding. Than on English language documents Chinese characters are displayed correctly (address, names, etc....) Probably it works for other languages too. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now