Native text and glyph rendering

Font selection, character widths, tiled text canvases and retained labels.

Studio uses Nintendo's font and graphics routines for native labels. Character lookup, measurement, glyph drawing and palette selection are separate steps. A correct Unicode string can still appear misplaced if its bearing, advance, tile order or palette bank is wrong. The following addresses are American V2 unless another release is named. [1]

Font selection

The loader at 0206D518 prepares ten objects. Selector 0206D70C maps a requested font number to an object slot; an out-of-range request falls back to slot six. Common fonts are loaded from Common/FontData; regional fonts come from the corresponding language directory. The archive loader at 0206D4E4 passes their data to SDK initialisation at 020AE984. [1]

Requested numberObject slotFont
00FotSeuratDB15
11FotSeuratDB32
26NITRO_LC_Font_s
35NITRO_LC_Font_m
49NumberFont
52FotSeuratB18
63FotSeuratDB14
77NITRO_LC_Font_s_Mail
84FotSeuratDB12
98NITRO_LC_Font_t

Lookup and measurement

NFTR initialisation relocates internal links, finds FINF and selects its character decoder. Initialising an already-relocated buffer again is unsafe. Lookup 020AE9B4 follows CMAP records through direct ranges, range tables or sorted sparse pairs. A miss returns 0xFFFF; the text consumer, rather than lookup itself, substitutes FINF's replacement glyph. The common small font has five direct ranges, sixteen range tables and one sparse table, covering 7,282 glyphs. [1]

Width lookup 020AE9FC returns a signed left bearing, bitmap width and advance from CWDH, falling back to FINF's defaults. Measurement 020AEA48 stops at NUL or a line feed, sums advances with inter-character spacing and removes the last spacing contribution when the result is positive. On a line feed it returns a continuation pointer to the next character; ordinary completion returns no continuation. Glyph-cell width must not be substituted for advance. [1]

Common fontCellGlyph count
Small9 × 127282
Number8 × 995
Medium9 × 15106
Tiny7 × 8106
Mail7 × 1294
ReleaseLookupWidthsMeasureInitialisation
JP V1020751F00207523802075284020751C0
JP V2020AE354020AE39C020AE3E8020AE324
US V2020AE9B4020AE9FC020AEA48020AE984
EU V2020AFA04020AFA4C020AFA98020AF9D4

Drawing into tiles

Canvas construction is at 020AF9DC, glyph dispatch at 020AF8B8, tiled placement at 020AF220, clipped unpacking at 020AEE48 and packed-bit reading at 020B05E0. Small and tiny source glyphs use one bit per pixel; the checked Seurat glyphs use three. Destination canvases can use four or eight bits per pixel. For a nonzero source sample, the stored index is ink minus one plus the sample. Zero samples leave existing pixels untouched. In four-bit storage, successive pixels occupy the low and high nibbles of a byte within each 8 × 8 tile. Coverage levels therefore survive; the glyph is not reduced to a binary mask. [1]

The signed bearing shifts the drawing origin; the returned advance still determines the next character position. Line drawing is at 020AFDB8 and multiline drawing at 020AFE6C. Each line advances by FINF's line feed plus the requested extra spacing. Flag 0x0800 aligns right and 0x0400 centres; right alignment takes precedence when both are present. For ordinary positive widths, centring uses integer divisions of (block width + 1) and (line width + 1) separately. [1]

Retained text objects

Constructor 0202EA14 takes twelve meaningful arguments: node, borrowed UTF-16 string, position pair, flags, character spacing, extra line spacing, ink, palette bank, optional animation child, graphics configuration, font and bounds pair. An eleven-argument declaration omits the final stack-supplied bounds. It copies the twenty-byte graphics configuration, allocates a rounded tile canvas, clears it with the SDK routine and prepares its OAM objects. [1]

Byte offset (decimal)Contents
0SDK canvas
4OAM pointer
8OAM count
12Copied graphics configuration
16Raster buffer
20 / 22Signed X / Y
24Palette bank
25Submission byte
26Tile count

Replacement 0202EAFC retains the caller's string pointer, so that storage must remain valid. It forwards to the bounds/reflow routine at 0202FE40, clears the old canvas and redraws through 0202FAC4. Replacing a wide label with a narrow one or an empty string removes its old pixels without reallocating the object. A configured shadow is drawn first at an offset, followed by the main glyphs. Palette setter 0202EB4C can remap the requested bank before storing it; it does not change font size. [1]

The constructor initially measures with character spacing one, then installs the requested spacing. It does not immediately repeat the width calculation. A subsequent string update measures with the live spacing. This explains a constructor/update difference without establishing a general on-screen defect. [1]

Inline ink changes

The favourite-button label at 0205F87C uses English “Add ★” with font number five. Its enabled form inserts UTF-16 controls 0002 before the star and 0001 after it. Routine 0202FDF0 interprets those as ink two and ink nine; they take no following argument. The enabled label uses palette bank thirteen. Disabling restores the normal message and remembered bank. Glyph coverage and palette-bank selection remain separate. [1]

Regional differences

Japanese V1's Seurat B18 has 496 glyphs in 20 × 20 cells with line feed eighteen; Japanese V2 has 603. European English B18 has 195 glyphs in 20 × 23 cells with line feed twenty-three. The small font remains 9 × 12 with line feed twelve and 7,282 glyphs. European B18 cannot draw Hiragana あ: its replacement glyph has zero bitmap width and advance six, so measurement advances while the pixel buffer stays unchanged. [1]

These results come from original CPU routines and original font data, including measurement, clipping, retained labels and regional glyph cases. They do not establish every rotated-font case, GPU submission or complete screen composition. Regional routines must be mapped independently rather than shifted by one assumed address delta. [1]

Keyboard editing and display are connected

Seven American V2 comparisons join 0206CDF8 to key editing, graph lookup, text setting, reflow, bounds, clearing and indexed glyph rasterisation using original NFTR cells. They cover empty/nonempty blink states, lower/shifted Key13 and Backspace with/without text. Key13 is q; the blink chooses the original underscore or space literal. Every output pixel, measured width and borrowed text pointer was checked in a declared 64 × 64 component. This is a text-rendering comparison, not a recovered whole-keyboard screenshot. Authored layout, every input method and physical key timing remain outside it. [2]

HTML segments become measured glyph records

American V2 producer 0207DADC now has connected checks through original NFTR character lookup, advances, emitted records and trailing-word relocation. Its segment decoder handles one-, two- and three-byte forms. The tested unsupported four-byte sequence becomes native replacement glyphs, rather than modern full-Unicode decoding. At this low-level entry CRLF differs from bare LF; surrounding HTML normalisation may alter the source before it arrives. [3]

When a run no longer fits, the native character-range decision can move trailing glyphs already emitted to the next line. Sixteen independent geometry comparisons cover short/long words, spaces, narrow widths, CJK, accented text, unsupported bytes and empty input. The font is the original small common NFTR; size, line height, spacing, colour slot and bounds are explicit inputs. These are glyph-list comparisons, not raster or GPU output. Their zero-spacing fixture is distinct from the normal CSS template, which supplies spacing one. [3]

Sources

  1. [1] Flipnote Decompilation Project — Native fonts, text canvases and regional glyph rendering
  2. [2] Flipnote Decompilation Project — Keyboard update into original NFTR rasterisation
  3. [3] Flipnote Decompilation Project — Original HTML text segmentation, wrapping and NFTR advances

← All documentation