fix: larger scale font whitespaces

This commit is contained in:
minjaesong
2024-05-21 23:21:24 +09:00
parent 2205e1bc44
commit 1f37ee1f4f
2 changed files with 4 additions and 4 deletions

View File

@@ -1086,7 +1086,7 @@ class MovableType(
// process blocks
input.forEachIndexed { index, it ->
val posX = it.posX - font.interchar * 2
val posX = it.posX
val prevEndPos = if (index == 0) 0 else input[index-1].getEndPos()
if (index > 0 && posX != prevEndPos) {
out.addAll((posX - prevEndPos).glueSizeToGlueChars())
@@ -1128,7 +1128,7 @@ class MovableType(
// process blocks
input.forEachIndexed { index, it ->
val posX = it.posX - font.interchar * 2
val posX = it.posX
val prevEndPos = if (index == 0) 0 else input[index-1].getEndPos()
if (index > 0 && posX != prevEndPos) {
out += posX - prevEndPos

View File

@@ -1071,13 +1071,13 @@ class TerrarumSansBitmap(
return 0
if (s.size == 1) {
return glyphProps[s.first()]?.width ?: (
return scale * (glyphProps[s.first()]?.width ?: (
if (errorOnUnknownChar)
throw InternalError("No GlyphProps for char '${s.first().toHex()}' " +
"(${s.first().charInfo()})")
else
0
)
))
}
val cacheObj = getCache(s.getHash())