Add bundled bus fonts and shared font favorites

This commit is contained in:
2026-10-12 15:00:40 +08:00
parent c9dd03c23b
commit 4be74a34f9
181 changed files with 2078575 additions and 76 deletions
+4 -4
View File
@@ -89,8 +89,8 @@ def test_font_catalog_import_duplicate_restart_and_render(tmp_path: Path) -> Non
assert str(tmp_path) not in created.text
stored = list((tmp_path / "data" / "fonts").glob("*.font"))
assert len(stored) == 1
assert stored[0].stem in imported["id"]
assert len(stored) == 3 # imported test face plus two bundled bus fonts
assert any(path.stem in imported["id"] for path in stored)
duplicate = client.post(
"/api/fonts/import?filename=renamed.otf",
@@ -99,7 +99,7 @@ def test_font_catalog_import_duplicate_restart_and_render(tmp_path: Path) -> Non
)
assert duplicate.status_code == 200
assert duplicate.json() == {"created": False, "fonts": [imported]}
assert len(list((tmp_path / "data" / "fonts").glob("*.font"))) == 1
assert len(list((tmp_path / "data" / "fonts").glob("*.font"))) == 3
preview = client.post("/api/preview/text-layer", json={
"text": "AB",
@@ -163,7 +163,7 @@ def test_font_import_rejects_type_content_and_size_without_residue(tmp_path: Pat
)
assert oversized.status_code == 413
assert not list(root.glob(".upload-*.tmp"))
assert not list(root.glob("*.font"))
assert len(list(root.glob("*.font"))) == 2 # bundled bus fonts are preserved
def test_invalid_persisted_font_is_preserved_and_reported(tmp_path: Path) -> None: