diff --git a/assets/graphics/fonts/LatinExtA_ef.png b/assets/graphics/fonts/LatinExtA_ef.png index d95756b52..fc99ccaa3 100644 Binary files a/assets/graphics/fonts/LatinExtA_ef.png and b/assets/graphics/fonts/LatinExtA_ef.png differ diff --git a/assets/graphics/fonts/LatinExtA_fullwidth.png b/assets/graphics/fonts/LatinExtA_fullwidth.png index 8ab7ed002..53bde7176 100644 Binary files a/assets/graphics/fonts/LatinExtA_fullwidth.png and b/assets/graphics/fonts/LatinExtA_fullwidth.png differ diff --git a/assets/graphics/fonts/alphanumeric_small.png b/assets/graphics/fonts/alphanumeric_small.png index 23bce2c27..bcf024bbd 100644 Binary files a/assets/graphics/fonts/alphanumeric_small.png and b/assets/graphics/fonts/alphanumeric_small.png differ diff --git a/assets/graphics/fonts/ascii_fullwidth.png b/assets/graphics/fonts/ascii_fullwidth.png index 1476cf22c..3a48fe03d 100644 Binary files a/assets/graphics/fonts/ascii_fullwidth.png and b/assets/graphics/fonts/ascii_fullwidth.png differ diff --git a/assets/graphics/fonts/ascii_special_ef.png b/assets/graphics/fonts/ascii_special_ef.png index f022c6825..a7ff3f424 100644 Binary files a/assets/graphics/fonts/ascii_special_ef.png and b/assets/graphics/fonts/ascii_special_ef.png differ diff --git a/assets/graphics/fonts/cjkpunct.png b/assets/graphics/fonts/cjkpunct.png index 4ebf62fea..e19409990 100644 Binary files a/assets/graphics/fonts/cjkpunct.png and b/assets/graphics/fonts/cjkpunct.png differ diff --git a/assets/graphics/fonts/cyrilic_ef.png b/assets/graphics/fonts/cyrilic_ef.png index d2a217969..e9f43cb4b 100644 Binary files a/assets/graphics/fonts/cyrilic_ef.png and b/assets/graphics/fonts/cyrilic_ef.png differ diff --git a/assets/graphics/fonts/cyrilic_fullwidth.png b/assets/graphics/fonts/cyrilic_fullwidth.png index 50a6da465..23b6eb450 100644 Binary files a/assets/graphics/fonts/cyrilic_fullwidth.png and b/assets/graphics/fonts/cyrilic_fullwidth.png differ diff --git a/assets/graphics/fonts/fullwidth_forms.png b/assets/graphics/fonts/fullwidth_forms.png index ed5ddb41c..e7c8c75bf 100644 Binary files a/assets/graphics/fonts/fullwidth_forms.png and b/assets/graphics/fonts/fullwidth_forms.png differ diff --git a/assets/graphics/fonts/futhark.png b/assets/graphics/fonts/futhark.png index 3545ad8a8..7b85a1b7e 100644 Binary files a/assets/graphics/fonts/futhark.png and b/assets/graphics/fonts/futhark.png differ diff --git a/assets/graphics/fonts/greek_ef.png b/assets/graphics/fonts/greek_ef.png index 928d49059..d40991939 100644 Binary files a/assets/graphics/fonts/greek_ef.png and b/assets/graphics/fonts/greek_ef.png differ diff --git a/assets/graphics/fonts/greek_fullwidth.png b/assets/graphics/fonts/greek_fullwidth.png index c9d54c1e4..948ba86d9 100644 Binary files a/assets/graphics/fonts/greek_fullwidth.png and b/assets/graphics/fonts/greek_fullwidth.png differ diff --git a/assets/graphics/fonts/han_johab.png b/assets/graphics/fonts/han_johab.png index 7a88ba2d3..452fe91c8 100644 Binary files a/assets/graphics/fonts/han_johab.png and b/assets/graphics/fonts/han_johab.png differ diff --git a/assets/graphics/fonts/kana.png b/assets/graphics/fonts/kana.png index af8317eb9..47b515b38 100644 Binary files a/assets/graphics/fonts/kana.png and b/assets/graphics/fonts/kana.png differ diff --git a/assets/graphics/fonts/romana_ef.png b/assets/graphics/fonts/romana_ef.png index 48c1735e7..508e78bc0 100644 Binary files a/assets/graphics/fonts/romana_ef.png and b/assets/graphics/fonts/romana_ef.png differ diff --git a/assets/graphics/fonts/romana_fullwidth.png b/assets/graphics/fonts/romana_fullwidth.png index 7cd48090b..fbeb79e10 100644 Binary files a/assets/graphics/fonts/romana_fullwidth.png and b/assets/graphics/fonts/romana_fullwidth.png differ diff --git a/assets/graphics/fonts/thai_fullwidth.png b/assets/graphics/fonts/thai_fullwidth.png index 7b8d61adc..5d7cd78eb 100644 Binary files a/assets/graphics/fonts/thai_fullwidth.png and b/assets/graphics/fonts/thai_fullwidth.png differ diff --git a/assets/graphics/fonts/unipunct.png b/assets/graphics/fonts/unipunct.png index 7dc3d2727..bf1754b56 100644 Binary files a/assets/graphics/fonts/unipunct.png and b/assets/graphics/fonts/unipunct.png differ diff --git a/assets/graphics/fonts/wenquanyi_11pt_part1.png b/assets/graphics/fonts/wenquanyi_11pt_part1.png index a4c9be19c..243e6b497 100644 Binary files a/assets/graphics/fonts/wenquanyi_11pt_part1.png and b/assets/graphics/fonts/wenquanyi_11pt_part1.png differ diff --git a/assets/graphics/fonts/wenquanyi_11pt_part2.png b/assets/graphics/fonts/wenquanyi_11pt_part2.png index e46f37790..cc1ba8628 100644 Binary files a/assets/graphics/fonts/wenquanyi_11pt_part2.png and b/assets/graphics/fonts/wenquanyi_11pt_part2.png differ diff --git a/src/net/torvald/imagefont/GameFontBase.kt b/src/net/torvald/imagefont/GameFontBase.kt index 924eabe60..2cc7388db 100644 --- a/src/net/torvald/imagefont/GameFontBase.kt +++ b/src/net/torvald/imagefont/GameFontBase.kt @@ -263,17 +263,17 @@ constructor() : Font { indexJong, jongRow )*/ - hangulSheet.getSubImage(indexCho, choRow).draw( + hangulSheet.getSubImage(indexCho, choRow).drawWithShadow( Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(), Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(), scale.toFloat(), thisCol ) - hangulSheet.getSubImage(indexJung, jungRow).draw( + hangulSheet.getSubImage(indexJung, jungRow).drawWithShadow( Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(), Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(), scale.toFloat(), thisCol ) - hangulSheet.getSubImage(indexJong, jongRow).draw( + hangulSheet.getSubImage(indexJong, jongRow).drawWithShadow( Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(), Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(), scale.toFloat(), thisCol @@ -321,7 +321,7 @@ constructor() : Font { wenQuanYiIndexX(ch), wenQuanYi1IndexY(ch) )*/ - wenQuanYi_1.getSubImage(wenQuanYiIndexX(ch), wenQuanYi1IndexY(ch)).draw( + wenQuanYi_1.getSubImage(wenQuanYiIndexX(ch), wenQuanYi1IndexY(ch)).drawWithShadow( Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(), Math.round((H - H_UNIHAN) / 2 + y).toFloat(), scale.toFloat(), thisCol @@ -349,7 +349,7 @@ constructor() : Font { wenQuanYiIndexX(ch), wenQuanYi2IndexY(ch) )*/ - wenQuanYi_2.getSubImage(wenQuanYiIndexX(ch), wenQuanYi2IndexY(ch)).draw( + wenQuanYi_2.getSubImage(wenQuanYiIndexX(ch), wenQuanYi2IndexY(ch)).drawWithShadow( Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(), Math.round((H - H_UNIHAN) / 2 + y).toFloat(), scale.toFloat(), thisCol @@ -461,7 +461,7 @@ constructor() : Font { else 0, sheetX, sheetY )*/ - sheetKey[prevInstance]!!.getSubImage(sheetX, sheetY).draw( + sheetKey[prevInstance]!!.getSubImage(sheetX, sheetY).drawWithShadow( Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(), // to deal with the height difference of the sheets @@ -738,5 +738,17 @@ constructor() : Font { Pair("x", colourKey[0x1A.toChar()]), Pair("k", colourKey[0x1B.toChar()]) ) - } + + }// end of companion object +} + +fun Image.drawWithShadow(x: Float, y: Float, color: Color) = + this.drawWithShadow(x, y, 1f, color) + +fun Image.drawWithShadow(x: Float, y: Float, scale: Float, color: Color) { + this.draw(x + 1, y + 1, scale, color.darker(0.5f)) + this.draw(x , y + 1, scale, color.darker(0.5f)) + this.draw(x + 1, y , scale, color.darker(0.5f)) + + this.draw(x, y, scale, color) } diff --git a/src/net/torvald/imagefont/TinyAlphNum.kt b/src/net/torvald/imagefont/TinyAlphNum.kt index 343a9e2b6..812a21f94 100644 --- a/src/net/torvald/imagefont/TinyAlphNum.kt +++ b/src/net/torvald/imagefont/TinyAlphNum.kt @@ -60,24 +60,11 @@ class TinyAlphNum : Font { thisCol = GameFontBase.colourKey[ch]!! continue } - if (index != null) { - // shadow - fontSheet.getSubImage(index % 16, index / 16).draw( - x + textPosOffset + 1, y, thisCol.darker(0.5f) - ) - fontSheet.getSubImage(index % 16, index / 16).draw( - x + textPosOffset + 1, y + 1, thisCol.darker(0.5f) - ) - fontSheet.getSubImage(index % 16, index / 16).draw( - x + textPosOffset, y + 1, thisCol.darker(0.5f) - ) + fontSheet.getSubImage(index % 16, index / 16).drawWithShadow( + x + textPosOffset, y, thisCol + ) - // main - fontSheet.getSubImage(index % 16, index / 16).draw( - x + textPosOffset, y, thisCol - ) - } textPosOffset += W } }