title: Bangla (Unicode) font not rendering correctly in tcpdf
body: <p>I am facing a problem with generating pdf in php by using TCPDF library. I need to show the bangla font correctly. I tried to add some bangla font(i.e. SolaimanLipi.ttf, SutonnyOMJ.ttf, Siyamrupali.ttf, Nikosh.ttf and so on). I can see the bangla font on pdf but the font is not display correctly. Its misplaced the word.</p>
  
  <p>By adding this font I see the on the /fonts/ directory there successfully created 3 file “solaimanlipi.ctg.z”,”solaimanlipi.php” and “solaimanlipi.z”. As well as I can see the bangla font on pdf, but this font is misplaced/scattered. I am attaching a picture what I actually see.</p>
  
  <p>This is how it should look (From browser screenshot):
  <a href="https://i.stack.imgur.com/6xglF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6xglF.png" alt="enter image description here"></a></p>
  
  <p>Here is the code to show above result:</p>
  
  <pre><code>&lt;?php
  $strData = file_get_contents('./data3.txt');
  ?&gt;
  &lt;html lang="en" dir="ltr"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;style&gt;
      @font-face
      {
          font-family: myUniFont;
          src: url(./SolaimanLipi_22-02-2012.ttf);
      }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;span style="font-family: myUniFont;"&gt;&lt;?php echo $strData; ?&gt;&lt;/span&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I use below code to use that very same font in my pdf:</p>
  
  <pre><code>$strBNFont = TCPDF_FONTS::addTTFfont('./SolaimanLipi_22-02-2012.ttf', 'TrueTypeUnicode', '', 32);
  $pdf-&gt;SetFont($strBNFont, '', 8, '', 'false');
  </code></pre>
  
  <p>And It is how it look like in PDF: :(</p>
  
  <p><a href="https://i.stack.imgur.com/yQ7E6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yQ7E6.png" alt="enter image description here"></a>
  Please advice me how can I display the bangla font correctly. </p>
  
  <p><strong>EDIT #1</strong></p>
  
  <p>wow! ;( OMG!</p>
  
  <p>dear sir, problem is not on pdf/tcPDF library nor even in the font file it self.</p>
  
  <p>please check the below php code:</p>
  
  <pre><code>&lt;?php
  header('Content-type: image/png');
  
  $text = 'তোমাদের  জন্য মুক্তিযুদ্ধের গল্প';
  
  $font = './Fonts/SolaimanLipi_22-02-2012.ttf';
  
  $im = imagecreatetruecolor(600, 300);
  
  $bg_color = imagecolorallocate($im, 255, 255, 255);
  
  $font_color = imagecolorallocate($im, 0, 0, 0);
  
  imagefilledrectangle($im, 0, 0, 599, 299, $bg_color);
  
  imagettftext($im, 20, 0, 10, 50, $font_color, $font, $font);
  
  imagettftext($im, 20, 0, 10, 120, $font_color, $font, $text);
  
  imagepng($im);
  
  imagedestroy($im);
  
  ?&gt;
  </code></pre>
  
  <p>this how it export/render the png image on browser:</p>
  
  <p><a href="https://i.stack.imgur.com/XZ7xQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XZ7xQ.png" alt="enter image description here"></a></p>
  
  <p>when i try to print the text on image file using imagettftext function it also broke the character :(</p>
  
  <p>as i am sure it's not font issue because i have just tested with 60+ fonts and all get broken.. while browser (html code) shows them very correctly.</p>
  
  <p>so, i thing this is very bigger than my brain can contain/handle ;(</p>
  
  <p>so, expert like you may only way out :)</p>
  
  <p>thanks again for your times </p>