Intervention / image

PHP Image Processing
https://image.intervention.io
MIT License
13.84k stars 1.5k forks source link

Emoji Symbols are not rendered with text() #1284

Closed olivervogel closed 7 months ago

olivervogel commented 7 months ago

Describe the bug Emoji symbols are either not rendered with the text() method (Imagick) or appear in cryptic form (GD).

It is possible that no solution is possible here, as the functionality is not planned with either GD or Imagick.

Code Example

$image->text('emoji: 💩', 65, 65, function ($font) {
    $font->size(50);
    $font->file('test.ttf');
});

Expected behavior Emoji symbols should be rendered together with the entered text with all drivers.

Images

Result with GD
Bildschirmfoto 2024-01-27 um 14 15 25
Result with Imagick
Bildschirmfoto 2024-01-27 um 14 15 43

Environment (please complete the following information):

olivervogel commented 7 months ago

As it turns out, this is currently not possible at all with GD[1]. 🙁 It should work with Imagick if the font includes the emojis.

[1] https://stackoverflow.com/questions/32391005/php-function-imagettftext-to-write-text-with-smileys#answer-32466289