Skip to content

Bold, italic, underline and strikethrough on the page - #23

Merged
anderix merged 3 commits into
mainfrom
formatting
Sep 28, 2026
Merged

anderix merged 3 commits into
mainfrom
formatting

Conversation

@anderix

@anderix anderix commented Sep 27, 2026

Copy link
Copy Markdown
Member

Text in a document or a slide's label can be made bold, italic, underlined or struck through: Ctrl+B, Ctrl+I and Ctrl+U, or the row of buttons over the page in edit mode. A selection takes the mark, or loses it where all of it has it, as one undo step. With only a caret, the mark goes to what is typed next there, in the same step as the typing. A spreadsheet cell is not formatted.

The library does the tree work in edit::format. It restyles a span the range holds whole and wraps any other run in a new span, so no span or link the document had is taken apart. It writes a property only where that changes what is drawn, and minting reuses automatic styles that say the same thing. tests/format.rs formats a range of every corpus paragraph, holds everything outside it equal, and checks that on then off gives the paragraph back.

Docs and listings now say this: DESIGN.md §11, the README, the manual page, the Debian description, both store listings and the release notes for Odox Text and Odox Deck. The App Review note in store-listing.toml changed and has to be retyped into App Store Connect at submission.

Verified on X11 in xodt and xodp, including a save reopened by the save guard. Workspace tests and clippy with -D warnings pass.

David M. Anderson added 3 commits September 27, 2026 18:20
…trike

edit::format cuts the range's ends into the nodes they fall inside, restyles
a span the range holds whole and wraps any other run in a new span inside
whatever holds it, so no span or link the document had is taken apart. A
property is written only where it changes what is drawn, a span left saying
nothing gives way to its contents, and taking a mark off text it was put on
gives back the paragraph it was. edit::marked answers whether a range, or the
text typed at a caret, carries a mark.

A span's style is an automatic style in content.xml, reused where one says the
same and otherwise named T and the first free number. Styles::add registers
it and never forgets a name, so an undo cannot free one for a different style.
Element::name_for and Element::declares move down from Document so the
format can spell what it writes the document's way, and a document that does
not declare the namespace is refused with Refused::Namespace.

tests/format.rs formats a range of every corpus paragraph, holds everything
outside it equal, and checks that on then off gives the paragraph back.
egui_richedit gains Mark, Edit::Format and Model::marked, which defaults to
nothing marked for a model that keeps no formatting. RichEdit::toggle gives
the selection a mark, or takes it off where all of it has it, as one undo
step and keeping the selection. With a caret and nothing selected the mark
waits for what is typed next at that caret, and goes with the typing's step.

FlowModel takes the document's Styles and formats paragraph by paragraph,
moving its root along when the library writes an automatic-styles container
before the body. odox_ui::toolbar draws the four buttons over the page in
xodt and xodp in edit mode, lit where the whole selection has the mark.
German says Fett, Kursiv, Unterstrichen and Durchgestrichen.
…ruck

DESIGN.md §11 states what a person can do and what a mark does to the tree.
The README, the manual page, the Debian description, both store listings and
the release notes for Odox Text and Odox Deck say so; Odox Grid's copy is
unchanged, since a cell is not formatted. The App Review note in the listing
says how to try it.
@anderix
anderix merged commit ad6dd36 into main Sep 28, 2026
6 checks passed
@anderix
anderix deleted the formatting branch September 28, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant