-
Notifications
You must be signed in to change notification settings - Fork 310
text: Apply "Source Sans 3" and (on Android) "Noto Color Emoji" widely across the app #439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
117670a
text [nfc]: Pull out kDefaultFontFamily constant
chrisbobbe 51eaddd
text: On Android, render emojis in message content with Noto Color Emoji
chrisbobbe f47ce05
content [nfc]: Use kBaseFontSize in a place we were using literal value
chrisbobbe cdc2688
text: Use more efficient MediaQuery.boldTextOf in weightVariableTextS…
chrisbobbe 806a3c3
text [nfc]: Take out helper constants kWght{Min,Max}
chrisbobbe bff2071
text test [nfc]: Reorder some lines to be like surrounding code
chrisbobbe 139fc34
text [nfc]: Don't force any callers to specify wghtIfPlatformRequests…
chrisbobbe 8567fdb
text [nfc]: In dev, add `debugLabel` to result of weightVariableTextS…
chrisbobbe 16d925f
text: Use font-family constants for text built on Typography styles
chrisbobbe 6784ef9
text [nfc]: Remove some now-redundant fontFamily{,Fallback} attributes
chrisbobbe 97afdcd
content [nfc]: Make paragraph text style `const`
chrisbobbe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -449,11 +449,15 @@ class MarkAsReadWidget extends StatelessWidget { | |
style: FilledButton.styleFrom( | ||
backgroundColor: _UnreadMarker.color, | ||
minimumSize: const Size.fromHeight(38), | ||
textStyle: const TextStyle( | ||
fontFamily: 'Source Sans 3', | ||
fontSize: 18, | ||
height: (23 / 18), | ||
).merge(weightVariableTextStyle(context)), | ||
textStyle: | ||
// Restate [FilledButton]'s default, which inherits from | ||
// [zulipTypography]… | ||
Theme.of(context).textTheme.labelLarge! | ||
// …then clobber some attributes to follow Figma: | ||
.merge(const TextStyle( | ||
fontSize: 18, | ||
height: (23 / 18)) | ||
.merge(weightVariableTextStyle(context, wght: 400))), | ||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(7)), | ||
), | ||
onPressed: () => _handlePress(context), | ||
|
@@ -631,11 +635,10 @@ class StreamMessageRecipientHeader extends StatelessWidget { | |
} | ||
final textStyle = TextStyle( | ||
color: contrastingColor, | ||
fontFamily: 'Source Sans 3', | ||
fontSize: 16, | ||
letterSpacing: 0.02 * 16, | ||
height: (18 / 16), | ||
).merge(weightVariableTextStyle(context, wght: 600, wghtIfPlatformRequestsBold: 900)); | ||
).merge(weightVariableTextStyle(context, wght: 600)); | ||
Comment on lines
-634
to
+641
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happy to see these repetitive elements getting centralized! I'd actually had the thought in the last couple of weeks that I should take a look at trying to deduplicate some of the recurring code around our text styles. This PR looks like great progress already in that direction. |
||
|
||
final Widget streamWidget; | ||
if (!showStream) { | ||
|
@@ -742,11 +745,10 @@ class DmRecipientHeader extends StatelessWidget { | |
Expanded( | ||
child: Text(title, | ||
style: const TextStyle( | ||
fontFamily: 'Source Sans 3', | ||
fontSize: 16, | ||
letterSpacing: 0.02 * 16, | ||
height: (18 / 16), | ||
).merge(weightVariableTextStyle(context, wght: 600, wghtIfPlatformRequestsBold: 900)), | ||
).merge(weightVariableTextStyle(context, wght: 600)), | ||
overflow: TextOverflow.ellipsis)), | ||
RecipientHeaderDate(message: message, | ||
color: _kDmRecipientHeaderDateColor), | ||
|
@@ -801,13 +803,12 @@ class DateText extends StatelessWidget { | |
return Text( | ||
style: TextStyle( | ||
color: color, | ||
fontFamily: 'Source Sans 3', | ||
fontSize: fontSize, | ||
height: height, | ||
// This is equivalent to css `all-small-caps`, see: | ||
// https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-caps#all-small-caps | ||
fontFeatures: const [FontFeature.enable('c2sc'), FontFeature.enable('smcp')], | ||
).merge(weightVariableTextStyle(context)), | ||
), | ||
formatHeaderDate( | ||
zulipLocalizations, | ||
DateTime.fromMillisecondsSinceEpoch(timestamp * 1000), | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm interesting. I guess this will be a case to consider when thinking about how we ultimately want to arrange the data flow for the text styles.