mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
still working on the <a> tag to work
This commit is contained in:
BIN
lib/TerrarumSansBitmap.jar
LFS
BIN
lib/TerrarumSansBitmap.jar
LFS
Binary file not shown.
@@ -12,12 +12,16 @@ import com.jme3.math.FastMath.DEG_TO_RAD
|
||||
import net.torvald.colourutil.OKLch
|
||||
import net.torvald.colourutil.tosRGB
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.btex.*
|
||||
import net.torvald.terrarum.btex.BTeXBatchDrawCall
|
||||
import net.torvald.terrarum.btex.BTeXDocument
|
||||
import net.torvald.terrarum.btex.BTeXDocument.Companion.DEFAULT_ORNAMENTS_COL
|
||||
import net.torvald.terrarum.btex.BTeXDrawCall
|
||||
import net.torvald.terrarum.btex.TypesetDrawCall
|
||||
import net.torvald.terrarum.gameitems.ItemID
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.ui.Toolkit
|
||||
import net.torvald.terrarumsansbitmap.MovableType
|
||||
import net.torvald.terrarumsansbitmap.MovableType.Companion.toReadable
|
||||
import net.torvald.terrarumsansbitmap.TypesettingStrategy
|
||||
import net.torvald.terrarumsansbitmap.gdx.CodepointSequence
|
||||
import net.torvald.terrarumsansbitmap.gdx.TerrarumSansBitmap
|
||||
@@ -1790,23 +1794,6 @@ object BTeXParser {
|
||||
return out
|
||||
}
|
||||
|
||||
private fun CodepointSequence.toReadable() = this.joinToString("") {
|
||||
if (it in 0x00..0x1f)
|
||||
"${(0x2400 + it).toChar()}"
|
||||
else if (it == 0x20)
|
||||
"\u2423"
|
||||
else if (it == NBSP)
|
||||
"{NBSP}"
|
||||
else if (it == SHY)
|
||||
"{SHY}"
|
||||
else if (it == ZWSP)
|
||||
"{ZWSP}"
|
||||
else if (it >= 0xF0000)
|
||||
it.toHex() + " "
|
||||
else
|
||||
Character.toString(it.toChar())
|
||||
}
|
||||
|
||||
private fun typesetTOCline(heading: String, name: String, pageNum: Int, handler: BTeXHandler, indentation: Int = 0, pageToWrite: Int? = null) {
|
||||
val pageNum = pageNum.plus(1).toString()
|
||||
val pageNumWidth = getFont().getWidth(pageNum)
|
||||
|
||||
@@ -112,16 +112,24 @@ class BTeXTest : ApplicationAdapter() {
|
||||
viewer = BTeXDocViewer(document)
|
||||
}
|
||||
else {
|
||||
batch.inUse {
|
||||
batch.draw(bg, 0f, 0f)
|
||||
viewer.render(batch, 640f, drawY.toFloat())
|
||||
if (document.isFinalised || document.fromArchive) {
|
||||
batch.inUse {
|
||||
batch.draw(bg, 0f, 0f)
|
||||
viewer.render(batch, 640f, drawY.toFloat())
|
||||
|
||||
batch.color = Color.WHITE
|
||||
val pageText = "${viewer.currentPageStr()}/${viewer.pageCount}"
|
||||
Toolkit.drawTextCentered(
|
||||
batch, TinyAlphNum, pageText,
|
||||
1280, 0, drawY + document.pageDimensionHeight + 12
|
||||
)
|
||||
batch.color = Color.WHITE
|
||||
val pageText = "${viewer.currentPageStr()}/${viewer.pageCount}"
|
||||
Toolkit.drawTextCentered(
|
||||
batch, TinyAlphNum, pageText,
|
||||
1280, 0, drawY + document.pageDimensionHeight + 12
|
||||
)
|
||||
}
|
||||
}
|
||||
else {
|
||||
batch.inUse {
|
||||
batch.color = Color.WHITE
|
||||
Toolkit.drawTextCentered(batch, TinyAlphNum, "Rendering...", 1280, 0, 354)
|
||||
}
|
||||
}
|
||||
|
||||
// control
|
||||
@@ -135,6 +143,12 @@ class BTeXTest : ApplicationAdapter() {
|
||||
viewer.gotoLastPage()
|
||||
}
|
||||
}
|
||||
else {
|
||||
batch.inUse {
|
||||
batch.color = Color.WHITE
|
||||
Toolkit.drawTextCentered(batch, TinyAlphNum, "Typesetting...", 1280, 0, 354)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user