|
|
@ -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() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|