pull/501/head
gedoor 4 years ago
parent 9208eeae54
commit 8c2c842c58
  1. 7
      app/src/main/java/io/legado/app/help/JsExtensions.kt

@ -275,12 +275,11 @@ interface JsExtensions {
end: Int end: Int
): String { ): String {
if (font1 == null || font2 == null) return text if (font1 == null || font2 == null) return text
val startChar = start.toChar()
val endChar = end.toChar()
val contentArray = text.toCharArray() val contentArray = text.toCharArray()
contentArray.forEachIndexed { index, s -> contentArray.forEachIndexed { index, s ->
if (s in startChar until endChar) { val oldCode = s.toInt()
val code = font2.GetCodeByGlyf(font1.GetGlyfByCode(s.toInt())) if (oldCode in startChar until endChar) {
val code = font2.GetCodeByGlyf(font1.GetGlyfByCode(oldCode))
contentArray[index] = code.toChar() contentArray[index] = code.toChar()
} }
} }

Loading…
Cancel
Save