UI: Arabic, Hebrew, Indic and Thai names can be typed and are drawn (#394)
Cause: two things kept Arabic out of a layer name on Windows. - Windows switches the keyboard layout with Alt+Shift. Releasing Shift before Alt left Alt held alone, and the in-window menu bar (#279) counted the release as an Alt tap: it took the keyboard focus, the rename field closed, and the letters typed next were swallowed by the menu bar. The Project panel's rename field lost them the same way. - The UI fonts are Inter plus the CJK system fallbacks, so Arabic, Hebrew, Indic and Thai names that did arrive (pasted, or from a project) showed as missing-glyph boxes. Fix: - An Alt tap only counts when Alt went down with no other modifier held, so Alt+Shift in either release order is no tap; a plain Alt tap still focuses the menu bar. - The UI registers installed system faces for Arabic, Hebrew, Devanagari, Bengali, Gurmukhi, Gujarati, Tamil, Telugu, Kannada, Malayalam and Thai after the CJK ones, the same way (native only; the web build has no system fonts). A face covering several scripts is registered once (Segoe UI: Arabic and Hebrew; Nirmala UI: every Indic script). - The text engine's fallback tries each script's plain platform families (Segoe UI, Nirmala UI, Leelawadee UI, Geeza Pro, Kohinoor, Noto…) before any covering face, so neither the UI nor a text layer gets a calligraphic face that merely sorts first. - The Timeline's rename field registers `timeline.layer.<id>.nameEdit`. egui 0.36 shapes each run of one face, so Arabic letters join and a word reads right to left; it has no bidirectional layout, so the words of a multi-word Arabic name (and mixed Arabic/Latin) still follow each other left to right. Tests: ui_inline_edit a_layout_switch_keeps_the_name_field_and_arabic_ names_are_kept (Alt+Shift both ways in the layer rename, Arabic typed and stored; Hebrew/Devanagari/Thai in the Project panel; a plain Alt tap still focuses File; failed before: the field closed), theme installed_script_fallbacks_draw_arabic_hebrew_indic_and_thai_names (failed before: replacement glyph for Arabic) and arabic_words_are_joined_and_read_right_to_left, text other_scripts_fall_back_to_a_plain_system_family and the script classification. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
921f0dbdbe
commit
98a6a3a041
@@ -1747,6 +1747,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
|
||||
if let Some((rl, mut buf)) = renaming.filter(|(rl, _)| *rl == layer.id.0) {
|
||||
let mut child = ui.new_child(egui::UiBuilder::new().max_rect(name_rect.shrink2(vec2(0.0, 2.0))));
|
||||
let er = child.add(egui::TextEdit::singleline(&mut buf).font(Tokens::ui(12.0)).desired_width(name_rect.width()));
|
||||
app.auto.add(&format!("timeline.layer.{rl}.nameEdit"), er.rect, &buf);
|
||||
if ctx.data_mut(|d| d.remove_temp::<bool>(rename_focus_id())).unwrap_or(false) {
|
||||
// Just started: focus the field with the whole name selected.
|
||||
er.request_focus();
|
||||
|
||||
Reference in New Issue
Block a user