diff --git a/FontTestGDX/lib/TerrarumSansBitmap.jar b/FontTestGDX/lib/TerrarumSansBitmap.jar index 1566085..a152f07 100644 Binary files a/FontTestGDX/lib/TerrarumSansBitmap.jar and b/FontTestGDX/lib/TerrarumSansBitmap.jar differ diff --git a/demo.PNG b/demo.PNG index 75d709b..e20621e 100644 Binary files a/demo.PNG and b/demo.PNG differ diff --git a/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt b/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt index 7021db1..0ceaf51 100644 --- a/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt +++ b/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt @@ -507,9 +507,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo sheetsPack.add(texRegPack) - - - //pixmap.dispose() // you are terminated + pixmap.dispose() // you are terminated } sheets = sheetsPack.toTypedArray() @@ -550,7 +548,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo private var pixmapTextureHolder: Texture? = null private var pixmapHolder: Pixmap? = null - private val pixmapOffsetY = -10 + private val pixmapOffsetY = 10 override fun draw(batch: Batch, charSeq: CharSequence, x: Float, y: Float): GlyphLayout? { val oldProjectionMatrix = batch.projectionMatrix @@ -622,7 +620,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo pixmapHolder?.dispose() /* you can do this one */ //pixmapTextureHolder?.dispose() /* you CAN'T do this however */ - pixmapHolder = Pixmap(getWidth(textBuffer), H + -(pixmapOffsetY * 2), Pixmap.Format.RGBA8888) + pixmapHolder = Pixmap(getWidth(textBuffer), H + (pixmapOffsetY * 2), Pixmap.Format.RGBA8888) var index = 0 while (index <= textBuffer.lastIndex) { @@ -712,7 +710,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo batch.color = mainCol makeShadow(pixmapHolder) pixmapTextureHolder = Texture(pixmapHolder) - batch.draw(pixmapTextureHolder, x.toFloat(), y.toFloat()) + batch.draw(pixmapTextureHolder, x.toFloat(), (y - pixmapOffsetY).toFloat()) /*textTexture.end() diff --git a/src/net/torvald/terrarumsansbitmap/gdx/PixmapRegionPack.kt b/src/net/torvald/terrarumsansbitmap/gdx/PixmapRegionPack.kt index 4619c2a..30fe9f7 100644 --- a/src/net/torvald/terrarumsansbitmap/gdx/PixmapRegionPack.kt +++ b/src/net/torvald/terrarumsansbitmap/gdx/PixmapRegionPack.kt @@ -1,3 +1,27 @@ +/* + * Terrarum Sans Bitmap + * + * Copyright (c) 2018 Minjae Song (Torvald) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package net.torvald.terrarumsansbitmap.gdx import com.badlogic.gdx.files.FileHandle