KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
biosfont.h
Go to the documentation of this file.
1/* KallistiOS ##version##
2
3 dc/biosfont.h
4 Copyright (C) 2000-2001 Megan Potter
5 Japanese Functions Copyright (C) 2002 Kazuaki Matsumoto
6 Copyright (C) 2017 Donald Haase
7 Copyright (C) 2024 Falco Girgis
8 Copyright (C) 2024 Andress Barajas
9
10*/
11
12/** \file dc/biosfont.h
13 \brief BIOS font drawing functions.
14 \ingroup bfont
15
16 This file provides support for utilizing the font built into the Dreamcast's
17 BIOS. These functions allow access to both the western character set and
18 Japanese characters.
19
20 \author Megan Potter
21 \author Kazuaki Matsumoto
22 \author Donald Haase
23 \author Falco Girgis
24
25 \todo
26 - More user-friendly way to fetch/print DC-specific icons.
27*/
28
29#ifndef __DC_BIOSFONT_H
30#define __DC_BIOSFONT_H
31
32#include <kos/cdefs.h>
33__BEGIN_DECLS
34
35#include <stdint.h>
36#include <stdbool.h>
37#include <stdarg.h>
38
39#include <arch/types.h>
40
41/** \defgroup bfont BIOS
42 \brief API for the Dreamcast's built-in BIOS font.
43 \ingroup video_fonts
44 @{
45*/
46
47/** \defgroup bfont_size Dimensions
48 \brief Font size definitions for the BIOS fonts.
49 @{
50*/
51#define BFONT_THIN_WIDTH 12 /**< \brief Width of Thin Font (ISO8859_1, half-JP) */
52#define BFONT_WIDE_WIDTH (BFONT_THIN_WIDTH * 2) /**< \brief Width of Wide Font (full-JP) */
53#define BFONT_HEIGHT 24 /**< \brief Height of All Fonts */
54#define BFONT_ICON_DIMEN 32 /**< \brief Dimension of vmu icons */
55/** @} */
56
57/** \defgroup bfont_byte_size Byte Sizes
58 \brief Byte size definitions for the BIOS fonts.
59 @{
60*/
61/** \brief Number of bytes to represent a single thin character within the BIOS font. */
62#define BFONT_BYTES_PER_CHAR (BFONT_THIN_WIDTH * BFONT_HEIGHT / 8)
63
64/** \brief Number of bytes to represent a single wide character within the BIOS font. */
65#define BFONT_BYTES_PER_WIDE_CHAR (BFONT_WIDE_WIDTH * BFONT_HEIGHT / 8)
66
67/** \brief Number of bytes to represent a vmu icon within the BIOS font. */
68#define BFONT_BYTES_PER_VMU_ICON (BFONT_ICON_DIMEN * BFONT_ICON_DIMEN / 8)
69
70/** @} */
71
72/** \defgroup bfont_indicies Structure
73 \brief Structure of the Bios Font.
74 @{
75*/
76/** \brief Start of Narrow Characters in Font Block */
77#define BFONT_NARROW_START 0
78#define BFONT_OVERBAR BFONT_NARROW_START
79#define BFONT_ISO_8859_1_33_126 (BFONT_NARROW_START + ( 1 * BFONT_BYTES_PER_CHAR))
80#define BFONT_YEN (BFONT_NARROW_START + (95 * BFONT_BYTES_PER_CHAR))
81#define BFONT_ISO_8859_1_160_255 (BFONT_NARROW_START + (96 * BFONT_BYTES_PER_CHAR))
82
83/* JISX-0208 Rows 1-7 and 16-84 are encoded between BFONT_WIDE_START and BFONT_DREAMCAST_SPECIFIC.
84 Only the box-drawing characters (row 8) are missing. */
85/** \brief Size of a row for JISX-0208 characters */
86#define JISX_0208_ROW_SIZE 94
87/** \brief Start of Wide Characters in Font Block */
88#define BFONT_WIDE_START (288 * BFONT_BYTES_PER_CHAR)
89/** \brief Start of JISX-0208 Rows 1-7 in Font Block */
90#define BFONT_JISX_0208_ROW1 BFONT_WIDE_START
91/** \brief Start of JISX-0208 Row 16-47 (Start of Level 1) in Font Block */
92#define BFONT_JISX_0208_ROW16 (BFONT_WIDE_START + (658 * BFONT_BYTES_PER_WIDE_CHAR))
93/** \brief JISX-0208 Row 48-84 (Start of Level 2) in Font Block */
94#define BFONT_JISX_0208_ROW48 (BFONT_JISX_0208_ROW16 + ((32 * JISX_0208_ROW_SIZE) * BFONT_BYTES_PER_WIDE_CHAR))
95
96/** \brief Start of DC Specific Icons in Font Block */
97#define BFONT_DREAMCAST_SPECIFIC (BFONT_WIDE_START + (7056 * BFONT_BYTES_PER_WIDE_CHAR))
98
99/** \brief Start of VMU Specific Icons in Font Block */
100#define BFONT_VMU_DREAMCAST_SPECIFIC (BFONT_DREAMCAST_SPECIFIC+(22 * BFONT_BYTES_PER_WIDE_CHAR))
101
102/** \brief Builtin DC Icons
103
104 Builtin DC user icons.
105 @{
106*/
107typedef enum bfont_dc_icon {
108 BFONT_ICON_CIRCLECOPYRIGHT = 0x00, /**< \brief Circle copyright */
109 BFONT_CIRCLER = 0x01, /**< \brief Circle restricted */
110 BFONT_ICON_TRADEMARK = 0x02, /**< \brief Trademark */
111 BFONT_ICON_UPARROW = 0x03, /**< \brief Up arrow */
112 BFONT_ICON_DOWNARROW = 0x04, /**< \brief Down arrow */
113 BFONT_ICON_LEFTARROW = 0x05, /**< \brief Left arrow */
114 BFONT_ICON_RIGHTARROW = 0x06, /**< \brief Right arrow */
115 BFONT_ICON_UPRIGHTARROW = 0x07, /**< \brief Up right arrow */
116 BFONT_ICON_DOWNRIGHTARROW = 0x08, /**< \brief Down right arrow */
117 BFONT_ICON_DOWNLEFTARROW = 0x09, /**< \brief Down left arrow */
118 BFONT_ICON_UPLEFTARROW = 0x0A, /**< \brief Up left arrow */
119 BFONT_ICON_ABUTTON = 0x0B, /**< \brief A button */
120 BFONT_ICON_BBUTTON = 0x0C, /**< \brief B button */
121 BFONT_ICON_CBUTTON = 0x0D, /**< \brief C button */
122 BFONT_ICON_DBUTTON = 0x0E, /**< \brief D button */
123 BFONT_ICON_XBUTTON = 0x0F, /**< \brief X button */
124 BFONT_ICON_YBUTTON = 0x10, /**< \brief Y button */
125 BFONT_ICON_ZBUTTON = 0x11, /**< \brief Z button */
126 BFONT_ICON_LTRIGGER = 0x12, /**< \brief L trigger */
127 BFONT_ICON_RTRIGGER = 0x13, /**< \brief R trigger */
128 BFONT_ICON_STARTBUTTON = 0x14, /**< \brief Start button */
129 BFONT_ICON_VMU = 0x15 /**< \brief VMU icon */
131/** @} */
132
133/** \brief Builtin VMU Icons
134
135 Builtin VMU volume user icons. The Dreamcast's BIOS allows the
136 user to set these when formatting the VMU.
137 @{
138*/
139typedef enum bfont_vmu_icon {
140 BFONT_ICON_INVALID_VMU = 0x00, /**< \brief Invalid */
141 BFONT_ICON_HOURGLASS_ONE = 0x01, /**< \brief Hourglass 1 */
142 BFONT_ICON_HOURGLASS_TWO = 0x02, /**< \brief Hourglass 2 */
143 BFONT_ICON_HOURGLASS_THREE = 0x03, /**< \brief Hourglass 3 */
144 BFONT_ICON_HOURGLASS_FOUR = 0x04, /**< \brief Hourglass 4 */
145 BFONT_ICON_VMUICON = 0x05, /**< \brief VMU */
146 BFONT_ICON_EARTH = 0x06, /**< \brief Earth */
147 BFONT_ICON_SATURN = 0x07, /**< \brief Saturn */
148 BFONT_ICON_QUARTER_MOON = 0x08, /**< \brief Quarter moon */
149 BFONT_ICON_LAUGHING_FACE = 0x09, /**< \brief Laughing face */
150 BFONT_ICON_SMILING_FACE = 0x0A, /**< \brief Smiling face */
151 BFONT_ICON_CASUAL_FACE = 0x0B, /**< \brief Casual face */
152 BFONT_ICON_ANGRY_FACE = 0x0C, /**< \brief Angry face */
153 BFONT_ICON_COW = 0x0D, /**< \brief Cow */
154 BFONT_ICON_HORSE = 0x0E, /**< \brief Horse */
155 BFONT_ICON_RABBIT = 0x0F, /**< \brief Rabbit */
156 BFONT_ICON_CAT = 0x10, /**< \brief Cat */
157 BFONT_ICON_CHICK = 0x11, /**< \brief Chick */
158 BFONT_ICON_LION = 0x12, /**< \brief Lion */
159 BFONT_ICON_MONKEY = 0x13, /**< \brief Monkye */
160 BFONT_ICON_PANDA = 0x14, /**< \brief Panda */
161 BFONT_ICON_BEAR = 0x15, /**< \brief Bear */
162 BFONT_ICON_PIG = 0x16, /**< \brief Pig */
163 BFONT_ICON_DOG = 0x17, /**< \brief Dog */
164 BFONT_ICON_FISH = 0x18, /**< \brief Fish */
165 BFONT_ICON_OCTOPUS = 0x19, /**< \brief Octopus */
166 BFONT_ICON_SQUID = 0x1A, /**< \brief Squid */
167 BFONT_ICON_WHALE = 0x1B, /**< \brief Whale */
168 BFONT_ICON_CRAB = 0x1C, /**< \brief Crab */
169 BFONT_ICON_BUTTERFLY = 0x1D, /**< \brief Butterfly */
170 BFONT_ICON_LADYBUG = 0x1E, /**< \brief Ladybug */
171 BFONT_ICON_ANGLER_FISH = 0x1F, /**< \brief Angler fish */
172 BFONT_ICON_PENGUIN = 0x20, /**< \brief Penguin */
173 BFONT_ICON_CHERRIES = 0x21, /**< \brief Cherries */
174 BFONT_ICON_TULIP = 0x22, /**< \brief Tulip */
175 BFONT_ICON_LEAF = 0x23, /**< \brief Leaf */
176 BFONT_ICON_SAKURA = 0x24, /**< \brief Sakura */
177 BFONT_ICON_APPLE = 0x25, /**< \brief Apple */
178 BFONT_ICON_ICECREAM = 0x26, /**< \brief Ice cream */
179 BFONT_ICON_CACTUS = 0x27, /**< \brief Cactus */
180 BFONT_ICON_PIANO = 0x28, /**< \brief Piano */
181 BFONT_ICON_GUITAR = 0x29, /**< \brief Guitar */
182 BFONT_ICON_EIGHTH_NOTE = 0x2A, /**< \brief Eighth note */
183 BFONT_ICON_TREBLE_CLEF = 0x2B, /**< \brief Treble clef */
184 BFONT_ICON_BOAT = 0x2C, /**< \brief Boat */
185 BFONT_ICON_CAR = 0x2D, /**< \brief Car */
186 BFONT_ICON_HELMET = 0x2E, /**< \brief Helmet */
187 BFONT_ICON_MOTORCYCLE = 0x2F, /**< \brief Motorcycle */
188 BFONT_ICON_VAN = 0x30, /**< \brief Van */
189 BFONT_ICON_TRUCK = 0x31, /**< \brief Truck */
190 BFONT_ICON_CLOCK = 0x32, /**< \brief Clock */
191 BFONT_ICON_TELEPHONE = 0x33, /**< \brief Telephone */
192 BFONT_ICON_PENCIL = 0x34, /**< \brief Pencil */
193 BFONT_ICON_CUP = 0x35, /**< \brief Cup */
194 BFONT_ICON_SILVERWARE = 0x36, /**< \brief Silverware */
195 BFONT_ICON_HOUSE = 0x37, /**< \brief House */
196 BFONT_ICON_BELL = 0x38, /**< \brief Bell */
197 BFONT_ICON_CROWN = 0x39, /**< \brief Crown */
198 BFONT_ICON_SOCK = 0x3A, /**< \brief Sock */
199 BFONT_ICON_CAKE = 0x3B, /**< \brief cake */
200 BFONT_ICON_KEY = 0x3C, /**< \brief Key */
201 BFONT_ICON_BOOK = 0x3D, /**< \brief Book */
202 BFONT_ICON_BASEBALL = 0x3E, /**< \brief Baseball */
203 BFONT_ICON_SOCCER = 0x3F, /**< \brief Soccer */
204 BFONT_ICON_BULB = 0x40, /**< \brief Bulb */
205 BFONT_ICON_TEDDY_BEAR = 0x41, /**< \brief Teddy bear */
206 BFONT_ICON_BOW_TIE = 0x42, /**< \brief Bow tie */
207 BFONT_ICON_BOW_ARROW = 0x43, /**< \brief Bow and arrow */
208 BFONT_ICON_SNOWMAN = 0x44, /**< \brief Snowman */
209 BFONT_ICON_LIGHTNING = 0x45, /**< \brief Lightning */
210 BFONT_ICON_SUN = 0x46, /**< \brief Sun */
211 BFONT_ICON_CLOUD = 0x47, /**< \brief Cloud */
212 BFONT_ICON_UMBRELLA = 0x48, /**< \brief Umbrella */
213 BFONT_ICON_ONE_STAR = 0x49, /**< \brief One star */
214 BFONT_ICON_TWO_STARS = 0x4A, /**< \brief Two stars */
215 BFONT_ICON_THREE_STARS = 0x4B, /**< \brief Three stars */
216 BFONT_ICON_FOUR_STARS = 0x4C, /**< \brief Four stars */
217 BFONT_ICON_HEART = 0x4D, /**< \brief Heart */
218 BFONT_ICON_DIAMOND = 0x4E, /**< \brief Diamond */
219 BFONT_ICON_SPADE = 0x4F, /**< \brief Spade */
220 BFONT_ICON_CLUB = 0x50, /**< \brief Club */
221 BFONT_ICON_JACK = 0x51, /**< \brief Jack */
222 BFONT_ICON_QUEEN = 0x52, /**< \brief Queen */
223 BFONT_ICON_KING = 0x53, /**< \brief King */
224 BFONT_ICON_JOKER = 0x54, /**< \brief Joker */
225 BFONT_ICON_ISLAND = 0x55, /**< \brief Island */
226 BFONT_ICON_0 = 0x56, /**< \brief `0` digit */
227 BFONT_ICON_1 = 0x57, /**< \brief `1` digit */
228 BFONT_ICON_2 = 0x58, /**< \brief `2` digit */
229 BFONT_ICON_3 = 0x59, /**< \brief `3` digit */
230 BFONT_ICON_4 = 0x5A, /**< \brief `4` digit */
231 BFONT_ICON_5 = 0x5B, /**< \brief `5` digit */
232 BFONT_ICON_6 = 0x5C, /**< \brief `6` digit */
233 BFONT_ICON_7 = 0x5D, /**< \brief `7` digit */
234 BFONT_ICON_8 = 0x5E, /**< \brief `8` digit */
235 BFONT_ICON_9 = 0x5F, /**< \brief `9` digit */
236 BFONT_ICON_A = 0x60, /**< \brief `A` letter */
237 BFONT_ICON_B = 0x61, /**< \brief `B` letter */
238 BFONT_ICON_C = 0x62, /**< \brief `C` letter */
239 BFONT_ICON_D = 0x63, /**< \brief `D` letter */
240 BFONT_ICON_E = 0x64, /**< \brief `E` letter */
241 BFONT_ICON_F = 0x65, /**< \brief `F` letter */
242 BFONT_ICON_G = 0x66, /**< \brief `G` letter */
243 BFONT_ICON_H = 0x67, /**< \brief `H` letter */
244 BFONT_ICON_I = 0x68, /**< \brief `I` letter */
245 BFONT_ICON_J = 0x69, /**< \brief `J` letter */
246 BFONT_ICON_K = 0x6A, /**< \brief `K` letter */
247 BFONT_ICON_L = 0x6B, /**< \brief `L` letter */
248 BFONT_ICON_M = 0x6C, /**< \brief `M` letter */
249 BFONT_ICON_N = 0x6D, /**< \brief `N` letter */
250 BFONT_ICON_O = 0x6E, /**< \brief `O` letter */
251 BFONT_ICON_P = 0x6F, /**< \brief `P` letter */
252 BFONT_ICON_Q = 0x70, /**< \brief `Q` letter */
253 BFONT_ICON_R = 0x71, /**< \brief `R` letter */
254 BFONT_ICON_S = 0x72, /**< \brief `S` letter */
255 BFONT_ICON_T = 0x73, /**< \brief `T` letter */
256 BFONT_ICON_U = 0x74, /**< \brief `U` letter */
257 BFONT_ICON_V = 0x75, /**< \brief `V` letter */
258 BFONT_ICON_W = 0x76, /**< \brief `W` letter */
259 BFONT_ICON_X = 0x77, /**< \brief `X` letter */
260 BFONT_ICON_Y = 0x78, /**< \brief `Y` letter */
261 BFONT_ICON_Z = 0x79, /**< \brief `Z` letter */
262 BFONT_ICON_CHECKER_BOARD = 0x7A, /**< \brief Checker board */
263 BFONT_ICON_GRID = 0x7B, /**< \brief Grid */
264 BFONT_ICON_LIGHT_GRAY = 0x7C, /**< \brief Light gray */
265 BFONT_ICON_DIAG_GRID = 0x7D, /**< \brief Diagonal grid */
266 BFONT_ICON_PACMAN_GRID = 0x7E, /**< \brief Pacman grid */
267 BFONT_ICON_DARK_GRAY = 0x7F, /**< \brief Dark gray */
268 BFONT_ICON_EMBROIDERY = 0x80 /**< \brief Embroidery */
270/** @} */
271
272/** @} */
273
274/** \name Coloring
275 \brief Methods for modifying the text color.
276 @{
277*/
278
279/** \brief Set the font foreground color.
280
281 This function selects the foreground color to draw when a pixel is opaque in
282 the font. The value passed in for the color should be in whatever pixel
283 format that you intend to use for the image produced.
284
285 \param c The color to use.
286 \return The old foreground color.
287
288 \sa bfont_set_background_color()
289*/
290uint32_t bfont_set_foreground_color(uint32_t c);
291
292/** \brief Set the font background color.
293
294 This function selects the background color to draw when a pixel is drawn in
295 the font. This color is only used for pixels not covered by the font when
296 you have selected to have the font be opaque.
297
298 \param c The color to use.
299 \return The old background color.
300
301 \sa bfont_set_foreground_color()
302*/
303uint32_t bfont_set_background_color(uint32_t c);
304
305/** @} */
306
307/* Constants for the function below */
308typedef enum bfont_code {
309 BFONT_CODE_ISO8859_1 = 0, /**< \brief ISO-8859-1 (western) charset */
310 BFONT_CODE_EUC = 1, /**< \brief EUC-JP charset */
311 BFONT_CODE_SJIS = 2, /**< \brief Shift-JIS charset */
312 BFONT_CODE_RAW = 3 /**< \brief Raw indexing to the BFONT */
314
315/** \brief Set the font encoding.
316
317 This function selects the font encoding that is used for the font. This
318 allows you to select between the various character sets available.
319
320 \param enc The character encoding in use
321*/
323
324/** \name Character Lookups
325 \brief Methods for finding various font characters and icons.
326 @{
327*/
328
329/** \brief Find an ISO-8859-1 character in the font.
330
331 This function retrieves a pointer to the font data for the specified
332 character in the font, if its available. Generally, you will not have to
333 use this function, use one of the bfont_draw_* functions instead.
334
335 \param ch The character to look up
336 \return A pointer to the raw character data
337*/
338const uint8_t *bfont_find_char(uint32_t ch);
339
340/** \brief Find an full-width Japanese character in the font.
341
342 This function retrieves a pointer to the font data for the specified
343 character in the font, if its available. Generally, you will not have to
344 use this function, use one of the bfont_draw_* functions instead.
345
346 This function deals with full-width kana and kanji.
347
348 \param ch The character to look up
349 \return A pointer to the raw character data
350*/
351uint8_t *bfont_find_char_jp(uint32_t ch);
352
353/** \brief Find an half-width Japanese character in the font.
354
355 This function retrieves a pointer to the font data for the specified
356 character in the font, if its available. Generally, you will not have to
357 use this function, use one of the bfont_draw_* functions instead.
358
359 This function deals with half-width kana only.
360
361 \param ch The character to look up
362 \return A pointer to the raw character data
363*/
364uint8_t *bfont_find_char_jp_half(uint32_t ch);
365
366/** \brief Find a VMU icon.
367
368 This function retrieves a pointer to the icon data for the specified VMU
369 icon in the bios, if its available. The icon data is flipped both vertically
370 and horizontally. Each vmu icon has dimensions 32x32 pixels and is 128 bytes
371 long.
372
373 \param icon The VMU icon index to look up.
374 \return A pointer to the raw icon data or NULL if icon value
375 is incorrect.
376*/
378
379/** \brief Find a DC icon.
380
381 This function retrieves a pointer to the icon data for the specified DC
382 icon in the bios, if its available. Each dc icon has dimensions 24x24 pixels
383 and is 72 bytes long.
384
385 \param icon The DC icon index to look up.
386 \return A pointer to the raw icon data or NULL if icon value
387 is incorrect.
388*/
390
391/** @} */
392
393/** \defgroup bfont_char Character Drawing
394 \brief Methods for rendering characters/icons.
395 @{
396*/
397
398/** \brief Draw a single character of any sort to a buffer.
399
400 This function draws a single character in the set encoding to the given
401 buffer. This function sits under draw, draw_thin, and draw_wide, while
402 exposing the colors and bitdepths desired. This will allow the writing
403 of bfont characters to paletted textures.
404
405 \param buffer The buffer to draw to
406 \param bufwidth The width of the buffer in pixels
407 \param fg The foreground color to use
408 \param bg The background color to use
409 \param bpp The number of bits per pixel in the buffer
410 \param opaque If true, overwrite background areas with black,
411 otherwise do not change them from what they are
412 \param c The character to draw
413 \param wide Draw a wide character
414 \param iskana Draw a half-width kana character
415 \return Amount of width covered in bytes
416*/
417size_t bfont_draw_ex(void *buffer, uint32_t bufwidth, uint32_t fg,
418 uint32_t bg, uint8_t bpp, bool opaque, uint32_t c,
419 bool wide, bool iskana);
420
421/** \brief Draw a single character to a buffer.
422
423 This function draws a single character in the set encoding to the given
424 buffer. Calling this is equivalent to calling bfont_draw_thin() with 0 for
425 the final parameter.
426
427 \param buffer The buffer to draw to (at least 12 x 24 pixels)
428 \param bufwidth The width of the buffer in pixels
429 \param opaque If true, overwrite blank areas with black,
430 otherwise do not change them from what they are
431 \param c The character to draw
432 \return Amount of width covered in bytes.
433*/
434size_t bfont_draw(void *buffer, uint32_t bufwidth, bool opaque, uint32_t c);
435
436/** \brief Draw a single thin character to a buffer.
437
438 This function draws a single character in the set encoding to the given
439 buffer. This only works with ISO-8859-1 characters and half-width kana.
440
441 \param buffer The buffer to draw to (at least 12 x 24 pixels)
442 \param bufwidth The width of the buffer in pixels
443 \param opaque If true, overwrite blank areas with black,
444 otherwise do not change them from what they are
445 \param c The character to draw
446 \param iskana Set to 1 if the character is a kana, 0 if ISO-8859-1
447 \return Amount of width covered in bytes.
448*/
449size_t bfont_draw_thin(void *buffer, uint32_t bufwidth, bool opaque,
450 uint32_t c, bool iskana);
451
452/** \brief Draw a single wide character to a buffer.
453
454 This function draws a single character in the set encoding to the given
455 buffer. This only works with full-width kana and kanji.
456
457 \param buffer The buffer to draw to (at least 24 x 24 pixels)
458 \param bufwidth The width of the buffer in pixels
459 \param opaque If true, overwrite blank areas with black,
460 otherwise do not change them from what they are
461 \param c The character to draw
462 \return Amount of width covered in bytes.
463*/
464size_t bfont_draw_wide(void *buffer, uint32_t bufwidth, bool opaque,
465 uint32_t c);
466
467/** \brief Draw a VMU icon to the buffer.
468
469 This function draws a 32x32 VMU icon to the given buffer, supporting
470 multiple color depths (4, 8, 16, and 32 bits per pixel).
471
472 \param buffer The buffer to draw to (at least 32 x 32 pixels)
473 \param bufwidth The width of the buffer in pixels
474 \param fg The foreground color to use
475 \param bg The background color to use
476 \param bpp The number of bits per pixel in the buffer
477 \param opaque If true, overwrite background areas with black,
478 otherwise do not change them from what they are
479 \param icon The VMU icon to draw
480 \return Amount of width covered in bytes
481*/
482size_t bfont_draw_vmu_icon_ex(void *buffer, uint32_t bufwidth, uint32_t fg,
483 uint32_t bg, uint8_t bpp, bool opaque,
484 bfont_vmu_icon_t icon);
485
486/** \brief Draw a VMU icon to a buffer.
487
488 This function draws a 32x32 VMU icon to the given buffer.
489
490 \param buffer The buffer to draw to (at least 32 x 32 pixels)
491 \param bufwidth The width of the buffer in pixels
492 \param opaque If true, overwrite blank areas with black,
493 otherwise do not change them from what they are
494 \param icon The VMU icon to draw
495 \return Amount of width covered in bytes.
496*/
497size_t bfont_draw_vmu_icon(void *buffer, uint32_t bufwidth, bool opaque,
498 bfont_vmu_icon_t icon);
499
500/** \brief Draw a DC icon to the buffer.
501
502 This function draws a 24x24 DC icon to the given buffer, supporting
503 multiple color depths (4, 8, 16, and 32 bits per pixel).
504
505 \param buffer The buffer to draw to (at least 24 x 24 pixels)
506 \param bufwidth The width of the buffer in pixels
507 \param fg The foreground color to use
508 \param bg The background color to use
509 \param bpp The number of bits per pixel in the buffer
510 \param opaque If true, overwrite background areas with black,
511 otherwise do not change them from what they are
512 \param icon The DC icon to draw
513 \return Amount of width covered in bytes
514*/
515size_t bfont_draw_dc_icon_ex(void *buffer, uint32_t bufwidth, uint32_t fg,
516 uint32_t bg, uint8_t bpp, bool opaque,
517 bfont_dc_icon_t icon);
518
519/** \brief Draw a DC icon to a buffer.
520
521 This function draws a 24x24 DC icon to the given buffer.
522
523 \param buffer The buffer to draw to (at least 24 x 24 pixels)
524 \param bufwidth The width of the buffer in pixels
525 \param opaque If true, overwrite blank areas with black,
526 otherwise do not change them from what they are
527 \param icon The DC icon to draw
528 \return Amount of width covered in bytes.
529*/
530size_t bfont_draw_dc_icon(void *buffer, uint32_t bufwidth, bool opaque,
531 bfont_dc_icon_t icon);
532
533/** @} */
534
535/** \defgroup bfont_string String Drawing
536 \brief Methods for rendering formatted text/icons.
537
538 @{
539*/
540
541/** brief Macros for Builtin DC Icons
542
543 These macros are provided for use in string concatenation for printf
544 and other functions requiring inline representation of DC icons.
545 @{
546*/
547#define DI_CIRCLECOPYRIGHT "\\di00"
548#define DI_CIRCLER "\\di01"
549#define DI_TRADEMARK "\\di02"
550#define DI_UPARROW "\\di03"
551#define DI_DOWNARROW "\\di04"
552#define DI_LEFTARROW "\\di05"
553#define DI_RIGHTARROW "\\di06"
554#define DI_UPRIGHTARROW "\\di07"
555#define DI_DOWNRIGHTARROW "\\di08"
556#define DI_DOWNLEFTARROW "\\di09"
557#define DI_UPLEFTARROW "\\di0A"
558#define DI_ABUTTON "\\di0B"
559#define DI_BBUTTON "\\di0C"
560#define DI_CBUTTON "\\di0D"
561#define DI_DBUTTON "\\di0E"
562#define DI_XBUTTON "\\di0F"
563#define DI_YBUTTON "\\di10"
564#define DI_ZBUTTON "\\di11"
565#define DI_LTRIGGER "\\di12"
566#define DI_RTRIGGER "\\di13"
567#define DI_STARTBUTTON "\\di14"
568#define DI_VMU "\\di15"
569/** @} */
570
571/** brief Macros for Builtin VMU Icons
572
573 These macros are provided for use in string concatenation for printf
574 and other functions requiring inline representation of VMU icons.
575 @{
576*/
577#define VI_INVALID_VMU "\\vi00"
578#define VI_HOURGLASS_ONE "\\vi01"
579#define VI_HOURGLASS_TWO "\\vi02"
580#define VI_HOURGLASS_THREE "\\vi03"
581#define VI_HOURGLASS_FOUR "\\vi04"
582#define VI_VMUICON "\\vi05"
583#define VI_EARTH "\\vi06"
584#define VI_SATURN "\\vi07"
585#define VI_QUARTER_MOON "\\vi08"
586#define VI_LAUGHING_FACE "\\vi09"
587#define VI_SMILING_FACE "\\vi0A"
588#define VI_CASUAL_FACE "\\vi0B"
589#define VI_ANGRY_FACE "\\vi0C"
590#define VI_COW "\\vi0D"
591#define VI_HORSE "\\vi0E"
592#define VI_RABBIT "\\vi0F"
593#define VI_CAT "\\vi10"
594#define VI_CHICK "\\vi11"
595#define VI_LION "\\vi12"
596#define VI_MONKEY "\\vi13"
597#define VI_PANDA "\\vi14"
598#define VI_BEAR "\\vi15"
599#define VI_PIG "\\vi16"
600#define VI_DOG "\\vi17"
601#define VI_FISH "\\vi18"
602#define VI_OCTOPUS "\\vi19"
603#define VI_SQUID "\\vi1A"
604#define VI_WHALE "\\vi1B"
605#define VI_CRAB "\\vi1C"
606#define VI_BUTTERFLY "\\vi1D"
607#define VI_LADYBUG "\\vi1E"
608#define VI_ANGLER_FISH "\\vi1F"
609#define VI_PENGUIN "\\vi20"
610#define VI_CHERRIES "\\vi21"
611#define VI_TULIP "\\vi22"
612#define VI_LEAF "\\vi23"
613#define VI_SAKURA "\\vi24"
614#define VI_APPLE "\\vi25"
615#define VI_ICECREAM "\\vi26"
616#define VI_CACTUS "\\vi27"
617#define VI_PIANO "\\vi28"
618#define VI_GUITAR "\\vi29"
619#define VI_EIGHTH_NOTE "\\vi2A"
620#define VI_TREBLE_CLEF "\\vi2B"
621#define VI_BOAT "\\vi2C"
622#define VI_CAR "\\vi2D"
623#define VI_HELMET "\\vi2E"
624#define VI_MOTORCYCLE "\\vi2F"
625#define VI_VAN "\\vi30"
626#define VI_TRUCK "\\vi31"
627#define VI_CLOCK "\\vi32"
628#define VI_TELEPHONE "\\vi33"
629#define VI_PENCIL "\\vi34"
630#define VI_CUP "\\vi35"
631#define VI_SILVERWARE "\\vi36"
632#define VI_HOUSE "\\vi37"
633#define VI_BELL "\\vi38"
634#define VI_CROWN "\\vi39"
635#define VI_SOCK "\\vi3A"
636#define VI_CAKE "\\vi3B"
637#define VI_KEY "\\vi3C"
638#define VI_BOOK "\\vi3D"
639#define VI_BASEBALL "\\vi3E"
640#define VI_SOCCER "\\vi3F"
641#define VI_BULB "\\vi40"
642#define VI_TEDDY_BEAR "\\vi41"
643#define VI_BOW_TIE "\\vi42"
644#define VI_BOW_ARROW "\\vi43"
645#define VI_SNOWMAN "\\vi44"
646#define VI_LIGHTNING "\\vi45"
647#define VI_SUN "\\vi46"
648#define VI_CLOUD "\\vi47"
649#define VI_UMBRELLA "\\vi48"
650#define VI_ONE_STAR "\\vi49"
651#define VI_TWO_STARS "\\vi4A"
652#define VI_THREE_STARS "\\vi4B"
653#define VI_FOUR_STARS "\\vi4C"
654#define VI_HEART "\\vi4D"
655#define VI_DIAMOND "\\vi4E"
656#define VI_SPADE "\\vi4F"
657#define VI_CLUB "\\vi50"
658#define VI_JACK "\\vi51"
659#define VI_QUEEN "\\vi52"
660#define VI_KING "\\vi53"
661#define VI_JOKER "\\vi54"
662#define VI_ISLAND "\\vi55"
663#define VI_0 "\\vi56"
664#define VI_1 "\\vi57"
665#define VI_2 "\\vi58"
666#define VI_3 "\\vi59"
667#define VI_4 "\\vi5A"
668#define VI_5 "\\vi5B"
669#define VI_6 "\\vi5C"
670#define VI_7 "\\vi5D"
671#define VI_8 "\\vi5E"
672#define VI_9 "\\vi5F"
673#define VI_A "\\vi60"
674#define VI_B "\\vi61"
675#define VI_C "\\vi62"
676#define VI_D "\\vi63"
677#define VI_E "\\vi64"
678#define VI_F "\\vi65"
679#define VI_G "\\vi66"
680#define VI_H "\\vi67"
681#define VI_I "\\vi68"
682#define VI_J "\\vi69"
683#define VI_K "\\vi6A"
684#define VI_L "\\vi6B"
685#define VI_M "\\vi6C"
686#define VI_N "\\vi6D"
687#define VI_O "\\vi6E"
688#define VI_P "\\vi6F"
689#define VI_Q "\\vi70"
690#define VI_R "\\vi71"
691#define VI_S "\\vi72"
692#define VI_T "\\vi73"
693#define VI_U "\\vi74"
694#define VI_V "\\vi75"
695#define VI_W "\\vi76"
696#define VI_X "\\vi77"
697#define VI_Y "\\vi78"
698#define VI_Z "\\vi79"
699#define VI_CHECKER_BOARD "\\vi7A"
700#define VI_GRID "\\vi7B"
701#define VI_LIGHT_GRAY "\\vi7C"
702#define VI_DIAG_GRID "\\vi7D"
703#define VI_PACMAN_GRID "\\vi7E"
704#define VI_DARK_GRAY "\\vi7F"
705#define VI_EMBROIDERY "\\vi80"
706/** @} */
707
708/** \brief Draw a full string of any sort to any sort of buffer.
709
710 This function draws a NUL-terminated string in the set encoding to the given
711 buffer. This will automatically handle mixed half and full-width characters
712 if the encoding is set to one of the Japanese encodings. Colors and bitdepth
713 can be set.
714
715 \param buffer The buffer to draw to.
716 \param width The width of the buffer in pixels.
717 \param fg The foreground color to use.
718 \param bg The background color to use.
719 \param bpp The number of bits per pixel in the buffer.
720 \param opaque If true, overwrite background areas with black,
721 otherwise do not change them from what they are.
722 \param str The string to draw.
723
724 \sa bfont_draw_str_ex_fmt(), bfont_draw_str_ex_va()
725*/
726void bfont_draw_str_ex(void *buffer, uint32_t width, uint32_t fg, uint32_t bg,
727 uint8_t bpp, bool opaque, const char *str);
728
729/** \brief Draw a full formatted string of any sort to any sort of buffer.
730
731 This function is equivalent to bfont_draw_str_ex(), except that the string
732 is formatted as with the `printf()` function.
733
734 \param buffer The buffer to draw to.
735 \param width The width of the buffer in pixels.
736 \param fg The foreground color to use.
737 \param bg The background color to use.
738 \param bpp The number of bits per pixel in the buffer.
739 \param opaque If true, overwrite background areas with black,
740 otherwise do not change them from what they are.
741 \param fmt The printf-style format string to draw.
742 \param ... Additional printf-style variadic arguments
743
744 \sa bfont_draw_str_ex_vfmt()
745*/
746void bfont_draw_str_ex_fmt(void *buffer, uint32_t width, uint32_t fg, uint32_t bg,
747 uint8_t bpp, bool opaque, const char *fmt, ...)
748 __printflike(7, 8);
749
750/** \brief Draw formatted string of any sort to buffer (with va_args).
751
752 This function is equivalent to bfont_draw_str_ex_fmt(), except that the
753 variadic argument list is passed via a pointer to a va_list.
754
755 \param buffer The buffer to draw to.
756 \param width The width of the buffer in pixels.
757 \param fg The foreground color to use.
758 \param bg The background color to use.
759 \param bpp The number of bits per pixel in the buffer.
760 \param opaque If true, overwrite background areas with black,
761 otherwise do not change them from what they are.
762 \param fmt The printf-style format string to draw.
763 \param var_args Additional printf-style variadic arguments
764
765 \sa bfont_draw_str_ex_fmt()
766*/
767void bfont_draw_str_ex_vfmt(void *buffer, uint32_t width, uint32_t fg, uint32_t bg,
768 uint8_t bpp, bool opaque, const char *fmt,
769 va_list *var_args);
770
771/** \brief Draw a full string to a buffer.
772
773 This function draws a NUL-terminated string in the set encoding to the given
774 buffer. This will automatically handle mixed half and full-width characters
775 if the encoding is set to one of the Japanese encodings. Draws pre-set
776 16-bit colors.
777
778 \param buffer The buffer to draw to.
779 \param width The width of the buffer in pixels.
780 \param opaque If true, overwrite blank areas with bfont_bgcolor,
781 otherwise do not change them from what they are.
782 \param str The string to draw.
783*/
784void bfont_draw_str(void *buffer, uint32_t width, bool opaque, const char *str);
785
786/** \brief Draw a full formatted string to a buffer.
787
788 This function is equvalent to bfont_draw_str(), except that the string is
789 formatted as with the `printf()` function.
790
791 \param buffer The buffer to draw to.
792 \param width The width of the buffer in pixels.
793 \param opaque If true, overwrite blank areas with bfont_bgcolor,
794 otherwise do not change them from what they are.
795 \param fmt The printf-style format string to draw.
796 \param ... Additional printf-style variadic arguments.
797*/
798void bfont_draw_str_fmt(void *buffer, uint32_t width, bool opaque, const char *fmt,
799 ...) __printflike(4, 5);
800
801/** \brief Draw a full formatted string to video ram (with va_args).
802
803 This function is equivalent to bfont_draw_str_ex_vfmt(), except that
804 the variadic argument list is passed via a pointer to a va_list.
805
806 \param x The x position to start drawing at.
807 \param y The y position to start drawing at.
808 \param fg The foreground color to use.
809 \param bg The background color to use.
810 \param opaque If true, overwrite background areas with black,
811 otherwise do not change them from what they are.
812 \param fmt The printf-style format string to draw.
813 \param var_args Additional printf-style variadic arguments
814
815 \sa bfont_draw_str_ex()
816*/
817void bfont_draw_str_vram_vfmt(uint32_t x, uint32_t y, uint32_t fg, uint32_t bg,
818 bool opaque, const char *fmt,
819 va_list *var_args);
820
821/** \brief Draw a full string to video ram.
822
823 This function draws a NUL-terminated string in the set encoding to video
824 ram. This will automatically handle mixed half and full-width characters
825 if the encoding is set to one of the Japanese encodings. Draws pre-set
826 16-bit colors.
827
828 \param x The x position to start drawing at.
829 \param y The y position to start drawing at.
830 \param opaque If true, overwrite blank areas with bfont_bgcolor,
831 otherwise do not change them from what they are.
832 \param fmt The printf-style format string to draw.
833 \param ... Additional printf-style variadic arguments.
834*/
835void bfont_draw_str_vram_fmt(uint32_t x, uint32_t y, bool opaque, const char *fmt,
836 ...) __printflike(4, 5);
837
838/** @} */
839
840/** @} */
841
842__END_DECLS
843
844#endif /* __DC_BIOSFONT_H */
Definitions for builtin attributes and compiler directives.
size_t bfont_draw_ex(void *buffer, uint32_t bufwidth, uint32_t fg, uint32_t bg, uint8_t bpp, bool opaque, uint32_t c, bool wide, bool iskana)
Draw a single character of any sort to a buffer.
size_t bfont_draw_thin(void *buffer, uint32_t bufwidth, bool opaque, uint32_t c, bool iskana)
Draw a single thin character to a buffer.
size_t bfont_draw(void *buffer, uint32_t bufwidth, bool opaque, uint32_t c)
Draw a single character to a buffer.
size_t bfont_draw_dc_icon(void *buffer, uint32_t bufwidth, bool opaque, bfont_dc_icon_t icon)
Draw a DC icon to a buffer.
size_t bfont_draw_wide(void *buffer, uint32_t bufwidth, bool opaque, uint32_t c)
Draw a single wide character to a buffer.
size_t bfont_draw_vmu_icon_ex(void *buffer, uint32_t bufwidth, uint32_t fg, uint32_t bg, uint8_t bpp, bool opaque, bfont_vmu_icon_t icon)
Draw a VMU icon to the buffer.
size_t bfont_draw_vmu_icon(void *buffer, uint32_t bufwidth, bool opaque, bfont_vmu_icon_t icon)
Draw a VMU icon to a buffer.
size_t bfont_draw_dc_icon_ex(void *buffer, uint32_t bufwidth, uint32_t fg, uint32_t bg, uint8_t bpp, bool opaque, bfont_dc_icon_t icon)
Draw a DC icon to the buffer.
bfont_vmu_icon_t
Builtin VMU Icons.
Definition biosfont.h:139
bfont_dc_icon_t
Builtin DC Icons.
Definition biosfont.h:107
@ BFONT_ICON_INVALID_VMU
Invalid.
Definition biosfont.h:140
@ BFONT_ICON_BOAT
Boat.
Definition biosfont.h:184
@ BFONT_ICON_TREBLE_CLEF
Treble clef.
Definition biosfont.h:183
@ BFONT_ICON_CUP
Cup.
Definition biosfont.h:193
@ BFONT_ICON_GRID
Grid.
Definition biosfont.h:263
@ BFONT_ICON_HOURGLASS_FOUR
Hourglass 4.
Definition biosfont.h:144
@ BFONT_ICON_CLOCK
Clock.
Definition biosfont.h:190
@ BFONT_ICON_W
W letter
Definition biosfont.h:258
@ BFONT_ICON_TWO_STARS
Two stars.
Definition biosfont.h:214
@ BFONT_ICON_EMBROIDERY
Embroidery.
Definition biosfont.h:268
@ BFONT_ICON_HOURGLASS_THREE
Hourglass 3.
Definition biosfont.h:143
@ BFONT_ICON_Q
Q letter
Definition biosfont.h:252
@ BFONT_ICON_TEDDY_BEAR
Teddy bear.
Definition biosfont.h:205
@ BFONT_ICON_3
3 digit
Definition biosfont.h:229
@ BFONT_ICON_0
0 digit
Definition biosfont.h:226
@ BFONT_ICON_PIANO
Piano.
Definition biosfont.h:180
@ BFONT_ICON_G
G letter
Definition biosfont.h:242
@ BFONT_ICON_BULB
Bulb.
Definition biosfont.h:204
@ BFONT_ICON_CLOUD
Cloud.
Definition biosfont.h:211
@ BFONT_ICON_CACTUS
Cactus.
Definition biosfont.h:179
@ BFONT_ICON_UMBRELLA
Umbrella.
Definition biosfont.h:212
@ BFONT_ICON_TRUCK
Truck.
Definition biosfont.h:189
@ BFONT_ICON_C
C letter
Definition biosfont.h:238
@ BFONT_ICON_HOURGLASS_TWO
Hourglass 2.
Definition biosfont.h:142
@ BFONT_ICON_9
9 digit
Definition biosfont.h:235
@ BFONT_ICON_SATURN
Saturn.
Definition biosfont.h:147
@ BFONT_ICON_LAUGHING_FACE
Laughing face.
Definition biosfont.h:149
@ BFONT_ICON_CRAB
Crab.
Definition biosfont.h:168
@ BFONT_ICON_HOURGLASS_ONE
Hourglass 1.
Definition biosfont.h:141
@ BFONT_ICON_SAKURA
Sakura.
Definition biosfont.h:176
@ BFONT_ICON_MONKEY
Monkye.
Definition biosfont.h:159
@ BFONT_ICON_I
I letter
Definition biosfont.h:244
@ BFONT_ICON_K
K letter
Definition biosfont.h:246
@ BFONT_ICON_KING
King.
Definition biosfont.h:223
@ BFONT_ICON_LIGHTNING
Lightning.
Definition biosfont.h:209
@ BFONT_ICON_TELEPHONE
Telephone.
Definition biosfont.h:191
@ BFONT_ICON_BASEBALL
Baseball.
Definition biosfont.h:202
@ BFONT_ICON_BEAR
Bear.
Definition biosfont.h:161
@ BFONT_ICON_H
H letter
Definition biosfont.h:243
@ BFONT_ICON_R
R letter
Definition biosfont.h:253
@ BFONT_ICON_BOOK
Book.
Definition biosfont.h:201
@ BFONT_ICON_U
U letter
Definition biosfont.h:256
@ BFONT_ICON_4
4 digit
Definition biosfont.h:230
@ BFONT_ICON_QUARTER_MOON
Quarter moon.
Definition biosfont.h:148
@ BFONT_ICON_PANDA
Panda.
Definition biosfont.h:160
@ BFONT_ICON_CHERRIES
Cherries.
Definition biosfont.h:173
@ BFONT_ICON_LION
Lion.
Definition biosfont.h:158
@ BFONT_ICON_ANGRY_FACE
Angry face.
Definition biosfont.h:152
@ BFONT_ICON_HORSE
Horse.
Definition biosfont.h:154
@ BFONT_ICON_CROWN
Crown.
Definition biosfont.h:197
@ BFONT_ICON_F
F letter
Definition biosfont.h:241
@ BFONT_ICON_ANGLER_FISH
Angler fish.
Definition biosfont.h:171
@ BFONT_ICON_1
1 digit
Definition biosfont.h:227
@ BFONT_ICON_V
V letter
Definition biosfont.h:257
@ BFONT_ICON_B
B letter
Definition biosfont.h:237
@ BFONT_ICON_2
2 digit
Definition biosfont.h:228
@ BFONT_ICON_WHALE
Whale.
Definition biosfont.h:167
@ BFONT_ICON_X
X letter
Definition biosfont.h:259
@ BFONT_ICON_HELMET
Helmet.
Definition biosfont.h:186
@ BFONT_ICON_CLUB
Club.
Definition biosfont.h:220
@ BFONT_ICON_CHECKER_BOARD
Checker board.
Definition biosfont.h:262
@ BFONT_ICON_DIAMOND
Diamond.
Definition biosfont.h:218
@ BFONT_ICON_JACK
Jack.
Definition biosfont.h:221
@ BFONT_ICON_ISLAND
Island.
Definition biosfont.h:225
@ BFONT_ICON_APPLE
Apple.
Definition biosfont.h:177
@ BFONT_ICON_JOKER
Joker.
Definition biosfont.h:224
@ BFONT_ICON_DARK_GRAY
Dark gray.
Definition biosfont.h:267
@ BFONT_ICON_CAKE
cake
Definition biosfont.h:199
@ BFONT_ICON_VAN
Van.
Definition biosfont.h:188
@ BFONT_ICON_L
L letter
Definition biosfont.h:247
@ BFONT_ICON_CAR
Car.
Definition biosfont.h:185
@ BFONT_ICON_CASUAL_FACE
Casual face.
Definition biosfont.h:151
@ BFONT_ICON_CHICK
Chick.
Definition biosfont.h:157
@ BFONT_ICON_7
7 digit
Definition biosfont.h:233
@ BFONT_ICON_BELL
Bell.
Definition biosfont.h:196
@ BFONT_ICON_S
S letter
Definition biosfont.h:254
@ BFONT_ICON_PENGUIN
Penguin.
Definition biosfont.h:172
@ BFONT_ICON_DOG
Dog.
Definition biosfont.h:163
@ BFONT_ICON_LIGHT_GRAY
Light gray.
Definition biosfont.h:264
@ BFONT_ICON_BOW_ARROW
Bow and arrow.
Definition biosfont.h:207
@ BFONT_ICON_BOW_TIE
Bow tie.
Definition biosfont.h:206
@ BFONT_ICON_VMUICON
VMU.
Definition biosfont.h:145
@ BFONT_ICON_FOUR_STARS
Four stars.
Definition biosfont.h:216
@ BFONT_ICON_M
M letter
Definition biosfont.h:248
@ BFONT_ICON_OCTOPUS
Octopus.
Definition biosfont.h:165
@ BFONT_ICON_SNOWMAN
Snowman.
Definition biosfont.h:208
@ BFONT_ICON_FISH
Fish.
Definition biosfont.h:164
@ BFONT_ICON_SPADE
Spade.
Definition biosfont.h:219
@ BFONT_ICON_A
A letter
Definition biosfont.h:236
@ BFONT_ICON_LADYBUG
Ladybug.
Definition biosfont.h:170
@ BFONT_ICON_5
5 digit
Definition biosfont.h:231
@ BFONT_ICON_SUN
Sun.
Definition biosfont.h:210
@ BFONT_ICON_P
P letter
Definition biosfont.h:251
@ BFONT_ICON_SOCK
Sock.
Definition biosfont.h:198
@ BFONT_ICON_DIAG_GRID
Diagonal grid.
Definition biosfont.h:265
@ BFONT_ICON_D
D letter
Definition biosfont.h:239
@ BFONT_ICON_Y
Y letter
Definition biosfont.h:260
@ BFONT_ICON_E
E letter
Definition biosfont.h:240
@ BFONT_ICON_SOCCER
Soccer.
Definition biosfont.h:203
@ BFONT_ICON_RABBIT
Rabbit.
Definition biosfont.h:155
@ BFONT_ICON_EIGHTH_NOTE
Eighth note.
Definition biosfont.h:182
@ BFONT_ICON_ICECREAM
Ice cream.
Definition biosfont.h:178
@ BFONT_ICON_SILVERWARE
Silverware.
Definition biosfont.h:194
@ BFONT_ICON_LEAF
Leaf.
Definition biosfont.h:175
@ BFONT_ICON_HEART
Heart.
Definition biosfont.h:217
@ BFONT_ICON_PIG
Pig.
Definition biosfont.h:162
@ BFONT_ICON_COW
Cow.
Definition biosfont.h:153
@ BFONT_ICON_THREE_STARS
Three stars.
Definition biosfont.h:215
@ BFONT_ICON_O
O letter
Definition biosfont.h:250
@ BFONT_ICON_SMILING_FACE
Smiling face.
Definition biosfont.h:150
@ BFONT_ICON_T
T letter
Definition biosfont.h:255
@ BFONT_ICON_KEY
Key.
Definition biosfont.h:200
@ BFONT_ICON_GUITAR
Guitar.
Definition biosfont.h:181
@ BFONT_ICON_PACMAN_GRID
Pacman grid.
Definition biosfont.h:266
@ BFONT_ICON_QUEEN
Queen.
Definition biosfont.h:222
@ BFONT_ICON_CAT
Cat.
Definition biosfont.h:156
@ BFONT_ICON_EARTH
Earth.
Definition biosfont.h:146
@ BFONT_ICON_PENCIL
Pencil.
Definition biosfont.h:192
@ BFONT_ICON_ONE_STAR
One star.
Definition biosfont.h:213
@ BFONT_ICON_BUTTERFLY
Butterfly.
Definition biosfont.h:169
@ BFONT_ICON_TULIP
Tulip.
Definition biosfont.h:174
@ BFONT_ICON_HOUSE
House.
Definition biosfont.h:195
@ BFONT_ICON_SQUID
Squid.
Definition biosfont.h:166
@ BFONT_ICON_8
8 digit
Definition biosfont.h:234
@ BFONT_ICON_J
J letter
Definition biosfont.h:245
@ BFONT_ICON_Z
Z letter
Definition biosfont.h:261
@ BFONT_ICON_MOTORCYCLE
Motorcycle.
Definition biosfont.h:187
@ BFONT_ICON_N
N letter
Definition biosfont.h:249
@ BFONT_ICON_6
6 digit
Definition biosfont.h:232
@ BFONT_ICON_RIGHTARROW
Right arrow.
Definition biosfont.h:114
@ BFONT_ICON_ABUTTON
A button.
Definition biosfont.h:119
@ BFONT_ICON_XBUTTON
X button.
Definition biosfont.h:123
@ BFONT_ICON_VMU
VMU icon.
Definition biosfont.h:129
@ BFONT_ICON_LTRIGGER
L trigger.
Definition biosfont.h:126
@ BFONT_ICON_CBUTTON
C button.
Definition biosfont.h:121
@ BFONT_ICON_UPRIGHTARROW
Up right arrow.
Definition biosfont.h:115
@ BFONT_ICON_CIRCLECOPYRIGHT
Circle copyright.
Definition biosfont.h:108
@ BFONT_ICON_TRADEMARK
Trademark.
Definition biosfont.h:110
@ BFONT_ICON_STARTBUTTON
Start button.
Definition biosfont.h:128
@ BFONT_ICON_UPLEFTARROW
Up left arrow.
Definition biosfont.h:118
@ BFONT_ICON_ZBUTTON
Z button.
Definition biosfont.h:125
@ BFONT_ICON_YBUTTON
Y button.
Definition biosfont.h:124
@ BFONT_ICON_DOWNRIGHTARROW
Down right arrow.
Definition biosfont.h:116
@ BFONT_ICON_BBUTTON
B button.
Definition biosfont.h:120
@ BFONT_ICON_UPARROW
Up arrow.
Definition biosfont.h:111
@ BFONT_CIRCLER
Circle restricted.
Definition biosfont.h:109
@ BFONT_ICON_DOWNLEFTARROW
Down left arrow.
Definition biosfont.h:117
@ BFONT_ICON_DOWNARROW
Down arrow.
Definition biosfont.h:112
@ BFONT_ICON_LEFTARROW
Left arrow.
Definition biosfont.h:113
@ BFONT_ICON_RTRIGGER
R trigger.
Definition biosfont.h:127
@ BFONT_ICON_DBUTTON
D button.
Definition biosfont.h:122
void bfont_draw_str_vram_fmt(uint32_t x, uint32_t y, bool opaque, const char *fmt,...) __printflike(4
Draw a full string to video ram.
void bfont_draw_str_ex_fmt(void *buffer, uint32_t width, uint32_t fg, uint32_t bg, uint8_t bpp, bool opaque, const char *fmt,...) __printflike(7
Draw a full formatted string of any sort to any sort of buffer.
void bfont_draw_str_ex(void *buffer, uint32_t width, uint32_t fg, uint32_t bg, uint8_t bpp, bool opaque, const char *str)
Draw a full string of any sort to any sort of buffer.
void bfont_draw_str(void *buffer, uint32_t width, bool opaque, const char *str)
Draw a full string to a buffer.
void void bfont_draw_str_vram_vfmt(uint32_t x, uint32_t y, uint32_t fg, uint32_t bg, bool opaque, const char *fmt, va_list *var_args)
Draw a full formatted string to video ram (with va_args).
void bfont_draw_str_fmt(void *buffer, uint32_t width, bool opaque, const char *fmt,...) __printflike(4
Draw a full formatted string to a buffer.
void void bfont_draw_str_ex_vfmt(void *buffer, uint32_t width, uint32_t fg, uint32_t bg, uint8_t bpp, bool opaque, const char *fmt, va_list *var_args)
Draw formatted string of any sort to buffer (with va_args).
const uint8_t * bfont_find_char(uint32_t ch)
Find an ISO-8859-1 character in the font.
uint8_t * bfont_find_char_jp_half(uint32_t ch)
Find an half-width Japanese character in the font.
uint8_t * bfont_find_dc_icon(bfont_dc_icon_t icon)
Find a DC icon.
void bfont_set_encoding(bfont_code_t enc)
Set the font encoding.
uint32_t bfont_set_background_color(uint32_t c)
Set the font background color.
uint8_t * bfont_find_icon(bfont_vmu_icon_t icon)
Find a VMU icon.
uint32_t bfont_set_foreground_color(uint32_t c)
Set the font foreground color.
bfont_code_t
Definition biosfont.h:308
uint8_t * bfont_find_char_jp(uint32_t ch)
Find an full-width Japanese character in the font.
@ BFONT_CODE_ISO8859_1
ISO-8859-1 (western) charset.
Definition biosfont.h:309
@ BFONT_CODE_RAW
Raw indexing to the BFONT.
Definition biosfont.h:312
@ BFONT_CODE_SJIS
Shift-JIS charset.
Definition biosfont.h:311
@ BFONT_CODE_EUC
EUC-JP charset.
Definition biosfont.h:310
#define __printflike(fmtarg, firstvararg)
Identify a function as accepting formatting like printf().
Definition cdefs.h:132
Common integer types.