php imagettftext and specific emoji

前端 未结 1 397
Happy的楠姐
Happy的楠姐 2020-12-22 04:10

I\'ve run into a problem drawing emoji that are under the \'Miscellaneous Symbols And Pictographs\' unicode block.

Here is an example code:



        
1条回答
  •  执笔经年
    2020-12-22 04:44

    I ran into this same kind of a problem with the Abigail TTF. After some research I found THIS LINK

    https://bugs.php.net/bug.php?id=17955

    Which had this example script in it:

    
    

    Their answer: You must convert your string to Unicdoe correctly. This got the Abigail font to show up properly. Unfortunately, I'm still looking at how to get a non-standard TTF file to show up properly. But I think it is just a matter of finding where they put the actual fonts (like your cyclone image).

    The other frustrating factor is that GD will put in squares sometimes and sometimes it will leave the character blank. I really would prefer the blank character to always be given since this comes back as WIDTH=0 and HEIGHT=0 whereas the square can come back with a lot of different sizes. If GD standardized on always giving back a blank character with no size then all you have to do is look for that. Otherwise - you have to jump through hoops to figure out a square was returned.

    I hope this helps! :-)

    0 讨论(0)
提交回复
热议问题