Emoji.Wpf
adds Emoji rendering support to WPF applications.
TextBlock
and RichTextBox
, no additional
code required.c:/Windows/Fonts
.Emoji.Wpf.TextBlock
: an emoji-aware version of System.Windows.Controls.TextBlock
.Emoji.Wpf.RichTextBox
: an emoji-aware version of System.Windows.Controls.RichTextBox
.Emoji.Wpf.Picker
: an emoji pickerEmoji.Image.Source
: attach to either System.Windows.Controls.Image
control or
System.Windows.Media.DrawingImage
object in order to manipulate emoji imagesbool Emoji.Wpf.EmojiData.EnableSubPixelRendering
: enable subpixel rendering, defaults to false
bool Emoji.Wpf.EmojiData.EnableWindowsStyleFlags
: enable flag rendering, defaults to autodetectedHere is how to use Emoji.Wpf in your XAML:
<Window ...
xmlns:emoji="clr-namespace:Emoji.Wpf;assembly=Emoji.Wpf"
...>
<Window.Resources>
<DrawingImage x:Key="MyImageSource" emoji:Image.Source="π»"/>
</Window.Resources>
...
<emoji:RichTextBox FontSize="24" Margin="5"/>
...
<emoji:TextBlock FontSize="24" Text="Hello! πππ¨π±βππ©πΏβπ©π»βπ¦π½ lol"/>
...
<emoji:Picker FontSize="40"/>
...
<Image Source="{StaticResource MyImageSource}"/>
...
<Image emoji:Image.Source="π¦"/>
...
</Window>
More classes are to come, but feedback on what is needed is welcome.
I am not a very good WPF or even C# developer, but I think this could become a very useful and robust library if given enough care. Any help appreciated!
emoji:RichTextBox
emoji:RichTextBox
emoji:EmojiRendering
dependency property for FlowDocument
emoji:Picker
emoji:Image.Source
dependency property for Image
and DrawingImage
objects, allowing
to easily render emoji as iconsColonSyntax="True"
in emoji:RichTextBox
for replace-as-you-type: :koala:
becomes π¨ etc.emoji:RichTextBox.Text
is two-way bindable and binding defaults to LostFocus
IEmojiControl
interface for convenienceExtensionAttribute
being redefinedemoji:RichTextBox
emoji:RichTextBox
Picked
event in emoji:Picker
ColorBlend="True"
to enableemoji:TextBlock
; Blending="False"
to disableemoji:TextBlock
Emoji.Wpf renders emoji as vector images, using the WPF text rendering engine. The geometry information is found in the Segoe UI Emoji font glyphs. The colour information is found in the same font, using Microsoftβs COLR/CPAL format extensions.