Wide characters overlap

Post Reply
SoulSpirit
Posts: 14
Joined: Wed Aug 22, 2018 1:16 pm

Wide characters overlap

Post by SoulSpirit » Mon Aug 05, 2019 9:02 am

Hi,
I was curious to try out the support for emoji characters in version 4 to implement some interesting features on my plugins, but there's something wrong.
I copied and pasted the example on the news released yesterday, but the text echoed is displayed like this:
Image

And the alias handling the command gives this error:
Image

The alias, copied from somewhere, some time ago, looks like this:

Code: Select all

local f,e = loadstring("return "..matches[2])
if not f then
	f,e = assert(loadstring(matches[2]))
end

local r = f()
if r ~= nil then display(r) end
There's nothing special about my Mudlet configuration, I'm using bitstream vera sans as font and I tried to change it, getting the same result:
Image

I've also tried to change server encoding to UTF-8, even if I think it's not related to the problem.
Image

Could you please help me understand what's going on? I'm currently running on Mudlet 4.0.1

Thanks.

EDIT: Oh, I forgot: I'm running on Windows 10

User avatar
Vadi
Posts: 4712
Joined: Sat Mar 14, 2009 3:13 pm

Re: Wide characters overlap

Post by Vadi » Mon Aug 05, 2019 9:48 am

That is correct - emoji's are now coloured but they can still overlap when you include a combining grapheme (enable the text analyser and you'll see the difference). See https://github.com/Mudlet/Mudlet/issues/2379 for the issue. I should have included that in the post, emoji support got better (now coloured) but still not perfect (can overlap).

SoulSpirit
Posts: 14
Joined: Wed Aug 22, 2018 1:16 pm

Re: Wide characters overlap

Post by SoulSpirit » Mon Aug 05, 2019 1:41 pm

I can see colored emoji since before Mudlet 3.1, I'm pretty sure about that. I think that's a Windows' feature: when it finds a character falling in the "emoji" category not handled by the selected font, it fallbacks to Segoe Color Emoji.
Perhaps this is the cause of the issue. I suppose mudlet reserves a certain width for each character rendered to the console, and that Segoe Color Emoji's char simply exceeds it. Even if in this screenshot from mudlet news clearly shows that emojis are wider than normal characters:
Image

I can't make text analyzer work (it simply doesn't output anything anywhere), so I can't say if there's a hidden combining joiner.

Do you know if I could do anything to make emoji output work (both under Windows and Linux)? Do I have to use a specific font for that? If yes, which one? If it exists, is it possible to include it in Mudlet so that every user can benefit from it? And eventually, could it become the default font?

I'd like to include such characters in my plugin output, but I can't if the solution is not reliable and breaks the user experience :(

Thanks

User avatar
Vadi
Posts: 4712
Joined: Sat Mar 14, 2009 3:13 pm

Re: Wide characters overlap

Post by Vadi » Mon Aug 05, 2019 1:58 pm

> I can see colored emoji since before Mudlet 3.1, I'm pretty sure about that. I think that's a Windows' feature: when it finds a character falling in the "emoji" category not handled by the selected font, it fallbacks to Segoe Color Emoji.

Hm... it definitely didn't for me. Double-check with 3.22.1 and 4.0.2.

> I can't make text analyzer work (it simply doesn't output anything anywhere), so I can't say if there's a hidden combining joiner.

It's a confusing design I agree. Hover over the menu and you'll get a tooltip with the analyser showing. I think we should make the click actually work and show a little window.

> Do you know if I could do anything to make emoji output work (both under Windows and Linux)? Do I have to use a specific font for that? If yes, which one? If it exists, is it possible to include it in Mudlet so that every user can benefit from it? And eventually, could it become the default font?

Making emoji's be shown in colour was this magical "just include the font" fix :) to make them not overlap, Mudlet's text rendering code needs to be updated. Try the analyser again and you'll see what I mean.

https://www.reddit.com/r/emojipasta/com ... _sit_amet/ is a good bit you can paste into Mudlet and you'll see that not all emoji's overlap.

SoulSpirit
Posts: 14
Joined: Wed Aug 22, 2018 1:16 pm

Re: Wide characters overlap

Post by SoulSpirit » Mon Aug 05, 2019 2:30 pm

I tried with the text you linked. Some emojis are "single spaced" others are "double spaced". In either case the character is partially cut on the right.
Note that the output is perfect in the command bar:
Image

Taking 2 adjacent characters rendered in the 2 different modes, the analyzer shows:
Image

I can't see nothing that says that the first character is single spaced, and the second is double spaced.
The 2 characters are similar:
👿 : U+1F47F
🤮 : U+1F92E

No VS15, no CGJ. Just plain characters.

Thanks.

User avatar
Vadi
Posts: 4712
Joined: Sat Mar 14, 2009 3:13 pm

Re: Wide characters overlap

Post by Vadi » Mon Aug 05, 2019 3:16 pm

Bummer - but it is a known issue. We just colourised them, proper rendering still needs needs more attention in this area. Dive in TConsole.cpp or wait for more updates when we get around to it :)

User avatar
SlySven
Posts: 920
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Wide characters overlap

Post by SlySven » Wed Aug 28, 2019 3:08 pm

BTW Which Windows - coloured Emojis only made it into a Windows 10 build a while ago (not sure which update) - if you are using Windows 7 (like I still am on this PC when I do boot it into Windoze) then coloured emojis just don't work...

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests