New issue
Advanced search Search tips
Starred by 7 users
Status: New
Area: Font
Priority: Medium
Type: Defect

Sign in to add a comment
SkTypeface::CreateFromName() return NULL when font is not found (linux)
Reported by, Sep 17 2013 Back to list
What steps will reproduce the problem?

1. SkTypeface *tf = SkTypeface::CreateFromName("foobar", SkTypeface::kNormal)

What is the expected output? What do you see instead?

SkTypeface::CreateFromName() return NULL. Instead it should be a reference to the the default font.
The docs explicitly says : "Will never return null" (

What version of the product are you using? On what operating system?

Skia : trunk@r11309 (lastest)
OS : Linux Debian

Please provide any additional information below.

Also, SkTypeface *tf = SkTypeface::CreateFromName(NULL, SkTypeface::kNormal) does return a non NULL pointer.

Project Member Comment 1 by, Sep 17 2013
Project Member Comment 2 by, Sep 17 2013
This was completely a policy issue. Mike, in the near term at least, should we return the default font or return NULL and update the comments? I think we already have both kinds of users (some assume one way, some assume the other), but both of them could complain that we're broken at the moment.
Project Member Comment 3 by, Sep 17 2013
I'm running into the problem as well as Chromium is expecting it to return NULL and Android is expecting it to return the default font.  If we can agree on all doing it the same way that will clear up some confusion on my end as well.
Project Member Comment 4 by, Aug 26 2014
Labels: Area-Font
Project Member Comment 5 by, Dec 7 2015
Labels: Hotlist-Fixit
Sign in to add a comment