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