update on the korean font
Former-commit-id: 89fd87d821235b5ed3a7dbd289e4ea7ef2efb185 Former-commit-id: 2681c691e7b453ef149a6aec168fada9d5dfa9b3
BIN
logo_repository.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
@@ -1,3 +0,0 @@
|
|||||||
안녕하세요 こんにちわ
|
|
||||||
|
|
||||||
《템페스트》 「テンペスト」
|
|
||||||
|
Before Width: | Height: | Size: 1011 B After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 259 B After Width: | Height: | Size: 58 KiB |
@@ -23,29 +23,36 @@ constructor() : Font {
|
|||||||
|
|
||||||
private fun getHanJongseong(hanIndex: Int) = hanIndex % JONG_COUNT
|
private fun getHanJongseong(hanIndex: Int) = hanIndex % JONG_COUNT
|
||||||
|
|
||||||
|
private val jungseongWide = arrayOf(8, 12, 13, 17, 18, 21)
|
||||||
|
private val jungseongComplex = arrayOf(9, 10, 11, 14, 15, 16, 22)
|
||||||
|
|
||||||
private fun getHanChoseongRow(hanIndex: Int): Int {
|
private fun isJungseongWide(hanIndex: Int) = jungseongWide.contains(getHanJungseong(hanIndex))
|
||||||
val jungseongIndex = getHanJungseong(hanIndex)
|
private fun isJungseongComplex(hanIndex: Int) = jungseongComplex.contains(getHanJungseong(hanIndex))
|
||||||
val jungseongWide = arrayOf(8, 12, 13, 17, 18, 21)
|
|
||||||
val jungseongComplex = arrayOf(9, 10, 11, 14, 15, 16, 22)
|
private fun getHanInitialRow(hanIndex: Int): Int {
|
||||||
val ret: Int
|
val ret: Int
|
||||||
|
|
||||||
if (jungseongWide.contains(jungseongIndex)) {
|
if (isJungseongWide(hanIndex))
|
||||||
ret = 2
|
ret = 2
|
||||||
}
|
else if (isJungseongComplex(hanIndex))
|
||||||
else if (jungseongComplex.contains(jungseongIndex)) {
|
|
||||||
ret = 4
|
ret = 4
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
ret = 0
|
ret = 0
|
||||||
}
|
|
||||||
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getHanJungseongRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
|
private fun getHanMedialRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
|
||||||
|
|
||||||
private val hanJongseongRow: Int
|
private fun getHanFinalRow(hanIndex: Int): Int {
|
||||||
get() = 8
|
val jungseongIndex = getHanJungseong(hanIndex)
|
||||||
|
|
||||||
|
return if (jungseongWide.contains(jungseongIndex))
|
||||||
|
8
|
||||||
|
else
|
||||||
|
9
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private fun isAsciiEF(c: Char) = asciiEFList.contains(c)
|
private fun isAsciiEF(c: Char) = asciiEFList.contains(c)
|
||||||
|
|
||||||
@@ -185,9 +192,9 @@ constructor() : Font {
|
|||||||
val indexJung = getHanJungseong(hIndex)
|
val indexJung = getHanJungseong(hIndex)
|
||||||
val indexJong = getHanJongseong(hIndex)
|
val indexJong = getHanJongseong(hIndex)
|
||||||
|
|
||||||
val choRow = getHanChoseongRow(hIndex)
|
val choRow = getHanInitialRow(hIndex)
|
||||||
val jungRow = getHanJungseongRow(hIndex)
|
val jungRow = getHanMedialRow(hIndex)
|
||||||
val jongRow = hanJongseongRow
|
val jongRow = getHanFinalRow(hIndex)
|
||||||
|
|
||||||
val glyphW = getWidth("" + ch)
|
val glyphW = getWidth("" + ch)
|
||||||
|
|
||||||
|
|||||||