[Snapshot tests] Only set a font asset delegate when there are no glyphs
This should give better test coverage of glyphs and font rendering.
@@ -145,11 +145,13 @@ suspend fun SnapshotTestCaseContext.snapshotComposition(
filmStripView.setOutlineMasksAndMattes(false)
filmStripView.setApplyingOpacityToLayersEnabled(false)
filmStripView.setImageAssetDelegate { BitmapFactory.decodeResource(context.resources, R.drawable.airbnb) }
+ if (composition.characters.isEmpty) {
filmStripView.setFontAssetDelegate(object : FontAssetDelegate() {
override fun getFontPath(fontFamily: String?, fontStyle: String?, fontName: String?): String {
return "fonts/Roboto.ttf"
}
})
+ }
callback?.invoke(filmStripView)
val spec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
filmStripView.measure(spec, spec)
