@@ -1621,23 +1621,36 @@ 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 =
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+ }
16281637 typefaces.push_back (SkTypeface::MakeFromStream (
16291638 SkMemoryStream::MakeDirect (kCoughFont , kCoughFontLength )));
16301639#endif // EMBED_TEST_FONT_DATA
16311640 return typefaces;
16321641}
16331642
16341643std::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
16381644 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 = {" FlutterTest" , " Ahem" , " Cough" };
1650+ } else {
1651+ names = {" FlutterTest" , " Ahem" , " Cough" };
1652+ }
16391653#endif // EMBED_TEST_FONT_DATA
16401654 return names;
16411655}
1642-
16431656} // namespace flutter
0 commit comments