Repository navigation
Ribbon: the Font list offers the installed fonts, theme fonts first (builds on #961, #974) - #1179
Open
richard1912 wants to merge 10 commits into
Open
richard1912 wants to merge 10 commits into
richard1912 wants to merge 10 commits into
Conversation
The size box is one frame with the Font name box's fill, border, height and corners, with the text field and the dropdown arrow inside it (focus shows the selection stroke). The size list drops directly below the box and is as wide as it, instead of opening 220 pt wide under the arrow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ut3hr3a13szpQdQ7gbYbfc
…torytold#933) The font name had the Enter bug Font Size had in storytold#932: Enter applied the highlighted row of the substring-filtered list, so Aptos gave Aptos Narrow, and a name outside the list was dropped. The font name is now the same box as Font Size, sharing its code: Enter applies the first list font the typed name begins (case-insensitive, so arial and Ari give Arial), otherwise the name as typed; Escape or clicking away reverts; the arrow opens the fonts. The keytip tests that used the font dropdown to exercise the filter combo now use the number format dropdown.
The desktop and web apps call setup_context_for_language directly, not setup_context, so fonts::start_scan never ran: the font catalog stayed empty, the Format Cells font list showed only the standard names and cells formatted with an installed font couldn't render in it. Start the scan there too (once; later calls and wasm are no-ops). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wasm) Contributed by @scottcampbelldata in #1. Co-authored-by: scottcampbelldata <251750033+scottcampbelldata@users.noreply.github.com>
The Font box listed only the 22 standard names. It now shows the workbook theme's heading and body fonts, then every font (standard and installed, from fonts::families) A to Z, as in Excel. Typed names autocomplete from the same list: an exact name first, then the first font it begins. The list is built once after the background scan and borrowed afterwards, and drops wider than the box (280 pt) so long family names stay on one line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Font list repeats the theme fonts at the top, so the highlight now starts on the last row with the current value: Down from Calibri moves to Cambria, as font_name_box::the_arrow_opens_the_list_of_fonts expects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… on rebind
Once the installed-font scan runs, set_bound updates a process-wide registry as
soon as new definitions are built, but egui applies them only at the next pass,
and every context (each test harness) has its own fonts. cell_family could then
name a family egui doesn't have, which panics in epaint ("FontFamily ... is not
bound to any fonts"); parallel UI tests on Windows hit this in header_autofit.
cell_family takes the context and, for an installed family, also checks that
context's font definitions (after its first pass). With that, the frame in which
a rebound font set is pending can paint, so the rebind no longer skips a frame:
a skipped frame dropped that frame's input, which made page_layout_view's ruler
drags miss now and then.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # contributors/people.toml
|
A small improvement suggestion, from reading the code and not measured: let listing = arrow.clicked() || egui::Popup::is_id_open(ui.ctx(), arrow.id.with("popup"));
let mut items: Vec<(&str, String)> = Vec::new();
if listing {
// theme fonts, then `fonts`
}I have not checked whether the per-frame clones are noticeable, so this is a suggestion rather than a reported slowdown. |
Closed
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #961 (and #952 under it) and #974, for the rest of #933: the Font list offers the installed fonts. Marco suggested this go up as its own PR rather than into his branch (marcoarnulfo#2). Until those PRs land, the diff here includes their commits; the new work is the last three commits.
What changes
crates/ui-egui/src/ribbon.rs): the workbook theme's heading and body fonts first ("Calibri (Headings)", "Calibri (Body)"), then every font, standard and installed (fonts::families()), A to Z, as in Excel.comicgives Comic Sans MS,wingdWingdings,Aptosstays Aptos); anything else is applied as typed, as before.the_arrow_opens_the_list_of_fonts).combo_popupusesrpositionfor this.cell_familyonly names families the context's own fonts have, and a font rebind no longer skips a frame (a skipped frame dropped that frame's input). Without it, starting the scan madeheader_autofitandpage_layout_viewflaky on Windows; details in the Fonts: start the installed-font scan in the app (installed fonts were never listed or rendered) #974 comment.Validation (Windows 11, 150%)
Arial,Ari,Aptos,comic,Segoe UI S,wingd+ Enter give Arial, Arial, Aptos, Comic Sans MS, Segoe UI Symbol, Wingdings;Zzz Fakeis applied as typed; Esc reverts.cargo fmt,cargo clippy --workspace --all-targets -- -D warningsandcargo xtask wasmpass.header_autofit0/10,page_layout_view0/12 andkeytips0/3 failures on repeated runs (on Ribbon: the Font name box applies a typed name on Enter #961's headkeytipsfailed 4/4 here).Not included: drawing each name in its own face in the list (optional in #933).
Refs #933
Summary by CodeRabbit
New Features
Bug Fixes