|
virtual | ~FontBase () |
|
void | uploadSystemFont (GPU &gpu, Vertex location={{.x=960,.y=464}}) |
| Uploads the system font to VRAM, and initializes the object.
|
|
void | uploadKromFont (GPU &gpu, Vertex location={{.x=960,.y=422}}) |
| Uploads the Kernel rom font to VRAM, and initializes the object.
|
|
void | initialize (GPU &gpu, Vertex location, Vertex glyphSize) |
| Initializes the object for use.
|
|
void | print (GPU &gpu, eastl::string_view text, Vertex pos, Color color) |
| These method immediately print text to the screen.
|
|
void | print (GPU &gpu, eastl::string_view text, Vertex pos, Color color, eastl::function< void()> &&callback, DMA::DmaCallback dmaCallback) |
|
void | print (GPU &gpu, const char *text, Vertex pos, Color color) |
|
void | print (GPU &gpu, const char *text, Vertex pos, Color color, eastl::function< void()> &&callback, DMA::DmaCallback dmaCallback) |
|
void | printf (GPU &gpu, Vertex pos, Color color, const char *format,...) |
|
void | printf (GPU &gpu, Vertex pos, Color color, eastl::function< void()> &&callback, DMA::DmaCallback dmaCallback, const char *format,...) |
|
void | vprintf (GPU &gpu, Vertex pos, Color color, const char *format, va_list ap) |
|
void | vprintf (GPU &gpu, Vertex pos, Color color, eastl::function< void()> &&callback, DMA::DmaCallback dmaCallback, const char *format, va_list ap) |
|
void | chainprint (GPU &gpu, eastl::string_view text, Vertex pos, Color color) |
| These methods use the DMA chaining system to print text to the screen.
|
|
void | chainprint (GPU &gpu, const char *text, Vertex pos, Color color) |
|
void | chainprintf (GPU &gpu, Vertex pos, Color color, const char *format,...) |
|
void | chainvprintf (GPU &gpu, Vertex pos, Color color, const char *format, va_list ap) |
|
The Font drawing class.
This class is used to draw text to the screen. It is a template class that takes a number of fragments as a template parameter. The number of fragments determines how many times a chainprint can be called. If not using chainprint, then the number of fragments is irrelevant, and should be set to 1. The font is expected to be uploaded to VRAM before use. It is expected to be a 4bpp texture, 256 pixels wide. While the location and size are user-defined, it is the user's responsibility to ensure that the font properly fits in a texture page. It should be in ASCII order, with the first character being ASCII 0x20 (space), which has to be completely transparent. Even though the font is 4bpp, it really should be monochrome, with the color being set by the color parameter of the various print methods.
Uploads the Kernel rom font to VRAM, and initializes the object.
This method uploads the built-in Kernel rom font to VRAM, and initializes the object. There is no need to call this method if you are using your own font. Also, when using this method, you should not call initialize() afterwards. The Kernel rom font is a 16x15 font created by Sony, and built into the PSX rom chip. Its appearance is variable, depending on the version of the PSX bios. It may not be available on all PSX models. The footprint for this font is 192 bytes of read-only data, and a 256x90x4bpp texture. This font isn't going to work if psyqo took over the kernel. See the Kernel
namespace for more information.
Uploads the system font to VRAM, and initializes the object.
This method uploads the built-in system font to VRAM, and initializes the object. There is no need to call this method if you are using your own font. Also, when using this method, you should not call initialize() afterwards. The footprint for this font is 877 bytes of read-only data, and a 256x48x4bpp texture. It is a 8x16 clean and simple ASCII font called mig68000, available for free with attribution, made by Zingot Games. See https://www.zingot.com/ and https://zingot.itch.io/fontpack