Satellite-im / Uplink-Backlog

Place to park issues that we want to track but aren't active/higher priority. Some times will be moved here/feel free to add tickets that can easily be moved to the active project
0 stars 0 forks source link

bug(emojis): fix windows emojis using a font #45

Closed tooshel closed 1 year ago

tooshel commented 1 year ago

We tried a few things to handle the emoji problem on Windows and in the end settled on using a font!

https://fonts.google.com/noto/specimen/Noto+Color+Emoji/glyphs

That's an example of all the emojis we use all in a font. It's basically the same emoji's as android. Jeff made a prototype and he's working through the details as I make this ticket!

Related to Satellite-im/Uplink#699

InfamousVague commented 1 year ago

I think the best way (from my current knowledge) is for us to determine a list of the emoji that will not display on a given OS and create a blacklist to filter out unsupported emojis, myabe something like

pub enum UnsupportedEmoji {
    Windows(Vec<&str>),
    MacOS(Vec<&str>),
    ...
}

Then we can filter the result from the emoji lib by this list using OS flags so we don't send unsupported emoji's to the picker.

Jekrimo commented 1 year ago

I think the best way (from my current knowledge) is for us to determine a list of the emoji that will not display on a given OS and create a blacklist to filter out unsupported emojis, myabe something like

pub enum UnsupportedEmoji {
    Windows(Vec<&str>),
    MacOS(Vec<&str>),
    ...
}

Then we can filter the result from the emoji lib by this list using OS flags so we don't send unsupported emoji's to the picker.

Would you stop Mac users from seeing unsupported windows emoji so that they can't send those unsupported emoji? This way we don't have to filter in messages if a weird unicode comes through, or, should we ignore in messages like some other places do?

Fairly certain I had this in place minus a few outlier emoji that didn't align with the versions, (and I remember flags being effected but can remember specifics). Been a minute but I can get it back to where it was and discuss then if you want? Then we can all go to casabonita and party

edit: here is the block of code I currently have for filtering windows if helpful...

let emojis_to_display: Vec<(Group, Vec<&Emoji>)> = emojis::Group::iter() .map(|group| { let filtered_emojis: Vec<&Emoji> = group .emojis() .filter(|emoji| { !(cfg!(target_os = "windows") && emoji.unicode_version().major() >= 14) }) .collect(); (group, filtered_emojis) }) .filter(|(_, emojis)| !emojis.is_empty()) .collect();

tooshel commented 1 year ago

Problems with the font and convering to svgs to use them (or something . . . ask Jeff for details) so this is going in the backlog and we will make a new ticket to say "find a solution to emoji's for windows users".