skia2/site/dev/testing/fonts.md
Andrew Monshizadeh 9d6681cc70 Changes to site documentation
Mostly just formatting fixes with a few grammatical changes.

Two real notable changes:
  - Removed references to SkGLCanvas from Tips & FAQ and replaced with
    references to `SkDevice` and `SkSurface`.
  - Deleted deprecated "Quick Start Guides" folder

Docs-Preview: https://skia.org/?cl=92361
Bug: skia:
Change-Id: Ief790b1c2bae8fe0e39aa8d66c79f80560d18c9e
Reviewed-on: https://skia-review.googlesource.com/92361
Reviewed-by: Heather Miller <hcm@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2018-01-11 19:47:58 +00:00

964 B

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.