mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-04 09:02:55 +00:00
Generate registration code for custom fonts imported in .60 files
This removes the need to manually register fonts. This is initially applied to the printer demo, but the other demos and removal of the public manual registration API will come in follow-up commits.
This commit is contained in:
parent
c301cc22b5
commit
f7ce1ba8b4
13 changed files with 138 additions and 30 deletions
|
|
@ -22,12 +22,6 @@ struct InkLevelModel : sixtyfps::Model<InkLevel>
|
|||
|
||||
int main()
|
||||
{
|
||||
if (auto error = sixtyfps::register_font_from_path(FONTS_DIR "/NotoSans-Regular.ttf")) {
|
||||
fprintf(stderr, "Error registering Noto Sans Regular font: %s\n", error->data());
|
||||
}
|
||||
if (auto error = sixtyfps::register_font_from_path(FONTS_DIR "/NotoSans-Bold.ttf")) {
|
||||
fprintf(stderr, "Error registering Noto Sans Bold font: %s\n", error->data());
|
||||
}
|
||||
auto printer_demo = MainWindow::create();
|
||||
printer_demo->set_ink_levels(std::make_shared<InkLevelModel>());
|
||||
printer_demo->on_quit([] { std::exit(0); });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue