Skip to content

Colourize emojis shown in Mudlet#2835

Merged
vadi2 merged 7 commits intoMudlet:developmentfrom
vadi2:colourize-emojis
Jul 30, 2019
Merged

Colourize emojis shown in Mudlet#2835
vadi2 merged 7 commits intoMudlet:developmentfrom
vadi2:colourize-emojis

Conversation

@vadi2
Copy link
Copy Markdown
Member

@vadi2 vadi2 commented Jul 22, 2019

Brief overview of PR changes/additions

This makes all emoji's that appear in Mudlet be shown in colour.

It does not attempt to or fix the case of emojis's/text overlapping each other times.

image

Motivation for adding to Mudlet

Black and white emoji's aren't modern anymore, and we're a modern client.

Other info (issues closed, discussion etc)

Credit to https://www.google.com/get/noto/help/emoji/ for the graphics.

@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Jul 22, 2019

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Jul 22, 2019

Yep doesn't always look amazing but the spacing is another thing to deal with later, so we shouldn't announce that we support emoji's. Build it piece by piece instead.

image

@vadi2 vadi2 marked this pull request as ready for review July 22, 2019 13:39
@vadi2 vadi2 requested a review from a team as a code owner July 22, 2019 13:39
@vadi2 vadi2 requested review from a team July 22, 2019 13:39
@SlySven
Copy link
Copy Markdown
Member

SlySven commented Jul 22, 2019

I think the licence is compatible with the GPL (see https://www.gnu.org/licenses/license-list.html#SILOFL) but to comply with licence term number 2 we need to include the SIL text in the "About Mudlet" dialog if the INCLUDE_FONTS is #defined - I am just rolling a PR against your Repo that will add it {the text is very similar to the ubuntu Font License - and is needed in exactly the same situation}:

Screenshot_20190722_220733

@SlySven
Copy link
Copy Markdown
Member

SlySven commented Jul 22, 2019

Okay it is waiting for you at vadi2#14 .

@SlySven SlySven added the Waiting for other PR Merge This PR is awaiting another PR to merge firstly. label Jul 22, 2019
Copy link
Copy Markdown
Member

@SlySven SlySven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I support this - but it needs the licence adding in...

The text is quite similar to the Ubuntu Font licence as it happens and it
is now needed under exactly the same situation (when `INCLUDE_FONTS` is
`#define`d during compilation...

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Jul 23, 2019

Added, thank you.

@vadi2 vadi2 removed the Waiting for other PR Merge This PR is awaiting another PR to merge firstly. label Jul 23, 2019
@vadi2 vadi2 assigned SlySven and unassigned vadi2 Jul 23, 2019
@SlySven
Copy link
Copy Markdown
Member

SlySven commented Jul 23, 2019

One thought - does this work on ALL three main platforms? I'd heard some rumours that it might not work on some Windows flavours - whilst the latest Win 🔟 version works it might not for some older flavours. I will have to give it a spin on my Win 7️⃣ PC...

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Jul 24, 2019

Does not seem to work in Windows 7, but I guess this is a Windows problem... it works in Win 10.

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Jul 24, 2019

So, it's better than nothing for Linux and Windows 10.

@maiyannah
Copy link
Copy Markdown

On Windows 7, it just renders black and white emojii most of the time, so I wouldn't call it a complete failure.

@SlySven
Copy link
Copy Markdown
Member

SlySven commented Jul 24, 2019

Does not seem to work in Windows 7, but I guess this is a Windows problem... it works in Win 10.

That was my expectation - M$ had their own candidate for a means to do coloured font support but it is not the default that the w3 group choose - see googlefonts/noto-emoji#43 .

Something about this improved with a particular version of Windows 10 - but everything thing before that is problematic I understand...

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Jul 25, 2019

Anything outstanding to finish the PR?

@maiyannah
Copy link
Copy Markdown

My life will not be complete until my emojii eggplant is purple. Do we actually know what causes Win 7 to not work? Is it something we can fix? I don't know knees from elbows when it comes to the emojii handling, but I can test whatever you want me to.

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Jul 25, 2019

googlefonts/noto-emoji#43 (comment)

Yes Windows 7 doesn't think it's a valid font, Windows 10 has it fixed. Windows 7 from the looks of it wants an SVG-based font instead - which would be a performance killer; colour emojis already are a really big hit already.

@SlySven
Copy link
Copy Markdown
Member

SlySven commented Jul 25, 2019

@maiyannah ℹ️ As I understand it only the latest (? though by now it might not be the latest) Windows 10 update supports colour fonts using the somewhat heavy-weight but agreed W3 standard for them - previous versions of Windows (7, 8, 8.1 and prior 10s) only supported M$s own proposed standard (which is somewhat lighter but only used by M$, and was only one of four proposals put forward)...

... and be careful who you send your purple egg-plant to: in the UK "eggplant" is just another name for an aubergine but I understand that over the other side of the pond it has a much more outstanding meaning! 😮

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Jul 25, 2019

So, this good to go?

@maiyannah
Copy link
Copy Markdown

Wow, they expect people to use SVGs in place of fonts? I can't imagine why that didn't get adopted.

I was just wondering if there was something we could do so we aren't missing Windows 7 with this, but it doesn't look like there is anything reasonable we can do.

@SlySven
Copy link
Copy Markdown
Member

SlySven commented Jul 28, 2019

👎 Its a bummer but I can't currently get noto colour emojis to work on Mudlet in FreeBSD either...

BTW Here is a relevant blog from M$ about the addition to Windows 🔟 :
https://blogs.windows.com/windowsdeveloper/2017/06/06/using-color-fonts-beautiful-text-icons/

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Jul 28, 2019

Let's enable this for cases where it works then, Linux & modern Windows? macOS already works with this out of the box.

Copy link
Copy Markdown
Contributor

@Kebap Kebap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes seem reasonable. Let's do this, as long as it doesn't worsen state or even crash on unsupported OS...

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Jul 29, 2019

It should be fine as far as I know, @maiyannah didn't mention anything being worse off either... but if there is hopefully we catch it in the 5 day test period!

@SlySven SlySven mentioned this pull request Jul 29, 2019
@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Jul 30, 2019

Today is the freeze date for new features, and I don't see any big objections from you @SlySven anymore. I'll dismiss your changes requested review about including the license; that is already in - just so we can get this in 4.0.

@vadi2 vadi2 dismissed SlySven’s stale review July 30, 2019 03:59

Font license is now included

@vadi2 vadi2 merged commit d153faf into Mudlet:development Jul 30, 2019
@vadi2 vadi2 deleted the colourize-emojis branch July 30, 2019 03:59
SlySven added a commit to SlySven/Mudlet that referenced this pull request Jan 15, 2020
This is needed because forcing the use of "Noto Color Emoji" on all
versions of all OSes is just no good:

Even the latest version (September 2019) of Windows 10 cannot load it for
use generally. Also versions of Windows prior to 8.1 are (unless, it is
suggested, they have MS Office 2016 installed) incapable of displaying ANY
color emoji characters.

Also, before a particular version of font-config - I *think* it is 2.11.94
things are broken and color emojis from the Noto Color Emoji font (at
least) end up being - I discovered - being miscaled so that they were
grossly oversized. Unfortunately there are some current Linux
distributions, including Devuan 2.0 ("ASCII") that use an older version
than this.

I am not sure that FreeBSD can do color emojis but that might just be a
configuration issue on my end.

So this PR is designed to allow the font used as a substitute to provide
emojis to be selected from several specific options - and to try to select
a reasonable default for each OS/Version. As well as providing a "None"
option - which reverts Mudlet's behaviour back to that before Vadim
introduced the support for color emojis in Mudlet#2835 .

As a fall-back to provide the SAME (currently only BW) Emojis for ALL cases
I have included the CC BY-SA 4.0 licenced font called:
[OpenMoji](https://www.openmoji.org/).
This includes support for Unicode 12.1 (Noto Color Emoji is only up to 11.0
even with the update I have included in this PR).

This PR deals only with fonts used in the following locations:
* Main Profile Console
* Dockable/Floating User Windows
* Sub-Console

Further PRs will be provided to address other areas where we might
reasonably expect color emoji characters to apply.  Note that this setting
has to be applied to the whole Mudlet application at a time as the Qt
facilities act on modifying the underlying application's font database - so
when you change the substitution for, say "DejaVu Sans" then whenever a
copy of that font is created for use in a widget then the changes will take
affect in that and all later uses - but it won't change any previous
instances of that font in other widgets. It also means that there are
distinct differences between passing references to `QFont`s and just
passing a *name* of a font. This is wht I have changed the name of:
`(bool) TConsole::setMiniConsoleFont(const QString&)`
to:
`(bool) TConsole::setMiniConsoleFontName(const QString&)` !

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants