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

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

am fad41c8f: am 5db1f5aa: Merge "Fix Java API error where requesting another...

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

* commit 'fad41c8f':
  Fix Java API error where requesting another style for a provided family fails
parents a0faa412 fad41c8f
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) {