0
我試圖將日文文本打印到圖像。
我的代碼:Imagick annotateImage顯示不正確日文文本
$text = // some japanese text
$imagick = new IMagick();
// $imagick implementation
$imagickDraw = new ImagickDraw();
$imagickDraw->setFontSize(12);
$textFontMetrics = $imagick->queryFontMetrics($imagickDraw, $text);
$imagick->annotateImage($imagickDraw, ($imageWidth - $textFontMetrics['textWidth'])/2, $imageHeight * 0.5, 0, $text);
// save imageBlob
當我檢查我的生成的圖像,而不是正常的日文文字我剛纔看到「?」。任何想法如何解決這個問題?
你能分享一些日文字體嗎? – pacification
@pacification你可以在我的答案中提到的字體搜索谷歌,這是[第一個結果](https://github.com/blagarde/midori)。 –