Skip to content

Improve: update bundled NotoColorEmoji font#5507

Merged
SlySven merged 2 commits intoMudlet:developmentfrom
SlySven:Improve_update_NotoColorEmoji_font
Oct 13, 2021
Merged

Improve: update bundled NotoColorEmoji font#5507
SlySven merged 2 commits intoMudlet:developmentfrom
SlySven:Improve_update_NotoColorEmoji_font

Conversation

@SlySven
Copy link
Copy Markdown
Member

@SlySven SlySven commented Oct 12, 2021

This is for LINUX only!

This pulls in changes for Unicode 13.1. It also will remove older versions of the font that prior versions of Mudlet will place in its own bit of the file-system so that the FontManager class will not try to load more than one instance of a font with an identical "family name" (which it will not IIRC).

Signed-off-by: Stephen Lyons slysven@virginmedia.com

Release post highlight

Update of the bundled copy of Note Color Emoji (used by Linux only builds of Mudlet) to version 2.028 (supporting Unicode 13.1) - this release also removes any older versions that prior release of Mudlet drop into the fonts folder within the files that Mudlet keeps locally. This should help to avoid complications that having multiple versions of fonts with the same "family name" might cause.

### This is for LINUX only!

This pulls in changes for Unicode 13.1. It also will remove older versions
of the font that prior versions of Mudlet will place in its own bit of the
file-system so that the FontManager class will not try to load more than
one instance of a font with an identical "family name" (which it will not
IIRC).

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven requested a review from a team as a code owner October 12, 2021 00:03
@SlySven SlySven requested a review from a team October 12, 2021 00:03
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Oct 12, 2021

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 12, 2021

Messages
✔️

PR type: Improvement

Generated by 🚫 dangerJS against 928185c

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

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

Italian Linux users rejoice @wiploo

image

src/main.cpp Outdated
Comment on lines +370 to +388
// Identify old versions so that we can remove them and later on only try
// to load the latest (otherwise, as they all have the same family name
// only the first one found will be loaded by the FontManager class):
QStringList oldNotoFontDirectories;
oldNotoFontDirectories << QStringLiteral("%1/notocoloremoji-unhinted-2018-04-24-pistol-update").arg(mudlet::getMudletPath(mudlet::mainFontsPath));
oldNotoFontDirectories << QStringLiteral("%1/noto-color-emoji-2019-11-19-unicode12").arg(mudlet::getMudletPath(mudlet::mainFontsPath));

QStringListIterator itOldNotoFontDirectory(oldNotoFontDirectories);
while (itOldNotoFontDirectory.hasNext()) {
auto oldNotoFontDirectory = itOldNotoFontDirectory.next();
QDir oldDir{oldNotoFontDirectory};
if (oldDir.exists()) {
// This can fail but we do not worry about that too much, as long
// as it nukes any "NotoColorEmoji.ttf" files:
if (!oldDir.removeRecursively()) {
qDebug().nospace().noquote() << "main() INFO - failed to remove old Noto Color Emoji font located at: " << oldDir.absolutePath();
}
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mind pulling this out into a method of its own?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not really - it is also part of the update because if Mudlet loads an older version I do not believe it will automatically replace it as an "application font" with the newer one - and if it DID then there is every reason to believe that the reverse would also be true, i..e if it did load the latest one first and then replaced it with the older one...!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't follow - right now it's part of the main() method but since it's logical piece of code on its own, it should be a small function.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sorry, I misread method() as PR! 🤦‍♂️

@vadi2 vadi2 assigned SlySven and unassigned vadi2 Oct 12, 2021
…ction

Requested in peer review.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven merged commit e78ccb3 into Mudlet:development Oct 13, 2021
@SlySven SlySven deleted the Improve_update_NotoColorEmoji_font branch October 13, 2021 21:21
@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Apr 9, 2022

I'm looking to do a similar update for Unicode 14, I'm stumped - the release on https://github.com/googlefonts/noto-emoji/releases/tag/v2.028 looks nothing like the release you've included here. Where did you get this release of noto-color-emoji from? Or did you trim the official release and included it here?

vadi2 added a commit that referenced this pull request Apr 11, 2022
#### Brief overview of PR changes/additions
Update Noto Color Emoji to the v2.034 release which supports Unicode 14.
#### Motivation for adding to Mudlet
So we can get these new emojis on Linux: https://emojipedia.org/unicode-14.0
### Other info
See #5507 which previously updated this to Unicode 13.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants