Trevor PaughSystems engineer
Trevor PaughProject Chronicles

Chronicles / Eboda Gymnast

Editing text in place

Milestone

The second of the three verbs is done. Click a run of text, retype it, pick a replacement font if the document's is not installed, undo and redo, and save. A save writes a temporary file beside the original, reopens and re-renders it to check, then swaps it in; it refuses if another program changed the file meanwhile. The writer is the builder's own, so every byte outside the edited text stays as it was. Two review rounds found a validation check that only counted objects and a close shortcut that skipped the unsaved-changes guard.

Reading landed on day one. Editing, the part no free library does, landed on day two.

What it does

In Edit mode, click a run of text and type. If the document’s font is not on the machine, the picker from the previous slice proposes the exact or closest font and the edit waits until one is chosen. Undo and redo cover every change. Save is a separate, explicit act, under the owner’s rule that no PDF is ever written without one.

The writer

The decision that shaped the slice: rather than go through the rendering engine’s text-object interface, the builder wrote its own writer, which appends an incremental update to the file and touches only the operator that holds the edited text. A parsing library reads the structure; the writer changes as little as possible. Every byte outside the edit stays as it was, which is what keeps a document valid for every other viewer.

The save

A save goes to a temporary file in the same folder, which is reopened and re-rendered to prove it is still a good document, and only then replaces the original in one step. If another program has changed the file since it was opened, the app refuses to save over it.

Review

Two rounds. The reviewer found that the check meant to confirm an edit came out as typed only compared object counts, and that the window’s close shortcut bypassed the unsaved-changes guard. Both fixed before merge.

Next: signing.