From 1af8e914403439fcbfd97e9973a0999b8e9fb082 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 21 Nov 2020 10:39:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/data/entities/rule/ContentRule.kt | 3 ++- app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.kt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/entities/rule/ContentRule.kt b/app/src/main/java/io/legado/app/data/entities/rule/ContentRule.kt index ed0d482cb..054939d0b 100644 --- a/app/src/main/java/io/legado/app/data/entities/rule/ContentRule.kt +++ b/app/src/main/java/io/legado/app/data/entities/rule/ContentRule.kt @@ -11,5 +11,6 @@ data class ContentRule( var sourceRegex: String? = null, var replaceRegex: String? = null, var imageStyle: String? = null, //默认大小居中,FULL最大宽度 - var font: String? = null //必须返回ByteArray + var font: String? = null, //网页内包含的字体必须返回ByteArray + var correctFont: String? = null, //正确的字体必须返回ByteArray ) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.kt b/app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.kt index bb8da0789..02fcb2e3e 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.kt @@ -9,7 +9,7 @@ import kotlin.experimental.and * @see 获取详情 * @see 基于Javascript的TTF解析器 */ -class QueryTTF(var Font: Array) : JsExtensions { +class QueryTTF(var Font: ByteArray) : JsExtensions { private class Header { var majorVersion: UShort = 0u var minorVersion: UShort = 0u @@ -150,7 +150,7 @@ class QueryTTF(var Font: Array) : JsExtensions { lateinit var yCoordinates: ArrayList } - private class ByteArrayReader(var Buffer: Array, var Index: Int) { + private class ByteArrayReader(var Buffer: ByteArray, var Index: Int) { fun ReadUIntX(len: Long): ULong { var result: ULong = 0u; for (i in 0 until len) {