-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Closed
flutter/engine
#7287Labels
a: typographyText rendering, possibly libtxtText rendering, possibly libtxtengineflutter/engine repository. See also e: labels.flutter/engine repository. See also e: labels.
Description
I want to add a background to text, here is my code:
RichText(
text: TextSpan(
text: "不科学1111",
style: TextStyle(
color: Colors.black,
background: new Paint()..color = Colors.pinkAccent,
),
children: [
TextSpan(
text: "不科学sdfsdfkd",
style: TextStyle(
color: Colors.lightGreenAccent,
background: new Paint()
..color = Colors.pinkAccent,
),
),
]),
),
But the Simplified Chinese words do not display:
If I set the background color with opacity, it seems well:
RichText(
text: TextSpan(
text: "不科学1111",
style: TextStyle(
color: Colors.black,
background: new Paint()..color = Colors.pinkAccent.withOpacity(0.5),
),
children: [
TextSpan(
text: "不科学sdfsdfkd",
style: TextStyle(
color: Colors.lightGreenAccent,
background: new Paint()
..color = Colors.pinkAccent,
),
),
]),
)
But it still doesn't meet my expectation:
I have added app locales supports like this:
supportedLocales: [
const Locale('zh', 'CH'),
const Locale('en', 'US'),
],
Still doesn't work.
nagoya0 and Andrwyw
Metadata
Metadata
Assignees
Labels
a: typographyText rendering, possibly libtxtText rendering, possibly libtxtengineflutter/engine repository. See also e: labels.flutter/engine repository. See also e: labels.