3 title: "Fonts and GM Tests"
4 linkTitle: "Fonts and GM Tests"
12 Each test in the gm directory draws a reference image. Their primary purpose is
13 to detect when images change unexpectedly, indicating that a rendering bug has
16 The gm tests have a secondary purpose: they detect when rendering is different
17 across platforms and configurations.
22 Each gm specifies the typeface to use when drawing text. For now, to set the
23 portable typeface on the paint, call:
26 ToolUtils::set_portable_typeface(SkPaint* , const char* name = nullptr,
27 SkFontStyle style = SkFontStyle());
30 To create a portable typeface, use:
33 SkTypeface* typeface = ToolUtils::create_portable_typeface(const char* name,
37 Eventually, both `set_portable_typeface()` and `create_portable_typeface()` will be
38 removed. Instead, a test-wide `SkFontMgr` will be selected to choose portable
39 fonts or resource fonts.