mirror of
https://github.com/curioustorvald/Terrarum-sans-bitmap.git
synced 2026-06-12 17:04:03 +09:00
better text scaling support
This commit is contained in:
@@ -20,7 +20,7 @@ import kotlin.math.*
|
|||||||
class MovableType(
|
class MovableType(
|
||||||
val font: TerrarumSansBitmap,
|
val font: TerrarumSansBitmap,
|
||||||
val inputText: CodepointSequence,
|
val inputText: CodepointSequence,
|
||||||
val paperWidth: Int,
|
paperWidth: Int,
|
||||||
internal val isNull: Boolean = false
|
internal val isNull: Boolean = false
|
||||||
): Disposable {
|
): Disposable {
|
||||||
|
|
||||||
@@ -285,7 +285,7 @@ class MovableType(
|
|||||||
font.drawNormalised(batch,
|
font.drawNormalised(batch,
|
||||||
it.block.text,
|
it.block.text,
|
||||||
x + it.posX,
|
x + it.posX,
|
||||||
y + lineNum * lineHeight
|
y + lineNum * lineHeight * font.scale
|
||||||
)
|
)
|
||||||
|
|
||||||
if (it.colour != null)
|
if (it.colour != null)
|
||||||
|
|||||||
@@ -766,10 +766,10 @@ class TerrarumSansBitmap(
|
|||||||
val cacheObj = getCache(s.getHash())
|
val cacheObj = getCache(s.getHash())
|
||||||
|
|
||||||
if (cacheObj != null) {
|
if (cacheObj != null) {
|
||||||
return cacheObj.glyphLayout!!.width
|
return cacheObj.glyphLayout!!.width * scale
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return buildPosMap(s).width
|
return buildPosMap(s).width * scale
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user