From 8f3409fdcb5752d07e8cc9fe27e6e0f34291ee8a Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 8 Oct 2021 08:18:09 +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 --- app/src/main/java/io/legado/app/help/JsExtensions.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 e5dd147e7..6a7b2685b 100644 --- a/app/src/main/java/io/legado/app/help/JsExtensions.kt +++ b/app/src/main/java/io/legado/app/help/JsExtensions.kt @@ -453,8 +453,11 @@ interface JsExtensions { contentArray.forEachIndexed { index, s -> val oldCode = s.code if (font1.inLimit(s)) { - val code = font2.getCodeByGlyf(font1.getGlyfByCode(oldCode)) - if (code != 0) contentArray[index] = code.toChar() + val glyf = font1.getGlyfByCode(oldCode) + val code = font2.getCodeByGlyf(glyf) + if (code != 0) { + contentArray[index] = code.toChar() + } } } return contentArray.joinToString("")