分离config使其作为单独的模块
This commit is contained in:
@@ -11,15 +11,7 @@
|
||||
|
||||
#include "utf8.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
mirage_app::get().init();
|
||||
|
||||
auto name = mirage_style::get().name();
|
||||
auto version = mirage_style::get().version();
|
||||
auto author = mirage_style::get().author();
|
||||
auto description = mirage_style::get().description();
|
||||
auto license = mirage_style::get().license();
|
||||
|
||||
void test_color() {
|
||||
const char* test_cases[] = {
|
||||
"#FFF", // hex rgb
|
||||
"#ff0000", // hex RRGGBB
|
||||
@@ -48,24 +40,30 @@ int main(int argc, char* argv[]) {
|
||||
std::println(std::cerr, "Failed to parse color string: {}", test_str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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");
|
||||
// manager.add_font(L"D:/Projects/noto-emoji-2.047/fonts/Noto-COLRv1.ttf");
|
||||
manager.add_font(L"C:/Windows/Fonts/seguiemj.ttf");
|
||||
int main(int argc, char* argv[]) {
|
||||
mirage_app::get().init();
|
||||
|
||||
font_manager::instance().load_default_font();
|
||||
|
||||
auto name = mirage_style::get().name();
|
||||
auto version = mirage_style::get().version();
|
||||
auto author = mirage_style::get().author();
|
||||
auto description = mirage_style::get().description();
|
||||
auto license = mirage_style::get().license();
|
||||
|
||||
const auto& text_block = std::make_shared<mtext_block>();
|
||||
std::stringstream ss;
|
||||
ss << "name: " << name << "\n";
|
||||
ss << "version: " << version << "\n";
|
||||
ss << "author: " << author << "\n";
|
||||
ss << "description: " << description << "\n";
|
||||
ss << "license: " << license << "\n";
|
||||
// text_block->set_text(U"Hello, World! 你好,世界!\n换行测试1111,测试测试测试测试,测试测试😀🐵🙏 😃🐵🙏");
|
||||
|
||||
// const char*转换为std::u32string
|
||||
text_block->set_text(utf8::utf8to32(ss.str()));
|
||||
const auto& config_info_str = utf8::utf8to32(ss.str());
|
||||
const auto& text_block = std::make_shared<mtext_block>();
|
||||
text_block->set_text(config_info_str);
|
||||
// text_block->set_text(U"Hello, World! 你好,世界!\n换行测试1111,测试测试测试测试,测试测试😀🐵🙏 😃🐵🙏");
|
||||
|
||||
const auto& text_block2 = std::make_shared<mtext_block>();
|
||||
text_block2->set_text(U"Hello, World!");
|
||||
|
||||
Reference in New Issue
Block a user