在PHP GD中识别塞尔维亚语字母

时间:2015-11-17 21:45:44

标签: php php-gd

我正在尝试使用PHP gd的一些西伯利亚字母名称,但每次,我都会收到有关ambigious字母的错误。以下是我的代码: -

function properText($text){
        $text = mb_convert_encoding($text, "HTML-ENTITIES", "UTF-8");
        $text = preg_replace('~^(&([a-zA-Z0-9]);)~',htmlentities('${1}'),$text);
        return($text);
    }
    $im = imagecreatefrompng('testcreating.png');
    $returnedtext = properText('Jelena Jovanić');
    imagettftext($im, 11, 0, 90, 195, 0x000000, 'transcript.ttf', $returnedtext);
    imagealphablending($im, true);
    imagesavealpha($im, true);
    imageJpeg($im, "testcreating.jpg", 85);
    imagedestroy($im);
    return HTML::image('testcreating.jpg');

但它无法识别字母ć,它提供了暧昧的代码。

我该如何解决呢。

由于

1 个答案:

答案 0 :(得分:1)

您正在使用的字体" transcript.ttf"必须支持你想要使用的字母。

我无法保证任何论文,但我发现一个网站声称这些字体将支持西伯利亚字母:http://www.fontsquirrel.com/fonts/list/language/serbian