diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index 77dc45e9a..090cf8ad9 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -169,7 +169,10 @@ object ReadBookConfig { get() = if (shareLayout) shareConfig.titleMode else durConfig.titleMode set(value) = if (shareLayout) shareConfig.titleMode = value else durConfig.titleMode = value - + var titleSize: Int + get() = if (shareLayout) shareConfig.titleSize else durConfig.titleSize + set(value) = + if (shareLayout) shareConfig.titleSize = value else durConfig.titleSize = value var titleTopSpacing: Int get() = if (shareLayout) shareConfig.titleTopSpacing else durConfig.titleTopSpacing set(value) = @@ -271,6 +274,7 @@ object ReadBookConfig { var lineSpacingExtra: Int = 12,//行间距 var paragraphSpacing: Int = 12,//段距 var titleMode: Int = 0,//标题居中 + var titleSize: Int = 0, var titleTopSpacing: Int = 0, var titleBottomSpacing: Int = 0, var paddingBottom: Int = 6, diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt index 927ef210f..11c5eb6a4 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt @@ -267,17 +267,17 @@ object ChapterProvider { titlePaint.color = ReadBookConfig.durConfig.textColor() titlePaint.letterSpacing = ReadBookConfig.letterSpacing titlePaint.typeface = Typeface.create(typeface, Typeface.BOLD) + titlePaint.textSize = (ReadBookConfig.textSize + ReadBookConfig.titleSize).sp.toFloat() //正文 contentPaint.isAntiAlias = true contentPaint.color = ReadBookConfig.durConfig.textColor() contentPaint.letterSpacing = ReadBookConfig.letterSpacing val bold = if (ReadBookConfig.textBold) Typeface.BOLD else Typeface.NORMAL contentPaint.typeface = Typeface.create(typeface, bold) + contentPaint.textSize = ReadBookConfig.textSize.sp.toFloat() //间距 lineSpacingExtra = ReadBookConfig.lineSpacingExtra paragraphSpacing = ReadBookConfig.paragraphSpacing - titlePaint.textSize = (ReadBookConfig.textSize + 2).sp.toFloat() - contentPaint.textSize = ReadBookConfig.textSize.sp.toFloat() titleTopSpacing = ReadBookConfig.titleTopSpacing.dp titleBottomSpacing = ReadBookConfig.titleBottomSpacing.dp upSize()