Debian Codegraph @

debian/patches/use_system_font_files_instead_of_embedded.patch

raw
1 Description: Fix building using Debian packaged fonts
2
3 On Debian we don't want to use hard coded fonts, but we prefer using
4 distribution packaged ones. This patch allows using packaged fonts by passing
5 fonts path as script invocation paremter.
6
7 Author: Abou Al Montacir <[email protected]>
8
9 Origin: Paul Gevers <[email protected]>
10 Forwarded: not-needed
11 Last-Update: 2024-10-12
12 ---
13 --- a/src/fonts/mk_fonts.sh
14 +++ b/src/fonts/mk_fonts.sh
15 @@ -1,7 +1,8 @@
16 #!/bin/bash
17 -set -eu
18 +set -eux
19
20 TEXTUREFONT2PASCAL='texture-font-to-pascal'
21 +TTF_FONTS_DIR=${1:-data}
22
23 # Add option to have common Unicode characters available (not just ASCII),
24 # this way we cover many Latin languages out-of-the-box,
25 @@ -23,7 +24,7 @@ TEXTUREFONT2PASCAL="${TEXTUREFONT2PASCAL} --sample-text-file=common_unicode_char
26 # so that changing sizes used by default by CGE can be easily done by changing +
27 # running this shell script.
28 TEXT_NODE_FONT_SIZE=25
29 -$TEXTUREFONT2PASCAL --size "${TEXT_NODE_FONT_SIZE}" data/DejaVuSans.ttf --unit-name CastleTextureFont_Default3D_Sans --function-name Font_Default3D_Sans
30 +$TEXTUREFONT2PASCAL --size "${TEXT_NODE_FONT_SIZE}" ${TTF_FONTS_DIR}/DejaVuSans.ttf --unit-name CastleTextureFont_Default3D_Sans --function-name Font_Default3D_Sans
31
32 # For other 11 font variants used by X3D,
33 # see castle-model-viewer castle-model-viewer/embedded_data/fonts/ .
34 @@ -32,4 +33,4 @@ $TEXTUREFONT2PASCAL --size "${TEXT_NODE_FONT_SIZE}" data/DejaVuSans.ttf --unit-n
35 # Used by FallbackFont and (default) UIFont.
36 # Note that changing the default size here will change the default font size in UI,
37 # so we actually cannot do this, to not break compatibility.
38 -$TEXTUREFONT2PASCAL --size 20 data/DejaVuSans.ttf --unit-name CastleTextureFont_DefaultUi --function-name Font_DefaultUi
39 +$TEXTUREFONT2PASCAL --size 20 ${TTF_FONTS_DIR}/DejaVuSans.ttf --unit-name CastleTextureFont_DefaultUi --function-name Font_DefaultUi
40