测试代码
This commit is contained in:
@@ -69,36 +69,36 @@ int main(int argc, char* argv[]) {
|
||||
window->set_content(
|
||||
mnew(mv_box)
|
||||
[
|
||||
// mslot(mv_box)
|
||||
// .horizontal_alignment(horizontal_alignment_t::left)
|
||||
// + mnew(mbutton)
|
||||
// [
|
||||
// mslot(mbutton)
|
||||
// .margin({10})
|
||||
// .visibility(visibility_t::visible)[
|
||||
// mnew(mtext_block,
|
||||
// .text(config_info_str)
|
||||
// .font_size(15)
|
||||
// )
|
||||
// ]
|
||||
// ],
|
||||
mslot(mv_box)
|
||||
.horizontal_alignment(horizontal_alignment_t::left)
|
||||
+ mnew(mbutton)
|
||||
[
|
||||
mslot(mbutton)
|
||||
.margin({10})
|
||||
.visibility(visibility_t::visible)[
|
||||
mnew(mtext_block,
|
||||
.text(config_info_str)
|
||||
.font_size(15)
|
||||
)
|
||||
]
|
||||
],
|
||||
|
||||
// mslot(mv_box)
|
||||
// .horizontal_alignment(horizontal_alignment_t::right)
|
||||
// + mnew(mbutton)
|
||||
// [
|
||||
// mslot(mbutton)
|
||||
// .margin({10})
|
||||
// .visibility(visibility_t::visible)
|
||||
// [
|
||||
// mnew(mtext_block,
|
||||
// .text(U"Hello, World! 你好,世界!\n换行测试1111,测试测试测试测试,测试测试😀🐵🙏 😃🐵🙏")
|
||||
// // .text(U"😀🐵🙏😀🐵🙏")
|
||||
// .font_size(15)
|
||||
// .warp_text(true)
|
||||
// )
|
||||
// ]
|
||||
// ],
|
||||
mslot(mv_box)
|
||||
.horizontal_alignment(horizontal_alignment_t::right)
|
||||
+ mnew(mbutton)
|
||||
[
|
||||
mslot(mbutton)
|
||||
.margin({10})
|
||||
.visibility(visibility_t::visible)
|
||||
[
|
||||
mnew(mtext_block,
|
||||
.text(U"Hello, World! 你好,世界!\n换行测试1111,测试测试测试测试,测试测试😀🐵🙏 😃🐵🙏")
|
||||
// .text(U"😀🐵🙏😀🐵🙏")
|
||||
.font_size(15)
|
||||
.warp_text(true)
|
||||
)
|
||||
]
|
||||
],
|
||||
|
||||
mslot(mv_box)
|
||||
.horizontal_alignment(horizontal_alignment_t::stretch)
|
||||
@@ -106,40 +106,40 @@ int main(int argc, char* argv[]) {
|
||||
]
|
||||
);
|
||||
|
||||
// const auto& window2 = mwindow::create({800, 600}, L"Hello, World!");
|
||||
// window2->set_content(
|
||||
// mnew(moverlay)
|
||||
// [
|
||||
// mslot(moverlay)
|
||||
// .h_alignment(horizontal_alignment_t::center)
|
||||
// .v_alignment(vertical_alignment_t::center)
|
||||
// + mnew(mbutton)
|
||||
// [
|
||||
// mslot(mbutton)
|
||||
// .margin({10})
|
||||
// [
|
||||
// mnew(mtext_block,
|
||||
// .text(U"测试测试")
|
||||
// .font_size(24))
|
||||
// ]
|
||||
// ],
|
||||
//
|
||||
// mslot(moverlay)
|
||||
// .h_alignment(horizontal_alignment_t::center)
|
||||
// .v_alignment(vertical_alignment_t::center)
|
||||
// + mnew(mbutton)
|
||||
// [
|
||||
// mslot(mbutton)
|
||||
// .margin({10})
|
||||
// [
|
||||
// mnew(mtext_block,
|
||||
// .text(U"测试测试21111")
|
||||
// .font_size(15))
|
||||
// ]
|
||||
// ]
|
||||
// ]
|
||||
// );
|
||||
//
|
||||
const auto& window2 = mwindow::create({800, 600}, L"Hello, World!");
|
||||
window2->set_content(
|
||||
mnew(moverlay)
|
||||
[
|
||||
mslot(moverlay)
|
||||
.h_alignment(horizontal_alignment_t::center)
|
||||
.v_alignment(vertical_alignment_t::center)
|
||||
+ mnew(mbutton)
|
||||
[
|
||||
mslot(mbutton)
|
||||
.margin({10})
|
||||
[
|
||||
mnew(mtext_block,
|
||||
.text(U"测试测试")
|
||||
.font_size(24))
|
||||
]
|
||||
],
|
||||
|
||||
mslot(moverlay)
|
||||
.h_alignment(horizontal_alignment_t::center)
|
||||
.v_alignment(vertical_alignment_t::center)
|
||||
+ mnew(mbutton)
|
||||
[
|
||||
mslot(mbutton)
|
||||
.margin({10})
|
||||
[
|
||||
mnew(mtext_block,
|
||||
.text(U"测试测试21111")
|
||||
.font_size(15))
|
||||
]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
mirage_app::get().run();
|
||||
return 0;
|
||||
|
||||
@@ -215,6 +215,8 @@ void font_manager::append_layout_text(
|
||||
const bool is_emoji = emoji_detector::is_emoji(c);
|
||||
uint32_t glyph_index = 0;
|
||||
const auto& using_font = get_font_for_code_point(primary_font, c, &glyph_index);
|
||||
if (!using_font)
|
||||
return;
|
||||
|
||||
if (!font_metrics_cache.contains(using_font)) {
|
||||
// 确保获取度量前字体大小已设置 (已在循环开始前完成)
|
||||
|
||||
Reference in New Issue
Block a user