aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-19 18:22:30 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-19 18:22:30 +0000
commit9902c38f4802aad589177c069f792eeeabb1a29b (patch)
treec6b08eaf87693677e67242517de93844697cb2a2 /include
parentc1a81ebec52bc5dff8c9461570e1212afe09506f (diff)
Add new entry point that supports fallback font selection based on language.
BUG= chromium:287995 R=reed@google.com, wangxianzhu@chromium.org Review URL: https://codereview.chromium.org/23819067 git-svn-id: http://skia.googlecode.com/svn/trunk@11394 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkPaintOptionsAndroid.h2
-rw-r--r--include/ports/SkTypeface_android.h24
2 files changed, 24 insertions, 2 deletions
diff --git a/include/core/SkPaintOptionsAndroid.h b/include/core/SkPaintOptionsAndroid.h
index 78e43868c0..1bb29f4760 100644
--- a/include/core/SkPaintOptionsAndroid.h
+++ b/include/core/SkPaintOptionsAndroid.h
@@ -94,7 +94,7 @@ public:
enum FontVariant {
- kDefault_Variant = 0x01, // Currently setting yourself to Default gives you Compact Variant
+ kDefault_Variant = 0x01,
kCompact_Variant = 0x02,
kElegant_Variant = 0x04,
kLast_Variant = kElegant_Variant,
diff --git a/include/ports/SkTypeface_android.h b/include/ports/SkTypeface_android.h
index 655670fb6b..1ee923c4e6 100644
--- a/include/ports/SkTypeface_android.h
+++ b/include/ports/SkTypeface_android.h
@@ -17,11 +17,33 @@ class SkPaintOptionsAndroid;
/**
* Get the family name of the font in the fallback font list containing
- * the specified character. if no font is found, returns false.
+ * the specified character using the system's default language. This function
+ * also assumes the only families with the elegant or default variants will be
+ * returned.
+ *
+ * @param uni The unicode character to use for the lookup.
+ * @param name The family name of the font file containing the unicode character
+ * in the default language
+ * @return true if a font is found and false otherwise
*/
SK_API bool SkGetFallbackFamilyNameForChar(SkUnichar uni, SkString* name);
/**
+ * Get the family name of the font in the fallback font list containing
+ * the specified character taking into account the provided language. This
+ * function also assumes the only families with the elegant or default variants
+ * will be returned.
+ *
+ * @param uni The unicode character to use for the lookup.
+ * @param lang The null terminated string representing the BCP 47 language
+ * identifier for the preferred language
+ * @param name The family name of the font file containing the unicode character
+ * in the preferred language
+ * @return true if a font is found and false otherwise
+ */
+SK_API bool SkGetFallbackFamilyNameForChar(SkUnichar uni, const char* lang, SkString* name);
+
+/**
* For test only.
* Load font config from given xml files, instead of those from Android system.
*/