New issue
Advanced search Search tips

Issue 2687 link

Starred by 4 users

Issue metadata

Status: Accepted
Area: Font
NextAction: ----
Priority: Medium
Type: Defect

Sign in to add a comment

generate test typeface for gm and other tests

Project Member Reported by, Jun 23 2014

Issue description

A gm today can specify that it is indifferent to the font used by text.


Ideally, all Skia test apps would trigger this behavior for all tests that create a paint, without setting its typeface.

Reed suggests that this could be achieved by installing a custom FontMgr after Graphics::Init() that returns the typeface created by SkTestScalarContext as the default typeface.

Project Member

Comment 1 by, Jul 11 2014

Ben, if you're not a good owner for this, feel free to set it back to blank.

I have iOS gm working now, so it would be very helpful to have a way to compare gms between a Mac and an iOS device. Today, the same GMs draw very differently because the pair of platforms use different fonts and font metrics.

If this is painful to fix, I'd like to implement my earlier strategy of hand-editing each GM to use a common font from the resource directory.
Project Member

Comment 2 by, Jul 31 2014

The following revision refers to this bug:

commit 992c7b03ef7914a18bfd78e965b0b4c99a5f5672
Author: Cary Clark <>
Date: Thu Jul 31 08:58:44 2014 -0400

Add standard fonts to all GMs.

Allow GM results to be compared across machines and platforms by
standardizing the fonts used by all tests.

This adds runtime flags to DM to use either the system font context (the
default), the fonts in the resources directory ( --resourceFonts ) or a set
of canonical paths generated from the fonts ( --portableFonts ).

This CL should leave the current DM results unchanged by default.

If the portable font data or resource font is missing when DM is run, it
falls back to using the system font context.

The create_test_font tool generates the paths and metrics read by DM
with the --portableFonts flag set, and generates the font substitution
tables read by DM with the --resourceFonts flag set.

If DM is run in SkDebug mode with the --reportUsedChars flag set, it
generates the corresponding data compiled into the create_test_font tool.

All GM tests set their typeface information by calling either

  sk_tool_utils::set_portable_typeface or
  sk_tool_utils::portable_typeface .

(The former takes the paint, the latter returns a SkTypeface.) These calls
can be removed in the future when the Font Manager can be superceded.


Review URL:

Project Member

Comment 3 by, Oct 9 2014

Labels: Area-Font
Project Member

Comment 4 by, Dec 7 2015

Labels: Hotlist-Fixit

Sign in to add a comment