@@ -1621,23 +1621,36 @@ namespace flutter {
1621
1621
std::vector<sk_sp<SkTypeface>> GetTestFontData () {
1622
1622
std::vector<sk_sp<SkTypeface>> typefaces;
1623
1623
#if EMBED_TEST_FONT_DATA
1624
- typefaces.push_back (SkTypeface::MakeFromStream (
1625
- SkMemoryStream::MakeDirect (kFlutterTestFont , kFlutterTestFontLength )));
1626
- typefaces.push_back (SkTypeface::MakeFromStream (
1627
- SkMemoryStream::MakeDirect (kAhemFont , kAhemFontLength )));
1624
+ const bool defaultsToAhem =
1625
+ std::getenv (" FLUTTER_ROOT" ) && !std::getenv (" USE_FLUTTER_TEST_FONT" );
1626
+ if (defaultsToAhem) {
1627
+ typefaces.push_back (SkTypeface::MakeFromStream (
1628
+ SkMemoryStream::MakeDirect (kAhemFont , kAhemFontLength )));
1629
+ typefaces.push_back (SkTypeface::MakeFromStream (
1630
+ SkMemoryStream::MakeDirect (kFlutterTestFont , kFlutterTestFontLength )));
1631
+ } else {
1632
+ typefaces.push_back (SkTypeface::MakeFromStream (
1633
+ SkMemoryStream::MakeDirect (kFlutterTestFont , kFlutterTestFontLength )));
1634
+ typefaces.push_back (SkTypeface::MakeFromStream (
1635
+ SkMemoryStream::MakeDirect (kAhemFont , kAhemFontLength )));
1636
+ }
1628
1637
typefaces.push_back (SkTypeface::MakeFromStream (
1629
1638
SkMemoryStream::MakeDirect (kCoughFont , kCoughFontLength )));
1630
1639
#endif // EMBED_TEST_FONT_DATA
1631
1640
return typefaces;
1632
1641
}
1633
1642
1634
1643
std::vector<std::string> GetTestFontFamilyNames () {
1635
- #if EMBED_TEST_FONT_DATA
1636
- std::vector<std::string> names = {" FlutterTest" , " Ahem" , " Cough" };
1637
- #else // EMBED_TEST_FONT_DATA
1638
1644
std::vector<std::string> names;
1645
+ #if EMBED_TEST_FONT_DATA
1646
+ const bool defaultsToAhem =
1647
+ std::getenv (" FLUTTER_ROOT" ) && !std::getenv (" USE_FLUTTER_TEST_FONT" );
1648
+ if (defaultsToAhem) {
1649
+ names = {" Ahem" , " FlutterTest" , " Cough" };
1650
+ } else {
1651
+ names = {" FlutterTest" , " Ahem" , " Cough" };
1652
+ }
1639
1653
#endif // EMBED_TEST_FONT_DATA
1640
1654
return names;
1641
1655
}
1642
-
1643
1656
} // namespace flutter
0 commit comments