mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-02-03 15:55:30 +03:00
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:
committed by
Misa Elizabeth Kai
parent
17d3c756c7
commit
f896a964fa
@@ -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.
|
||||
|
||||
@@ -53,7 +53,7 @@ Irish: Specific letters may be kept in lowercase when making a string full-caps.
|
||||
|
||||
=== W O R D W R A P P I N G A N D L E N G T H L I M I T S ===
|
||||
|
||||
For most languages, VVVVVV can automatically wordwrap based on spaces. This may not work for some languages (like Chinese, Japanese and Korean), so... TODO
|
||||
For most languages, VVVVVV can automatically wordwrap based on spaces. This may not work for some languages (like Chinese, Japanese and Korean), so instead, newlines can be inserted manually (see below) and automatic wordwrapping can be disabled in meta.xml.
|
||||
|
||||
VVVVVV's resolution is 320x240, and the default font is 8x8, which means there is a 40x30 character grid (although we don't adhere to this grid for the UI, but it gives a good indication). Naturally, if the font has a different size like 12x12, less characters will fit on the screen too.
|
||||
|
||||
@@ -65,7 +65,7 @@ Strings are usually annotated with their limits (for example, max="38*3"). This
|
||||
|
||||
(B) if X*Y (for example 33*3): the text should fit within an area of X characters wide and Y lines high. The text is automatically word-wrapped to fit (unless disabled in meta.xml). If automatic word-wrapping is disabled, you need to manually insert newlines with |, or possibly as a literal newline.
|
||||
|
||||
If your language uses a font with a different size than 8x8, there will be two limits given: `max`, which is the original limit based on the 8x8 font, and `max_local`, which is adapted to the size of your font. To get this notation, either use the maintenance option to sync language files from within VVVVVV, or use the Excel document. Ensure the correct font is set in meta.xml first.
|
||||
If your language uses a font with a different size than 8x8, there will be two limits given: `max`, which is the original limit based on the 8x8 font, and `max_local`, which is adapted to the size of your font. To get this notation, use the maintenance option to sync language files from within VVVVVV. Ensure the correct font is set in meta.xml first.
|
||||
|
||||
The translator menu has an option ("limits check") to automatically find strings that break the given limits. There may be a few cases where this detection isn't perfect, but it should be a helpful quality assurance tool.
|
||||
|
||||
@@ -75,9 +75,9 @@ The maximum lengths are not always given. Notoriously, menu option buttons are p
|
||||
|
||||
=== F O N T S ===
|
||||
|
||||
The game uses an 8x8 pixel font by default (font.png and font.txt in the "fonts" folder). If your language can be represented in 8x8 characters, it is preferable to use this font. TODO
|
||||
The game uses an 8x8 pixel font by default (font.png and font.fontmeta in the "fonts" folder). If your language can be represented in 8x8 characters, it is preferable to use this font, or for this font to be extended.
|
||||
|
||||
TODO: The fonts directory will also have a README.txt file
|
||||
The fonts directory also has a README.txt file that explains how the font format works.
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user