Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / skia / site / docs / dev / testing / fonts.md
1
2 ---
3 title: "Fonts and GM Tests"
4 linkTitle: "Fonts and GM Tests"
5
6 ---
7
8
9 Overview
10 --------
11
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
14 been introduced.
15
16 The gm tests have a secondary purpose: they detect when rendering is different
17 across platforms and configurations.
18
19 GM font selection
20 -----------------
21
22 Each gm specifies the typeface to use when drawing text. For now, to set the
23 portable typeface on the paint, call:
24
25 ~~~~
26 ToolUtils::set_portable_typeface(SkPaint* , const char* name = nullptr,
27 SkFontStyle style = SkFontStyle());
28 ~~~~
29
30 To create a portable typeface, use:
31
32 ~~~~
33 SkTypeface* typeface = ToolUtils::create_portable_typeface(const char* name,
34 SkFontStyle style);
35 ~~~~
36
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.
40