ulauncher-emoji icon indicating copy to clipboard operation
ulauncher-emoji copied to clipboard

Flag icons are broken

Open gornostal opened this issue 4 years ago • 21 comments

image Although flag emojies are copied correctly to the clipboard


The issue occurs with noto and blobs theme 👉 Workaround: Select a fallback theme different from noto and blobs

gornostal avatar Oct 03 '20 19:10 gornostal

@MyriaCore Any ideas where to look for a cause of this bug?

gornostal avatar Oct 03 '20 19:10 gornostal

Sorry for late reply. I'll start digging around

MyriaCore avatar Oct 12 '20 17:10 MyriaCore

No worries! And thanks for looking!

gornostal avatar Oct 12 '20 18:10 gornostal

image mine works, weird. I've done a ton of weird hacks to my stuff since tho, might have been something I changed. What emoji pack are u using?

MyriaCore avatar Oct 12 '20 18:10 MyriaCore

It appears to only affect noto and blobs:

With noto:

image

With blobs:

image

With apple:

image

MyriaCore avatar Oct 12 '20 18:10 MyriaCore

noto

After merging I did some minor refactoring, but I also tested tested with the version from your branch and I saw the same issue there.

gornostal avatar Oct 12 '20 18:10 gornostal

It appears to only affect noto and blobs:

Indeed.

gornostal avatar Oct 12 '20 18:10 gornostal

image

The icon entries for most of these flags are null in blobmoji / noto. Maybe a codepoint mismatch?

MyriaCore avatar Oct 12 '20 18:10 MyriaCore

Aah.. I had noto as a fallback theme too. Changing it helped.

So I guess it's not a bug then. I'm going to close it

gornostal avatar Oct 12 '20 18:10 gornostal

Or you think it is a bug and the flags should be there with noto?

gornostal avatar Oct 12 '20 18:10 gornostal

Yeah, I think so. I don't think these flags are new, so it's probably not an emoji 13 thing, right? AFAIK noto and blob should support full emoji 11 (or maybe 12).

MyriaCore avatar Oct 12 '20 18:10 MyriaCore

I think I agree. I also think that at this point you know much more about emojies than I do, so I'll trust your opinion. I haven't heard about noto or other emoji packs before your PR 😀

gornostal avatar Oct 12 '20 18:10 gornostal

This is the unicode.org listing for the lithuania flag. The listed codepoint is U+1F1F1 U+1F1F9.

Here's the function where we generate the URL to get the image:

https://github.com/Ulauncher/ulauncher-emoji/blob/d56b2c8106ab5fbc87b55f608a3bd75db23f2904/EmojiSpider.py#L68-L94

base for this codepoint should be "1f1f1-1f1f9", so it probably attempts to retrieve the URL here, which 404's.

MyriaCore avatar Oct 12 '20 18:10 MyriaCore

ah.. I see

gornostal avatar Oct 12 '20 18:10 gornostal

$ python -c 'print("🇱🇹".encode("unicode-escape"))'
b'\\U0001f1f1\\U0001f1f9'

So the codepoint seems correct. Maybe there's some schema that noto and blob is using that I didn't properly enforce.

MyriaCore avatar Oct 12 '20 18:10 MyriaCore

After looking at the makefile for the blobmoji project, I've determined that the schema for the flags is actually :

  • https://github.com/C1710/blobmoji/raw/master/third_party/region-flags/png/%s.png

... where %s is the BCP 47 country/region/subregion code. See the readme for the region-flags dir.

MyriaCore avatar Oct 12 '20 19:10 MyriaCore

Also in the readme for blobmoji:

Also note that the images in the font might differ from the original assets. In particular the flag images in the font are PNG images to which transforms have been applied to standardize the size and generate the wave and border shadow. We do not have SVG versions that reflect these transforms.

This explains why the flags are so detailed, and why they don't appear to have other non-country flags (like the trans flag or the pirate flag)

MyriaCore avatar Oct 12 '20 19:10 MyriaCore

There's a similar passage in the readme for noto emoji. This is kinda worrying.

@gornostal the way I see it, we have 3 options:

  1. Close the issue and cry. It looks like it'd be pretty difficult to add support for these emojis from this data source.
  2. Try to see if their makefile can be modified to maintain these transformations in image form.
  3. Find a different datasource for the noto and blob emoji set, like emojipedia. Related: #15
  • blobs: https://emojipedia.org/google/android-7.0/
  • noto: https://emojipedia.org/google/android-11.0/

MyriaCore avatar Oct 12 '20 19:10 MyriaCore

Wait NVM, I'm super wrong I think. I think that the flags are turned into emojis, since there's an unknown_flag_aliases file.

MyriaCore avatar Oct 12 '20 19:10 MyriaCore

It looks like the make the name for the flag emojis here. The names are reformatted in 04x hex.

Not sure why the normal URL of just:

https://github.com/C1710/blobmoji/raw/master/png/128/emoji_u1f1f1_1f1f9.png

doesn't work then.

MyriaCore avatar Oct 12 '20 19:10 MyriaCore

I think it's fine because there's a fallback theme. If it's set correctly the issue is gone. Thanks a lot for looking into this!

gornostal avatar Oct 13 '20 05:10 gornostal