1 Fonts and GM Tests 2 ================== 3 4 Overview 5 -------- 6 7 Each test in the gm directory draws a reference image. Their primary purpose is 8 to detect when images change unexpectedly, indicating that a rendering bug has 9 been introduced. 10 11 The gm tests have a secondary purpose: they detect when rendering is different 12 across platforms and configurations. 13 14 GM font selection 15 ----------------- 16 17 Each gm specifies the typeface to use when drawing text. For now, to set the 18 portable typeface on the paint, call: 19 20 ~~~~ 21 sk_tool_utils::set_portable_typeface(SkPaint* , const char* name = nullptr, 22 SkFontStyle style = SkFontStyle()); 23 ~~~~ 24 25 To create a portable typeface, use: 26 27 ~~~~ 28 SkTypeface* typeface = sk_tool_utils::create_portable_typeface(const char* name, 29 SkFontStyle style); 30 ~~~~ 31 32 Eventually, both `set_portable_typeface()` and `create_portable_typeface()` will be 33 removed. Instead, a test-wide `SkFontMgr` will be selected to choose portable 34 fonts or resource fonts. 35