Sketch text: live Edit Text from the Text tool, a font list, handles, and whole-text picking (#821)

Live Edit Text from the Text tool, a font list, handles, and picking the whole text.
This commit is contained in:
phanoob authored and GitHub committed 2026-10-13 16:29:37 -04:00
1 parent 69050c81d9
commit ec5d7f9789
17 files changed
+1248 -80

No files matched your search

+17
View File
@@ -307,3 +307,20 @@ fn a_font_is_kept_in_the_design_and_old_designs_read_without_one() {
assert!(json.contains(r#""font":"C:/fonts/Some Font.ttf""#), "{json}");
assert_eq!(serde_json::from_str::<LinkSource>(&json).unwrap(), source(Some("C:/fonts/Some Font.ttf")));
}
#[test]
fn installed_families_are_listed_by_name_once_without_the_built_in_one() {
let folder = Folder::new("families");
// A second copy of the tiny font, the built-in font and the repository's second font: each family once,
// sorted; the built-in family is not among the installed ones, broken files and other files are skipped.
std::fs::write(folder.0.join("copy.ttf"), tiny_font()).unwrap();
std::fs::copy(PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("fonts").join("LiberationSans-Regular.ttf"), folder.0.join("lib.ttf")).unwrap();
std::fs::copy(web_fonts().join("BIZUDPGothic-Regular.ttf"), folder.0.join("biz.ttf")).unwrap();
let families = crate::families_in(std::slice::from_ref(&folder.0));
assert_eq!(families, ["BIZ UDPGothic", "Tiny Block"]);
// Each name finds its font again.
for family in &families {
assert!(find_family_in(std::slice::from_ref(&folder.0), family).unwrap().is_some(), "{family}");
}
assert!(crate::families_in(&[folder.0.join("missing")]).is_empty());
}