Featured image of post كيفية عرض اللغة اليابانية في egui

كيفية عرض اللغة اليابانية في egui

الحصول على مثال egui

يمكنك تشغيل مثال egui بالأوامر التالية.

1
2
3
git clone https://github.com/emilk/eframe_template/ egui_test
cd egui_test
cargo run

تحميل خط يدعم اليابانية

لعرض اللغة اليابانية، تحتاج إلى تحميل خط يدعمها.

في src/app.rs، أضف الأسطر التالية داخل طريقة pub fn new.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
// تحميل خط يدعم اللغة اليابانية
let mut fonts = egui::FontDefinitions::default();
fonts.font_data.insert(
    "Meiryo".to_owned(),
    egui::FontData::from_static(include_bytes!("C:/Windows/Fonts/Meiryo.ttc")),
);
fonts
    .families
    .entry(egui::FontFamily::Proportional)
    .or_default()
    .insert(0, "Meiryo".to_owned());
cc.egui_ctx.set_fonts(fonts);

الآن يمكنك عرض اللغة اليابانية.

img.png

comments powered by Disqus
مبني بستخدام Hugo
قالب Stack مصمم من Jimmy