AkbarDizaji / APdf

Laravel Package for export page as PDF with support of UTF-8 like farsi character
8 stars 2 forks source link

Not support Khmer (Cambodia) Language #1

Open smartmot opened 3 years ago

smartmot commented 3 years ago

Not support Khmer (Cambodia) Language

 $apdf = new Apdf();
 $apdf->print('<p>សួស្ដីពិភពលោក</p>');

Result is [][][][][][] box

and

$html = "
<html>
<head>
<style>
/* khmer */
@font-face {
  font-family: 'Siemreap';
  font-style: normal;
  font-weight: 400;
  src: url(https://fonts.gstatic.com/s/siemreap/v15/Gg82N5oFbgLvHAfNl1YXlg4.woff2) format('woff2');
  unicode-range: U+1780-17FF, U+200C, U+25CC, U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
</style>
</head>
<body>
<div style='font-family: Siemreap, KhmerOS, sans-serif'>សួស្ដីពិភពលោករបស់ខ្ញុំ</div>
</body>
</html>
";
        $pdf = new Apdf();
        $pdf->AddFont("KhmerOS", "", public_path("fonts/KhmerOS"));
        $pdf->print($html);

the result is [][][][][][][][] too

AkbarDizaji commented 3 years ago

Is this language support utf8 encoding?This package just tested for utf8 languages

smartmot commented 3 years ago

Yes, this language is support utf8

AkbarDizaji commented 3 years ago

See this topic: https://sourceforge.net/p/tcpdf/discussion/435311/thread/9ef28f41/ because my package implement TCPDF so this solution for tcpdf works for apdf too.