This PR makes signs_lib signs able to disply all Unicode Plane 0 characters (63000+), adding only ~2MB data.
Changes:
Added GNU Unifont as the fallback font. The font texture is made of 256 sheets (in textures/unifont), each with 16x16 chars. Rendering is done using (nested) ^[sheet filters.
Use of texture sheets greatly improves data compactness, so the 63000+ glyphs weigh only ~2MB in total. It comes with some transmission overhead though due to slightly longer texture strings, so the original individual PNG glyphs are still preferred for basic letters.
(Trivia: GNU Unifont is also the default "Unicode font" used in Minecraft, and also in the form of 16x16 texture sheets)
If desired, a "Unicode font" switch for each sign can be turned on to make all characters rendered in Unifont, which improves letter style consistency in multilingual texts.
This is similar to Minecraft's "force Unicode font" mode, however unlike MC this is a per-sign switch, not a global option, and does not affect UI.
Font sizes available are now 16 and 32, in order to fit 16px Unifont glyphs.
Former values (15 & 31) are now aliases to the new values for compatibility.
Besides charset support, I have also improved the escaping syntax for # (color codes) and ^ (arrows), the new rules are as follows:
#[0-9a-fA-F] changes color
^[1-8a-h] produces arrows
## and #^ produces literal # and ^ respectively
A #/^ not followed by characters mentioned above produces a normal #/^
Examples:
^3 produces →
#^3 produces ^3
##^3 produces #→
###^3 produces #^3
####^3 produces ##→
^k and #^k both produce ^k (^k is not a valid arrow sequence)
This PR makes
signs_lib
signs able to disply all Unicode Plane 0 characters (63000+), adding only ~2MB data.Changes:
Added GNU Unifont as the fallback font. The font texture is made of 256 sheets (in textures/unifont), each with 16x16 chars. Rendering is done using (nested)
^[sheet
filters.Use of texture sheets greatly improves data compactness, so the 63000+ glyphs weigh only ~2MB in total. It comes with some transmission overhead though due to slightly longer texture strings, so the original individual PNG glyphs are still preferred for basic letters.
(Trivia: GNU Unifont is also the default "Unicode font" used in Minecraft, and also in the form of 16x16 texture sheets)
If desired, a "Unicode font" switch for each sign can be turned on to make all characters rendered in Unifont, which improves letter style consistency in multilingual texts.
This is similar to Minecraft's "force Unicode font" mode, however unlike MC this is a per-sign switch, not a global option, and does not affect UI.
Font sizes available are now 16 and 32, in order to fit 16px Unifont glyphs.
Former values (15 & 31) are now aliases to the new values for compatibility.
Besides charset support, I have also improved the escaping syntax for
#
(color codes) and^
(arrows), the new rules are as follows:#[0-9a-fA-F]
changes color^[1-8a-h]
produces arrows##
and#^
produces literal#
and^
respectively#
/^
not followed by characters mentioned above produces a normal#
/^
Examples:
^3
produces→
#^3
produces^3
##^3
produces#→
###^3
produces#^3
####^3
produces##→
^k
and#^k
both produce^k
(^k
is not a valid arrow sequence)##^k
and###^k
both produce#^k
####^k
produces##^k
#1
changes color##1
produces#1
###1
produces#
, then changes color####1
produces##1
#k
and##k
both produce#k
(k
is not a hex digit)##
produces#
###
and####
both produce##