SkFontMgr::matchFamilyStyle can return nullptr.
The current documentation states that SkFontMgr::matchFamilyStyle will never return nullptr, resolving to the default system font or the empty typeface if necessary. This isn't the behavior desired by any users, since doing so makes it difficult for the user to check if a 'good' match was made or not. All of the current SkFontMgr implementations can return nullptr anyway for a number of reasons, from lack of a 'good' match to an error. Bug: skia:8260 Change-Id: I96299c16aaa7228fd42a9d8ec4889c7355cb53a5 Reviewed-on: https://skia-review.googlesource.com/147721 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
parent
0edb982602
commit
035aa329ba
@ -57,8 +57,7 @@ public:
|
||||
/**
|
||||
* Find the closest matching typeface to the specified familyName and style
|
||||
* and return a ref to it. The caller must call unref() on the returned
|
||||
* object. Will never return NULL, as it will return the default font if
|
||||
* no matching font is found.
|
||||
* object. Will return nullptr if no 'good' match is found.
|
||||
*
|
||||
* Passing |nullptr| as the parameter for |familyName| will return the
|
||||
* default system font.
|
||||
|
Loading…
Reference in New Issue
Block a user