How to draw color emojis with love.graphics.print()

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: How to draw color emojis with love.graphics.print()

Post by grump »

????????????????????????????????????????????
Last edited by grump on Wed Jan 19, 2022 3:02 am, edited 1 time in total.
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: How to draw color emojis with love.graphics.print()

Post by zorg »

grump wrote: Tue Jan 18, 2022 6:49 pm Just as a hypothetical: if you were to make a multiplayer game with chat functionality, emoji support would be a major thing that you have to support in 2022.
Why? Did people forget how to use words, and now they absolutely need such symbols? :awesome:

I disagree that it's a must; obviously it's nice to have, but that felt like an absolute claim (even as part of a hypothetical, which, as i read it, was about the making the game part, not the emojis being a "have to support" thing part) which is, i want to say, simply untrue. :o:

(Admittedly, i'm just being nitpicky about phrasing...)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: How to draw color emojis with love.graphics.print()

Post by grump »

????????????????????????????????????????????
Last edited by grump on Wed Jan 19, 2022 3:02 am, edited 1 time in total.
User avatar
EngineerSmith
Prole
Posts: 38
Joined: Thu Dec 02, 2021 11:38 am
Contact:

Re: How to draw color emojis with love.graphics.print()

Post by EngineerSmith »

Not even Unity natively supports emojis (and possibly Unreal, couldn't find out from my googles if it does or not). Most games I've played don't do full emoji support, and instead add basic emojis wrapped with colons and insert custom images at those positions (you can use libraries like sysl-text to insert an image into text if it matches against the correct keyword within colons). You can always convert emojis written in by keyboard input or paste to these colon formatted emojis too
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: How to draw color emojis with love.graphics.print()

Post by zorg »

I agree that it's expected, but just as you say, grump, i don't need to like the trend, nor do i need to care about the feature/impl./pull request, hence it's not something someone -has to- support (at all costs). And yes, there are probably a lot of ways to implement such functionality anyway if someone really needs it... but then again, that also goes for RTL and TTB text as well, which is (as i understand it) hard to "fully" support as well, for some definition of fully.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
MrFariator
Party member
Posts: 509
Joined: Wed Oct 05, 2016 11:53 am

Re: How to draw color emojis with love.graphics.print()

Post by MrFariator »

More often than not I see games implementing their own sets of emotes (eq. Monster Hunter World/Rise, Dota2, among others), or even dances or gestures (like Guilty Gear Strive), as opposed to implementing emojis outright. If you were making a straight up communication app, however, then I could see the need.

Personally, I feel it's a little silly to expect every framework or engine to support emojis out of the box, when even Unity doesn't do it. After all, the subset of developers who benefit from such an inclusion is relatively small, given how most games are single player experiences rather than multiplayer. Even then, it's becoming increasingly common that players chat outside the games by using external tools, and so the in-game chat gets relegated to simple communication between strangers in public matchmaking, where basic text is enough.

That's not to say I'm opposed to the idea of löve getting emoji support, far from it, but it's understandable why it's not really an immediate concern.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: How to draw color emojis with love.graphics.print()

Post by grump »

????????????????????????????????????????????
Last edited by grump on Wed Jan 19, 2022 3:02 am, edited 1 time in total.
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: How to draw color emojis with love.graphics.print()

Post by pgimeno »

I made a simple proof of concept with the font I linked, and it worked out of the box, which is why I linked it:

Code: Select all

local fnt = love.graphics.newFont('NotoEmoji-Regular.ttf')
love.graphics.setFont(fnt)

function love.draw()
  love.graphics.print('\xF0\x9F\x98\x80')
end
There may be a problem that my simple POC did not show. I thought the characters were not showing up for dusoft, but maybe I was wrong and the problem is not exactly that.
User avatar
slime
Solid Snayke
Posts: 3131
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: How to draw color emojis with love.graphics.print()

Post by slime »

grump wrote: Tue Jan 18, 2022 8:06 pm Emoji are just a tiny part of this. RTL (or whatever direction your weird country likes to write in) and combining characters are much more important and unsupported.
I agree RTL is important. It's also completely off-topic to this thread. Your attitude related to this open source community-run project is consistently tiring to me. I contribute as a community member to this project in my spare time because I enjoy it. The attitude you bring significantly reduces my enjoyment.
grump wrote: Tue Jan 18, 2022 8:06 pm Having support for major Unicode features is not an unreasonable request. It's a huge thing and difficult to support, and I certainly wouldn't want to be the one that implements it.
There is a separate issue in the issue tracker for it. No one told you it's an unreasonable request, you made the assumption yourself. Because love is an open source community-run project, for something to be implemented a member of this community has to both want to do it and have the free time and skills required to do it, and also prioritize it above every other feature or fix they could be working on instead.


As for emoji, as pgimeno points out they're already supported to a degree as far as I know. It's color truetype fonts that are not supported. And I gave a workaround for color fonts (in lieu of a community member contributing ttf support) earlier in this thread.
User avatar
BrotSagtMist
Party member
Posts: 607
Joined: Fri Aug 06, 2021 10:30 pm

Re: How to draw color emojis with love.graphics.print()

Post by BrotSagtMist »

Full color emojis for a multiplayer chat is exactly what id like to have at some point...
Images are pretty useless for that if you want seamless zooming.

Anyway, a while ago i posted this simple parser https://love2d.org/forums/viewtopic.php?f=5&t=91900
This method can be used to add at least one or two colours for a few selected chars:
Image
Its something i guess *shrug*

Regarding fonts, there is a mass of file formats and lack of proper programs, we should be lucky with what we have for now i guess.
Id be happy if someone could name any of said export programs or any font editor that does not seem to have gone EOL in the 90s.
obey
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 41 guests