Update readmes for new font system

There were still some TODOs left open for the font changes, and I also
made a dedicated README.txt in the fonts directory.
This commit is contained in:
Dav999-v
2023-01-23 23:56:19 +01:00
committed by Misa Elizabeth Kai
parent 17d3c756c7
commit f896a964fa
3 changed files with 132 additions and 28 deletions

View File

@@ -1,6 +1,6 @@
=== I N T R O D U C T I O N ===
This fill will explain what you need to know when maintaining translations of VVVVVV (like adding new strings and syncing them across languages).
This file will explain what you need to know when maintaining translations of VVVVVV (like adding new strings and syncing them across languages).
@@ -16,6 +16,81 @@ The max value indicates how many characters of space there is for the text, and
=== T E X T P R I N T I N G ===
These are the text printing functions:
font::print(flags, x, y, text, r, g, b)
font::print(flags, x, y, text, r, g, b, linespacing = -1, maxwidth = -1)
The flags argument can be 0, or a set of flags that do things like centering, enlarging, etc.
Some examples (can also be found in Font.h):
Standard print
font::print(0, 50, 50, "Hello world!", 255, 255, 255);
Centered text
font::print(PR_CEN, -1, 50, "Hello world!", 255, 255, 255);
(set X to -1, unless you want to center *around* X)
2x scale
font::print(PR_2X, 50, 50, "V", 255, 255, 255);
Centered 2x scale
font::print(PR_CEN | PR_2X, -1, 50, "V", 255, 255, 255);
Right-aligned 3x scale with a border around it
font::print(PR_RIGHT | PR_3X | PR_BOR, 320, 50, "V", 255, 255, 255);
Wordwrapped centered text
font::print_wrap(PR_CEN, -1, 50, "Hello world, this will wordwrap to the screen width", 255, 255, 255);
A not-technically-exhaustive list of all flags (which are defined in Font.h):
- PR_2X/PR_3X/.../PR_8X Print at larger scale (PR_1X is default)
- PR_FONT_INTERFACE [DEFAULT] Use interface (VVVVVV language) font
- PR_FONT_LEVEL Use level-specific font (room names, cutscenes, etc)
- PR_FONT_8X8 Use 8x8 font no matter what
- PR_BRIGHTNESS(value) Use this brightness 0-255 (this value is mixed with
r, g and b for an alpha effect)
- PR_BOR Draw a black border around the text
- PR_LEFT [DEFAULT] Left-align text/place at X coordinate
- PR_CEN Center-align text relative to X (X is center)
or to screen if X == -1
- PR_RIGHT Right-align text to X
(X is now the right border, not left border)
- PR_CJK_CEN [DEFAULT] Large fonts (Chinese/Japanese/Korean) should
stick out on top and bottom compared to 8x8 font
- PR_CJK_LOW Larger fonts should stick out fully on the bottom
(draw at Y)
- PR_CJK_HIGH Larger fonts should stick out fully on the top
=== S T R I N G F O R M A T T I N G ===
Instead of sprintf-family functions, it is preferred to use VVVVVV's own formatting system, VFormat.
Strings sometimes have placeholders, which look like {name} or {name|flags}. For example, "{n_trinkets} of {max_trinkets}".
Placeholders can also have "flags" that modify their behavior. These can be added or removed in the translation as needed. Flags are separated by | (pipe).
For more info, see the documentation at the top of VFormat.h.
Full example:
char buffer[100];
vformat_buf(buffer, sizeof(buffer),
"{crewmate} got {number} out of {total} trinkets in {m}:{s|digits=2}.{ms|digits=3}",
"number:int, total:int, crewmate:str, m:int, s:int, ms:int",
2, 20, "Vermilion", 2, 3, 1
);
=> "Vermilion got 2 out of 20 trinkets in 2:03.001"
=== T R A N S L A T O R M E N U ===
The translator menu has options for both translators and maintainers - it allows testing menus, translating room names within the game, syncing all language files with the English template files, getting statistics on translation progress, and more.
@@ -44,29 +119,6 @@ These files are untouched by the syncing feature.
=== S T R I N G F O R M A T T I N G ===
Instead of sprintf-family functions, it is preferred to use VVVVVV's own formatting system, VFormat.
Strings sometimes have placeholders, which look like {name} or {name|flags}. For example, "{n_trinkets} of {max_trinkets}".
Placeholders can also have "flags" that modify their behavior. These can be added or removed in the translation as needed. Flags are separated by | (pipe).
For more info, see the documentation at the top of VFormat.h.
Full example:
char buffer[100];
vformat_buf(buffer, sizeof(buffer),
"{crewmate} got {number} out of {total} trinkets in {m}:{s|digits=2}.{ms|digits=3}",
"number:int, total:int, crewmate:str, m:int, s:int, ms:int",
2, 20, "Vermilion", 2, 3, 1
);
=> "Vermilion got 2 out of 20 trinkets in 2:03.001"
=== F I L E S ===
* meta.xml: This file contains some general information about a translation.