mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-10-17 02:45:05 +00:00
Features: - Implemented terminal app based on BreezyBox - Implemented shell based on BreezyBox - Added font-module with fixed-width fonts Improvements: - Improved application standard-output and error-output routing, including dynamically loaded applications. - Updated shared icons and Material Symbols mappings. - Other improvements & fixes
35 lines
1.3 KiB
C
35 lines
1.3 KiB
C
// SPDX-License-Identifier: Apache-2.0
|
|
#pragma once
|
|
|
|
#include <font/font.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* Renders one character's glyph into buffer, a caller-owned RGB565 pixel buffer laid out as
|
|
* `stride` pixels per row. The glyph occupies a font->glyph_width x font->glyph_height box
|
|
* starting at buffer's first pixel - buffer must already point at that box's top-left corner
|
|
* within the larger destination image. A character outside [first_codepoint, last_codepoint]
|
|
* renders as a space.
|
|
*/
|
|
void font_render_char(const FixedWidthFont* font, char ch, uint16_t fg, uint16_t bg, uint16_t* buffer, int stride);
|
|
|
|
/**
|
|
* Renders a null-terminated string left to right, one font_render_char() call per character,
|
|
* each advanced by font->glyph_width pixels from the last. buffer must point at the first
|
|
* character's top-left corner; the string occupies strlen(str) * font->glyph_width x
|
|
* font->glyph_height pixels in total.
|
|
*/
|
|
void font_render_string(const FixedWidthFont* font, const char* str, uint16_t fg, uint16_t bg, uint16_t* buffer, int stride);
|
|
|
|
/** Pixel width font_render_string() would occupy for str: strlen(str) * font->glyph_width. */
|
|
int font_get_string_length(const FixedWidthFont* font, const char* str);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|