Skip to content

FilmCraft: An open-source, nonlinear video editor written by scratch in pure Rust

M10: choose vertical titles from the Type tool flyout

midasdfb7beca9bb9a8
diff --git a/ROADMAP.md b/ROADMAP.md
index 553a6fcf9..28a598cb2 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -159,6 +159,8 @@ Status: ✅ done · 🟡 in progress · ⬜ not started. Estimates are remaining
## Log
+- **2026-10-08:** Type-button long-press/right-click offers Vertical Type, dispatching the existing vertical-text command. Properties exposes the existing orientation flag; title layout and paragraph-text work are unchanged.
+
- **2026-10-06:** 21 community PRs landed (#19, #28, #38, #39, #41–#60). Highlights: hardware decoding is now actually on in the desktop app (#41: `register()` sat inside a `log::info!` that never ran, so #33's VideoToolbox path only worked in the CLI and benchmarks); decode memory on long timelines cut sharply (frame pool, shared GOP-cache budget, positional file reads); exports are byte-identical across machines (#19); crash fix for odd track names over MCP (#44); ripple trim, ripple delete and speed changes move split-edit clips once (#56–#58); Japanese interface using an installed system font (#38; no fonts bundled); MCP annotations, resources, export progress and cancellation (#28).
- **2026-10-05:** honest assessment added (checklist ~87% vs ready for real work ~50–60%). Hardware acceleration started (#30): blend modes on the GPU (#32); VideoToolbox decode + `platform` crate, the one crate allowed `unsafe` (#33). Community fixes landed: AIFF import, export start/end ranges, transitions following ripple trims, Slide moving linked audio (#5–#8).
diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs
index a18ced6ef..d7e9c7ed8 100644
--- a/crates/ui-egui/src/i18n.rs
+++ b/crates/ui-egui/src/i18n.rs
@@ -474,6 +474,8 @@ const SPANISH: &[(&str, &str)] = &[
];
const JAPANESE: &[(&str, &str)] = &[
+ ("Type Tool", "文字ツール"),
+ ("Vertical Type Tool", "縦書き文字ツール"),
("Clip", "クリップ"),
("Sequence", "シーケンス"),
("Markers", "マーカー"),
diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs
index 8dc557f05..160b83af3 100644
--- a/crates/ui-egui/src/menus.rs
+++ b/crates/ui-egui/src/menus.rs
@@ -114,6 +114,7 @@ pub const UI_COMMANDS: &[UiCommand] = &[
uic!("tool.hand", "Hand Tool", [], Some("H")),
uic!("tool.zoom", "Zoom Tool", [], Some("Z")),
uic!("tool.type", "Type Tool", [], Some("T")),
+ uic!("tool.verticalType", "Vertical Type Tool", [], None),
uic!("mode.import", "Import", [], None),
uic!("mode.edit", "Edit", [], None),
uic!("mode.export", "Export", ["File", "Export"], Some("Cmd+M")),
diff --git a/crates/ui-egui/src/panels/graphics.rs b/crates/ui-egui/src/panels/graphics.rs
index 7aefe56ff..398e70753 100644
--- a/crates/ui-egui/src/panels/graphics.rs
+++ b/crates/ui-egui/src/panels/graphics.rs
@@ -237,7 +237,7 @@ pub fn monitor_overlay(app: &mut FilmcraftApp, ui: &mut egui::Ui, pic: Rect, fra
let sel_layers = app.session.state.graphic_layers.clone();
let editing = app.ui.gfx_edit.clone();
// ---- boxes and handles
- let graphics_tool = matches!(tool, Tool::Selection | Tool::Type | Tool::Rectangle | Tool::Ellipse | Tool::Pen);
+ let graphics_tool = matches!(tool, Tool::Selection | Tool::Type | Tool::VerticalType | Tool::Rectangle | Tool::Ellipse | Tool::Pen);
if graphics_tool {
for v in views.iter().filter(|v| Some(v.clip) == sel_clip) {
let q = v.quad();
@@ -275,7 +275,7 @@ pub fn monitor_overlay(app: &mut FilmcraftApp, ui: &mut egui::Ui, pic: Rect, fra
// cursors
if let Some(p) = hover {
match tool {
- Tool::Type => ui.ctx().set_cursor_icon(egui::CursorIcon::Text),
+ Tool::Type | Tool::VerticalType => ui.ctx().set_cursor_icon(egui::CursorIcon::Text),
Tool::Rectangle | Tool::Ellipse | Tool::Pen => ui.ctx().set_cursor_icon(egui::CursorIcon::Crosshair),
Tool::Selection => {
if editing.as_ref().is_some_and(|e| views.iter().any(|v| v.clip.0 == e.clip && v.layer == e.layer && v.hit(p))) {
@@ -321,7 +321,7 @@ pub fn monitor_overlay(app: &mut FilmcraftApp, ui: &mut egui::Ui, pic: Rect, fra
}
} else {
match tool {
- Tool::Selection | Tool::Type => {
+ Tool::Selection | Tool::Type | Tool::VerticalType => {
// handles of the selected layers first
let handle = views
.iter()
@@ -461,7 +461,7 @@ pub fn monitor_overlay(app: &mut FilmcraftApp, ui: &mut egui::Ui, pic: Rect, fra
let in_edit = edit_view.is_some_and(|v| v.hit(p));
match tool {
_ if in_edit => {}
- Tool::Type => {
+ Tool::Type | Tool::VerticalType => {
if let Some(v) = views.iter().find(|v| v.is_text() && v.hit(p)) {
start_edit_at(app, ui, v, p, &mut actions);
} else {
@@ -473,7 +473,8 @@ pub fn monitor_overlay(app: &mut FilmcraftApp, ui: &mut egui::Ui, pic: Rect, fra
if let Some(cl) = into {
prm["clip"] = json!(cl.0);
}
- actions.push(("graphics.newText#edit".into(), prm));
+ let command = if tool == Tool::VerticalType { "graphics.newVerticalText#edit" } else { "graphics.newText#edit" };
+ actions.push((command.into(), prm));
}
}
Tool::Selection => {
@@ -1269,6 +1270,14 @@ pub fn properties(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
cx.number(ui, "Tracking", "tracking", 1.0, (-1000.0, 10_000.0), 0, "");
cx.number(ui, "Leading", "leading", 0.5, (-5000.0, 5000.0), 0, "");
cx.number(ui, "Baseline Shift", "baseline_shift", 0.5, (-5000.0, 5000.0), 0, "");
+ let vertical = pv(e, "vertical", mt).as_bool().unwrap_or(false);
+ let (_, mut vui) = cx.row(ui, "Orientation");
+ let mut value = vertical;
+ let response = vui.checkbox(&mut value, "Vertical Text");
+ cx.auto("vertical", response.rect, "Vertical Text");
+ if response.changed() {
+ cx.set("vertical", json!(value));
+ }
cx.number(ui, "Text Box Width", "box_width", 2.0, (0.0, 100_000.0), 0, "");
let (_, mut vui) = cx.row(ui, "Style");
let flag = |id: &str| pv(e, id, mt).as_bool().unwrap_or(false);
diff --git a/crates/ui-egui/src/panels/tools.rs b/crates/ui-egui/src/panels/tools.rs
index 9119ddb3c..35afefc9d 100644
--- a/crates/ui-egui/src/panels/tools.rs
+++ b/crates/ui-egui/src/panels/tools.rs
@@ -11,14 +11,19 @@ pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
let t = app.tokens;
let mut y = rect.min.y + 4.0;
let size = 32.0;
+ let held_id = egui::Id::new("tools-held");
+ if ui.input(|i| i.pointer.any_pressed()) {
+ ui.data_mut(|d| d.remove::<egui::Id>(held_id));
+ }
for group in Tool::groups() {
let current = if group.contains(&app.ui.tool) { app.ui.tool } else { group[0] };
let r = Rect::from_min_size(pos2(rect.center().x - size / 2.0, y), vec2(size, size));
- let resp = ui.interact(r, egui::Id::new(("tool", format!("{:?}", group[0]))), Sense::click()).on_hover_text(format!(
- "{} ({})",
- current.label(),
- current.shortcut()
- ));
+ let tip = if current.shortcut().is_empty() {
+ app.ui.language.tr(current.label()).to_owned()
+ } else {
+ format!("{} ({})", app.ui.language.tr(current.label()), current.shortcut())
+ };
+ let resp = ui.interact(r, egui::Id::new(("tool", format!("{:?}", group[0]))), Sense::click()).on_hover_text(tip);
for tl in &group {
app.auto.add(&format!("tools.{tl:?}"), r, tl.label());
}
@@ -33,14 +38,36 @@ pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
let c = r.right_bottom() - vec2(3.0, 3.0);
ui.painter().add(egui::Shape::convex_polygon(vec![c, c - vec2(5.0, 0.0), c - vec2(0.0, 5.0)], t.text_dim, egui::Stroke::NONE));
}
- if resp.clicked() {
+ let held = ui.data(|d| d.get_temp::<egui::Id>(held_id)) == Some(resp.id);
+ if resp.clicked() && !held {
app.ui.tool = current;
}
if group.len() > 1 {
- egui::Popup::context_menu(&resp).show(|ui| {
+ let held_for = resp.is_pointer_button_down_on().then(|| ui.input(|i| i.pointer.press_start_time().map(|s| i.time - s))).flatten();
+ if let Some(seconds) = held_for
+ && seconds < 0.35
+ {
+ ui.ctx().request_repaint_after(std::time::Duration::from_secs_f64(0.35 - seconds));
+ }
+ let long_press = held_for.is_some_and(|seconds| seconds >= 0.35) && !held;
+ let command = if resp.secondary_clicked() || long_press {
+ if long_press {
+ ui.data_mut(|d| d.insert_temp(held_id, resp.id));
+ }
+ Some(egui::SetOpenCommand::Bool(true))
+ } else if resp.clicked() && !held {
+ Some(egui::SetOpenCommand::Bool(false))
+ } else {
+ None
+ };
+ let close_behavior = if held && resp.clicked() { egui::PopupCloseBehavior::IgnoreClicks } else { egui::PopupCloseBehavior::CloseOnClickOutside };
+ egui::Popup::menu(&resp).open_memory(command).close_behavior(close_behavior).show(|ui| {
for tl in &group {
- if ui.selectable_label(app.ui.tool == *tl, format!("{} {}", tl.label(), tl.shortcut())).clicked() {
+ let row = ui.selectable_label(app.ui.tool == *tl, format!("{} {}", app.ui.language.tr(tl.label()), tl.shortcut()));
+ app.auto.add(&format!("tools.select.{tl:?}"), row.rect, tl.label());
+ if row.clicked() {
app.ui.tool = *tl;
+ ui.close();
}
}
});
@@ -51,3 +78,66 @@ pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
}
}
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ fn frame(app: &mut FilmcraftApp, ctx: &egui::Context, time: f64, events: Vec<egui::Event>) {
+ app.auto.begin_frame();
+ let mut out = ctx.run_ui(
+ egui::RawInput { time: Some(time), events, screen_rect: Some(Rect::from_min_size(egui::Pos2::ZERO, vec2(1000.0, 800.0))), ..Default::default() },
+ |ui| show(app, ui, Rect::from_min_size(egui::Pos2::ZERO, vec2(42.0, 700.0))),
+ );
+ out.textures_delta.clear();
+ }
+
+ #[test]
+ fn long_press_type_selects_vertical_without_selecting_on_release() {
+ let mut app = FilmcraftApp::new(filmcraft_engine::Session::default());
+ let ctx = egui::Context::default();
+ crate::theme::install(&ctx, &app.tokens);
+ frame(&mut app, &ctx, 0.0, vec![]);
+ frame(&mut app, &ctx, 0.1, vec![]);
+ let center = |element: &crate::automation::Element| {
+ let [x, y, w, h] = element.rect;
+ egui::pos2(x + w / 2.0, y + h / 2.0)
+ };
+ let at = center(app.auto.elements.iter().find(|w| w.id == "tools.Type").unwrap());
+ let pointer = |pos, pressed| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() };
+ frame(&mut app, &ctx, 1.0, vec![egui::Event::PointerMoved(at), pointer(at, true)]);
+ frame(&mut app, &ctx, 1.36, vec![]);
+ frame(&mut app, &ctx, 1.4, vec![pointer(at, false)]);
+ frame(&mut app, &ctx, 1.45, vec![]);
+ assert_eq!(app.ui.tool, Tool::Selection);
+ let row = center(app.auto.elements.iter().find(|w| w.id == "tools.select.VerticalType").unwrap());
+ frame(&mut app, &ctx, 2.0, vec![egui::Event::PointerMoved(row), pointer(row, true)]);
+ frame(&mut app, &ctx, 2.05, vec![pointer(row, false)]);
+ assert_eq!(app.ui.tool, Tool::VerticalType);
+ frame(&mut app, &ctx, 2.1, vec![]);
+ assert!(!app.auto.elements.iter().any(|w| w.id == "tools.select.VerticalType"));
+ app.session.execute("file.openDemoProject", serde_json::json!({})).unwrap();
+ let pic = Rect::from_min_size(pos2(100.0, 100.0), vec2(480.0, 270.0));
+ for (time, pressed) in [(2.5, None), (2.6, None), (3.0, Some(true)), (3.05, Some(false))] {
+ let mut out = ctx.run_ui(
+ egui::RawInput {
+ time: Some(time),
+ events: pressed.map(|pressed| vec![egui::Event::PointerMoved(pic.center()), pointer(pic.center(), pressed)]).unwrap_or_default(),
+ screen_rect: Some(Rect::from_min_size(egui::Pos2::ZERO, vec2(1000.0, 800.0))),
+ ..Default::default()
+ },
+ |ui| {
+ crate::panels::graphics::monitor_overlay(&mut app, ui, pic, (1920, 1080));
+ },
+ );
+ out.textures_delta.clear();
+ }
+ let edit = app.ui.gfx_edit.as_ref().unwrap();
+ let sequence = app.session.active_sequence().unwrap();
+ let (_, item) = sequence.find_item(filmcraft_project::ClipId(edit.clip)).unwrap();
+ let effect_index = filmcraft_project::graphic::layer_indices(&item.effects)[edit.layer];
+ let layer = filmcraft_project::graphic::eval_layer(&item.effects[effect_index], filmcraft_time::Tick::ZERO, (1920, 1080)).unwrap();
+ let filmcraft_project::graphic::LayerContent::Text(text) = layer.content else { panic!("text layer expected") };
+ assert!(text.vertical, "the actual monitor click dispatches the existing vertical text command");
+ }
+}
diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs
index 12f810e25..b3fe57ecb 100644
--- a/crates/ui-egui/src/state.rs
+++ b/crates/ui-egui/src/state.rs
@@ -25,10 +25,11 @@ pub enum Tool {
Hand,
Zoom,
Type,
+ VerticalType,
}
impl Tool {
- pub const ALL: [Tool; 16] = [
+ pub const ALL: [Tool; 17] = [
Tool::Selection,
Tool::TrackSelectForward,
Tool::TrackSelectBackward,
@@ -45,6 +46,7 @@ impl Tool {
Tool::Hand,
Tool::Zoom,
Tool::Type,
+ Tool::VerticalType,
];
pub fn label(self) -> &'static str {
match self {
@@ -64,6 +66,7 @@ impl Tool {
Tool::Hand => "Hand Tool",
Tool::Zoom => "Zoom Tool",
Tool::Type => "Type Tool",
+ Tool::VerticalType => "Vertical Type Tool",
}
}
pub fn shortcut(self) -> &'static str {
@@ -83,6 +86,7 @@ impl Tool {
Tool::Hand => "H",
Tool::Zoom => "Z",
Tool::Type => "T",
+ Tool::VerticalType => "",
}
}
pub fn icon(self) -> Icon {
@@ -102,7 +106,7 @@ impl Tool {
Tool::Ellipse => Icon::Ellipse,
Tool::Hand => Icon::Hand,
Tool::Zoom => Icon::Zoom,
- Tool::Type => Icon::Type,
+ Tool::Type | Tool::VerticalType => Icon::Type,
}
}
pub fn from_name(s: &str) -> Option<Tool> {
@@ -122,7 +126,7 @@ impl Tool {
vec![Tool::Slip, Tool::Slide],
vec![Tool::Pen, Tool::Rectangle, Tool::Ellipse],
vec![Tool::Hand, Tool::Zoom],
- vec![Tool::Type],
+ vec![Tool::Type, Tool::VerticalType],
]
}
}