11#if (LANGUAGE != LANGUAGE_JAPANESE)
35 secondIndex = (code << 8) >> 16;
39 if (work->
mode != 0) {
46 firstIndex = code - 32;
51 Iwram_ExpandBitRuns(glyph, pixels + 49, shadowColour);
52 Iwram_ExpandBitRuns(glyph, pixels + 50, shadowColour);
53 Iwram_ExpandBitRuns(glyph, pixels + 32, colour);
54 Iwram_ExpandBitRuns(glyph, pixels + 33, colour);
57 Iwram_ExpandBitRuns(glyph, pixels + 49, shadowColour);
58 Iwram_ExpandBitRuns(glyph, pixels + 32, colour);
61 if ((
u16)secondIndex != 0) {
70 secondWidth = *(
const u16 *)glyph;
136 if (work->
mode != 0) {
146 if (markGlyph != 0) {
152 if (markGlyph != 0) {
165 if (markGlyph != 0) {
186 tileLine = (tileLine << 4) + *pixel--;
188 }
while (pixelsLeft >= 0);
195 }
while (tileRow <= 1);
198 }
while (tileColumn <= 1);
204#if (LANGUAGE == LANGUAGE_GERMAN || LANGUAGE == LANGUAGE_SPANISH || \
205 LANGUAGE == LANGUAGE_FRENCH || LANGUAGE == LANGUAGE_ITALIAN)
206#define WIDE_WIDTH_FIXED 1
210#define FONT_GLYPH(n) \
211 ((const struct FontGlyph *)((n) * sizeof(struct FontGlyph) + \
212 (const u8 *)gUiText_Glyphs))
222#if !defined(WIDE_WIDTH_FIXED)
233 }
else if (code <= 0xffU) {
234#if defined(WIDE_WIDTH_FIXED)
238 if (glyphIndex > 1U) {
263#if (LANGUAGE != LANGUAGE_JAPANESE)
277#if (LANGUAGE != LANGUAGE_JAPANESE)
280 while ((code = *text++) != 0)
283#if (LANGUAGE != LANGUAGE_JAPANESE)
320#if (LANGUAGE != LANGUAGE_JAPANESE)
327#if (LANGUAGE != LANGUAGE_JAPANESE)
332#if (LANGUAGE == LANGUAGE_SPANISH)
333 if (code > 32 && nextCode > 32) {
338 if ((
u16)width <= 14) {
339 code |= nextCode << 8;
342 }
else if ((
u16)width <= 15) {
343 code |= nextCode << 8;
348 if (code > 32 && nextCode > 32 &&
351 code |= nextCode << 8;
377 s32 offsetX,
s32 offsetY) {
381 if (buffer ==
NULL) {
389 cell = ((work->
y + offsetY + 1) << 5) + (work->
x + offsetX) + 1;
390 if (cell < 32 * 20) {
444#if (LANGUAGE != LANGUAGE_JAPANESE)
452#if (LANGUAGE == LANGUAGE_GERMAN) || (LANGUAGE == LANGUAGE_SPANISH) || \
453 (LANGUAGE == LANGUAGE_FRENCH) || (LANGUAGE == LANGUAGE_ITALIAN)
489 for (offset = 12; offset != 0; offset--) {
490 buffer[offset] = value % 10 +
'0';
496 spaceCharacter =
' ';
498 minusCharacter =
'-';
499 for (leading = buffer; offset != 13; leading++, offset++) {
500 if (leading[1] ==
'0') {
502 leading[1] = spaceCharacter;
505 leading[0] = minusCharacter;
512 if (buffer[0] ==
' ') {
519 }
while (*trim ==
' ');
521 return buffer + offset;
524 if (width < 0 || width > 12)
526 return buffer + 13 - width;
const u16 gUiText_MarkGlyphCodes[]
void UiWork_ResetCounters(void)
Resets the text style glyphs are drawn with: colour 15, no outline, line spacing 10.
const struct FontGlyph gUiText_Glyphs[]
#define FONT_GLYPH(n)
The main font's glyph n, counted from the space character.
u8 * UiText_FormatNumber(u8 *buffer, s32 input, s32 width)
Writes value as decimal text into buffer (14 bytes) and returns where the text starts.
s32 UiText_GetWideStringWidth(u16 *text)
Returns the width in pixels of a zero-terminated string of 16-bit character codes: 4 for a space,...
s32 UiText_RenderGlyphPair(s32 code, u32 *out)
Draws a character, and a second one when the code carries it in bits 8 to 15, into a 16x16-pixel cell...
void UiText_RenderWideStringInWindow(s16 *text, struct UiWindow *window, s32 x, s32 y)
Draws a zero-terminated string of 16-bit character codes into a window's tilemap at tile (x,...
UNUSED void UiText_RenderGlyphTileAtWorkOffset(u16 *buffer, const struct UiWindow *work, s32 offsetX, s32 offsetY)
Draws a string of 16-bit character codes straight into the UI tilemap, as tiles, inside a window at t...
void UiText_RenderWideStringAtOffset(u16 *text, struct UiWindow *window, s32 x, s32 y)
Draws a zero-terminated string of 16-bit character codes into a text canvas window at pixel (x,...
#define Iwram_ExpandBitRuns
static s32 Iwram_ClearWords(void *destination, s32 size)
A character of the text font: its width and its rows of pixels.
u16 rows[FONT_GLYPH_ROWS]
The window system's work: the windows' tilemap, the windows, the three text channels,...
u8 mode
Set while Mind Read shows thoughts: round frame corners, colour 8 text with no shadow,...
u16 tilemap[640]
the windows' BG tilemap, 32 by 20 tiles
u8 dirty
The tilemap's 4-row bands to upload: bit 0 for all, bit n + 1 for band n.
u16 entries[RENDER_ENTRY_MASK+1]
decoded text, a ring of codes
u16 count
where the next code goes in entries
u16 colour
the current channel's, copied in to draw
u16 outline
the current channel's, copied in to draw
u16 lineSpacing
the current channel's, copied in to draw
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
u16 flags
UI_WINDOW_ flags; 0 once closing or free.
#define RENDER_ENTRY_MASK
const u8 gUiText_KanjiGlyphs[]
s32 UiText_RenderStringTiles(u16 *text, u16 *tiles, u16 *mirror, s32 x)
Draws a string of 16-bit character codes with the window font into tiles of their own,...
#define UI_TILEMAP_VRAM
The UI tilemap in VRAM (BG screen block 4), which UiWork_UploadDirtyBlocks copies the work block's ti...
@ UI_WINDOW_TEXT_CANVAS
text is drawn into a canvas of bitmap tiles (UiWindow_MapTextCanvasTiles)
void UiWindow_PutGlyph(struct UiWindow *win, u32 tile, u32 x, u32 y, s32 mode)
Puts a character into a window's tilemap as a tile at tile (x, y) of its interior.
s32 UiText_DrawGlyph(struct UiWindow *window, s32 character, s32 x, s32 y, s32 mode)
Draws a character of a window's text with its top-left corner at pixel (x, y) of the window's interio...
What every part of the window object shares: its includes, edition values, macros and the codes of de...
@ TEXT_OUTLINE
the next entry is the outline colour
@ TEXT_VOICED_MARK
dakuten
@ TEXT_SEMIVOICED_MARK
handakuten
@ TEXT_COLOUR
the next entry is the text colour
@ TEXT_LINE_SPACING
the next entry is the line spacing
#define TEXT_CODE_SEMIVOICED
#define TEXT_CODE_MARK_SHIFT