Ken Van Hoeylandt 7ea8c346b0
Various improvements (#673)
Graphics & rendering

- Implement `binfont-module` to generate bitmap fonts on the device itself
- Remove lodepng support from LVGL library and create `Modules/lodepng-module` to make the feature re-usable in non-LVGL apps too. Add binding functions for LVGL support.
- Implement large icons for boot screen (Tactility and USB logos)
- Remove unused asset files in `Data/`

Boot

- Split up `Tactility.cpp` and its `run()` function into various `Init*.cpp` files.
- Re-implement `Boot.cpp` app as non-LVGL app
- Boot app now has a `BootSequence.cpp` for the init code.
- LVGL is now started when the Boot app finishes
- Move more init logic into Boot app

BLE

- Don't allocate scan result buffers unless BLE is on
- Allocate scan results in external memory if possible

UX & UI

- USB Settings app: remove border from the button container
2026-10-04 18:09:21 +02:00

58 lines
1.6 KiB
C

// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <binfont/binfont.h>
#include <graphics/pixel_buffer.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Alpha-blends one glyph over the existing pixels of a PixelBuffer.
* @param[out] buffer destination, in any pixel format
* @param[in] x pen position x
* @param[in] baseline_y pen position y (the baseline)
* @param[in] font the font
* @param[in] codepoint the Unicode codepoint
* @param[in] color glyph colour as RGB565
* @param[in] conversion how colours reduce into the buffer's native format (see PixelBufferConversion)
* @return the horizontal advance in pixels, or 0 when the font has no glyph for the codepoint
*/
int binfont_draw_glyph_rgb565(
struct PixelBuffer* buffer,
int x,
int baseline_y,
struct BinFont* font,
uint32_t codepoint,
uint16_t color,
enum PixelBufferConversion conversion
);
/**
* @brief Alpha-blends a UTF-8 string over the existing pixels of a PixelBuffer, applying kerning.
* @param[out] buffer destination, in any pixel format
* @param[in] x pen position x
* @param[in] baseline_y pen position y (the baseline)
* @param[in] font the font
* @param[in] text UTF-8 encoded, null-terminated text
* @param[in] color glyph colour as RGB565
* @param[in] conversion how colours reduce into the buffer's native format (see PixelBufferConversion)
* @return the total advance in pixels
*/
int binfont_draw_text_rgb565(
struct PixelBuffer* buffer,
int x,
int baseline_y,
struct BinFont* font,
const char* text,
uint16_t color,
enum PixelBufferConversion conversion
);
#ifdef __cplusplus
}
#endif