Commit fd60d84
committed
TTF font and Unicode support
All text is now rendered with TTF fonts using `pangocairo`, and UTF-8 strings are supported natively.
Add a dependency on `pango >= 1.46`, `cairo >= 1.18` and `fontconfig`.
Player names are restricted to a subset of Latin, Cyrillic and Greek characters in order to prevent abuse. The rest of the UI, console and particles can use any Unicode characters without restriction.
In addition to the color codes `\f0` through `\f9`, more codes have been added to support basic markup:
- \fb...\fB = bold
- \fi...\fI = italic
- \fu...\fU = underline
- \ft...\fT = strikethrough
- \fo...\fO = overline
where `...` is the part of the string to apply the markup to.
Using TTF fonts:
- each TTF file must be registered with the `registerfont` command before it can be used
- the `font` command is used to define a font family (and optionally style) to use in-game
- several commands are available to customize each font, see `config/font.cfg` for how to use them
- the `fontalias` command has been removed
Console changes:
- add the `conshadow` (0, 255, 255) variable: adds a shadow to console text for increased visibility
- change the range of `conscale` from (0.001, 0.45, 1000) to (0.5, 1, 2)
Text input changes:
- add the `cursorblink` (0, 750, 2000) variable to customize the cursor's blink speed (0 = disable blinking)
- add the `cursorcolor` (0xFFFFFF) variable to customize the cursor's color
- the cursor does not blink while the user is typing
Text particle changes:
- the font to use for each particle can be specified as an argument to `particle_text()`
- add the `particle_hud_text()` function: renders a text particle as a hud mark, similar to `particle_hud_mark()`, this is now used to render the `GOAL` label in CTF mode
UI changes:
- `uitext` and related commands accept a `fancy` argument, used for shadows and outlines, and a `language` argument, which may be necessary to render text in certain languages correctly. The language argument must be in `RFC 3066` format.
- valid values for `fancy`: 0 = nothing; 1 = shadow; 2 = outline; 3 = shadow + outline
- remove the `uitextrows` variable; UI text scale can still be configured with `uiscale`
- add the `uifps` (0, 60, 1000) variable: controls how often text elements check for text changes (0 = check every frame, may impact performace)
Miscellaneous changes:
- change the `filtertext` function to take a `flags` argument rather than a series of booleans
- remove the `tabify` and `textbright` commands
- remove the `tessfont` tool
Global font settings (users may change these to their liking):
- fontantialias (0, 1, 1): toggle font antialiasing (only grayscale antialiasing is supported)
- fonthinting (-1, -1, 3): set font hinting (-1 = system default, 0 = disabled, 1 = slight, 2 = medium, 3 = full)
Settings for individual fonts (to use after the `font` command, refer to `config/font.cfg`):
- fontweight [-3..6]: < 0 = lighter, > 0 = bolder
- fontstretch [-4..4]: < 0 = tighter, > 0 = wider; many fonts don't support this, use `fontletterspacing` instead
- fontstyle [0..2]: 0 = normal, 1 = oblique, 2 = italic
- fontsmallcaps 0|1
- fontletterspacing val: `val` is a floating point value, measured in points; < 0 = tighter, > 0 = wider
- fontfeatures [...features]: OpenType features, in CSS `font-feature-settings` format
- fontvariations "variations": for OpenType variable fonts, format: "AXIS1=VALUE,AXIS2=VALUE..."1 parent 86f18b5 commit fd60d84
41 files changed
Lines changed: 1555 additions & 1989 deletions
File tree
- config
- glsl
- ui
- hud
- source
- engine
- game
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
7 | 5 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 31 | | |
59 | 32 | | |
60 | 33 | | |
| |||
152 | 125 | | |
153 | 126 | | |
154 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
155 | 152 | | |
156 | 153 | | |
157 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
| 110 | + | |
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 116 | + | |
| 117 | + | |
121 | 118 | | |
122 | 119 | | |
123 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
337 | | - | |
| 336 | + | |
| 337 | + | |
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
| 738 | + | |
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
| |||
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
789 | | - | |
| 789 | + | |
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
793 | 793 | | |
794 | | - | |
| 794 | + | |
795 | 795 | | |
796 | | - | |
| 796 | + | |
797 | 797 | | |
798 | 798 | | |
799 | 799 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
| 48 | + | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
796 | | - | |
| 796 | + | |
797 | 797 | | |
798 | 798 | | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
| 799 | + | |
| 800 | + | |
807 | 801 | | |
808 | 802 | | |
809 | 803 | | |
810 | 804 | | |
811 | 805 | | |
812 | | - | |
| 806 | + | |
813 | 807 | | |
814 | 808 | | |
815 | 809 | | |
| |||
851 | 845 | | |
852 | 846 | | |
853 | 847 | | |
854 | | - | |
| 848 | + | |
855 | 849 | | |
856 | 850 | | |
857 | 851 | | |
| |||
880 | 874 | | |
881 | 875 | | |
882 | 876 | | |
883 | | - | |
| 877 | + | |
884 | 878 | | |
885 | 879 | | |
886 | 880 | | |
| |||
910 | 904 | | |
911 | 905 | | |
912 | 906 | | |
913 | | - | |
| 907 | + | |
914 | 908 | | |
915 | 909 | | |
916 | 910 | | |
| |||
940 | 934 | | |
941 | 935 | | |
942 | 936 | | |
943 | | - | |
| 937 | + | |
944 | 938 | | |
945 | 939 | | |
946 | 940 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
0 commit comments