18

I want to use Noto Color Emoji with lualatex (package fonts-noto-color-emoji on my box). However, this fails as follows. How to use Noto Color Emoji with lualatex?

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Noto Color Emoji}
\begin{document}
๐Ÿ˜บ
๐Ÿ‘… 
\end{document}

Error:

$ lualatex emoji.tex 
This is LuaTeX, Version 1.07.0 (TeX Live 2019/dev/Debian) 
 restricted system commands enabled.
(./emoji.tex
LaTeX2e <2018-12-01>

luaotfload | main : initialization completed in 2.224 seconds
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3pdfmode.def)))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/tuenc.def))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (./emoji.aux)
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./emoji.aux))
 409 words of node memory still in use:
   3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 5 attribute, 48 glue_spec
, 5 attribute_list, 1 write nodes
   avail lists: 2:15,3:4,4:1,5:21,6:1,7:13,8:1,9:6
</usr/share/fonts/truetype/noto/NotoColorEmoji.ttf
! error:  (file /usr/share/fonts/truetype/noto/NotoColorEmoji.ttf) (ttf): sfnt 
table not found
!  ==> Fatal error occurred, no output PDF file produced!
1
19

Update november 2019

With lualatex-dev (based now on luahbtex) and luaotfload 3.11 the example looks like this

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Noto Color Emoji}[Renderer=Harfbuzz]
\begin{document}
๐Ÿ˜บ
๐Ÿ‘…
\end{document}  

Old answer

It works with harflatex (How to install HarfTeX on TeXLive?):

\documentclass{article}
\usepackage{harfload}
\usepackage{fontspec}
\setmainfont{Noto Color Emoji}[RawFeature={mode=harf}]
\begin{document}
๐Ÿ˜บ
๐Ÿ‘…
\end{document} 

enter image description here

3
  • Great :-)! Very nice the cat.
    – Sebastiano
    Jun 25 '19 at 19:35
  • 1
    Oooo. Colour! I didn't know that was now possible. Jul 16 '19 at 13:15
  • For the slow of understanding like me: to get this you'll have to install luahblatex from contrib.texlive.info and compile your document with luahblatex instead of lualatex
    – Evpok
    Nov 8 '19 at 16:33
3

Ulrike Fischer's insightful answer didn't work for me (very likely my fault) since non-emoji text wouldn't be rendered in the resulting PDF.

I fixed this using the custom \emoji command that restricts the scope where Noto Color Emoji is applied:

\documentclass{article}
\usepackage{fontspec}

\newcommand{\emoji}[1]{
  {\setmainfont{Noto Color Emoji}[Renderer=Harfbuzz]{#1}}
}

\begin{document}
  \begin{itemize}
    \item Happy: \emoji{๐Ÿ˜๐Ÿ˜๐Ÿ˜‚๐Ÿ˜ƒ๐Ÿ˜Š๐Ÿค“๐Ÿ˜‡}
    \item Neutral: \emoji{๐Ÿ˜๐Ÿค๐Ÿฅถ๐Ÿฅธ๐Ÿ˜ฌ๐Ÿ˜ถ}
    \item Not amused: \emoji{๐Ÿ™๐Ÿคจ๐Ÿฅฑ๐Ÿ˜ ๐Ÿ˜ฑ๐Ÿ˜ฟ๐Ÿ˜ˆ๐Ÿ˜ญ}
    \item More emojis: \emoji{๐ŸŽ‰๐Ÿชƒ๐Ÿฆฉ๐Ÿฎ๐Ÿ•ต๏ธ๐Ÿง‘๐Ÿผโ€๐Ÿ”ฌ๐Ÿ๐Ÿซ–๐Ÿฐ๐Ÿ’–๐Ÿง‘๐Ÿฝโ€๐Ÿฆณ๐Ÿ‘น}
  \end{itemize}
\end{document}

Compiling the file with lualatex produces this:

different emojis, mostly faces

I also tested it successfully in a Beamer presentation but had to use \fontspec{Noto Color Emoji}[RawFeature={mode=harf}] to get the emojis to show up.


lualatex --version gives

This is LuaHBTeX, Version 1.12.0 (TeX Live 2020/Arch Linux)

1

Alternatively, we can use Symbola font. After apt-get install fonts-symbola, the following file produces what is desired:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Symbola}
\begin{document}
๐Ÿ˜บ
๐Ÿ‘… 
\end{document}

We can also use Segoe UI Emoji font bundled with MS Windows.

5
  • I think the OP wants to use colour emojis, but this will only produce black and white emojis. Jul 16 '19 at 13:14
  • I confirm that Symbola works for having ๐Ÿ˜บ๐Ÿ‘… in a Latex document. This is not exactly the answer to the question, but it's very valuable for having the big picture of emojis in Latex. It seems that's the perfect answer to stackoverflow.com/questions/190145/…. Would you post it there? Jul 17 '19 at 7:27
  • Hi @MartinMonperrus thanks for your suggestion. I added information to your suggested thread as stackoverflow.com/questions/190145/… Jul 17 '19 at 12:41
  • Thanks. Upvoted for your answer there. Jul 17 '19 at 13:33
  • Yeah, not the answer to the question but the answer I was looking for! :-D
    – Peque
    Sep 28 '20 at 19:22

Your Answer

By clicking โ€œPost Your Answerโ€, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.