xref: /aosp_15_r20/external/skia/site/docs/dev/testing/fonts.md (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1
2---
3title: "Fonts and GM Tests"
4linkTitle: "Fonts and GM Tests"
5
6---
7
8
9Overview
10--------
11
12Each test in the gm directory draws a reference image. Their primary purpose is
13to detect when images change unexpectedly, indicating that a rendering bug has
14been introduced.
15
16The gm tests have a secondary purpose: they detect when rendering is different
17across platforms and configurations.
18
19GM font selection
20-----------------
21
22Each gm specifies the typeface to use when drawing text. To create a portable
23typeface, use:
24
25~~~~
26SkTypeface* typeface = ToolUtils::CreatePortableTypeface(const char* name,
27SkFontStyle style);
28~~~~
29
30