Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fad41c8f authored by Derek Sollenberger's avatar Derek Sollenberger Committed by Android Git Automerger
Browse files

am 5db1f5aa: Merge "Fix Java API error where requesting another style for a...

am 5db1f5aa: Merge "Fix Java API error where requesting another style for a provided family fails" into klp-dev

* commit '5db1f5aa':
  Fix Java API error where requesting another style for a provided family fails
parents dc655c0e 5db1f5aa
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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) {