2010-02-17 4 views
1

PHP GD 라이브러리를 사용하여 유니 코드 문자 모양 (언어 : Malayalam, Tamil 및 Hindi)을 렌더링하는 데 문제가 있습니다. 이것은 GD 라이브러리의 렌더링 엔진과 관련이 있습니까? 어떤 해결 방법을 사용할 수 있습니까?PHP GD가 유니 코드 글꼴을 올바르게 렌더링하지 않습니다.

+0

아무도 시도하지 발견? – Orion

+0

내 대답 좀 봐 http://stackoverflow.com/questions/21188046/writing-hindi-fonts-with-gd-library-do-not-render-as-desired/27502129#27502129 – Pops

답변

1

먼저 글꼴에 원하는 글리프 (Arial과 같은 시스템 글꼴)가 포함되어 있는지 확인하십시오. 그런 다음 utf8_decode()을 사용하여 매개 변수를 유니 코드로 변환해야합니다.

1

내가 하나가 도움이 주변에이

<?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

+1

대답의 링크가 아닙니다. 더 이상 도달 할 수있는 – Trix

관련 문제