Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
dcf42ada
Unverified
Commit
dcf42ada
authored
Sep 07, 2022
by
Jason Simmons
Committed by
GitHub
Sep 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use raw fontFamilyFallback values without packages when constructing a merged TextStyle (#110887)
parent
c5890f0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
text_style.dart
packages/flutter/lib/src/painting/text_style.dart
+4
-4
text_style_test.dart
packages/flutter/test/painting/text_style_test.dart
+17
-0
No files found.
packages/flutter/lib/src/painting/text_style.dart
View file @
dcf42ada
...
...
@@ -1059,7 +1059,7 @@ class TextStyle with Diagnosticable {
decorationThickness:
other
.
decorationThickness
,
debugLabel:
mergedDebugLabel
,
fontFamily:
other
.
_fontFamily
,
fontFamilyFallback:
other
.
fontFamilyFallback
,
fontFamilyFallback:
other
.
_
fontFamilyFallback
,
package:
other
.
_package
,
overflow:
other
.
overflow
,
);
...
...
@@ -1116,7 +1116,7 @@ class TextStyle with Diagnosticable {
decorationThickness:
t
<
0.5
?
null
:
b
.
decorationThickness
,
debugLabel:
lerpDebugLabel
,
fontFamily:
t
<
0.5
?
null
:
b
.
_fontFamily
,
fontFamilyFallback:
t
<
0.5
?
null
:
b
.
fontFamilyFallback
,
fontFamilyFallback:
t
<
0.5
?
null
:
b
.
_
fontFamilyFallback
,
package:
t
<
0.5
?
null
:
b
.
_package
,
overflow:
t
<
0.5
?
null
:
b
.
overflow
,
);
...
...
@@ -1147,7 +1147,7 @@ class TextStyle with Diagnosticable {
decorationThickness:
t
<
0.5
?
a
.
decorationThickness
:
null
,
debugLabel:
lerpDebugLabel
,
fontFamily:
t
<
0.5
?
a
.
_fontFamily
:
null
,
fontFamilyFallback:
t
<
0.5
?
a
.
fontFamilyFallback
:
null
,
fontFamilyFallback:
t
<
0.5
?
a
.
_
fontFamilyFallback
:
null
,
package:
t
<
0.5
?
a
.
_package
:
null
,
overflow:
t
<
0.5
?
a
.
overflow
:
null
,
);
...
...
@@ -1185,7 +1185,7 @@ class TextStyle with Diagnosticable {
decorationThickness:
ui
.
lerpDouble
(
a
.
decorationThickness
??
b
.
decorationThickness
,
b
.
decorationThickness
??
a
.
decorationThickness
,
t
),
debugLabel:
lerpDebugLabel
,
fontFamily:
t
<
0.5
?
a
.
_fontFamily
:
b
.
_fontFamily
,
fontFamilyFallback:
t
<
0.5
?
a
.
fontFamilyFallback
:
b
.
fontFamilyFallback
,
fontFamilyFallback:
t
<
0.5
?
a
.
_fontFamilyFallback
:
b
.
_
fontFamilyFallback
,
package:
t
<
0.5
?
a
.
_package
:
b
.
_package
,
overflow:
t
<
0.5
?
a
.
overflow
:
b
.
overflow
,
);
...
...
packages/flutter/test/painting/text_style_test.dart
View file @
dcf42ada
...
...
@@ -304,6 +304,23 @@ void main() {
expect
(
s10
.
fontFamilyFallback
,
<
String
>[]);
});
test
(
'TextStyle package font merge'
,
()
{
const
TextStyle
s1
=
TextStyle
(
package:
'p'
,
fontFamily:
'font1'
,
fontFamilyFallback:
<
String
>[
'fallback1'
]);
const
TextStyle
s2
=
TextStyle
(
package:
'p'
,
fontFamily:
'font2'
,
fontFamilyFallback:
<
String
>[
'fallback2'
]);
final
TextStyle
emptyMerge
=
const
TextStyle
().
merge
(
s1
);
expect
(
emptyMerge
.
fontFamily
,
'packages/p/font1'
);
expect
(
emptyMerge
.
fontFamilyFallback
,
<
String
>[
'packages/p/fallback1'
]);
final
TextStyle
lerp1
=
TextStyle
.
lerp
(
s1
,
s2
,
0
)!;
expect
(
lerp1
.
fontFamily
,
'packages/p/font1'
);
expect
(
lerp1
.
fontFamilyFallback
,
<
String
>[
'packages/p/fallback1'
]);
final
TextStyle
lerp2
=
TextStyle
.
lerp
(
s1
,
s2
,
1.0
)!;
expect
(
lerp2
.
fontFamily
,
'packages/p/font2'
);
expect
(
lerp2
.
fontFamilyFallback
,
<
String
>[
'packages/p/fallback2'
]);
});
test
(
'TextStyle font family fallback'
,
()
{
const
TextStyle
s1
=
TextStyle
(
fontFamilyFallback:
<
String
>[
'Roboto'
,
'test'
]);
expect
(
s1
.
fontFamilyFallback
![
0
],
'Roboto'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment