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



Sign in to add a comment
SkTypeface::CreateFromName() return NULL when font is not found (linux)
Reported by efy...@gmail.com, 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" (http://skia-autogen.googlecode.com/svn/docs/html/classSkTypeface.html#ad4aa72c969aede1907be3407753f757d)


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 scro...@google.com, Sep 17 2013
Cc: reed@google.com djsollen@google.com
Owner: bungeman@google.com
Project Member Comment 2 by bungeman@google.com, Sep 17 2013
Cc: -reed@google.com bungeman@google.com
Owner: reed@google.com
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 djsollen@google.com, 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 hcm@google.com, Aug 26 2014
Labels: Area-Font
Project Member Comment 5 by hcm@google.com, Dec 7 2015
Labels: Hotlist-Fixit
Sign in to add a comment