Repository navigation
Fonts: add custom font from files via UI file picker, drag-and-drop, and font.add path support - #829
GhostMitra wants to merge 1 commit into
Conversation
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: custom fonts can be added from files through a file picker, drag and drop, and font.add path support, with ttf, otf, ttc, woff and woff2 accepted, and the author is added to contributors/people.toml. Installing a user-provided font into a document is a licence matter: the font's embedding permission (the fsType flags in the OS/2 table) must be honoured when the font is embedded into a saved file or exported PDF, and restricted fonts must not be embedded. Font parsing is untrusted input, with woff2 decompression a known source of memory-safety bugs, so decompressed sizes must be bounded; a font file picked by the user is copied into the document or into a user folder, which should be stated. I did not read the loader. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
Summary
Allows users to load custom font files (
.ttf,.otf,.ttc,.woff,.woff2) directly into DeckCraft for the session via:.ttf,.otf,.ttc,.woff,.woff2).infer_commandand loaded viafont.add.rfd::FileDialogwith font filters.rfd::AsyncFileDialogand inbox file delivery.font.addenhancement:font.addnow accepts both base64dataand filepath(viacrate::io::read_file)."Added 1 font face from CustomFont.ttf").@GhostMitratocontributors/people.toml.Validation
cargo fmt --checkpassed.cargo clippy --workspace --all-targets -- -D warningspassed (0 warnings).cargo test -p deckcraft-engine --lib font_addpassed.cargo test -p deckcraft-ui-egui --lib fontpassed (all 16 tests passed).cargo xtask assetspassed (47 asset files attributed).cargo xtask layerspassed (28 crates, 0 violations).cargo xtask wasmpassed (all 23 crates passed).