Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我使用自定义字体,主题切换按钮乱码了 #5613

Open
enomothem opened this issue Jan 17, 2025 · 1 comment
Open

我使用自定义字体,主题切换按钮乱码了 #5613

enomothem opened this issue Jan 17, 2025 · 1 comment
Labels
bug Something is broken

Comments

@enomothem
Copy link

Image

        let mut font_definitions = FontDefinitions::default();
        font_definitions.font_data.insert(
            "simsum".to_owned(),
            Arc::new(egui::FontData::from_static(include_bytes!("../assets/simsun.ttc"))),
        );
egui::TopBottomPanel::top("top_panel").show(ctx, |ui| {
            ui.horizontal(|ui|{
egui::widgets::global_theme_preference_switch(ui);
@enomothem enomothem added the bug Something is broken label Jan 17, 2025
@enomothem enomothem changed the title 我使用自定义字体,主体切换按钮乱码了 我使用自定义字体,主题切换按钮乱码了 Jan 18, 2025
@lalala-233
Copy link

可能是因为字体缺少相应的 unicode 编码?

It might be because the font lacks the corresponding Unicode encoding?

.add(Button::new("☀").frame(false))

.add(Button::new("🌙").frame(false))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants