mirror of
https://github.com/curioustorvald/Terrarum-sans-bitmap.git
synced 2026-03-07 11:51:50 +09:00
another devanagari changes
This commit is contained in:
@@ -27,13 +27,15 @@ class FontTestGDX : Game() {
|
||||
|
||||
lateinit var camera: OrthographicCamera
|
||||
|
||||
private val testing = true
|
||||
private val testing = false
|
||||
|
||||
private val demotextName = if (testing) "testtext.txt" else "demotext.txt"
|
||||
private val outimageName = if (testing) "testing.PNG" else "demo.PNG"
|
||||
|
||||
private lateinit var faketex: Texture
|
||||
|
||||
private val lineHeight = 24
|
||||
|
||||
override fun create() {
|
||||
font = TerrarumSansBitmap("./assets", debug = true, flipY = false, errorOnUnknownChar = false, shadowAlpha = 0.5f) // must test for two flipY cases
|
||||
|
||||
@@ -45,9 +47,6 @@ class FontTestGDX : Game() {
|
||||
batch = SpriteBatch()
|
||||
|
||||
|
||||
println(font.getWidth("हिन्दी"))
|
||||
|
||||
|
||||
// create faketex
|
||||
val fakepix = Pixmap(1,1,Pixmap.Format.RGBA8888)
|
||||
fakepix.drawPixel(0,0,-1)
|
||||
@@ -99,7 +98,7 @@ class FontTestGDX : Game() {
|
||||
|
||||
batch.color = Color.WHITE
|
||||
inputText.forEachIndexed { index, s ->
|
||||
font.draw(batch, s, 10f, TEXH - 30f - index * font.lineHeight)
|
||||
font.draw(batch, s, 10f, TEXH - 30f - index * lineHeight)
|
||||
}
|
||||
|
||||
batch.end()
|
||||
@@ -155,11 +154,11 @@ class FontTestGDX : Game() {
|
||||
}
|
||||
|
||||
fun scrollAdd(x: Int = 1) {
|
||||
scrollOffsetY -= (TEXH.toFloat() / HEIGHT) * 20f * x
|
||||
scrollOffsetY -= (TEXH.toFloat() / HEIGHT) * lineHeight * x
|
||||
}
|
||||
|
||||
fun scrollSub(x: Int = 1) {
|
||||
scrollOffsetY += (TEXH.toFloat() / HEIGHT) * 20f * x
|
||||
scrollOffsetY += (TEXH.toFloat() / HEIGHT) * lineHeight * x
|
||||
}
|
||||
|
||||
class Navigator(val main: FontTestGDX) : InputAdapter() {
|
||||
@@ -270,7 +269,7 @@ class FontTestGDX : Game() {
|
||||
|
||||
lateinit var appConfig: Lwjgl3ApplicationConfiguration
|
||||
const val TEXW = 874
|
||||
const val TEXH = 128 * 20
|
||||
const val TEXH = 24 * 130
|
||||
|
||||
const val WIDTH = TEXW
|
||||
const val HEIGHT = 768
|
||||
|
||||
BIN
assets/devanagari_variable.tga
LFS
BIN
assets/devanagari_variable.tga
LFS
Binary file not shown.
BIN
demo.PNG
BIN
demo.PNG
Binary file not shown.
|
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 152 KiB |
@@ -87,7 +87,10 @@ internal typealias Hash = Long
|
||||
* Shiftdown only occurs when non-diacritic character before the mark is lowercase, and the mark itself would stack up.
|
||||
* Stack-up or down is defined using Tag system.
|
||||
*
|
||||
* ## Line Height
|
||||
*
|
||||
* The line height is defined as 20 pixels on the font, and this number will not change on the source code to ensure backwards compatibility,
|
||||
* **but I recommend you to use 24 pixels for the line height** for increased legibility.
|
||||
*
|
||||
*
|
||||
* @param noShadow Self-explanatory
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user