diff --git a/.idea/workspace.xml b/.idea/workspace.xml index e32a325..711d939 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -8,13 +8,8 @@ - - - - - @@ -693,27 +688,27 @@ - - - - - - - - - - - + - - + + + + + + + + + + + + diff --git a/FontTestGDX/demotext.txt b/FontTestGDX/demotext.txt index dc9ef10..daeb713 100644 --- a/FontTestGDX/demotext.txt +++ b/FontTestGDX/demotext.txt @@ -63,9 +63,9 @@ Multilingual brackets; these are the most basic things, right? Fixed-width numbers, because number-crunching matters - 􏀏ᚱ􏄏ᛂ􏈏ᚴ􏌏ᛋ􏐏ᛂ􏔏ᛋ􏘏ᛏ􏜏ᛋ􏠏ᚮ􏤏ᚾ􏨏ᛔ􏬏ᚢ􏰏ᛏ􏴏ᛚ􏸏ᚮ􏼏ᛋ􎼏᛬􍼏ᚱ􌼏ᛂ􋼏ᚴ􊼏ᛋ􉼏ᛋ􈼏ᚢ􇼏ᚼ􆼏ᚾ􅼏ᚢ􄼏ᛘ􃼏ᚢ􂼏ᛚ􁼏ᚾ􀼏ᛏ􀼟ᚮ􀼯᛬􀼿ᛏ􀽏ᚮ􀽟ᛋ􀽯ᛁ􀽿ᚮ􀾏ᚵ􀾟ᛂ􀾯ᚢ􀾿ᛏ􀿏ᚮ􀿟ᚱ􀿯ᛘ􀿿ᛔ􀻿ᚱ􀷿ᛂ􀳿ᚴ􀯿ᛋ􀫿ᛏ􀧿᛭􀣿ᛋ􀟿ᚢ􀛿ᚼ􀗿ᚾ􀓿ᚢ􀏿ᛋ􀋿ᛘ􀇿ᚮ􀃿ᛁ􁃿ᚵ􂃿ᚾ􃃿ᛁ􄃿ᛂ􅃿ᛏ􆃿ᚮ􇃿ᛑ􈃿᛭􉃿ᚵ􊃿ᛂ􋃿ᚢ􌃿ᛏ􍃿ᚮ􎃿ᚱ􀀀 + 􏼀ᚱ􏼐ᛂ􏼠ᚴ􏼰ᛋ􏽀ᛂ􏽐ᛋ􏽠ᛏ􏽰ᛋ􏾀ᚮ􏾐ᚾ􏾠ᛔ􏾰ᚢ􏿀ᛏ􏿐ᛚ􏿠ᚮ􏿰ᛋ􏻰᛬􏷰ᚱ􏳰ᛂ􏯰ᚴ􏫰ᛋ􏧰ᛋ􏣰ᚢ􏟰ᚼ􏛰ᚾ􏗰ᚢ􏓰ᛘ􏏰ᚢ􏋰ᛚ􏇰ᚾ􏃰ᛏ􏃱ᚮ􏃲᛬􏃳ᛏ􏃴ᚮ􏃵ᛋ􏃶ᛁ􏃷ᚮ􏃸ᚵ􏃹ᛂ􏃺ᚢ􏃻ᛏ􏃼ᚮ􏃽ᚱ􏃾ᛘ􏃿ᛔ􏃯ᚱ􏃟ᛂ􏃏ᚴ􏂿ᛋ􏂯ᛏ􏂟᛭􏂏ᛋ􏁿ᚢ􏁯ᚼ􏁟ᚾ􏁏ᚢ􏀿ᛋ􏀯ᛘ􏀟ᚮ􏀏ᛁ􏄏ᚵ􏈏ᚾ􏌏ᛁ􏐏ᛂ􏔏ᛏ􏘏ᚮ􏜏ᛑ􏠏᛭􏤏ᚵ􏨏ᛂ􏬏ᚢ􏰏ᛏ􏴏ᚮ􏸏ᚱ􀀀 -Colour-code that supports 65535 opaque or semi-transparent colours via 4 bit RGBA +Colour-code that supports 65535 opaque or semi-transparent colours via 4 bit ARGB 󿿹Гномът Доцьо приключи спящ в шейна за жаби󿿸 (Bulgarian) 󿿺Љубазни фењерџија чађавог лица хоће да ми покаже штос󿿸 (Serbian) diff --git a/FontTestGDX/lib/TerrarumSansBitmap.jar b/FontTestGDX/lib/TerrarumSansBitmap.jar index c9ba60e..8fafe34 100644 Binary files a/FontTestGDX/lib/TerrarumSansBitmap.jar and b/FontTestGDX/lib/TerrarumSansBitmap.jar differ diff --git a/FontTestGDX/src/FontTestGDX.kt b/FontTestGDX/src/FontTestGDX.kt index cf3de8b..a0a3771 100644 --- a/FontTestGDX/src/FontTestGDX.kt +++ b/FontTestGDX/src/FontTestGDX.kt @@ -33,7 +33,67 @@ class FontTestGDX : Game() { println("START") - val l = intArrayOf(0xF00F, + val l = intArrayOf(0xFF00, + 0xFF10, + 0xFF20, + 0xFF30, + 0xFF40, + 0xFF50, + 0xFF60, + 0xFF70, + 0xFF80, + 0xFF90, + 0xFFA0, + 0xFFB0, + 0xFFC0, + 0xFFD0, + 0xFFE0, + 0xFFF0, + 0xFEF0, + 0xFDF0, + 0xFCF0, + 0xFBF0, + 0xFAF0, + 0xF9F0, + 0xF8F0, + 0xF7F0, + 0xF6F0, + 0xF5F0, + 0xF4F0, + 0xF3F0, + 0xF2F0, + 0xF1F0, + 0xF0F0, + 0xF0F1, + 0xF0F2, + 0xF0F3, + 0xF0F4, + 0xF0F5, + 0xF0F6, + 0xF0F7, + 0xF0F8, + 0xF0F9, + 0xF0FA, + 0xF0FB, + 0xF0FC, + 0xF0FD, + 0xF0FE, + 0xF0FF, + 0xF0EF, + 0xF0DF, + 0xF0CF, + 0xF0BF, + 0xF0AF, + 0xF09F, + 0xF08F, + 0xF07F, + 0xF06F, + 0xF05F, + 0xF04F, + 0xF03F, + 0xF02F, + 0xF01F, + 0xF00F, 0xF10F, 0xF20F, 0xF30F, @@ -48,67 +108,7 @@ class FontTestGDX : Game() { 0xFC0F, 0xFD0F, 0xFE0F, - 0xFF0F, - 0xEF0F, - 0xDF0F, - 0xCF0F, - 0xBF0F, - 0xAF0F, - 0x9F0F, - 0x8F0F, - 0x7F0F, - 0x6F0F, - 0x5F0F, - 0x4F0F, - 0x3F0F, - 0x2F0F, - 0x1F0F, - 0x0F0F, - 0x0F1F, - 0x0F2F, - 0x0F3F, - 0x0F4F, - 0x0F5F, - 0x0F6F, - 0x0F7F, - 0x0F8F, - 0x0F9F, - 0x0FAF, - 0x0FBF, - 0x0FCF, - 0x0FDF, - 0x0FEF, - 0x0FFF, - 0x0EFF, - 0x0DFF, - 0x0CFF, - 0x0BFF, - 0x0AFF, - 0x09FF, - 0x08FF, - 0x07FF, - 0x06FF, - 0x05FF, - 0x04FF, - 0x03FF, - 0x02FF, - 0x01FF, - 0x00FF, - 0x10FF, - 0x20FF, - 0x30FF, - 0x40FF, - 0x50FF, - 0x60FF, - 0x70FF, - 0x80FF, - 0x90FF, - 0xA0FF, - 0xB0FF, - 0xC0FF, - 0xD0FF, - 0xE0FF, - 0xF0FF) + 0xFF0F) val s = "ᚱᛂᚴᛋᛂᛋᛏᛋᚮᚾᛔᚢᛏᛚᚮᛋ᛬ᚱᛂᚴᛋᛋᚢᚼᚾᚢᛘᚢᛚᚾᛏᚮ᛬ᛏᚮᛋᛁᚮᚵᛂᚢᛏᚮᚱᛘᛔᚱᛂᚴᛋᛏ᛭ᛋᚢᚼᚾᚢᛋᛘᚮᛁᚵᚾᛁᛂᛏᚮᛑ᛭ᚵᛂᚢᛏᚮᚱ" var lc = 0 var sc = 0 diff --git a/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt b/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt index 3c19150..8308dde 100644 --- a/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt +++ b/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt @@ -190,10 +190,10 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo if (colourBuffer.containsKey(codePoint)) return colourBuffer[codePoint]!! - val r = codePoint.and(0xF000).ushr(12) - val g = codePoint.and(0x0F00).ushr(8) - val b = codePoint.and(0x00F0).ushr(4) - val a = codePoint.and(0x000F) + val a = codePoint.and(0xF000).ushr(12) + val r = codePoint.and(0x0F00).ushr(8) + val g = codePoint.and(0x00F0).ushr(4) + val b = codePoint.and(0x000F) val col = Color(r.shl(28) or r.shl(24) or g.shl(20) or g.shl(16) or b.shl(12) or b.shl(8) or a.shl(4) or a) @@ -778,7 +778,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo } fun toColorCode(rgba4444: Int): String = GameFontBase.toColorCode(rgba4444) - fun toColorCode(r: Int, g: Int, b: Int, a: Int = 0x0F): String = toColorCode(r.shl(12) or g.shl(8) or b.shl(4) or a) + fun toColorCode(r: Int, g: Int, b: Int, a: Int = 0x0F): String = GameFontBase.toColorCode(r, g, b, a) val noColorCode = toColorCode(0x0000) val charsetOverrideNormal = Character.toChars(CHARSET_OVERRIDE_NULL) @@ -834,8 +834,8 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo val charsetOverrideNormal = Character.toChars(CHARSET_OVERRIDE_NULL) val charsetOverrideBulgarian = Character.toChars(CHARSET_OVERRIDE_BG_BG) val charsetOverrideSerbian = Character.toChars(CHARSET_OVERRIDE_SR_SR) - fun toColorCode(rgba4444: Int): String = Character.toChars(0x100000 + rgba4444).toColCode() - fun toColorCode(r: Int, g: Int, b: Int, a: Int = 0x0F): String = toColorCode(r.shl(12) or g.shl(8) or b.shl(4) or a) + fun toColorCode(argb4444: Int): String = Character.toChars(0x100000 + argb4444).toColCode() + fun toColorCode(r: Int, g: Int, b: Int, a: Int = 0x0F): String = toColorCode(a.shl(12) or r.shl(8) or g.shl(4) or b) private fun CharArray.toColCode(): String = "${this[0]}${this[1]}" val noColorCode = toColorCode(0x0000)