PHP GD düzgün unicode yazı render değil

2 Cevap php

PHP GD kütüphanesi ile: I unicode gliflere (Malayalam, Tamil ve Hintçe dil) render problemleri yaşıyorum. Bu GD kütüphanesinin render motoru ile ilgili bir şey var mı? Mevcut herhangi bir geçici çözüm?

2 Cevap

ben bir bu deneyin bulduk

<?php
//error_reporting(0);
$text = ("Unreadable text");
$font = "mangal.ttf";
$fontSize = "10";
$width = '600';
    $s = new CairoImageSurface(CairoFormat::ARGB32, $width, 21);
    $c = new CairoContext($s);

    /* Set the background*/
    $c->setSourceRGB(.1,149,.58);
    $c->paint();

    $c->setSourceRGB(.1,.1,.1);

    /* Make a Pango layout, set the font, then set the layout size */
    $l = new PangoLayout($c);
    $desc = new PangoFontDescription("mangal normal $fontSize");
    $l->setFontDescription($desc);

    /* Here, we use Pango markup to make part of the text bold */
    $l->setText($text);

    /* Draw the layout on the surface */
    $l->showLayout($c);
    $s->writeToPng("unicode.png");
    echo $img = "<img src=\"unicode.png\">";        
?> 

http://fatalweb.com/articles/how+to+render+hindi+unicode+font+using+php-29.htm

İlk fontlar istenilen motifleri (Arial gerektiği gibi sistem yazı tipleri) içerdiğinden emin olun. Sonra utf8_decode() eğer gerekliyse kullanarak unicode için parametreleri dönüştürmek emin olun.