aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/dev/testing/fonts.md
blob: 15e7727041d83eb1ad58f0cea99e4270c6b96fb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Fonts and GM Tests
==================

Overview
--------

Each test in the gm directory draws a reference image. Their primary purpose is
to detect when images change unexpectedly, indicating that a rendering bug has
been introduced.

The gm tests have a secondary purpose: they detect when rendering is different
across platforms and configurations.

GM font selection
-----------------

Each gm specifies the typeface to use when drawing text. For now, to set the
portable typeface on the paint, call:

~~~~
sk_tool_utils::set_portable_typeface(SkPaint* , const char* name = nullptr,
SkFontStyle style = SkFontStyle());
~~~~

To create a portable typeface, use:

~~~~
SkTypeface* typeface = sk_tool_utils::create_portable_typeface(const char* name,
SkFontStyle style);
~~~~

Eventually, both 'set_portable_typeface()' and 'create_portable_typeface()' will be
removed. Instead, a test-wide 'SkFontMgr' will be selected to choose portable
fonts or resource fonts.