From c16b55b4df2259f2cd8b9fef2b5d431b471b3982 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 29 Aug 2019 16:16:18 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/ui/widget/page/ContentView.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt index 5a0c3627f..d1b33ce0a 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt @@ -2,6 +2,7 @@ package io.legado.app.ui.widget.page import android.annotation.SuppressLint import android.content.Context +import android.graphics.Typeface import android.graphics.drawable.Drawable import android.util.AttributeSet import android.widget.FrameLayout @@ -66,6 +67,13 @@ class ContentView : FrameLayout { tv_bottom_right.setTextColor(it) } } + context.getPrefString("readBookFont")?.let { + if (it.isNotEmpty()) { + content_text_view.typeface = Typeface.createFromFile(it) + } else { + content_text_view.typeface = Typeface.DEFAULT + } + } } fun setBg(bg: Drawable?) {