-
Notifications
You must be signed in to change notification settings - Fork 353
content: Fix **bold code** rendering with regular weight
#501
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
Conversation
|
If #439 is merged first, I should update the commit message for content: Fix because at that point the needed |
This comment was marked as resolved.
This comment was marked as resolved.
30cbd05 to
26fa0f8
Compare
This comment was marked as resolved.
This comment was marked as resolved.
gnprice
left a comment
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.
Thanks! One small comment below; otherwise LGTM.
|
|
||
| InlineSpan build() { | ||
| InlineSpan build(BuildContext context) { | ||
| _context = context; |
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.
| _context = context; | |
| assert(_context == null); | |
| _context = context; |
|
(Plus this, I guess:)
|
Our experience with variable-weight fonts is that, whenever we use
such a font, we need to specify a "wght" value, even if we want the
text to appear in the boring, regular weight. If we don't specify a
"wght", the text will appear in an extremely light weight.
We use a variable-weight font (Source Code Pro) for rendering inline
code spans, so that's why we were using weightVariableTextStyle
here. As an unfortunate result, when a code span appears inside a
bold ("strong") span, the outer span's bold-weight style has been
getting clobbered, and the code span appears in regular weight.
Fortunately, removing the `weightVariableTextStyle` from the inline
code style doesn't actually cause any inline spans to appear at
minimum weight. This is a relief, and it follows from the presence
of a `weightVariableTextStyle` applied widely across the app; see
zulipTypography and 6784ef9. We apply it widely across the app
because we apply Source Sans 3 widely across the app, and that is
also a variable-weight font. Moreover, Source Code Pro and Source
Sans 3 seem closely related (and were designed by the same person),
so it's likely that their "wght" axes are identical.
Fixes: zulip#498
26fa0f8 to
4c0c6cd
Compare
|
Thanks for the review! Revision pushed. |
|
Thanks! Looks good; merging. |
Also format
**bold text**using weightVariableTextStyle, fixing #499, and update a comment to point to #500.Fixes: #498
Fixes: #499