mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 18:44:05 +09:00
codestyle wip
This commit is contained in:
BIN
assets/graphics/fonts/terrarum-sans-bitmap/pua_codestyle_ascii_variable.tga
LFS
Normal file
BIN
assets/graphics/fonts/terrarum-sans-bitmap/pua_codestyle_ascii_variable.tga
LFS
Normal file
Binary file not shown.
BIN
lib/TerrarumSansBitmap.jar
LFS
BIN
lib/TerrarumSansBitmap.jar
LFS
Binary file not shown.
@@ -286,7 +286,7 @@ object BTeXParser {
|
|||||||
private var oldCodeMode = false
|
private var oldCodeMode = false
|
||||||
|
|
||||||
override fun characters(ch: CharArray, start: Int, length: Int) {
|
override fun characters(ch: CharArray, start: Int, length: Int) {
|
||||||
val str =
|
var str =
|
||||||
String(ch.sliceArray(start until start + length)).replace('\n', ' ').replace(Regex(" +"), " ")//.trim()
|
String(ch.sliceArray(start until start + length)).replace('\n', ' ').replace(Regex(" +"), " ")//.trim()
|
||||||
|
|
||||||
if (str.isNotEmpty()) {
|
if (str.isNotEmpty()) {
|
||||||
@@ -309,11 +309,20 @@ object BTeXParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// process code request
|
// process code request
|
||||||
if (codeMode != oldCodeMode && codeMode) {
|
if (codeMode != oldCodeMode || codeMode) {
|
||||||
println("CODE tag for str '$str'")
|
println("CODE tag for str '$str'")
|
||||||
val w = getFont().getWidth(str)
|
|
||||||
getOrPutCodeTagRef(w)
|
str = CodepointSequence(listOf(0xF901D, 0xF901D, 0xF901D)).toUTF8Bytes().decodeToString()
|
||||||
paragraphBuffer.appendObjectPlaceholder("TAG@CODE-$w")
|
|
||||||
|
if (!codeMode) {
|
||||||
|
paragraphBuffer.append(TerrarumSansBitmap.charsetOverrideDefault)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
val w = getFont().getWidth(str)
|
||||||
|
getOrPutCodeTagRef(w)
|
||||||
|
paragraphBuffer.appendObjectPlaceholder("TAG@CODE-$w")
|
||||||
|
paragraphBuffer.append(TerrarumSansBitmap.charsetOverrideCodestyle)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user