You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which backend are you using? I suspect the OS is supplying the emoji images
through the GUI framework, so it wouldn't work in all backends, nor have we
ever written tests for this. I doubt it would be trivial to add support for
it throughout mpl.
On Jun 2, 2015 4:04 PM, "yeqingyan" [email protected] wrote:
@WeatherGod emoji are just unicode, support only depneds on the font being use. The issue here is that the font being used by osx is a system font which has them and for the png I bet it is falling back to the fonts we ship. Explicitly setting the text to use a font that has the emoji glyphs should be all that is needed.
I wonder if resetting the font list cache might help here? I don't know how
well the font-finding mechanisms work on macs, but it should pick up the
system font, no?
On Wed, Jun 3, 2015 at 8:44 AM, Michael Droettboom <[email protected]
wrote:
Wow. Talk about something cool that works completely by accident!
—
Reply to this email directly or view it on GitHub #4492 (comment)
.
from matplotlib.font_manager import FontProperties
from pylab import *
subplot(111, axisbg='w')
font0 = FontProperties()
alignment = {'horizontalalignment':'center', 'verticalalignment':'baseline'}
### Show family options
family = ['Apple Color Emoji', 'Apple Color Emoji', 'Apple Color Emoji', 'Apple Color Emoji', 'Apple Color Emoji']
font1 = font0.copy()
font1.set_size('large')
t = text(-0.8, 0.9, 'family', fontproperties=font1,
**alignment)
yp = [0.7, 0.5, 0.3, 0.1, -0.1, -0.3, -0.5]
for k in range(5):
font = font0.copy()
font.set_family(family[k])
if k == 2:
font.set_name('Script MT')
#print emoji
t = text(-0.8, yp[k], '\xf0\x9f\x98\x8d'.decode("utf-8"), fontproperties=font,
**alignment)
axis([-1,1,0,1])
show()
I tried @tacaswell's suggestions but with Apple Emoji.
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
t = ax.text(.5, .25, '😅😍😅', fontname='Apple Color Emoji', fontsize=30, ha='center')
plt.show() displays nicely:
But I couldn't save it and instead get the same boxes as shown above in the thread. I could save with Symbola font though. So is there any way I can take advantage of Apple Emoji while saving ?
This is probably related to the differences in the macosx's font lookup
which enables it to find more fonts than what matplotlib can find. Have you
tried clearing your font-cache?
But I couldn't save it and instead get the same boxes as shown above in
the thread. I could save with Symbola font though. So is there any way I
can take advantage of Apple Emoji while saving ? Like copying the font to
somewhere inside matplotlib folder ?
Activity
WeatherGod commentedon Jun 2, 2015
Which backend are you using? I suspect the OS is supplying the emoji images
through the GUI framework, so it wouldn't work in all backends, nor have we
ever written tests for this. I doubt it would be trivial to add support for
it throughout mpl.
On Jun 2, 2015 4:04 PM, "yeqingyan" [email protected] wrote:
yeqingyan commentedon Jun 2, 2015
I think the backend I used is MacOSX. I got it by running following commands:
tacaswell commentedon Jun 3, 2015
@WeatherGod emoji are just unicode, support only depneds on the font being use. The issue here is that the font being used by osx is a system font which has them and for the png I bet it is falling back to the fonts we ship. Explicitly setting the text to use a font that has the emoji glyphs should be all that is needed.
mdboom commentedon Jun 3, 2015
Wow. Talk about something cool that works completely by accident!
WeatherGod commentedon Jun 3, 2015
I wonder if resetting the font list cache might help here? I don't know how
well the font-finding mechanisms work on macs, but it should pick up the
system font, no?
On Wed, Jun 3, 2015 at 8:44 AM, Michael Droettboom <[email protected]
yeqingyan commentedon Jun 3, 2015
Thank you for your reply! I followed font example here http://matplotlib.org/examples/pylab_examples/fonts_demo.html, I tried to set the emoji font family,but I still got the same result, the emoji looks good after call show function, but they are missing after I save it to png files.
In show window:


After save it to png file:
tacaswell commentedon Jun 19, 2015
I think you want to be setting the font name, not family, ex
will let you run the font search and will tell you (via a warning) if it fails.
pelson commentedon Jun 22, 2015
@tacaswell - I hope you've lined this example up for the state of the library talk! 😄
tacaswell commentedon Jun 22, 2015
The plan is emoji + hello in a collection of languages.
WeatherGod commentedon Jun 22, 2015
Do we still not support right-to-left fonts such as arabic and hebrew?
On Mon, Jun 22, 2015 at 1:34 PM, Thomas A Caswell [email protected]
wrote:
tacaswell commentedon Jun 22, 2015
Ah, I bet we do not.
On Mon, Jun 22, 2015 at 1:45 PM Benjamin Root [email protected]
wrote:
mdboom commentedon Jun 22, 2015
Yeah -- the text layout algorithm is still "Naive American [TM]"
On Mon, Jun 22, 2015 at 1:47 PM Thomas A Caswell [email protected]
wrote:
samsaara commentedon Jun 28, 2016
I tried @tacaswell's suggestions but with
Apple Emoji.plt.show()displays nicely:But I couldn't save it and instead get the same boxes as shown above in the thread. I could save with
Symbolafont though. So is there any way I can take advantage ofApple Emojiwhile saving ?I use Mac OS X
10.11.5and Matplotlib1.5.1WeatherGod commentedon Jun 28, 2016
This is probably related to the differences in the macosx's font lookup
which enables it to find more fonts than what matplotlib can find. Have you
tried clearing your font-cache?
On Tue, Jun 28, 2016 at 6:38 AM, Keviv [email protected] wrote:
samsaara commentedon Jun 28, 2016
if you mean, deleting the
.matplotlibfolder, then yes; I've tried that option.