Skip to content

Commit

Permalink
fix: remove incorrect typeface default (#1151)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRogue76 committed Jan 4, 2024
1 parent 3cff262 commit 297c2aa
Showing 1 changed file with 2 additions and 6 deletions.
Expand Up @@ -3,7 +3,6 @@ package com.airbnb.android.react.lottie
import android.graphics.ColorFilter
import android.graphics.Typeface
import android.net.Uri
import android.util.Log
import android.widget.ImageView
import com.airbnb.lottie.LottieAnimationView
import com.airbnb.lottie.LottieDrawable
Expand All @@ -14,7 +13,6 @@ import com.airbnb.lottie.TextDelegate
import com.airbnb.lottie.FontAssetDelegate
import com.airbnb.lottie.model.KeyPath
import com.airbnb.lottie.value.LottieValueCallback
import com.facebook.react.BuildConfig
import com.facebook.react.bridge.ColorPropConverter
import com.facebook.react.bridge.ReadableArray
import com.facebook.react.bridge.ReadableMap
Expand Down Expand Up @@ -70,9 +68,8 @@ class LottieAnimationViewPropertyManager(view: LottieAnimationView) {

view.setFontAssetDelegate(object : FontAssetDelegate() {
override fun fetchFont(fontFamily: String): Typeface {
val typeface = ReactFontManager.getInstance()
return ReactFontManager.getInstance()
.getTypeface(fontFamily, UNSET, UNSET, view.context.assets)
return typeface?: Typeface.defaultFromStyle(400)
}

override fun fetchFont(fontFamily: String, fontStyle: String, fontName: String): Typeface {
Expand All @@ -85,9 +82,8 @@ class LottieAnimationViewPropertyManager(view: LottieAnimationView) {
"Black" -> 900
else -> UNSET
}
val typeface = ReactFontManager.getInstance()
return ReactFontManager.getInstance()
.getTypeface(fontName, UNSET, weight, view.context.assets)
return typeface?: Typeface.defaultFromStyle(400)
}
})
}
Expand Down

0 comments on commit 297c2aa

Please sign in to comment.