ibis icon indicating copy to clipboard operation
ibis copied to clipboard

[Feature Request]: Emoji Support

Open bhushan opened this issue 3 years ago • 4 comments

Screenshot 2021-08-21 at 1 45 48 PM

Markdown supports Emojis, HTML Supports Emojis but In generated PDF, Emojis are shown incorrectly.

@themsaid Please have a look when you have time.

bhushan avatar Aug 21 '21 08:08 bhushan

I was able to get a little bit of emoji support working (enough for my pressing needs) using the following steps:

  1. Get the emoji fonts here: https://github.com/MorbZ/OpenSansEmoji
  2. Put the OpenSansEmoji.ttf file in the fonts directory as per the readme.md
  3. Edit the ibis.php file to include the new font

ibis.php:

/**
     * The list of fonts to be used in the different themes.
     */
    'fonts' => [
        //        'calibri' => 'Calibri-Regular.ttf',
        //        'times' => 'times-regular.ttf',
        'emoji' => 'OpenSansEmoji.ttf',
    ],
  1. Use the font in the theme file (theme-dark.html and/or theme-light.html)

theme-dark.html, theme-dark.html:

In the style section, add an emoji class:

.pdfEmoji{
      font-family: emoji;
    }
  1. In your markdown, use <span class="pdfEmoji">😎</span>

yourcontentfile.md:

<span class="pdfEmoji">😎</span>

The result looks like this:

image

There's a lot to desire - I presume a better emoji font would be the next starting point, but this served my needs for my pressing project. Hope it helps someone else in the meantime.

This also was useful in getting this to work: https://github.com/mpdf/mpdf/issues/223

plabbett avatar Sep 07 '21 23:09 plabbett

Thank you @plabbett its still not perfect will check it more.. thank you for idea

bhushan avatar Sep 12 '21 13:09 bhushan

Thanks @plabbett this helped.

shalvah avatar Oct 18 '21 13:10 shalvah