Skip to content

The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.

feat(text): a title can be set in any font on the machine, or one of your own, imported from the Text inspector

Jareer93793e81b88c
diff --git a/src/Cargo.lock b/src/Cargo.lock
index 7bfc039b..26fee0b2 100644
--- a/src/Cargo.lock
+++ b/src/Cargo.lock
@@ -1141,6 +1141,7 @@ dependencies = [
"concat-project",
"concat-server",
"concat-speech",
+ "concat-text",
"concat-vision",
"image",
"log",
diff --git a/src/crates/concat-text/src/lib.rs b/src/crates/concat-text/src/lib.rs
index 204e723a..42c68fc5 100644
--- a/src/crates/concat-text/src/lib.rs
+++ b/src/crates/concat-text/src/lib.rs
@@ -239,6 +239,41 @@ impl Fonts {
self.db.load_font_file(path).is_ok()
}
+ /// Every family the database knows, once each, in alphabetical order
+ /// without regard to case: what a font picker offers. The bundled face
+ /// is among them.
+ pub fn families(&self) -> Vec<String> {
+ family_names(&self.db)
+ }
+}
+
+/// The families a font file carries - one for a face, several for a
+/// collection - or none when it is not a font this crate can read. Reads
+/// the file alone, with no system font behind it.
+pub fn families_in(path: &std::path::Path) -> Vec<String> {
+ let mut db = fontdb::Database::new();
+ if db.load_font_file(path).is_err() {
+ return Vec::new();
+ }
+ family_names(&db)
+}
+
+fn family_names(db: &fontdb::Database) -> Vec<String> {
+ let mut names: Vec<String> = db
+ .faces()
+ .filter_map(|face| {
+ face.families
+ .first()
+ .map(|(name, _)| name.trim().to_owned())
+ })
+ .filter(|name| !name.is_empty())
+ .collect();
+ names.sort_by_cached_key(|name| name.to_lowercase());
+ names.dedup();
+ names
+}
+
+impl Fonts {
/// The best face for a style: the named family at the nearest weight and
/// slant, then any sans-serif, then anything at all.
fn pick(&self, style: &TitleStyle) -> Result<Vec<u8>, Error> {
@@ -789,6 +824,34 @@ fn push_rounded_rect(builder: &mut PathBuilder, rect: Rect, radius: f32) {
mod tests {
use super::*;
+ #[test]
+ fn a_font_file_names_its_family_and_anything_else_names_none() {
+ let dir = std::env::temp_dir().join(format!("concat-text-fam-{}", std::process::id()));
+ std::fs::create_dir_all(&dir).expect("a temp dir");
+ let font = dir.join("face.ttf");
+ std::fs::write(&font, BUNDLED[0]).expect("written");
+ assert_eq!(families_in(&font), vec![BUNDLED_FAMILY.to_owned()]);
+ let words = dir.join("words.txt");
+ std::fs::write(&words, b"not a font").expect("written");
+ assert!(families_in(&words).is_empty());
+ assert!(families_in(&dir.join("missing.otf")).is_empty());
+ let _ = std::fs::remove_dir_all(&dir);
+ }
+
+ #[test]
+ fn the_families_on_offer_are_sorted_once_each_and_include_the_bundled_face() {
+ let families = Fonts::new().families();
+ assert!(families.iter().any(|name| name == BUNDLED_FAMILY));
+ let lowered: Vec<String> = families.iter().map(|name| name.to_lowercase()).collect();
+ let mut sorted = lowered.clone();
+ sorted.sort();
+ sorted.dedup();
+ assert_eq!(
+ lowered, sorted,
+ "sorted without regard to case, and once each"
+ );
+ }
+
fn style(content: &str) -> TitleStyle {
TitleStyle {
content: content.to_owned(),
diff --git a/src/crates/concat/Cargo.toml b/src/crates/concat/Cargo.toml
index a1f0e05f..d4af2186 100644
--- a/src/crates/concat/Cargo.toml
+++ b/src/crates/concat/Cargo.toml
@@ -114,6 +114,9 @@ concat-effects.workspace = true
# The cutout's mapping from a stage press to a source fraction; the model
# itself runs in the host.
concat-vision.workspace = true
+# The title painter's font list: the families on the machine and the ones
+# in a file, for the Text inspector's picker and its import button.
+concat-text.workspace = true
# Remembered preferences, as a small JSON file in the config directory.
serde = { version = "1", features = ["derive"] }
diff --git a/src/crates/concat/locales/de.json b/src/crates/concat/locales/de.json
index 486f5abd..11ae6785 100644
--- a/src/crates/concat/locales/de.json
+++ b/src/crates/concat/locales/de.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "Nächster Key",
"keyframesPane.previousKey": "Vorheriger Key",
"keyframesPane.selectClipEditKeyframes": "Wähle einen Clip, um seine Keyframes zu bearbeiten",
+ "lib.fonts": "Schriften",
+ "lib.importFont": "Schrift importieren",
"lib.importMedia": "Medien importieren",
"lib.pickEffectFilterLibrary": "Wähle einen Effekt oder Filter aus der Bibliothek",
"mediaBin.importedFiles": "{0} Dateien importiert",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "{0} wird verbessert: {1}× unterwegs, Bild für Bild",
"studio.export": "Exportieren…",
"studio.fileHasNoPicture": "Diese Datei hat kein Bild zum Verbessern",
+ "studio.fontImported": "{0} importiert; steht ab jetzt in der Schriftliste",
"studio.importLut": "Import LUT",
"studio.importMedia": "Medien importieren…",
"studio.importedLooksFindThem": "Imported {0} look(s); find them under Imported",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "mono",
"studio.mute": "Stumm",
+ "studio.notAFont": "{0} ist keine Schrift, die Concat lesen kann",
"studio.openProject": "Open project…",
"studio.paste": "Einfügen",
"studio.processed": "verarbeitet",
@@ -898,6 +902,7 @@
"textPanel.font": "Schrift",
"textPanel.fontWeight": "Schriftstärke",
"textPanel.horizontal": "Horizontal",
+ "textPanel.importFont": "Schrift importieren…",
"textPanel.italic": "Kursiv",
"textPanel.layout": "Layout",
"textPanel.lineHeight": "Zeilenhöhe",
diff --git a/src/crates/concat/locales/en.json b/src/crates/concat/locales/en.json
index 52bcc2c8..c96b9627 100644
--- a/src/crates/concat/locales/en.json
+++ b/src/crates/concat/locales/en.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "Next key",
"keyframesPane.previousKey": "Previous key",
"keyframesPane.selectClipEditKeyframes": "Select a clip to edit its keyframes",
+ "lib.fonts": "Fonts",
+ "lib.importFont": "Import a font",
"lib.importMedia": "Import media",
"lib.pickEffectFilterLibrary": "Pick an effect or filter from the library",
"mediaBin.importedFiles": "Imported {0} files",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "Enhancing {0}: {1}× on its way, frame by frame",
"studio.export": "Export…",
"studio.fileHasNoPicture": "This file has no picture to enhance",
+ "studio.fontImported": "{0} imported; it is in the font list from now on",
"studio.importLut": "Import LUT",
"studio.importMedia": "Import media…",
"studio.importedLooksFindThem": "Imported {0} look(s); find them under Imported",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "mono",
"studio.mute": "Mute",
+ "studio.notAFont": "{0} is not a font Concat can read",
"studio.openProject": "Open project…",
"studio.paste": "Paste",
"studio.processed": "processed",
@@ -898,6 +902,7 @@
"textPanel.font": "Font",
"textPanel.fontWeight": "Font Weight",
"textPanel.horizontal": "Horizontal",
+ "textPanel.importFont": "Import a font…",
"textPanel.italic": "Italic",
"textPanel.layout": "Layout",
"textPanel.lineHeight": "Line height",
diff --git a/src/crates/concat/locales/es.json b/src/crates/concat/locales/es.json
index d85230a1..6e38e33b 100644
--- a/src/crates/concat/locales/es.json
+++ b/src/crates/concat/locales/es.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "Fotograma clave siguiente",
"keyframesPane.previousKey": "Fotograma clave anterior",
"keyframesPane.selectClipEditKeyframes": "Selecciona un clip para editar sus fotogramas clave",
+ "lib.fonts": "Fuentes",
+ "lib.importFont": "Importar una fuente",
"lib.importMedia": "Importar medios",
"lib.pickEffectFilterLibrary": "Elige un efecto o filtro de la biblioteca",
"mediaBin.importedFiles": "{0} archivos importados",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "Mejorando {0}: {1}× en camino, fotograma a fotograma",
"studio.export": "Exportar…",
"studio.fileHasNoPicture": "Este archivo no tiene imagen que mejorar",
+ "studio.fontImported": "{0} importada; desde ahora está en la lista de fuentes",
"studio.importLut": "Import LUT",
"studio.importMedia": "Importar medios…",
"studio.importedLooksFindThem": "Imported {0} look(s); find them under Imported",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "mono",
"studio.mute": "Silenciar",
+ "studio.notAFont": "{0} no es una fuente que Concat pueda leer",
"studio.openProject": "Open project…",
"studio.paste": "Pegar",
"studio.processed": "procesado",
@@ -898,6 +902,7 @@
"textPanel.font": "Fuente",
"textPanel.fontWeight": "Grosor de fuente",
"textPanel.horizontal": "Horizontal",
+ "textPanel.importFont": "Importar una fuente…",
"textPanel.italic": "Cursiva",
"textPanel.layout": "Disposición",
"textPanel.lineHeight": "Interlineado",
diff --git a/src/crates/concat/locales/fa.json b/src/crates/concat/locales/fa.json
index 44a4e4b2..64e3bbad 100644
--- a/src/crates/concat/locales/fa.json
+++ b/src/crates/concat/locales/fa.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "کی‌فریم بعدی",
"keyframesPane.previousKey": "کی‌فریم قبلی",
"keyframesPane.selectClipEditKeyframes": "برای ویرایش کی‌فریم‌ها یک کلیپ انتخاب کنید",
+ "lib.fonts": "قلم‌ها",
+ "lib.importFont": "وارد کردن قلم",
"lib.importMedia": "وارد کردن رسانه",
"lib.pickEffectFilterLibrary": "یک افکت یا فیلتر از کتابخانه انتخاب کنید",
"mediaBin.importedFiles": "{0} فایل وارد کردن شد",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "در حال بهبود کیفیت {0}: {1}× در راه است، فریم به فریم",
"studio.export": "خروجی گرفتن…",
"studio.fileHasNoPicture": "این فایل تصویری برای بهبود کیفیت ندارد",
+ "studio.fontImported": "{0} وارد شد؛ از این پس در فهرست قلم‌ها است",
"studio.importLut": "وارد کردن LUT",
"studio.importMedia": "وارد کردن رسانه…",
"studio.importedLooksFindThem": "{0} ظاهر وارد کردن شد؛ آن‌ها را در بخش Imported پیدا کنید",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "Mono",
"studio.mute": "بی‌صدا",
+ "studio.notAFont": "{0} قلمی نیست که Concat بتواند بخواند",
"studio.openProject": "باز کردن پروژه…",
"studio.paste": "چسباندن",
"studio.processed": "پردازش‌شده",
@@ -898,6 +902,7 @@
"textPanel.font": "فونت",
"textPanel.fontWeight": "وزن فونت",
"textPanel.horizontal": "افقی",
+ "textPanel.importFont": "وارد کردن قلم…",
"textPanel.italic": "ایتالیک",
"textPanel.layout": "چیدمان",
"textPanel.lineHeight": "ارتفاع خط",
diff --git a/src/crates/concat/locales/fr.json b/src/crates/concat/locales/fr.json
index 800eeda5..85303150 100644
--- a/src/crates/concat/locales/fr.json
+++ b/src/crates/concat/locales/fr.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "Image clé suivante",
"keyframesPane.previousKey": "Image clé précédente",
"keyframesPane.selectClipEditKeyframes": "Sélectionnez un clip pour modifier ses images clés",
+ "lib.fonts": "Polices",
+ "lib.importFont": "Importer une police",
"lib.importMedia": "Importer des médias",
"lib.pickEffectFilterLibrary": "Choisissez un effet ou un filtre dans la bibliothèque",
"mediaBin.importedFiles": "{0} fichiers importés",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "Amélioration de {0} : ×{1} en cours, image par image",
"studio.export": "Exporter…",
"studio.fileHasNoPicture": "Ce fichier n'a pas d'image à améliorer",
+ "studio.fontImported": "{0} importée ; elle figure désormais dans la liste des polices",
"studio.importLut": "Import LUT",
"studio.importMedia": "Importer des médias…",
"studio.importedLooksFindThem": "Imported {0} look(s); find them under Imported",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "mono",
"studio.mute": "Muet",
+ "studio.notAFont": "{0} n’est pas une police que Concat sait lire",
"studio.openProject": "Open project…",
"studio.paste": "Coller",
"studio.processed": "traité",
@@ -898,6 +902,7 @@
"textPanel.font": "Police",
"textPanel.fontWeight": "Graisse de la police",
"textPanel.horizontal": "Horizontal",
+ "textPanel.importFont": "Importer une police…",
"textPanel.italic": "Italique",
"textPanel.layout": "Disposition",
"textPanel.lineHeight": "Interligne",
diff --git a/src/crates/concat/locales/hr.json b/src/crates/concat/locales/hr.json
index b055c9ff..d07bf035 100644
--- a/src/crates/concat/locales/hr.json
+++ b/src/crates/concat/locales/hr.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "Sljedeći ključni kadar",
"keyframesPane.previousKey": "Prethodni ključni kadar",
"keyframesPane.selectClipEditKeyframes": "Odaberite klip za uređivanje njegovih ključnih kadrova",
+ "lib.fonts": "Fontovi",
+ "lib.importFont": "Uvezi font",
"lib.importMedia": "Uvezi medije",
"lib.pickEffectFilterLibrary": "Odaberite efekt ili filtar iz biblioteke",
"mediaBin.importedFiles": "Uvezeno {0} datoteka",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "Poboljšavanje {0}: {1}× na putu, kadar po kadar",
"studio.export": "Izvoz…",
"studio.fileHasNoPicture": "Ova datoteka nema slike za poboljšanje",
+ "studio.fontImported": "{0} uvezen; od sada je na popisu fontova",
"studio.importLut": "Uvezi LUT",
"studio.importMedia": "Uvezi medije…",
"studio.importedLooksFindThem": "Uvezeno {0} izgleda; naći ćete ih pod Uvezeno",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "mono",
"studio.mute": "Utišaj",
+ "studio.notAFont": "{0} nije font koji Concat može pročitati",
"studio.openProject": "Open project…",
"studio.paste": "Zalijepi",
"studio.processed": "obrađeno",
@@ -898,6 +902,7 @@
"textPanel.font": "Font",
"textPanel.fontWeight": "Debljina fonta",
"textPanel.horizontal": "Vodoravno",
+ "textPanel.importFont": "Uvezi font…",
"textPanel.italic": "Kurziv",
"textPanel.layout": "Raspored",
"textPanel.lineHeight": "Visina retka",
diff --git a/src/crates/concat/locales/it.json b/src/crates/concat/locales/it.json
index 27558ce2..12ba81a4 100644
--- a/src/crates/concat/locales/it.json
+++ b/src/crates/concat/locales/it.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "Fotogramma chiave successivo",
"keyframesPane.previousKey": "Fotogramma chiave precedente",
"keyframesPane.selectClipEditKeyframes": "Seleziona una clip per modificarne i fotogrammi chiave",
+ "lib.fonts": "Font",
+ "lib.importFont": "Importa un font",
"lib.importMedia": "Importa media",
"lib.pickEffectFilterLibrary": "Scegli un effetto o un filtro dalla libreria",
"mediaBin.importedFiles": "{0} file importati",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "Miglioramento di {0}: {1}× in arrivo, fotogramma per fotogramma",
"studio.export": "Esporta…",
"studio.fileHasNoPicture": "Questo file non ha un'immagine da migliorare",
+ "studio.fontImported": "{0} importato; da ora è nell’elenco dei font",
"studio.importLut": "Import LUT",
"studio.importMedia": "Importa media…",
"studio.importedLooksFindThem": "Imported {0} look(s); find them under Imported",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "mono",
"studio.mute": "Muto",
+ "studio.notAFont": "{0} non è un font che Concat sa leggere",
"studio.openProject": "Open project…",
"studio.paste": "Incolla",
"studio.processed": "elaborato",
@@ -898,6 +902,7 @@
"textPanel.font": "Carattere",
"textPanel.fontWeight": "Peso del carattere",
"textPanel.horizontal": "Orizzontale",
+ "textPanel.importFont": "Importa un font…",
"textPanel.italic": "Corsivo",
"textPanel.layout": "Impaginazione",
"textPanel.lineHeight": "Interlinea",
diff --git a/src/crates/concat/locales/ja.json b/src/crates/concat/locales/ja.json
index e55a1c4f..0d6df970 100644
--- a/src/crates/concat/locales/ja.json
+++ b/src/crates/concat/locales/ja.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "次のキー",
"keyframesPane.previousKey": "前のキー",
"keyframesPane.selectClipEditKeyframes": "クリップを選択するとキーフレームを編集できます",
+ "lib.fonts": "フォント",
+ "lib.importFont": "フォントを読み込む",
"lib.importMedia": "メディアを読み込む",
"lib.pickEffectFilterLibrary": "ライブラリからエフェクトまたはフィルターを選んでください",
"mediaBin.importedFiles": "{0} 個のファイルを読み込みました",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "{0} を高画質化中:{1}× をフレームごとに処理しています",
"studio.export": "書き出し…",
"studio.fileHasNoPicture": "このファイルには高画質化する映像がありません",
+ "studio.fontImported": "{0} を読み込みました。これ以降フォント一覧に表示されます",
"studio.importLut": "Import LUT",
"studio.importMedia": "メディアを読み込む…",
"studio.importedLooksFindThem": "Imported {0} look(s); find them under Imported",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "mono",
"studio.mute": "ミュート",
+ "studio.notAFont": "{0} は Concat が読み込めるフォントではありません",
"studio.openProject": "Open project…",
"studio.paste": "ペースト",
"studio.processed": "処理済み",
@@ -898,6 +902,7 @@
"textPanel.font": "フォント",
"textPanel.fontWeight": "フォントの太さ",
"textPanel.horizontal": "水平",
+ "textPanel.importFont": "フォントを読み込む…",
"textPanel.italic": "斜体",
"textPanel.layout": "レイアウト",
"textPanel.lineHeight": "行の高さ",
diff --git a/src/crates/concat/locales/ko.json b/src/crates/concat/locales/ko.json
index fa16f96f..6d9f777a 100644
--- a/src/crates/concat/locales/ko.json
+++ b/src/crates/concat/locales/ko.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "다음 키",
"keyframesPane.previousKey": "이전 키",
"keyframesPane.selectClipEditKeyframes": "키프레임을 편집할 클립을 선택하세요",
+ "lib.fonts": "글꼴",
+ "lib.importFont": "글꼴 가져오기",
"lib.importMedia": "미디어 가져오기",
"lib.pickEffectFilterLibrary": "라이브러리에서 효과나 필터를 선택하세요",
"mediaBin.importedFiles": "파일 {0}개를 가져왔습니다",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "{0} 향상 중: {1}×로 한 프레임씩 진행합니다",
"studio.export": "내보내기…",
"studio.fileHasNoPicture": "이 파일에는 향상할 영상이 없습니다",
+ "studio.fontImported": "{0}을(를) 가져왔습니다. 이제부터 글꼴 목록에 표시됩니다",
"studio.importLut": "Import LUT",
"studio.importMedia": "미디어 가져오기…",
"studio.importedLooksFindThem": "Imported {0} look(s); find them under Imported",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "mono",
"studio.mute": "음소거",
+ "studio.notAFont": "{0}은(는) Concat이 읽을 수 있는 글꼴이 아닙니다",
"studio.openProject": "Open project…",
"studio.paste": "붙여넣기",
"studio.processed": "처리됨",
@@ -898,6 +902,7 @@
"textPanel.font": "글꼴",
"textPanel.fontWeight": "글꼴 굵기",
"textPanel.horizontal": "가로",
+ "textPanel.importFont": "글꼴 가져오기…",
"textPanel.italic": "기울임",
"textPanel.layout": "레이아웃",
"textPanel.lineHeight": "줄 높이",
diff --git a/src/crates/concat/locales/pt-BR.json b/src/crates/concat/locales/pt-BR.json
index fcab6103..117f0ef5 100644
--- a/src/crates/concat/locales/pt-BR.json
+++ b/src/crates/concat/locales/pt-BR.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "Próximo quadro-chave",
"keyframesPane.previousKey": "Quadro-chave anterior",
"keyframesPane.selectClipEditKeyframes": "Selecione um clipe para editar seus quadros-chave",
+ "lib.fonts": "Fontes",
+ "lib.importFont": "Importar uma fonte",
"lib.importMedia": "Importar mídia",
"lib.pickEffectFilterLibrary": "Escolha um efeito ou filtro na biblioteca",
"mediaBin.importedFiles": "{0} arquivos importados",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "Melhorando {0}: {1}× a caminho, quadro a quadro",
"studio.export": "Exportar…",
"studio.fileHasNoPicture": "Este arquivo não tem imagem para melhorar",
+ "studio.fontImported": "{0} importada; a partir de agora está na lista de fontes",
"studio.importLut": "Import LUT",
"studio.importMedia": "Importar mídia…",
"studio.importedLooksFindThem": "Imported {0} look(s); find them under Imported",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "mono",
"studio.mute": "Mudo",
+ "studio.notAFont": "{0} não é uma fonte que o Concat consiga ler",
"studio.openProject": "Open project…",
"studio.paste": "Colar",
"studio.processed": "processado",
@@ -898,6 +902,7 @@
"textPanel.font": "Fonte",
"textPanel.fontWeight": "Peso da fonte",
"textPanel.horizontal": "Horizontal",
+ "textPanel.importFont": "Importar uma fonte…",
"textPanel.italic": "Itálico",
"textPanel.layout": "Leiaute",
"textPanel.lineHeight": "Altura da linha",
diff --git a/src/crates/concat/locales/ru.json b/src/crates/concat/locales/ru.json
index b8b84687..307328f3 100644
--- a/src/crates/concat/locales/ru.json
+++ b/src/crates/concat/locales/ru.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "Следующий ключевой кадр",
"keyframesPane.previousKey": "Предыдущий ключевой кадр",
"keyframesPane.selectClipEditKeyframes": "Выберите клип, чтобы редактировать его ключевые кадры",
+ "lib.fonts": "Шрифты",
+ "lib.importFont": "Импортировать шрифт",
"lib.importMedia": "Импорт медиа",
"lib.pickEffectFilterLibrary": "Выберите эффект или фильтр в библиотеке",
"mediaBin.importedFiles": "Импортировано файлов: {0}",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "Улучшение {0}: {1}× на подходе, кадр за кадром",
"studio.export": "Экспорт…",
"studio.fileHasNoPicture": "В этом файле нет картинки для улучшения",
+ "studio.fontImported": "{0} импортирован; теперь он в списке шрифтов",
"studio.importLut": "Импорт LUT",
"studio.importMedia": "Импорт медиа…",
"studio.importedLooksFindThem": "Импортировано стилей: {0}; они в разделе «Импортированные»",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "моно",
"studio.mute": "Без звука",
+ "studio.notAFont": "{0} — не шрифт, который Concat может прочитать",
"studio.openProject": "Открыть проект…",
"studio.paste": "Вставить",
"studio.processed": "обработано",
@@ -898,6 +902,7 @@
"textPanel.font": "Шрифт",
"textPanel.fontWeight": "Насыщенность шрифта",
"textPanel.horizontal": "По горизонтали",
+ "textPanel.importFont": "Импортировать шрифт…",
"textPanel.italic": "Курсив",
"textPanel.layout": "Компоновка",
"textPanel.lineHeight": "Высота строки",
diff --git a/src/crates/concat/locales/tr.json b/src/crates/concat/locales/tr.json
index bad2afe5..b4529f17 100644
--- a/src/crates/concat/locales/tr.json
+++ b/src/crates/concat/locales/tr.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "Sonraki anahtar kare",
"keyframesPane.previousKey": "Önceki anahtar kare",
"keyframesPane.selectClipEditKeyframes": "Anahtar karelerini düzenlemek için bir klip seçin",
+ "lib.fonts": "Yazı tipleri",
+ "lib.importFont": "Yazı tipi içe aktar",
"lib.importMedia": "Medya içe aktar",
"lib.pickEffectFilterLibrary": "Kitaplıktan bir efekt veya filtre seçin",
"mediaBin.importedFiles": "{0} dosya içe aktarıldı",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "{0} iyileştiriliyor: {1}× kare kare yolda",
"studio.export": "Dışa aktar…",
"studio.fileHasNoPicture": "Bu dosyanın iyileştirilecek görüntüsü yok",
+ "studio.fontImported": "{0} içe aktarıldı; artık yazı tipi listesinde",
"studio.importLut": "Import LUT",
"studio.importMedia": "Medya içe aktar…",
"studio.importedLooksFindThem": "Imported {0} look(s); find them under Imported",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "mono",
"studio.mute": "Sessiz",
+ "studio.notAFont": "{0}, Concat’ın okuyabildiği bir yazı tipi değil",
"studio.openProject": "Open project…",
"studio.paste": "Yapıştır",
"studio.processed": "işlenmiş",
@@ -898,6 +902,7 @@
"textPanel.font": "Yazı tipi",
"textPanel.fontWeight": "Yazı kalınlığı",
"textPanel.horizontal": "Yatay",
+ "textPanel.importFont": "Yazı tipi içe aktar…",
"textPanel.italic": "İtalik",
"textPanel.layout": "Yerleşim",
"textPanel.lineHeight": "Satır yüksekliği",
diff --git a/src/crates/concat/locales/zh-Hans.json b/src/crates/concat/locales/zh-Hans.json
index 635955b4..a363e6d1 100644
--- a/src/crates/concat/locales/zh-Hans.json
+++ b/src/crates/concat/locales/zh-Hans.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "下一个关键帧",
"keyframesPane.previousKey": "上一个关键帧",
"keyframesPane.selectClipEditKeyframes": "选择一个片段以编辑其关键帧",
+ "lib.fonts": "字体",
+ "lib.importFont": "导入字体",
"lib.importMedia": "导入媒体",
"lib.pickEffectFilterLibrary": "从素材库中选择效果或滤镜",
"mediaBin.importedFiles": "已导入 {0} 个文件",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "正在增强{0}:{1}× 逐帧处理中",
"studio.export": "导出…",
"studio.fileHasNoPicture": "此文件没有可增强的画面",
+ "studio.fontImported": "已导入 {0},从现在起会出现在字体列表中",
"studio.importLut": "导入 LUT",
"studio.importMedia": "导入媒体…",
"studio.importedLooksFindThem": "已导入 {0} 个风格,可在“已导入”中找到",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "单声道",
"studio.mute": "静音",
+ "studio.notAFont": "{0} 不是 Concat 能读取的字体",
"studio.openProject": "打开项目…",
"studio.paste": "粘贴",
"studio.processed": "已处理",
@@ -898,6 +902,7 @@
"textPanel.font": "字体",
"textPanel.fontWeight": "字重",
"textPanel.horizontal": "水平",
+ "textPanel.importFont": "导入字体…",
"textPanel.italic": "斜体",
"textPanel.layout": "布局",
"textPanel.lineHeight": "行高",
diff --git a/src/crates/concat/locales/zh-TW.json b/src/crates/concat/locales/zh-TW.json
index fb07f3c8..e6b502d6 100644
--- a/src/crates/concat/locales/zh-TW.json
+++ b/src/crates/concat/locales/zh-TW.json
@@ -600,6 +600,8 @@
"keyframesPane.nextKey": "下一個關鍵影格",
"keyframesPane.previousKey": "上一個關鍵影格",
"keyframesPane.selectClipEditKeyframes": "選取一個片段以編輯其關鍵影格",
+ "lib.fonts": "字型",
+ "lib.importFont": "匯入字型",
"lib.importMedia": "匯入媒體",
"lib.pickEffectFilterLibrary": "從素材庫中選擇效果或濾鏡",
"mediaBin.importedFiles": "已匯入 {0} 個檔案",
@@ -835,6 +837,7 @@
"studio.enhancingWayFrameFrame": "正在增強{0}:{1}× 逐影格處理中",
"studio.export": "匯出…",
"studio.fileHasNoPicture": "此檔案沒有可增強的畫面",
+ "studio.fontImported": "已匯入 {0},從現在起會出現在字型清單中",
"studio.importLut": "匯入 LUT",
"studio.importMedia": "匯入媒體…",
"studio.importedLooksFindThem": "已匯入 {0} 個風格,可在「已匯入」中找到",
@@ -844,6 +847,7 @@
"studio.lut": "LUT",
"studio.mono": "單聲道",
"studio.mute": "靜音",
+ "studio.notAFont": "{0} 不是 Concat 能讀取的字型",
"studio.openProject": "打開專案…",
"studio.paste": "貼上",
"studio.processed": "已處理",
@@ -898,6 +902,7 @@
"textPanel.font": "字型",
"textPanel.fontWeight": "字重",
"textPanel.horizontal": "水平",
+ "textPanel.importFont": "匯入字型…",
"textPanel.italic": "斜體",
"textPanel.layout": "佈局",
"textPanel.lineHeight": "行高",
diff --git a/src/crates/concat/src/lib.rs b/src/crates/concat/src/lib.rs
index bc7e34aa..9865a99d 100644
--- a/src/crates/concat/src/lib.rs
+++ b/src/crates/concat/src/lib.rs
@@ -191,6 +191,15 @@ pub fn run() -> Result<(), slint::PlatformError> {
});
Shell::install(shell.clone());
+ // The machine's fonts, for the Text inspector's picker. Read on a
+ // worker: on a machine with a few thousand faces it is a moment, and
+ // the window should not open a moment late for a list nobody is
+ // looking at yet.
+ host::spawn(
+ || concat_text::Fonts::new().families(),
+ |studio, _, _, families| studio.system_fonts_known(families),
+ );
+
// Handed over once, here, and never replaced: a fresh model is a reset,
// and a reset rebuilds every row that hangs off it.
{
@@ -247,6 +256,7 @@ pub fn run() -> Result<(), slint::PlatformError> {
editor.set_dividers(ModelRc::from(models.dividers.clone()));
app.set_recents(ModelRc::from(models.recents.clone()));
editor.set_text_presets(ModelRc::from(models.text_presets.clone()));
+ editor.set_font_families(ModelRc::from(models.font_families.clone()));
}
// Settings > About's block, gathered once: nothing in it changes while
@@ -633,6 +643,20 @@ pub fn run() -> Result<(), slint::PlatformError> {
);
});
});
+ // Font files, the way media files come in: the system's picker, and
+ // the answer later, on the window's thread.
+ editor.on_import_font(|| {
+ Shell::with(|shell, _| {
+ if shell.studio.borrow().session.is_none() {
+ return;
+ }
+ platform::pick_files_async(
+ &i18n::t("lib.importFont"),
+ Some((i18n::t("lib.fonts").as_str(), &["ttf", "otf", "ttc"])),
+ |paths| on_ui(move |studio, _, _| studio.import_fonts(paths)),
+ );
+ });
+ });
editor.on_media_activate(on_window!(|state, id: i32| {
state.place_at_playhead(&format!("media:{id}"));
}));
diff --git a/src/crates/concat/src/presets.rs b/src/crates/concat/src/presets.rs
index f675c414..042cfca1 100644
--- a/src/crates/concat/src/presets.rs
+++ b/src/crates/concat/src/presets.rs
@@ -310,19 +310,57 @@ pub fn all(dirs: &AppDirs) -> Vec<TextPreset> {
presets
}
-/// Puts the preset's font where the app keeps fonts, if it is not there
-/// already, and says how to register it: the family the style names and
-/// the installed file. None for a preset that brings no font, or whose
-/// file cannot be read.
-pub fn install_font(dirs: &AppDirs, preset: &TextPreset) -> Option<(String, String)> {
- let source = preset.font.as_ref().filter(|path| path.is_file())?;
+/// Where the app keeps fonts: the ones presets brought, and the ones the
+/// user imported from the Text inspector. A font here outlives the project
+/// it was imported into - it is offered to every title, and registered on
+/// a project the moment a title in it is set in the face.
+pub fn fonts_dir(dirs: &AppDirs) -> PathBuf {
+ dirs.config.join("fonts")
+}
+
+/// Copies a font file into [`fonts_dir`], unless one of that name is there
+/// already, and says where it landed. None when it cannot be copied.
+pub fn install_font_file(dirs: &AppDirs, source: &Path) -> Option<PathBuf> {
let name = source.file_name()?;
- let fonts = dirs.config.join("fonts");
+ let fonts = fonts_dir(dirs);
let installed = fonts.join(name);
if !installed.is_file() {
std::fs::create_dir_all(&fonts).ok()?;
std::fs::copy(source, &installed).ok()?;
}
+ Some(installed)
+}
+
+/// Every family in [`fonts_dir`], with the file that carries it: what the
+/// font picker offers beyond the bundled face and the system's, in the
+/// order the files are found. A file that is not a font is passed over.
+pub fn installed_fonts(dirs: &AppDirs) -> Vec<(String, String)> {
+ let Ok(entries) = std::fs::read_dir(fonts_dir(dirs)) else {
+ return Vec::new();
+ };
+ let mut paths: Vec<PathBuf> = entries
+ .filter_map(Result::ok)
+ .map(|entry| entry.path())
+ .filter(|path| path.is_file())
+ .collect();
+ paths.sort();
+ let mut out = Vec::new();
+ for path in paths {
+ let file = path.to_string_lossy().into_owned();
+ for family in concat_text::families_in(&path) {
+ out.push((family, file.clone()));
+ }
+ }
+ out
+}
+
+/// Puts the preset's font where the app keeps fonts, if it is not there
+/// already, and says how to register it: the family the style names and
+/// the installed file. None for a preset that brings no font, or whose
+/// file cannot be read.
+pub fn install_font(dirs: &AppDirs, preset: &TextPreset) -> Option<(String, String)> {
+ let source = preset.font.as_ref().filter(|path| path.is_file())?;
+ let installed = install_font_file(dirs, source)?;
let family = preset.style.font_family.trim().trim_matches('"').to_owned();
if family.is_empty() {
return None;
diff --git a/src/crates/concat/src/studio.rs b/src/crates/concat/src/studio.rs
index 6376c1f8..12210525 100644
--- a/src/crates/concat/src/studio.rs
+++ b/src/crates/concat/src/studio.rs
@@ -612,6 +612,8 @@ pub struct Models {
pub recents: Rc<VecModel<RecentProjectData>>,
/// The Text page's presets, published once from the loaded list.
pub text_presets: Rc<VecModel<TextPresetData>>,
+ /// The families a title can be set in; see `Studio::font_families`.
+ pub font_families: Rc<VecModel<SharedString>>,
}
impl Models {
@@ -667,6 +669,7 @@ impl Models {
dividers: Rc::new(VecModel::default()),
recents: Rc::new(VecModel::default()),
text_presets: Rc::new(VecModel::default()),
+ font_families: Rc::new(VecModel::default()),
}
}
}
@@ -875,6 +878,15 @@ pub struct Studio {
/// Every speaker the voice engine offers, in its own order.
/// The looks the Text page offers; see `presets`.
pub text_presets: Vec<TextPreset>,
+ /// The fonts in the app's own folder - imported from the Text
+ /// inspector, or brought by a preset - as (family, file), read once at
+ /// start and added to as files come in. Offered to every title; a
+ /// project a title is set in one of them registers the file so the
+ /// painter finds it. See `presets::installed_fonts`.
+ pub installed_fonts: Vec<(String, String)>,
+ /// The families the machine has, found on a worker after the window is
+ /// up - the system's fonts take a moment to read - and empty until then.
+ pub system_fonts: Vec<String>,
/// The languages Settings › General offers, in its order; see `i18n`.
pub languages: Vec<i18n::Language>,
@@ -1773,6 +1785,8 @@ impl Studio {
captions: crate::panes::captions::CaptionsPane::default(),
speech: crate::panes::speech::SpeechPane::default(),
text_presets,
+ installed_fonts: presets::installed_fonts(&host.dirs),
+ system_fonts: Vec::new(),
languages,
brush: 0,
brush_size: 0.06,
@@ -4045,6 +4059,12 @@ impl Studio {
let Some(id) = self.sole_selection() else {
return;
};
+ // One of the app's own fonts goes on the project before the title
+ // is set in it, as a command of its own: the painter reads the
+ // project's fonts, and the echo below is not the project.
+ if field == ClipTextField::FontFamily {
+ self.ensure_font(value);
+ }
self.commit_target = Some(id.clone());
self.begin_echo();
let Some(clip) = self.echo_clip_mut(&id) else {
@@ -4082,6 +4102,99 @@ impl Studio {
self.request_preview();
}
+ // ── fonts ──
+
+ /// The families a title can be set in, in the order the picker shows
+ /// them: the bundled face; then the user's own - the project's fonts
+ /// and the app's installed ones, once each, in alphabetical order; then
+ /// the system's, likewise, less any already listed.
+ pub fn font_families(&self) -> Vec<String> {
+ let mut out = vec![concat_text::BUNDLED_FAMILY.to_owned()];
+ let mut own: Vec<String> = self
+ .installed_fonts
+ .iter()
+ .map(|(family, _)| family.clone())
+ .chain(
+ self.session
+ .as_ref()
+ .map(|session| session.project().fonts.clone())
+ .unwrap_or_default()
+ .into_iter()
+ .map(|font| font.family),
+ )
+ .filter(|family| !family.is_empty())
+ .collect();
+ own.sort_by_cached_key(|family| family.to_lowercase());
+ own.dedup();
+ for family in own.into_iter().chain(self.system_fonts.iter().cloned()) {
+ if !out.iter().any(|held| held.eq_ignore_ascii_case(&family)) {
+ out.push(family);
+ }
+ }
+ out
+ }
+
+ /// The machine's families have been read; see `system_fonts`.
+ pub fn system_fonts_known(&mut self, families: Vec<String>) {
+ self.system_fonts = families;
+ }
+
+ /// Font files the user picked: each is copied to the app's own folder,
+ /// so it is there next session and for every project, and registered
+ /// on this project; the selected title is set in the first of them.
+ pub fn import_fonts(&mut self, paths: Vec<std::path::PathBuf>) {
+ let mut first: Option<String> = None;
+ for path in paths {
+ let families = concat_text::families_in(&path);
+ if families.is_empty() {
+ self.notify(&tf("studio.notAFont", &[&path.display()]), true);
+ continue;
+ }
+ let Some(installed) = presets::install_font_file(&self.host.dirs, &path) else {
+ self.notify(&tf("studio.notAFont", &[&path.display()]), true);
+ continue;
+ };
+ let file = installed.to_string_lossy().into_owned();
+ for family in families {
+ if !self.installed_fonts.iter().any(|(held, _)| *held == family) {
+ self.installed_fonts.push((family.clone(), file.clone()));
+ }
+ self.ensure_font(&family);
+ first.get_or_insert(family);
+ }
+ }
+ if let Some(family) = first {
+ self.notify(&tf("studio.fontImported", &[&family]), false);
+ if self.sole_selection().is_some() {
+ self.clip_set_text(ClipTextField::FontFamily, &family);
+ self.clip_commit();
+ }
+ }
+ }
+
+ /// Registers the file behind one of the app's installed families on the
+ /// project, once, so the painter - which reads a project's fonts and
+ /// the system's, and nothing else - finds it. Nothing for a family the
+ /// project already carries, or one that is not the app's to register.
+ fn ensure_font(&mut self, family: &str) {
+ let family = family.trim().trim_matches('"');
+ let carried = self.session.as_ref().is_some_and(|session| {
+ session
+ .project()
+ .fonts
+ .iter()
+ .any(|font| font.family == family)
+ });
+ if carried {
+ return;
+ }
+ let Some((_, path)) = self.installed_fonts.iter().find(|(held, _)| held == family) else {
+ return;
+ };
+ let (family, path) = (family.to_owned(), path.clone());
+ self.apply(Command::AddFont { family, path });
+ }
+
pub fn clip_set_colour(&mut self, field: ClipTextField, value: slint::Color) {
let Some(id) = self.sole_selection() else {
return;
@@ -6658,6 +6771,13 @@ impl Studio {
let rows = self.key_rows();
keys.set_available(!rows.is_empty());
sync(&models.key_rows, rows);
+ sync(
+ &models.font_families,
+ self.font_families()
+ .into_iter()
+ .map(SharedString::from)
+ .collect(),
+ );
editor.set_inspector_jump_token(self.inspector_jump.0);
editor.set_library_audition(self.audition_of().unwrap_or("").into());
editor.set_inspector_jump_tab(self.inspector_jump.1.into());
@@ -7759,6 +7879,11 @@ impl Studio {
fade_out: clip.fade_out as f32,
content: text.content.as_str().into(),
font_family: text.font_family.trim_matches('"').into(),
+ family_row: self
+ .font_families()
+ .iter()
+ .position(|family| family.eq_ignore_ascii_case(text.font_family.trim_matches('"')))
+ .unwrap_or(0) as i32,
font_size: text.font_size as f32,
font_weight: text.font_weight as f32,
italic: text.italic,
diff --git a/src/crates/concat/ui/editor.slint b/src/crates/concat/ui/editor.slint
index 634c7de3..a542f748 100644
--- a/src/crates/concat/ui/editor.slint
+++ b/src/crates/concat/ui/editor.slint
@@ -132,6 +132,13 @@ export global Editor {
callback clip-set-text(field: ClipTextField, value: string);
callback clip-set-colour(field: ClipTextField, value: color);
callback clip-commit();
+ /// The families a title can be set in: the bundled face, the user's
+ /// own fonts, then the machine's. See `Studio::font_families`.
+ in-out property <[string]> font-families;
+ /// The Text inspector's import button: font files picked from disk
+ /// join the user's own fonts, for good, and the title is set in the
+ /// first of them.
+ callback import-font();
// The effect catalogue's shelves, published once, and the selected
// clip's two chains with a row per parameter. See PresetStack.
diff --git a/src/crates/concat/ui/inspector/text-panel.slint b/src/crates/concat/ui/inspector/text-panel.slint
index 7b04e49f..c78965d2 100644
--- a/src/crates/concat/ui/inspector/text-panel.slint
+++ b/src/crates/concat/ui/inspector/text-panel.slint
@@ -40,6 +40,8 @@ export component TextPanel inherits VerticalLayout {
callback set-text(field: ClipTextField, value: string);
callback set-colour(field: ClipTextField, value: color);
callback commit();
+ /// The square beside the font picker: bring a font file of your own in.
+ callback import-font();
// Local editing state, seeded rather than bound — see the note on
// AdjustPanel, which has the same problem for the same reason.
@@ -98,9 +100,9 @@ export component TextPanel inherits VerticalLayout {
root.weight-index = root.selected.font-weight >= 700 ? 3
: root.selected.font-weight >= 600 ? 2
: root.selected.font-weight >= 500 ? 1 : 0;
- // One bundled face; a title from an older document that named a
- // retired one is painted in it too, so it is that row as well.
- root.family-index = 0;
+ // Where the family sits in the list Rust offers; a family nobody
+ // has is painted in the bundled face and shows as that row.
+ root.family-index = root.selected.family-row;
}
init => { root.seed(); }
@@ -242,6 +244,13 @@ export component TextPanel inherits VerticalLayout {
root.commit();
}
}
+ // A font of your own, from a file: it joins the list for good
+ // and the title is set in it.
+ IconButton {
+ glyph: Glyph.import;
+ label: I18n.t("textPanel.importFont");
+ clicked => { root.import-font(); }
+ }
}
Row {
diff --git a/src/crates/concat/ui/phone/editor.slint b/src/crates/concat/ui/phone/editor.slint
index 613392fa..1ed342c9 100644
--- a/src/crates/concat/ui/phone/editor.slint
+++ b/src/crates/concat/ui/phone/editor.slint
@@ -1094,10 +1094,12 @@ export component PhoneEditor inherits Rectangle {
if root.sheet == "clip-text": TextPanel {
selected: Editor.selected-clip;
+ families: Editor.font-families;
set(field, value) => { Editor.clip-set(field, value); }
set-text(field, value) => { Editor.clip-set-text(field, value); }
set-colour(field, value) => { Editor.clip-set-colour(field, value); }
commit => { Editor.clip-commit(); }
+ import-font => { Editor.import-font(); }
}
if root.sheet == "clip-layer": FilterPanel {
diff --git a/src/crates/concat/ui/timeline/model.slint b/src/crates/concat/ui/timeline/model.slint
index e388cf95..cc97cacf 100644
--- a/src/crates/concat/ui/timeline/model.slint
+++ b/src/crates/concat/ui/timeline/model.slint
@@ -327,6 +327,10 @@ export struct SelectedClipData {
// the overlay, when this is a text clip
content: string,
font-family: string,
+ /// The row of `Editor.font-families` the family is on, for the picker;
+ /// 0 - the bundled face - for a family nobody has, which is painted in
+ /// it.
+ family-row: int,
/// share of frame height, not points: the frame can be any resolution
font-size: float,
font-weight: float,
diff --git a/src/crates/concat/ui/workspace/config-pane.slint b/src/crates/concat/ui/workspace/config-pane.slint
index ae50fcbb..fc23b7a6 100644
--- a/src/crates/concat/ui/workspace/config-pane.slint
+++ b/src/crates/concat/ui/workspace/config-pane.slint
@@ -183,6 +183,9 @@ export component ConfigPane inherits Rectangle {
callback clip-set-text(field: ClipTextField, value: string);
callback clip-set-colour(field: ClipTextField, value: color);
callback clip-commit();
+ /// The Text tab's font picker and its import button; see Editor.
+ in property <[string]> font-families;
+ callback import-font();
/// The cutout's brush and controls; see Editor.
in property <int> brush-tool;
@@ -582,10 +585,12 @@ export component ConfigPane inherits Rectangle {
if root.showing == "Text": TextPanel {
selected: root.selected;
+ families: root.font-families;
set(field, value) => { root.clip-set(field, value); }
set-text(field, value) => { root.clip-set-text(field, value); }
set-colour(field, value) => { root.clip-set-colour(field, value); }
commit => { root.clip-commit(); }
+ import-font => { root.import-font(); }
}
// Audio: the level and fades, then the voice and room chain
diff --git a/src/crates/concat/ui/workspace/seat.slint b/src/crates/concat/ui/workspace/seat.slint
index 828297f8..14422648 100644
--- a/src/crates/concat/ui/workspace/seat.slint
+++ b/src/crates/concat/ui/workspace/seat.slint
@@ -268,6 +268,8 @@ export component Seat inherits Rectangle {
clip-set-text(field, value) => { Editor.clip-set-text(field, value); }
clip-set-colour(field, value) => { Editor.clip-set-colour(field, value); }
clip-commit => { Editor.clip-commit(); }
+ font-families: Editor.font-families;
+ import-font => { Editor.import-font(); }
}
// Declared before the views, so anything inside one of them that takes