Update documentation for SkFontMgr methods.
authorerikchen <erikchen@chromium.org>
Thu, 3 Dec 2015 20:12:13 +0000 (12:12 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 3 Dec 2015 20:12:13 +0000 (12:12 -0800)
The appropriate way to get the default system font is to pass |nullptr| as the
familyName. This was not clear from the interface, which may be why ui/gfx/ has
the wrong behavior.

BUG=chromium:564266

Review URL: https://codereview.chromium.org/1494253002

include/ports/SkFontMgr.h

index 8d57986..96a8501 100644 (file)
@@ -43,6 +43,8 @@ public:
      *  The caller must call unref() on the returned object.
      *  Never returns NULL; will return an empty set if the name is not found.
      *
+     *  Passing |nullptr| as the parameter will return the default system font.
+     *
      *  It is possible that this will return a style set not accessible from
      *  createStyleSet(int) due to hidden or auto-activated fonts.
      */
@@ -54,6 +56,9 @@ public:
      *  object. Will never return NULL, as it will return the default font if
      *  no matching font is found.
      *
+     *  Passing |nullptr| as the parameter for |familyName| will return the
+     *  default system font.
+     *
      *  It is possible that this will return a style set not accessible from
      *  createStyleSet(int) or matchFamily(const char[]) due to hidden or
      *  auto-activated fonts.
@@ -68,6 +73,9 @@ public:
      *  Will return NULL if no family can be found for the character
      *  in the system fallback.
      *
+     *  Passing |nullptr| as the parameter for |familyName| will return the
+     *  default system font.
+     *
      *  bcp47[0] is the least significant fallback, bcp47[bcp47Count-1] is the
      *  most significant. If no specified bcp47 codes match, any font with the
      *  requested character will be matched.