thai kerning

This commit is contained in:
minjaesong
2021-11-27 17:59:04 +09:00
parent f2eb1464f6
commit 14ea4d8d84
5 changed files with 5 additions and 6 deletions

View File

@@ -50,11 +50,6 @@ class FontTestGDX : Game() {
faketex = Texture(fakepix)
fakepix.dispose()
println(font.charsetOverrideDefault)
println(font.charsetOverrideBulgarian)
println(font.charsetOverrideSerbian)
frameBuffer = FrameBuffer(Pixmap.Format.RGBA8888, TEXW, TEXH, true)
camera = OrthographicCamera(TEXW.toFloat(), TEXH.toFloat())

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 131 B

BIN
demo.PNG

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View File

@@ -337,7 +337,10 @@ class TerrarumSansBitmap(
private val pixmapOffsetY = 10
fun draw(batch: Batch, charSeq: CharSequence, x: Int, y: Int) = draw(batch, charSeq, x.toFloat(), y.toFloat())
override fun draw(batch: Batch, charSeq: CharSequence, x: Float, y: Float) = drawNormalised(batch, charSeq.toCodePoints(), x, y)
override fun draw(batch: Batch, charSeq: CharSequence, x: Float, y: Float): GlyphLayout? {
// charSeq.forEach { dbgprn("${it.toInt().charInfo()} ${glyphProps[it.toInt()]}") }
return drawNormalised(batch, charSeq.toCodePoints(), x, y)
}
fun draw(batch: Batch, codepoints: CodepointSequence, x: Int, y: Int) = drawNormalised(batch, codepoints.normalise(), x.toFloat(), y.toFloat())
fun draw(batch: Batch, codepoints: CodepointSequence, x: Float, y: Float) = drawNormalised(batch, codepoints.normalise(), x, y)
@@ -1112,6 +1115,7 @@ class TerrarumSansBitmap(
// DOES NOT WORK if said diacritics has codepoint > 0xFFFF
else if (i < this.lastIndex && this[i + 1] <= 0xFFFF &&
glyphProps[this[i + 1]]?.stackWhere == GlyphProps.STACK_BEFORE_N_AFTER) {
val diacriticsProp = glyphProps[this[i + 1]]!!
seq.add(c)
seq.add(diacriticsProp.extInfo!![0])

Binary file not shown.