文本布局系统
This commit is contained in:
@@ -1,21 +1,18 @@
|
||||
#include "mirage.h"
|
||||
#include "window/mwindow.h"
|
||||
#include "widget/panel_widget/mbox.h"
|
||||
#include "font/font_atlas_system.h"
|
||||
#include "font/font_face.h"
|
||||
#include "font/font_system.h"
|
||||
#include "widget/widget_new.h"
|
||||
#include "widget/leaf_widget/mimage.h"
|
||||
#include "widget/leaf_widget/mtext_block.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
mirage_app::get().init();
|
||||
|
||||
auto& manager = font_manager::instance();
|
||||
manager.add_font(L"C:/Users/46944/AppData/Local/Microsoft/Windows/Fonts/MapleMono-NF-CN-Regular.ttf");
|
||||
manager.add_font(L"C:/Windows/Fonts/msyh.ttc");
|
||||
|
||||
auto text_block = std::make_shared<mtext_block>();
|
||||
text_block->set_text("Hello, World!");
|
||||
text_block->set_text(U"Hello, World! 你好,世界!😀");
|
||||
|
||||
const auto& window = mwindow::create({ 1024, 1024 }, L"Hello, World!");
|
||||
window->set_content(text_block);
|
||||
|
||||
Reference in New Issue
Block a user