Explorar o código

替换轮廓数据时忽略索引0

Antecer %!s(int64=2) %!d(string=hai) anos
pai
achega
dffc5e5ed7
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      app/src/main/java/io/legado/app/help/JsExtensions.kt

+ 2 - 1
app/src/main/java/io/legado/app/help/JsExtensions.kt

@@ -802,8 +802,9 @@ interface JsExtensions : JsEncodeUtils {
             if (errorQueryTTF.isBlankUnicode(oldCode)) {
                 return@forEachIndexed
             }
-            val glyf = errorQueryTTF.getGlyfByUnicode(oldCode)
             // 删除轮廓数据不存在的字符
+            var glyf = errorQueryTTF.getGlyfByUnicode(oldCode)  // 轮廓数据不存在
+            if (errorQueryTTF.getGlyfIdByUnicode(oldCode) == 0) glyf = null; // 轮廓数据指向保留索引0
             if (filter && (glyf == null)) {
                 contentArray[index] = ""
                 return@forEachIndexed