richfitz / remoji

Emoji for R :joy_cat:
Other
42 stars 4 forks source link

OS X support #5

Closed GuangchuangYu closed 8 years ago

GuangchuangYu commented 8 years ago

OS X support emoji, and remoji works fine in R console. emoji

But if I try to plot them by base plot or ggplot, it fails.

In linux, after I installed ttf-ancient-fonts, emoji works fine in both console and plot.

I want to produce phylomoji with ggtree:

It seems that in OS X, the plotting system, base or grid, can't recognize AppleEmoji font.

Any idea?

richfitz commented 8 years ago

It's possible something in the approach here could work: http://blog.revolutionanalytics.com/2012/09/how-to-use-your-favorite-fonts-in-r-charts.html

GuangchuangYu commented 8 years ago

I did try, but it seems that both showtext and extrafont can't import /System/Library/Fonts/Apple Color Emoji.ttf.

richfitz commented 8 years ago

hmm, it might be a limitation of the quartz device as this works on OSX (quartz) and Linux (X11)

> plot(1:10, pch=-0x2642L)

while this only works on Linux

> plot(1:10, pch=-0x1f321L)

On OSX neither work to PDF (via pdf and cairo_pdf).

GuangchuangYu commented 8 years ago

FYI, the above figure produce in OSX using OpenSansEmoji, which can be imported by showtext but fail with extrafont.

GuangchuangYu commented 8 years ago

Hi @richfitz , I created the emojifont package to support using emoji font.