22

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!
  • There’s a good answer at https://tex.stackexchange.com/a/572220/2141 that sets Noto Color Emoji as a fallback font. – andrew Sep 02 '21 at 23:32

3 Answers3

23

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

Ulrike Fischer
  • 327,261
6

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)

  • Hello. I copied and pasted your text but no emojis appear. In the log file, I have: Package fontspec Info: Could not resolve font "NotoColorEmoji/BI" (it probably (fontspec) doesn't exist). So how do I install the Noto Color Emoji Font? I downloaded the package noto-emoji and tried to install the two fonts inside the package but I got the error message: NotoColorEmoji.ttf doesn't seem to be a valid font – Didier Jul 22 '23 at 06:19
3

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.

  • I think the OP wants to use colour emojis, but this will only produce black and white emojis. – David Purton 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 https://stackoverflow.com/questions/190145/how-to-insert-emoticons-in-latex. Would you post it there? – Martin Monperrus Jul 17 '19 at 07:27
  • Hi @MartinMonperrus thanks for your suggestion. I added information to your suggested thread as https://stackoverflow.com/questions/190145/how-to-insert-emoticons-in-latex/57076064#57076064 – Ryutaroh Matsumoto Jul 17 '19 at 12:41
  • Thanks. Upvoted for your answer there. – Martin Monperrus 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