@@ -1621,23 +1621,34 @@ namespace flutter {
16211621std::vector<sk_sp<SkTypeface>> GetTestFontData () {
16221622 std::vector<sk_sp<SkTypeface>> typefaces;
16231623#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+ }
16281636 typefaces.push_back (SkTypeface::MakeFromStream (
16291637 SkMemoryStream::MakeDirect (kCoughFont , kCoughFontLength )));
16301638#endif // EMBED_TEST_FONT_DATA
16311639 return typefaces;
16321640}
16331641
16341642std::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
16381643 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+ }
16391651#endif // EMBED_TEST_FONT_DATA
16401652 return names;
16411653}
1642-
16431654} // namespace flutter
0 commit comments