From 43ce6381a5b3aebf021acac817bfe0c53a33542e Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 27 Jan 2022 12:28:04 +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/help/JsExtensions.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/JsExtensions.kt b/app/src/main/java/io/legado/app/help/JsExtensions.kt index bd515d46d..f17ae2a8d 100644 --- a/app/src/main/java/io/legado/app/help/JsExtensions.kt +++ b/app/src/main/java/io/legado/app/help/JsExtensions.kt @@ -482,21 +482,21 @@ interface JsExtensions { /** * @param text 包含错误字体的内容 - * @param font1 错误的字体 - * @param font2 正确的字体 + * @param errorQueryTTF 错误的字体 + * @param correctQueryTTF 正确的字体 */ fun replaceFont( text: String, - font1: QueryTTF?, - font2: QueryTTF? + errorQueryTTF: QueryTTF?, + correctQueryTTF: QueryTTF? ): String { - if (font1 == null || font2 == null) return text + if (errorQueryTTF == null || correctQueryTTF == null) return text val contentArray = text.toCharArray() contentArray.forEachIndexed { index, s -> val oldCode = s.code - if (font1.inLimit(s)) { - val glyf = font1.getGlyfByCode(oldCode) - val code = font2.getCodeByGlyf(glyf) + if (errorQueryTTF.inLimit(s)) { + val glyf = errorQueryTTF.getGlyfByCode(oldCode) + val code = correctQueryTTF.getCodeByGlyf(glyf) if (code != 0) { contentArray[index] = code.toChar() }