Add support for embedding bitmap fonts in C++

This commit is contained in:
Simon Hausmann 2023-07-20 14:17:23 +02:00 committed by Simon Hausmann
parent 49b3e15bc8
commit 917cecff85
4 changed files with 141 additions and 8 deletions

View file

@ -122,6 +122,15 @@ pub unsafe extern "C" fn slint_register_font_from_data(
)
}
#[no_mangle]
pub unsafe extern "C" fn slint_register_bitmap_font(
win: *const WindowAdapterRcOpaque,
font_data: &'static i_slint_core::graphics::BitmapFont,
) {
let window_adapter = &*(win as *const Rc<dyn WindowAdapter>);
window_adapter.renderer().register_bitmap_font(font_data);
}
#[cfg(feature = "testing")]
#[no_mangle]
pub unsafe extern "C" fn slint_testing_init_backend() {