1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-30 09:10:21 +02:00

Update Font.php

This commit is contained in:
Tomoyuki Tsujimoto
2019-09-03 05:17:03 +09:00
committed by GitHub
parent d5611555bf
commit 5f5ab3b0d1

View File

@@ -82,6 +82,11 @@ class Font extends \Intervention\Image\AbstractFont
if ($this->hasApplicableFontFile()) { if ($this->hasApplicableFontFile()) {
// imagettfbbox() converts numeric entities to their respective
// character. Preserve any originally double encoded entities to be
// represented as is.
// eg:   will render   rather than its character.
$this->text = preg_replace('/&(#(?:x[a-fA-F0-9]+|[0-9]+);)/', '&\1', $this->text);
$this->text = mb_encode_numericentity($this->text, array(0x0080, 0xffff, 0, 0xffff), 'UTF-8'); $this->text = mb_encode_numericentity($this->text, array(0x0080, 0xffff, 0, 0xffff), 'UTF-8');
// get bounding box with angle 0 // get bounding box with angle 0