-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Describe the bug
Chinese can be entered in the first position of text_editor, but not in other positions
To Reproduce
Steps to reproduce the behavior:
-
git clone eframe_template
-
setup custom fonts:
fn setup_custom_fonts(ctx: &egui::Context) {
// Start with the default fonts (we will be adding to them rather than replacing them).
let mut fonts = egui::FontDefinitions::default();// Install my own font (maybe supporting non-latin characters).
// .ttf and .otf files supported.
fonts.font_data.insert(
"my_font".to_owned(),
egui::FontData::from_static(include_bytes!(
"msyh.ttc"
)),
);// Put my font first (highest priority) for proportional text:
fonts
.families
.entry(egui::FontFamily::Proportional)
.or_default()
.insert(0, "my_font".to_owned());// Put my font as last fallback for monospace:
fonts
.families
.entry(egui::FontFamily::Monospace)
.or_default()
.push("my_font".to_owned());// Tell egui to use these fonts:
ctx.set_fonts(fonts);
} -
cargo run
Expected behavior
check this scrennshorts,“你好” can be entered in the first position, but can not entered after "test"
Screenshots
Desktop (please complete the following information):
- OS: I check windows 11 and unbuntu,has the same behavior.
- Browser
- Version