CodepointSequence.toReadable() is now public

This commit is contained in:
minjaesong
2024-05-17 23:58:50 +09:00
parent 42c72a6a90
commit d8dc1c8cfd
2 changed files with 11 additions and 11 deletions

View File

@@ -987,19 +987,19 @@ class MovableType(
private val parenOpen = listOf(0x28,0x5B,0x7B).toSortedSet().also { it.addAll(cjparenStarts) }
private val parenClose = listOf(0x29,0x5D,0x7D).toSortedSet().also { it.addAll(cjparenEnds) }
private const val ZWSP = 0x200B
private const val SHY = 0xAD
private const val NBSP = 0xA0
private const val GLUE_POSITIVE_ONE = 0xFFFF0
private const val GLUE_POSITIVE_SIXTEEN = 0xFFFFF
private const val GLUE_NEGATIVE_ONE = 0xFFFE0
private const val GLUE_NEGATIVE_SIXTEEN = 0xFFFEF
const val ZWSP = 0x200B
const val SHY = 0xAD
const val NBSP = 0xA0
const val GLUE_POSITIVE_ONE = 0xFFFF0
const val GLUE_POSITIVE_SIXTEEN = 0xFFFFF
const val GLUE_NEGATIVE_ONE = 0xFFFE0
const val GLUE_NEGATIVE_SIXTEEN = 0xFFFEF
private fun CharArray.toSurrogatedString(): String = if (this.size == 1) "${this[0]}" else "${this[0]}${this[1]}"
private inline fun Int.codepointToString() = Character.toChars(this).toSurrogatedString()
private fun CodepointSequence.toReadable() = this.joinToString("") {
fun CodepointSequence.toReadable() = this.joinToString("") {
if (it in 0x00..0x1f)
"${(0x2400 + it).toChar()}"
else if (it == 0x20 || it == 0xF0520)

View File

@@ -2355,9 +2355,9 @@ class TerrarumSansBitmap(
internal const val CHARSET_OVERRIDE_SR_SR = 0xFFFC2
internal const val CHARSET_OVERRIDE_CODESTYLE = 0xFFFC3
internal const val FIXED_BLOCK_1 = 0xFFFD0
internal const val MOVABLE_BLOCK_M1 = 0xFFFE0
internal const val MOVABLE_BLOCK_1 = 0xFFFF0
const val FIXED_BLOCK_1 = 0xFFFD0
const val MOVABLE_BLOCK_M1 = 0xFFFE0
const val MOVABLE_BLOCK_1 = 0xFFFF0
private val autoShiftDownOnLowercase = arrayOf(