0

There are now a range of "color fonts" such as "noto color emoji" that contain multi-colored emoji. Is there any way to use such fonts in pdftex? As far as I can tell, the PDF format should be able support these fonts.

gmvh
  • 345
  • There are some packages (https://www.ctan.org/pkg/coloremoji and https://www.ctan.org/pkg/twemojis) that can be used with pdfLaTeX but they render the emojis as images and not as characters. Representing an emoji font with a large number of characters using pdftex font encodings is rather difficult, because the font handling was not designed for so many different characters. Using XeLaTeX or LuaLaTeX you can use the opentype or truetype versions of these fonts easily - although for the Noto font specifically you need a fairly recent version, [...] – Marijn May 29 '21 at 13:19
  • see https://tex.stackexchange.com/questions/497403/how-to-use-noto-color-emoji-with-lualatex. – Marijn May 29 '21 at 13:19
  • 1
    @Marijn Especially for Noto Color Emoji all approaches render the emoji as images since the "emoji font file" is just a wrapper around a bunch of PNG images. So while they might appear like characters in TeX, they just end up as images in the PDF file. – Marcel Krüger May 29 '21 at 13:27
  • @MarcelKrüger the actual output may be images but the emojis are still represented as characters, i.e., they can be copied and pasted into a text editor as unicode glyphs. The pdfLaTeX compatible packages linked above seem to use only images, so without representing them as characters. – Marijn May 29 '21 at 13:35
  • If one ignores the large number of characters and e.g. creates a 256-char "color font", is there any support for this in pdflatex? – gmvh May 29 '21 at 14:25
  • you could generate a virtual font that exposed 256 images as a 256 character font to pdflatex, although I'm not sure if that is done here. As the font encoding would need to be a custom non-unicode encoding it's not clear if it would have any advantages over just directly including the images? – David Carlisle May 29 '21 at 14:34
  • @Marijn you could actual text pdf annotations to make (any) image cut and paste with suitable text (similar to the alt attribute in html) – David Carlisle May 29 '21 at 14:36
  • 1
    @ gmvh what you propose is (to my understanding) more or less how fontawesome5 works for pdflatex (a package by @MarcelKrüger). If you look at the file properties of the manual, which is compiled with pdflatex, then you will see that several varieties of the Font Awesome 5 font are embedded into the pdf, and the examples are actual characters. However, if you select the file icons from page 2 for example and copy them in a text editor, then you see they are encoded internally as the characters > ? > ? (in different colors). – Marijn May 29 '21 at 15:31
  • @Marijn but would the color aspect work with pdflatex in this case? Or does it just ignore the colors? – gmvh May 29 '21 at 15:46
  • @gmvh I'm not sure what you mean exactly by 'color aspect'. The Noto emoji are colored, for example is green in that font, and you can add the image to your pdftex font and the output will show a green shamrock. However, if you are asking about the mechanism of changing the skin color of human emoji, this is done with a set of additional modifier characters (the 'Fitzpatrick 1-6 modifier'), which is not supported by pdflatex (see https://tex.stackexchange.com/questions/79333/is-there-a-way-to-get-pdflatex-to-accept-unicode-combining-accents). You could still create a font with [...] – Marijn May 29 '21 at 16:05
  • six different versions of the same emoji of course, but you would need six different input characters, or a macro like \emoji[color]{name} that would map to six different input characters, to support the full range of colors. – Marijn May 29 '21 at 16:07

0 Answers0