Skip to content

Feature/emoji in report

Xiaowu Zhang requested to merge xiaowu.zhang/erp5:feature/emoji_in_report into master

jp ask to support emoji when convert a html to pdf by using cloudooo

i have an original text:

image

when convert to pdf by using cloudooo, i got

image

i tried to add emoji font in the html, i use this one: https://fonts.google.com/noto/specimen/Noto+Emoji

with: NotoEmoji-VariableFont_wght.ttf

image

with: NotoColorEmoji-Regular.ttf

image

so my conclusion is that wkhtmltopdf doesn't support well emoji font.

i found it has already some discussion about emoji issue with wkhtmltopdf

one solution is using: twemoji

this js librairy parse the html, then replace the emoji by a png link, something like:

<td>Système d'exploitation</td> <td zwidth="226">Ubuntu</td> <td zwidth="226">libre</td>
<td style="text-align: center;" zwidth="226"><img draggable="false" class="emoji" alt="" src="https://twemoji.maxcdn.com/v/14.0.2/72x72/1f1ec-1f1e7.png"> 

but it doesn't work with our cloudooo which seems block the external access(but not sure)

at final, i download the twemoji, then do the emoji --> svg at server side

Edited by Xiaowu Zhang

Merge request reports