Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Emoji font #193

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/fonts/Twemoji.ttf
Binary file not shown.
3 changes: 2 additions & 1 deletion lib/widgets/theming/primary_accent_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class OBPrimaryAccentText extends StatelessWidget {
TextStyle themedTextStyle = TextStyle(
foreground: Paint()
..shader = themeValueParserService
.parseGradient(theme.primaryAccentColor).createShader(Rect.fromLTWH(0.0, 0.0, 200.0, 70.0)));
.parseGradient(theme.primaryAccentColor).createShader(Rect.fromLTWH(0.0, 0.0, 200.0, 70.0)),
fontFamilyFallback: ['NunitoSans', 'Emoji']);

if (finalStyle != null) {
finalStyle = finalStyle.merge(themedTextStyle);
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/theming/secondary_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class OBSecondaryText extends StatelessWidget {
TextStyle finalStyle = style;
TextStyle themedTextStyle = TextStyle(
color:
themeValueParserService.parseColor(theme.secondaryTextColor));
themeValueParserService.parseColor(theme.secondaryTextColor),
fontFamilyFallback: ['NunitoSans', 'Emoji']);

if (finalStyle != null) {
finalStyle = finalStyle.merge(themedTextStyle);
Expand Down
5 changes: 3 additions & 2 deletions lib/widgets/theming/smart_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ class OBSmartText extends StatelessWidget {
TextStyle textStyle = TextStyle(
color: primaryTextColor,
fontSize: fontSize,
fontFamilyFallback: ['NunitoSans']);
fontFamilyFallback: ['NunitoSans', 'Emoji']);

TextStyle secondaryTextStyle;

Expand All @@ -386,7 +386,7 @@ class OBSmartText extends StatelessWidget {
secondaryTextStyle = TextStyle(
color: secondaryTextColor,
fontSize: fontSize * 0.8,
fontFamilyFallback: ['NunitoSans']);
fontFamilyFallback: ['NunitoSans', 'Emoji']);
}

Color actionsForegroundColor = themeValueParserService
Expand All @@ -397,6 +397,7 @@ class OBSmartText extends StatelessWidget {
color: actionsForegroundColor,
fontSize: fontSize,
fontWeight: FontWeight.bold,
fontFamilyFallback: ['NunitoSans', 'Emoji'],
);

return RichText(
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/theming/text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class OBText extends StatelessWidget {

TextStyle themedTextStyle = TextStyle(
color: themeValueParserService.parseColor(theme.primaryTextColor),
fontFamilyFallback: ['NunitoSans'],
fontFamilyFallback: ['NunitoSans', 'Emoji'],
fontSize: (style != null && style.fontSize != null)
? style.fontSize
: fontSize);
Expand Down
5 changes: 5 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ flutter:
style: normal
- asset: assets/fonts/VisbyRoundCF-Bold.otf
style: italic
# Generic name to allow changing the emoji font later on
- family: Emoji
fonts:
- asset: assets/fonts/Twemoji.ttf
style: normal
- family: ''
fonts:
- asset: assets/fonts/NunitoSans-Regular.ttf
Expand Down