diff --git a/assets/internal_variable.tga b/assets/internal_variable.tga index a70d169..8cddb43 100644 Binary files a/assets/internal_variable.tga and b/assets/internal_variable.tga differ diff --git a/src/net/torvald/terrarumsansbitmap/gdx/TerrarumSansBitmap.kt b/src/net/torvald/terrarumsansbitmap/gdx/TerrarumSansBitmap.kt index 82eb5f5..8258d24 100755 --- a/src/net/torvald/terrarumsansbitmap/gdx/TerrarumSansBitmap.kt +++ b/src/net/torvald/terrarumsansbitmap/gdx/TerrarumSansBitmap.kt @@ -83,6 +83,8 @@ internal typealias Hash = Long * Shiftdown only occurs when non-diacritic character before the mark is lowercase, and the mark itself would stack up. * Stack-up or down is defined using Tag system. * + * If shifted glyphs does not appear correctly, try setting `diacriticStackingAlternative` to `true` + * * * * @param noShadow Self-explanatory @@ -100,7 +102,8 @@ class TerrarumSansBitmap( val textCacheSize: Int = 256, val debug: Boolean = false, val shadowAlpha: Float = 0.5f, - val shadowAlphaPremultiply: Boolean = false + val shadowAlphaPremultiply: Boolean = false, + val diacriticStackingAlternative: Boolean = false ) : BitmapFont() { constructor(fontDir: String, noShadow: Boolean, flipY: Boolean, invertShadow: Boolean) : this(fontDir, noShadow, flipY, invertShadow, false, 256, false) @@ -929,9 +932,9 @@ class TerrarumSansBitmap( //println("lastNonDiacriticChar: ${lastNonDiacriticChar.toHex()}") //println("cond: ${thisProp.alignXPos == GlyphProps.DIA_OVERLAY}, charIndex: $charIndex") if (thisProp.alignXPos == GlyphProps.DIA_OVERLAY) - posYbuffer[charIndex] -= H_OVERLAY_LOWERCASE_SHIFTDOWN // if minus-assign doesn't work, try plus-assign + posYbuffer[charIndex] -= H_OVERLAY_LOWERCASE_SHIFTDOWN * (!diacriticStackingAlternative).toSign() // if minus-assign doesn't work, try plus-assign else - posYbuffer[charIndex] -= H_STACKUP_LOWERCASE_SHIFTDOWN // if minus-assign doesn't work, try plus-assign + posYbuffer[charIndex] -= H_STACKUP_LOWERCASE_SHIFTDOWN * (!diacriticStackingAlternative).toSign() // if minus-assign doesn't work, try plus-assign } stackUpwardCounter++ @@ -1338,6 +1341,7 @@ class TerrarumSansBitmap( companion object { + private fun Boolean.toSign() = if (this) 1 else -1 /** * lowercase AND the height is equal to x-height (e.g. lowercase B, D, F, H, K, L, ... does not count @@ -1780,7 +1784,7 @@ for c in s: print(','.join(a)) */ // acegijmnopqrsuvwxyzɱɳʙɾɽʒʂʐʋɹɻɥɟɡɢʛȵɲŋɴʀɕʑçʝxɣχʁʜʍɰʟɨʉɯuʊøɘɵɤəɛœɜɞʌɔæɐɶɑɒɚɝɩɪʅʈʏʞⱥⱦⱱⱳⱴⱶⱷⱸⱺⱻꜥꜩꜫꜭꜯꜰꜱꜳꜵꜷꜹꜻꜽꜿꝋꝍꝏꝑꝓꝕꝗꝙꝛꝝꝟꝡꝫꝯꝳꝴꝵꝶꝷꝺꝼꝿꞁꞃꞅꞇꞑꞓꞔꞛꞝꞟꞡꞥꞧꞩꞮꞷꟺ\uA7AF\uA7B9\uA7C3\uA7CAƍƞơƣƨưƴƶƹƺƽƿıȷ - private val lowHeightLetters = intArrayOf(0x61,0x63,0x65,0x67,0x69,0x6a,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x75,0x76,0x77,0x78,0x79,0x7a,0x271,0x273,0x299,0x27e,0x27d,0x292,0x282,0x290,0x28b,0x279,0x27b,0x265,0x25f,0x261,0x262,0x29b,0x235,0x272,0x14b,0x274,0x280,0x255,0x291,0xe7,0x29d,0x78,0x263,0x3c7,0x281,0x29c,0x28d,0x270,0x29f,0x268,0x289,0x26f,0x75,0x28a,0xf8,0x258,0x275,0x264,0x259,0x25b,0x153,0x25c,0x25e,0x28c,0x254,0xe6,0x250,0x276,0x251,0x252,0x25a,0x25d,0x269,0x26a,0x285,0x288,0x28f,0x29e,0x2c65,0x2c66,0x2c71,0x2c73,0x2c74,0x2c76,0x2c77,0x2c78,0x2c7a,0x2c7b,0xa725,0xa729,0xa72b,0xa72d,0xa72f,0xa730,0xa731,0xa733,0xa735,0xa737,0xa739,0xa73b,0xa73d,0xa73f,0xa74b,0xa74d,0xa74f,0xa751,0xa753,0xa755,0xa757,0xa759,0xa75b,0xa75d,0xa75f,0xa761,0xa76b,0xa76f,0xa773,0xa774,0xa775,0xa776,0xa777,0xa77a,0xa77c,0xa77f,0xa781,0xa783,0xa785,0xa787,0xa791,0xa793,0xa794,0xa79b,0xa79d,0xa79f,0xa7a1,0xa7a5,0xa7a7,0xa7a9,0xa7ae,0xa7b7,0xa7fa,0xa7af,0xa7b9,0xa7c3,0xa7ca,0x18d,0x19e,0x1a1,0x1a3,0x1a8,0x1b0,0x1b4,0x1b6,0x1b9,0x1ba,0x1bd,0x1bf,0x131,0x237,0xFFE00).toSortedSet() + private val lowHeightLetters = intArrayOf(0x61,0x63,0x65,0x67,0x69,0x6a,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x75,0x76,0x77,0x78,0x79,0x7a,0x271,0x273,0x299,0x27e,0x27d,0x292,0x282,0x290,0x28b,0x279,0x27b,0x265,0x25f,0x261,0x262,0x29b,0x235,0x272,0x14b,0x274,0x280,0x255,0x291,0xe7,0x29d,0x78,0x263,0x3c7,0x281,0x29c,0x28d,0x270,0x29f,0x268,0x289,0x26f,0x75,0x28a,0xf8,0x258,0x275,0x264,0x259,0x25b,0x153,0x25c,0x25e,0x28c,0x254,0xe6,0x250,0x276,0x251,0x252,0x25a,0x25d,0x269,0x26a,0x285,0x288,0x28f,0x29e,0x2c65,0x2c66,0x2c71,0x2c73,0x2c74,0x2c76,0x2c77,0x2c78,0x2c7a,0x2c7b,0xa725,0xa729,0xa72b,0xa72d,0xa72f,0xa730,0xa731,0xa733,0xa735,0xa737,0xa739,0xa73b,0xa73d,0xa73f,0xa74b,0xa74d,0xa74f,0xa751,0xa753,0xa755,0xa757,0xa759,0xa75b,0xa75d,0xa75f,0xa761,0xa76b,0xa76f,0xa773,0xa774,0xa775,0xa776,0xa777,0xa77a,0xa77c,0xa77f,0xa781,0xa783,0xa785,0xa787,0xa791,0xa793,0xa794,0xa79b,0xa79d,0xa79f,0xa7a1,0xa7a5,0xa7a7,0xa7a9,0xa7ae,0xa7b7,0xa7fa,0xa7af,0xa7b9,0xa7c3,0xa7ca,0x18d,0x19e,0x1a1,0x1a3,0x1a8,0x1b0,0x1b4,0x1b6,0x1b9,0x1ba,0x1bd,0x1bf,0x131,0x237,0xFFE01).toSortedSet() // TŢŤƬƮȚͲΤТҬᛏṪṬṮṰⲦϮϯⴶꚌꚐᎢᛠꓔ private val kernTees = intArrayOf(0x54,0x162,0x164,0x1ac,0x1ae,0x21a,0x372,0x3a4,0x422,0x4ac,0x16cf,0x1e6a,0x1e6c,0x1e6e,0x1e70,0x2ca6,0x3ee,0x3ef,0x2d36,0xa68c,0xa690,0x13a2,0x16e0,0xa4d4).toSortedSet() // ŦȾYÝŶŸɎΎΫΥҮҰᛉᛘẎỲỴỶỸὙὛὝὟῪΎꓬȲ diff --git a/work_files/internal_variable.psd b/work_files/internal_variable.psd index b4b5d0b..1062924 100644 Binary files a/work_files/internal_variable.psd and b/work_files/internal_variable.psd differ