Page 1 of 1

Emoticons

Posted: 08 Jan 2023, 06:20
by Coded
hello, I wanted to know if it is possible to make a TextBlock show emoji on the screen through the text like this: :( flip > 😕 ;D flip >😁 among others...

if possible do you have any example or doc? I did not find

Re: Emoticons

Posted: 10 Jan 2023, 15:09
by jsantos
Yes, COLR/CPAL fonts are supported. (ony v0 for now, but there are plans to support v1 gradients).
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
  <Viewbox>
    <Viewbox Height="600">
        <StackPanel TextElement.FontFamily="Fonts/#Twemoji Mozilla">
          <TextBlock FontSize="120" TextWrapping="Wrap">
              😀😁😂🤣😃😄😅😆😉
          </TextBlock>
        </StackPanel>
    </Viewbox>
  </Viewbox>
</Grid>

Re: Emoticons

Posted: 17 Jan 2023, 21:28
by Coded
I tried to use it that way but if the user writes the text containing :( :) :D among others it is not becoming an emoticon only when he pastes an emoticon from some site

Re: Emoticons

Posted: 18 Jan 2023, 11:18
by jsantos
You need to manually convert the ":)" to the corresponding emoji. I recommend extending our RichText class (source code is available in the SDK)