diff --git a/core/fonts/OpenSans-Regular.ttf b/core/fonts/OpenSans-Regular.ttf new file mode 100644 index 0000000000..db433349b7 Binary files /dev/null and b/core/fonts/OpenSans-Regular.ttf differ diff --git a/lib/private/preview/txt.php b/lib/private/preview/txt.php index c9aa20968d..063543c627 100644 --- a/lib/private/preview/txt.php +++ b/lib/private/preview/txt.php @@ -40,13 +40,17 @@ class TXT extends Provider { imagecolorallocate($image, 255, 255, 255); $textColor = imagecolorallocate($image, 0, 0, 0); + $fontFile = __DIR__; + $fontFile .= '/../../../core'; + $fontFile .= '/fonts/OpenSans-Regular.ttf'; + foreach($lines as $index => $line) { $index = $index + 1; $x = (int) 1; - $y = (int) ($index * $lineSize) - $fontSize; + $y = (int) ($index * $lineSize); - imagestring($image, 1, $x, $y, $line, $textColor); + imagettftext($image, $fontSize, 0, $x, $y, $textColor, $fontFile, $line); if(($index * $lineSize) >= $maxY) { break;