mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-09 13:21:51 +09:00
reading text from the keyboard input panel will return the string in Unicode NFC
This commit is contained in:
@@ -7,6 +7,7 @@ import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.Pixmap
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.glutils.FrameBuffer
|
||||
import com.ibm.icu.text.Normalizer2
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.gamecontroller.*
|
||||
@@ -433,9 +434,11 @@ class UIItemTextLineInput(
|
||||
}
|
||||
|
||||
private fun textbufToString(): String {
|
||||
return textbuf.toJavaString()
|
||||
return textbuf.toJavaString().toUnicodeNFC()
|
||||
}
|
||||
|
||||
private fun String.toUnicodeNFC() = Normalizer2.getNFCInstance().normalize(this)
|
||||
|
||||
private fun moveCursorToEnd(stride: Int) {
|
||||
try {
|
||||
cursorX += stride
|
||||
|
||||
Reference in New Issue
Block a user