Debian Codegraph @

src/fonts/mk_fonts.sh

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 #!/bin/bash
2 set -eu
3
4 TEXTUREFONT2PASCAL='texture-font-to-pascal'
5
6 # Add option to have common Unicode characters available (not just ASCII),
7 # this way we cover many Latin languages out-of-the-box,
8 # see https://gist.github.com/ivandrofly/0fe20773bd712b303f78 .
9 # Note: CGE applications can always define fonts that use more glyphs,
10 # e.g. to support Japanese or Chinese see https://castle-engine.io/manual_text.php .
11 TEXTUREFONT2PASCAL="${TEXTUREFONT2PASCAL} --sample-text-file=common_unicode_chars.txt"
12
13 # Some texture-font-to-pascal options are useful for debugging what's going on.
14 #TEXTUREFONT2PASCAL="${TEXTUREFONT2PASCAL} --debug-log --debug-font-image"
15
16 # Used by Text node in X3DNodes. This font is drawn in 3D,
17 # always automatically stretched to desired size, so you can freely
18 # adjust TEXT_NODE_FONT_SIZE to balance the font texture size vs nice font look.
19 #
20 # The default value is the maximum value where we still fit all in (at most)
21 # 2048x2048 texture.
22 # We deliberately use unit and function names that make the unit/function indendepent of the size,
23 # so that changing sizes used by default by CGE can be easily done by changing +
24 # running this shell script.
25 TEXT_NODE_FONT_SIZE=25
26 $TEXTUREFONT2PASCAL --size "${TEXT_NODE_FONT_SIZE}" data/DejaVuSans.ttf --unit-name CastleTextureFont_Default3D_Sans --function-name Font_Default3D_Sans
27
28 # For other 11 font variants used by X3D,
29 # see castle-model-viewer castle-model-viewer/embedded_data/fonts/ .
30 # We no longer generate / embed them in CGE core.
31
32 # Used by FallbackFont and (default) UIFont.
33 # Note that changing the default size here will change the default font size in UI,
34 # so we actually cannot do this, to not break compatibility.
35 $TEXTUREFONT2PASCAL --size 20 data/DejaVuSans.ttf --unit-name CastleTextureFont_DefaultUi --function-name Font_DefaultUi