mdube
Topic Author
Posts: 12
Joined: 23 Aug 2019, 12:14

Emoji on android

26 Aug 2020, 04:58

Hi,

I'm trying to have emoji rendered by setting 'TwemojiMozilla.ttf' as a fallback font. On Windows I get the proper result. The font is loaded and used when needed. On android, I always get the crossed box placeholder. Is there any current known issue regarding emoji fonts on android?

I'm using Noesis 3.0.4

Thanks
 
User avatar
sfernandez
Site Admin
Posts: 1933
Joined: 22 Dec 2011, 19:20

Re: Emoji on android

26 Aug 2020, 11:24

Hi, I just downloaded 'TwemojiMozilla.ttf' from https://github.com/mozilla/twemoji-colr/releases and place it next to the following xaml:
<Grid
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <TextBlock Text="Hello World 😀 👍 💻" FontFamily="./#PT Root UI, ./#Twemoji Mozilla" FontSize="30"
    HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
And it correctly shows emojis on Android.

Is that what you tried?
 
mdube
Topic Author
Posts: 12
Joined: 23 Aug 2019, 12:14

Re: Emoji on android

26 Aug 2020, 15:01

This is what I have, I'll try your code.
<TextBlock Foreground="White" FontSize="16" FontFamily="Twemoji Mozilla" HorizontalAlignment="Center" VerticalAlignment="Bottom">😀</TextBlock>
I'm not seeing any log message, on android, about Noesis loading the Twemoji font, while on windows I get this log:
[NOESIS/I] 'Twemoji Mozilla Regular' loaded
so it looks as if Noesis is not even trying to load the font.
 
mdube
Topic Author
Posts: 12
Joined: 23 Aug 2019, 12:14

Re: Emoji on android

26 Aug 2020, 15:33

Thanks, I got it to work and it seems the magic is in the #. By prefixing with # it now works both on android and windows, either inline or with GUI::SetFontFallbacks, without #, thats a no go on android. Now, time to get myself educated on that #. Thanks for the help.
 
User avatar
jsantos
Site Admin
Posts: 2921
Joined: 20 Jan 2012, 17:18
Contact:

Re: Emoji on android

26 Aug 2020, 15:48

Without the '#' it means system font. You probably have the font installed on your windows machine, more information here.

We don't emit warning for system fonts because it is common to have a big list of fallback system fonts.

Who is online

Users browsing this forum: No registered users and 6 guests