Skip to content

Commit

Permalink
emoji: Use "Apple Color Emoji" font on iOS/macOS for UnicodeEmojiWidget
Browse files Browse the repository at this point in the history
Some unicode characters, like U+2764 (❤) or U+00AE (®) can
have glyphs in non-Emoji fonts, resulting in incorrect
rendering of such characters, where we specifically want an
emoji to be displayed.

So, explicitly mention "Apple Color Emoji" to be the font used on
iOS/macOS for displaying the unicode emoji.
  • Loading branch information
rajveermalviya committed Dec 4, 2024
1 parent 904067c commit 7dba11f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/widgets/emoji.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ class UnicodeEmojiWidget extends StatelessWidget {
SizedBox(height: boxSize, width: boxSize),
PositionedDirectional(start: 0, child: Text(
textScaler: textScaler,
style: TextStyle(fontSize: size),
style: TextStyle(
fontFamily: 'Apple Color Emoji',
fontSize: size),
strutStyle: StrutStyle(fontSize: size, forceStrutHeight: true),
emojiDisplay.emojiUnicode)),
]);
Expand Down

0 comments on commit 7dba11f

Please sign in to comment.