Markdown-preview-enhanced: emoji color icons

Created on 14 Nov 2018  路  3Comments  路  Source: shd101wyy/markdown-preview-enhanced

In markdown-preview, unicode emojis (馃崟) are rendered b/w and markdown emojis (:pizza:) are rendered in color (:pizza:). In markdown-preview-enhanced, either is rendered b/w. Would be nice to have color emoji font support.
This is on Linux. Thanks!

Most helpful comment

I'm on linux as well, and I had the same issue. Figured out a work around. You need to add an emoji font to the preview (doesn't take the Editor font family into account). So just Ctrl+P and select Markdown Preview Enhanced: Customize CSS and add a font-family property:

.markdown-preview.markdown-preview {
  font-family: "Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif, 'Noto Color Emoji';
}

Noto Color Emoji is the emoji font in my case.

PS: You can use the developer tools to find out which font(s) were being used by the preview so you can maintain that and add the emoji font (Help menu > Toggle Developer Tools)

All 3 comments

+10!! Would even be VERY NICE!! It is such a pity, that currently markdown emojis' exports via markdown-preview-enhanced :

  • in HTML are rendered correctly in color, but
  • in PDF are not even rendered (via Chrome Puppeteer).
    Also Linux here (Manjaro Linux). Many thanks by advance if you could do something for us :smile:

I'm on linux as well, and I had the same issue. Figured out a work around. You need to add an emoji font to the preview (doesn't take the Editor font family into account). So just Ctrl+P and select Markdown Preview Enhanced: Customize CSS and add a font-family property:

.markdown-preview.markdown-preview {
  font-family: "Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif, 'Noto Color Emoji';
}

Noto Color Emoji is the emoji font in my case.

PS: You can use the developer tools to find out which font(s) were being used by the preview so you can maintain that and add the emoji font (Help menu > Toggle Developer Tools)

GREAT D3VR! Thankxx a lot, nice trick, it saved me a lot of mind-bending.
Your workaround solved the 3 problems I had with emojis (on Manjaro Linux / Archlinux):
1掳) emojis are now correctly rendered:

  • in markdown-preview-enhanced's preview pane
  • in HTML (offline) exports
  • in PDFs

2掳) I had to install these font packages though (of course):

  • ttf-joypixels
  • noto-fonts-emoji

3掳) I also had to swap the sans-serif default font position for HTML exports (otherwise your code was not working for me)

.markdown-preview.markdown-preview {
font-family: "Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans, JoyPixels, 'Noto Color Emoji', sans-serif;
}

Thanks a lot, problem solved for me :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saeidamiri1 picture saeidamiri1  路  3Comments

xu4wang picture xu4wang  路  5Comments

adamaltmejd picture adamaltmejd  路  5Comments

ajstadlin picture ajstadlin  路  5Comments

fengxs269 picture fengxs269  路  4Comments