-
Notifications
You must be signed in to change notification settings - Fork 169
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
Cannot render CJK characters correctly #58
Comments
That is probably an issue with egui. If you try running one of their examples with CJK text, does it work? |
Yes, I cannot find a way to get egui raw context yesterday :) I fixed that problem by calling setfonts api as following: fn configure_visuals(mut egui_ctx: ResMut<EguiContext>) {
egui_ctx.ctx_mut().set_visuals(egui::Visuals {
window_rounding: 0.0.into(),
..Default::default()
});
// support customized fonts
{
let mut fonts = egui::FontDefinitions::default();
// Install my own font (maybe supporting non-latin characters):
// .ttf and .otf supported
// Put my font first (highest priority):
fonts.font_data.insert(
"cjk_font".to_owned(),
egui::FontData::from_static(include_bytes!("../assets/fonts/adobe/SourceHanSansCN-Normal.otf")),
);
fonts
.families
.get_mut(&egui::FontFamily::Proportional)
.unwrap()
.insert(0, "cjk_font".to_owned());
egui_ctx.ctx_mut().set_fonts(fonts);
}
} |
Awesome, I added a note to the readme: https://github.com/jakobhellermann/bevy-inspector-egui/#common-issues |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CJK characters cannot be handled as shown in below image. Do you have any ideas to resolve it?
The text was updated successfully, but these errors were encountered: