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