Merge "Fix Java API error where requesting another style for a provided family fails" into klp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5db1f5aaac
@@ -44,7 +44,13 @@ static SkTypeface* Typeface_create(JNIEnv* env, jobject, jstring name,
|
||||
}
|
||||
|
||||
static SkTypeface* Typeface_createFromTypeface(JNIEnv* env, jobject, SkTypeface* family, int style) {
|
||||
return SkTypeface::CreateFromTypeface(family, (SkTypeface::Style)style);
|
||||
SkTypeface* face = SkTypeface::CreateFromTypeface(family, (SkTypeface::Style)style);
|
||||
// return the default font at the best style if the requested style does not
|
||||
// exist in the provided family
|
||||
if (NULL == face) {
|
||||
face = SkTypeface::CreateFromName(NULL, (SkTypeface::Style)style);
|
||||
}
|
||||
return face;
|
||||
}
|
||||
|
||||
static void Typeface_unref(JNIEnv* env, jobject obj, SkTypeface* face) {
|
||||
|
||||
Reference in New Issue
Block a user