Repository navigation
Conversation
33a1bbc to
0d29cb3
Compare
leifrossau
left a comment
There was a problem hiding this comment.
Thanks, this is a nice step up, and keeping the matching, recents and script logic in egui-free modules with tests makes it easy to follow.
A few things I found, roughly in order of importance (details inline):
- Add Font can empty an installed font: picking a file that is already in the fonts folder copies it onto itself (
fs::copytruncates; I checked it). - Clicking away applies the half-typed filter as the font family.
- Scrolling the family list reads font files and calls
set_fontson the UI thread as rows come into view. - Rows grow when their font loads, and the sections are rebuilt and cloned every frame.
- Smaller ones: the floating toolbar doesn't update recents, a catalog-read race, a leaked catalog per rescan, Windows registration, and the usage sink with telemetry off.
I read the diff and the code around it, but haven't built or run this branch.
🤖 Generated with Claude Code
| pub fn user_fonts_dir() -> Option<PathBuf> { | ||
| #[cfg(target_os = "windows")] | ||
| { | ||
| std::env::var_os("LOCALAPPDATA").map(|local| PathBuf::from(local).join("Microsoft").join("Windows").join("Fonts")) |
There was a problem hiding this comment.
On Windows a per-user font is only installed once it's also registered under HKCU\Software\Microsoft\Windows NT\CurrentVersion\Fonts (and loaded with AddFontResourceEx / announced with WM_FONTCHANGE). Copying the file makes it show in NoteCraft, which scans this folder itself, but Windows and other apps won't see it. A page that uses it then renders with a fallback in WordCraft or a browser.
There was a problem hiding this comment.
Acknowledged, not implemented yet. The limitation is recorded in docs/gaps.md (commit 02f6780): a font copied into the user's folder shows in NoteCraft but not in Windows or other applications until it is registered. Registration needs your decision; this thread stays open for it.
alientechsw
left a comment
There was a problem hiding this comment.
Don't merge yet please
Typing in the family box lists the families that contain the text, Up and Down move the highlight, and Enter applies it. The size box is unchanged. One new UI test is ignored until its focus problem is found. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The filter test clicked the Font Family arrow, which opens the list and never focuses the text box, so typed text went nowhere. It now clicks the Font name box. The test runs again and passes. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
A font family box lists the families used lately above All Fonts, and the ribbon and the floating bar share the list. The matching, recents and size check live in a font_picker module with no egui in it, so it can move to a shared library later. Ported from WordCraft's ranking. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
A family box shows an amber mark, with a tooltip, when the family on the page is not among the installed fonts. The warning waits until the installed list is known, so it does not flash while fonts load. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The family list shows every name in that font, as a sample, once the font is loaded. Fonts load as their rows come into view, and a row falls back to the interface font until then. The list keeps NoteCraft's drop-down position and look. The size list is unchanged. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The family list has a heading for each script a font covers, so the list scrolls from language to language. Fonts covering none of the listed scripts go under Other. The catalogue reads each font's characters once. Fixes a press on a typed match: the list stayed on the matches until the release, so the click lands on the row that was pressed. The font tests now choose a font by typing its name, as a user does. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Clippy's needless_borrow check failed the CI gate on the font test that clicks the family name. Passing the name as &str fixes it. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Add Font… opens a multi-select file picker, copies the font files into the user's fonts folder, and reads the installed fonts again. Script headings are bold on a band, and typing a script name lists that script's fonts first. Usage events (font chosen, list opened, font added or skipped, missing font, catalogue read) go to the telemetry session and the local log, through a sink the app installs; nothing is uploaded. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The family list shows each font name left-aligned and indented under its script heading, on the picker colours. The size list is unchanged. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The WASM and Android builds have no installed-font catalogue and no file dialog, so the add-font and script-section code failed to compile there. Those calls are now compiled only on Windows, macOS and Linux; the other platforms get stubs that do nothing. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Add Font no longer empties a font already in the folder, and refuses to overwrite a different font with the same name. A click away applies only an exact family name, not half-typed text. Floating toolbar and ribbon share the recent list. The usage log always records events, and telemetry only when a session exists. Family rows have a fixed height. Script sections are built once per catalogue read. Font files are read on background threads and added in one batch per frame. The catalogue publishes only newer reads and is shared, not leaked. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The missing-font test waits for the notice, which now appears after a background lookup. docs/gaps.md records that Add Font does not register fonts with Windows yet. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Background font loading can still request a frame, so the test waits for the frames to settle rather than running one step. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
0d29cb3 to
77dd914
Compare
The non-desktop build no longer uses BTreeMap, so the Android clippy check failed on the unused import. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Summary
font_pickermodule and anfont_installmodule, with no egui in them, so they can move to a shared library later.Known gaps
Test plan
cargo xtask cipasses locally (all checks, full UI suite).🤖 Generated with Claude Code