mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 02:54:04 +09:00
finalising fonts
Former-commit-id: e85038e433c9e451761a25ce93fa976b847c9e1e Former-commit-id: 0f59fe3a1b5a174ff63f5a79f11007f0e9d4a204
This commit is contained in:
@@ -52,7 +52,6 @@ open class GameFontBase : Font {
|
|||||||
8
|
8
|
||||||
else
|
else
|
||||||
9
|
9
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isHangul(c: Char) = c.toInt() >= 0xAC00 && c.toInt() < 0xD7A4
|
private fun isHangul(c: Char) = c.toInt() >= 0xAC00 && c.toInt() < 0xD7A4
|
||||||
@@ -68,13 +67,12 @@ open class GameFontBase : Font {
|
|||||||
private fun isWenQuanYi1(c: Char) = c.toInt() >= 0x33F3 && c.toInt() <= 0x69FC
|
private fun isWenQuanYi1(c: Char) = c.toInt() >= 0x33F3 && c.toInt() <= 0x69FC
|
||||||
private fun isWenQuanYi2(c: Char) = c.toInt() >= 0x69FD && c.toInt() <= 0x9FDC
|
private fun isWenQuanYi2(c: Char) = c.toInt() >= 0x69FD && c.toInt() <= 0x9FDC
|
||||||
private fun isGreek(c: Char) = c.toInt() >= 0x370 && c.toInt() <= 0x3CE
|
private fun isGreek(c: Char) = c.toInt() >= 0x370 && c.toInt() <= 0x3CE
|
||||||
private fun isGreekEF(c: Char) = greekEFList.contains(c)
|
|
||||||
private fun isRomanian(c: Char) = c.toInt() >= 0x218 && c.toInt() <= 0x21A
|
private fun isRomanian(c: Char) = c.toInt() >= 0x218 && c.toInt() <= 0x21A
|
||||||
private fun isRomanianEF(c: Char) = c.toInt() == 0x21B
|
private fun isRomanianNarrow(c: Char) = c.toInt() == 0x21B
|
||||||
private fun isThai(c: Char) = c.toInt() >= 0xE00 && c.toInt() <= 0xE7F
|
private fun isThai(c: Char) = c.toInt() >= 0xE00 && c.toInt() <= 0xE7F
|
||||||
private fun isThaiDiacritics(c: Char) = (c.toInt() >= 0xE34 && c.toInt() <= 0xE3A)
|
private fun isThaiDiacritics(c: Char) = (c.toInt() >= 0xE34 && c.toInt() <= 0xE3A)
|
||||||
|| (c.toInt() >= 0xE47 && c.toInt() <= 0xE4E)
|
|| (c.toInt() >= 0xE47 && c.toInt() <= 0xE4E)
|
||||||
|| (c.toInt() == 0xE31)
|
|| (c.toInt() == 0xE31)
|
||||||
private fun isThaiEF(c: Char) = c.toInt() == 0xE40
|
private fun isThaiEF(c: Char) = c.toInt() == 0xE40
|
||||||
private fun isKeycap(c: Char) = c.toInt() >= 0xE000 && c.toInt() <= 0xE07F
|
private fun isKeycap(c: Char) = c.toInt() >= 0xE000 && c.toInt() <= 0xE07F
|
||||||
|
|
||||||
@@ -118,14 +116,14 @@ open class GameFontBase : Font {
|
|||||||
private fun thaiIndexX(c: Char) = (c.toInt() - 0xE00) % 16
|
private fun thaiIndexX(c: Char) = (c.toInt() - 0xE00) % 16
|
||||||
private fun thaiIndexY(c: Char) = (c.toInt() - 0xE00) / 16
|
private fun thaiIndexY(c: Char) = (c.toInt() - 0xE00) / 16
|
||||||
|
|
||||||
private fun thaiEFIndexX(c: Char) = 3
|
private fun thaiNarrowIndexX(c: Char) = 3
|
||||||
private fun thaiEFIndexY(c: Char) = 0
|
private fun thaiNarrowIndexY(c: Char) = 0
|
||||||
|
|
||||||
private fun keycapIndexX(c: Char) = (c.toInt() - 0xE000) % 16
|
private fun keycapIndexX(c: Char) = (c.toInt() - 0xE000) % 16
|
||||||
private fun keycapIndexY(c: Char) = (c.toInt() - 0xE000) / 16
|
private fun keycapIndexY(c: Char) = (c.toInt() - 0xE000) / 16
|
||||||
|
|
||||||
private val narrowWidthSheets = arrayOf(
|
private val narrowWidthSheets = arrayOf(
|
||||||
SHEET_EXTB_ROMANIAN_EF
|
SHEET_EXTB_ROMANIAN_NARROW
|
||||||
)
|
)
|
||||||
private val unihanWidthSheets = arrayOf(
|
private val unihanWidthSheets = arrayOf(
|
||||||
SHEET_UNIHAN,
|
SHEET_UNIHAN,
|
||||||
@@ -350,35 +348,35 @@ open class GameFontBase : Font {
|
|||||||
sheetX = cyrilicIndexX(ch)
|
sheetX = cyrilicIndexX(ch)
|
||||||
sheetY = cyrilicIndexY(ch)
|
sheetY = cyrilicIndexY(ch)
|
||||||
}
|
}
|
||||||
SHEET_FW_UNI -> {
|
SHEET_FW_UNI -> {
|
||||||
sheetX = fullwidthUniIndexX(ch)
|
sheetX = fullwidthUniIndexX(ch)
|
||||||
sheetY = fullwidthUniIndexY(ch)
|
sheetY = fullwidthUniIndexY(ch)
|
||||||
}
|
}
|
||||||
SHEET_UNI_PUNCT -> {
|
SHEET_UNI_PUNCT -> {
|
||||||
sheetX = uniPunctIndexX(ch)
|
sheetX = uniPunctIndexX(ch)
|
||||||
sheetY = uniPunctIndexY(ch)
|
sheetY = uniPunctIndexY(ch)
|
||||||
}
|
}
|
||||||
SHEET_GREEK_VARW -> {
|
SHEET_GREEK_VARW -> {
|
||||||
sheetX = greekIndexX(ch)
|
sheetX = greekIndexX(ch)
|
||||||
sheetY = greekIndexY(ch)
|
sheetY = greekIndexY(ch)
|
||||||
}
|
}
|
||||||
SHEET_EXTB_ROMANIAN_EM -> {
|
SHEET_EXTB_ROMANIAN_WIDE -> {
|
||||||
sheetX = romanianIndexX(ch)
|
sheetX = romanianIndexX(ch)
|
||||||
sheetY = romanianIndexY(ch)
|
sheetY = romanianIndexY(ch)
|
||||||
}
|
}
|
||||||
SHEET_EXTB_ROMANIAN_EF -> {
|
SHEET_EXTB_ROMANIAN_NARROW -> {
|
||||||
sheetX = 0
|
sheetX = 0
|
||||||
sheetY = 0
|
sheetY = 0
|
||||||
}
|
}
|
||||||
SHEET_THAI_EM -> {
|
SHEET_THAI_WIDE -> {
|
||||||
sheetX = thaiIndexX(ch)
|
sheetX = thaiIndexX(ch)
|
||||||
sheetY = thaiIndexY(ch)
|
sheetY = thaiIndexY(ch)
|
||||||
}
|
}
|
||||||
SHEET_KEYCAP -> {
|
SHEET_KEYCAP -> {
|
||||||
sheetX = keycapIndexX(ch)
|
sheetX = keycapIndexX(ch)
|
||||||
sheetY = keycapIndexY(ch)
|
sheetY = keycapIndexY(ch)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
sheetX = ch.toInt() % 16
|
sheetX = ch.toInt() % 16
|
||||||
sheetY = ch.toInt() / 16
|
sheetY = ch.toInt() / 16
|
||||||
}
|
}
|
||||||
@@ -417,8 +415,8 @@ open class GameFontBase : Font {
|
|||||||
|
|
||||||
private fun getSheetType(c: Char): Int {
|
private fun getSheetType(c: Char): Int {
|
||||||
// EFs
|
// EFs
|
||||||
if (isRomanianEF(c))
|
if (isRomanianNarrow(c))
|
||||||
return SHEET_EXTB_ROMANIAN_EF
|
return SHEET_EXTB_ROMANIAN_NARROW
|
||||||
else if (isThaiEF(c))
|
else if (isThaiEF(c))
|
||||||
return SHEET_EXTA_VARW // will use fourth glyph in EXTA_EF
|
return SHEET_EXTA_VARW // will use fourth glyph in EXTA_EF
|
||||||
else if (isRunic(c))
|
else if (isRunic(c))
|
||||||
@@ -444,9 +442,9 @@ open class GameFontBase : Font {
|
|||||||
else if (isGreek(c))
|
else if (isGreek(c))
|
||||||
return SHEET_GREEK_VARW
|
return SHEET_GREEK_VARW
|
||||||
else if (isRomanian(c))
|
else if (isRomanian(c))
|
||||||
return SHEET_EXTB_ROMANIAN_EM
|
return SHEET_EXTB_ROMANIAN_WIDE
|
||||||
else if (isThai(c))
|
else if (isThai(c))
|
||||||
return SHEET_THAI_EM
|
return SHEET_THAI_WIDE
|
||||||
else if (c.isColourCode())
|
else if (c.isColourCode())
|
||||||
return SHEET_COLOURCODE
|
return SHEET_COLOURCODE
|
||||||
else if (isKeycap(c))
|
else if (isKeycap(c))
|
||||||
@@ -536,7 +534,7 @@ open class GameFontBase : Font {
|
|||||||
lateinit internal var wenQuanYi_2: SpriteSheet
|
lateinit internal var wenQuanYi_2: SpriteSheet
|
||||||
lateinit internal var greekSheet: SpriteSheet
|
lateinit internal var greekSheet: SpriteSheet
|
||||||
lateinit internal var romanianSheet: SpriteSheet
|
lateinit internal var romanianSheet: SpriteSheet
|
||||||
lateinit internal var romanianSheetEF: SpriteSheet
|
lateinit internal var romanianSheetNarrow: SpriteSheet
|
||||||
lateinit internal var thaiSheet: SpriteSheet
|
lateinit internal var thaiSheet: SpriteSheet
|
||||||
lateinit internal var keycapSheet: SpriteSheet
|
lateinit internal var keycapSheet: SpriteSheet
|
||||||
|
|
||||||
@@ -570,24 +568,16 @@ open class GameFontBase : Font {
|
|||||||
internal val SHEET_WENQUANYI_1 = 10
|
internal val SHEET_WENQUANYI_1 = 10
|
||||||
internal val SHEET_WENQUANYI_2 = 11
|
internal val SHEET_WENQUANYI_2 = 11
|
||||||
internal val SHEET_GREEK_VARW = 12
|
internal val SHEET_GREEK_VARW = 12
|
||||||
internal val SHEET_EXTB_ROMANIAN_EM = 13
|
internal val SHEET_EXTB_ROMANIAN_WIDE = 13
|
||||||
internal val SHEET_EXTB_ROMANIAN_EF = 14
|
internal val SHEET_EXTB_ROMANIAN_NARROW = 14
|
||||||
internal val SHEET_THAI_EM = 15
|
internal val SHEET_THAI_WIDE = 15
|
||||||
internal val SHEET_THAI_EF = 16
|
internal val SHEET_THAI_NARROW = 16
|
||||||
internal val SHEET_KEYCAP = 17
|
internal val SHEET_KEYCAP = 17
|
||||||
|
|
||||||
internal val SHEET_UNKNOWN = 254
|
internal val SHEET_UNKNOWN = 254
|
||||||
internal val SHEET_COLOURCODE = 255
|
internal val SHEET_COLOURCODE = 255
|
||||||
|
|
||||||
lateinit internal var sheetKey: Array<SpriteSheet?>
|
lateinit internal var sheetKey: Array<SpriteSheet?>
|
||||||
internal val greekEFList = arrayOf(
|
|
||||||
0x390.toChar(),
|
|
||||||
0x399.toChar(),
|
|
||||||
0x3AA.toChar(),
|
|
||||||
0x3AF.toChar(),
|
|
||||||
0x3B9.toChar(),
|
|
||||||
0x3CA.toChar()
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runic letters list used for game. The set is
|
* Runic letters list used for game. The set is
|
||||||
@@ -627,7 +617,7 @@ open class GameFontBase : Font {
|
|||||||
Pair(0x19.toChar(), Color(0x008000)), //v iridian
|
Pair(0x19.toChar(), Color(0x008000)), //v iridian
|
||||||
Pair(0x1A.toChar(), Color(0x805030)), //x (khaki)
|
Pair(0x1A.toChar(), Color(0x805030)), //x (khaki)
|
||||||
Pair(0x1B.toChar(), Color(0x808080)) //*k
|
Pair(0x1B.toChar(), Color(0x808080)) //*k
|
||||||
//* marked: commonly used
|
//* marked: commonly used
|
||||||
)
|
)
|
||||||
val colToCode = hashMapOf(
|
val colToCode = hashMapOf(
|
||||||
Pair("w", 0x10.toChar()),
|
Pair("w", 0x10.toChar()),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import org.newdawn.slick.*
|
|||||||
/**
|
/**
|
||||||
* Created by minjaesong on 16-01-20.
|
* Created by minjaesong on 16-01-20.
|
||||||
*/
|
*/
|
||||||
class GameFontWhite : GameFontBase() {
|
class GameFontImpl : GameFontBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
||||||
@@ -41,11 +41,11 @@ class GameFontWhite : GameFontBase() {
|
|||||||
GameFontBase.greekSheet = SpriteSheet(
|
GameFontBase.greekSheet = SpriteSheet(
|
||||||
"./assets/graphics/fonts/greek_variable.tga", 15, 19, 1)
|
"./assets/graphics/fonts/greek_variable.tga", 15, 19, 1)
|
||||||
GameFontBase.romanianSheet = SpriteSheet(
|
GameFontBase.romanianSheet = SpriteSheet(
|
||||||
"./assets/graphics/fonts/romana_fullwidth.tga", GameFontBase.W_LATIN_WIDE, GameFontBase.H)
|
"./assets/graphics/fonts/romana_wide.tga", GameFontBase.W_LATIN_WIDE, GameFontBase.H)
|
||||||
GameFontBase.romanianSheetEF = SpriteSheet(
|
GameFontBase.romanianSheetNarrow = SpriteSheet(
|
||||||
"./assets/graphics/fonts/romana_ef.tga", GameFontBase.W_LATIN_NARROW, GameFontBase.H)
|
"./assets/graphics/fonts/romana_narrow.tga", GameFontBase.W_LATIN_NARROW, GameFontBase.H)
|
||||||
GameFontBase.thaiSheet = SpriteSheet(
|
GameFontBase.thaiSheet = SpriteSheet(
|
||||||
"./assets/graphics/fonts/thai_fullwidth.tga", GameFontBase.W_LATIN_WIDE, GameFontBase.H)
|
"./assets/graphics/fonts/thai_wide.tga", GameFontBase.W_LATIN_WIDE, GameFontBase.H)
|
||||||
GameFontBase.keycapSheet = SpriteSheet(
|
GameFontBase.keycapSheet = SpriteSheet(
|
||||||
"./assets/graphics/fonts/puae000-e07f.tga", GameFontBase.SIZE_KEYCAP, GameFontBase.SIZE_KEYCAP)
|
"./assets/graphics/fonts/puae000-e07f.tga", GameFontBase.SIZE_KEYCAP, GameFontBase.SIZE_KEYCAP)
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ class GameFontWhite : GameFontBase() {
|
|||||||
GameFontBase.wenQuanYi_2,
|
GameFontBase.wenQuanYi_2,
|
||||||
GameFontBase.greekSheet,
|
GameFontBase.greekSheet,
|
||||||
GameFontBase.romanianSheet,
|
GameFontBase.romanianSheet,
|
||||||
GameFontBase.romanianSheetEF,
|
GameFontBase.romanianSheetNarrow,
|
||||||
GameFontBase.thaiSheet,
|
GameFontBase.thaiSheet,
|
||||||
null, // Thai EF, filler because not being used right now
|
null, // Thai EF, filler because not being used right now
|
||||||
GameFontBase.keycapSheet
|
GameFontBase.keycapSheet
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package net.torvald.terrarum
|
package net.torvald.terrarum
|
||||||
|
|
||||||
import net.torvald.imagefont.GameFontWhite
|
import net.torvald.imagefont.GameFontImpl
|
||||||
import net.torvald.terrarum.langpack.Lang
|
import net.torvald.terrarum.langpack.Lang
|
||||||
import org.newdawn.slick.*
|
import org.newdawn.slick.*
|
||||||
import org.newdawn.slick.state.BasicGameState
|
import org.newdawn.slick.state.BasicGameState
|
||||||
@@ -110,9 +110,10 @@ nopqrstuvwxyz
|
|||||||
"sjaldgæft ekki stjórnarskrárvarin",
|
"sjaldgæft ekki stjórnarskrárvarin",
|
||||||
"",
|
"",
|
||||||
"Also supports:",
|
"Also supports:",
|
||||||
"키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다. 대한민국! 머한민국? (대구) {머구} 명작, 띵작. 유식 윾싀",
|
"‛Unicode’ „quotation marks“—dashes…‼",
|
||||||
|
"으웽~. 얘! 위에 이 애 우유의 양 외워와! 아오~ 왜요? 어여! 예... 웬 초콜릿? 제가 원했던 건 뻥튀기 쬐끔과 의류예요. 얘야, 왜 또 불평? 퀡퇣풿횂",
|
||||||
"とりなくこゑす ゆめさませ みよあけわたる ひんかしを そらいろはえて おきつへに ほふねむれゐぬ もやのうち",
|
"とりなくこゑす ゆめさませ みよあけわたる ひんかしを そらいろはえて おきつへに ほふねむれゐぬ もやのうち",
|
||||||
"鳥啼く声す 夢覚ませ 見よ明け渡る 東を 空色栄えて 沖つ辺に 帆船群れゐぬ 靄の中 (using WenQuanYi)",
|
"鳥啼く声す 夢覚ませ 見よ明け渡る 東を 空色栄えて 沖つ辺に 帆船群れゐぬ 靄の中",
|
||||||
""
|
""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package net.torvald.terrarum
|
|||||||
import com.google.gson.JsonArray
|
import com.google.gson.JsonArray
|
||||||
import com.google.gson.JsonObject
|
import com.google.gson.JsonObject
|
||||||
import com.google.gson.JsonPrimitive
|
import com.google.gson.JsonPrimitive
|
||||||
import net.torvald.imagefont.GameFontWhite
|
import net.torvald.imagefont.GameFontImpl
|
||||||
import net.torvald.JsonFetcher
|
import net.torvald.JsonFetcher
|
||||||
import net.torvald.JsonWriter
|
import net.torvald.JsonWriter
|
||||||
import net.torvald.imagefont.TinyAlphNum
|
import net.torvald.imagefont.TinyAlphNum
|
||||||
@@ -94,7 +94,7 @@ constructor(gamename: String) : StateBasedGame(gamename) {
|
|||||||
override fun initStatesList(gc: GameContainer) {
|
override fun initStatesList(gc: GameContainer) {
|
||||||
gc.input.enableKeyRepeat()
|
gc.input.enableKeyRepeat()
|
||||||
|
|
||||||
fontGame = GameFontWhite()
|
fontGame = GameFontImpl()
|
||||||
fontSmallNumbers = TinyAlphNum()
|
fontSmallNumbers = TinyAlphNum()
|
||||||
|
|
||||||
// search for real controller
|
// search for real controller
|
||||||
@@ -130,14 +130,14 @@ constructor(gamename: String) : StateBasedGame(gamename) {
|
|||||||
//addState(StateTestingLightning())
|
//addState(StateTestingLightning())
|
||||||
//addState(StateSplash())
|
//addState(StateSplash())
|
||||||
//addState(StateMonitorCheck())
|
//addState(StateMonitorCheck())
|
||||||
addState(StateFontTester())
|
//addState(StateFontTester())
|
||||||
//addState(StateNoiseTexGen())
|
//addState(StateNoiseTexGen())
|
||||||
//addState(StateBlurTest())
|
//addState(StateBlurTest())
|
||||||
//addState(StateShaderTest())
|
//addState(StateShaderTest())
|
||||||
//addState(StateNoiseTester())
|
//addState(StateNoiseTester())
|
||||||
|
|
||||||
//ingame = StateInGame()
|
ingame = StateInGame()
|
||||||
//addState(ingame)
|
addState(ingame)
|
||||||
|
|
||||||
|
|
||||||
// foolproof
|
// foolproof
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
package net.torvald.terrarum.langpack
|
package net.torvald.terrarum.langpack
|
||||||
|
|
||||||
import net.torvald.CSVFetcher
|
|
||||||
import net.torvald.JsonFetcher
|
import net.torvald.JsonFetcher
|
||||||
import net.torvald.imagefont.GameFontWhite
|
|
||||||
import net.torvald.terrarum.Terrarum
|
import net.torvald.terrarum.Terrarum
|
||||||
import org.apache.commons.csv.CSVRecord
|
|
||||||
import org.newdawn.slick.SlickException
|
|
||||||
|
|
||||||
import java.io.*
|
import java.io.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package net.torvald.terrarum.ui
|
package net.torvald.terrarum.ui
|
||||||
|
|
||||||
import net.torvald.imagefont.GameFontWhite
|
import net.torvald.imagefont.GameFontImpl
|
||||||
import com.jme3.math.FastMath
|
import com.jme3.math.FastMath
|
||||||
import net.torvald.terrarum.blendDisable
|
import net.torvald.terrarum.blendDisable
|
||||||
import net.torvald.terrarum.blendNormal
|
import net.torvald.terrarum.blendNormal
|
||||||
@@ -40,7 +40,7 @@ constructor(override var width: Int, isBlackVariant: Boolean) : UICanvas {
|
|||||||
segmentRight = Image("./assets/graphics/gui/message_black_right.tga")
|
segmentRight = Image("./assets/graphics/gui/message_black_right.tga")
|
||||||
segmentBody = Image("./assets/graphics/gui/message_black_body.tga")
|
segmentBody = Image("./assets/graphics/gui/message_black_body.tga")
|
||||||
}
|
}
|
||||||
uiFont = GameFontWhite()
|
uiFont = GameFontImpl()
|
||||||
height = segmentLeft!!.height
|
height = segmentLeft!!.height
|
||||||
messageWindowRadius = segmentLeft!!.width
|
messageWindowRadius = segmentLeft!!.width
|
||||||
messagesList = arrayOf("", "")
|
messagesList = arrayOf("", "")
|
||||||
|
|||||||
Reference in New Issue
Block a user