Repository navigation
Conversation
Fonts without a usable character map extract as control codes, so the edit box held invisible characters that could not be saved. These lines now start with an empty box, are redrawn in the bundled font and stay centered where the original was. Fixes Forward-Future#120 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
stozo04
marked this pull request as ready for review
November 30, 2026 19:14
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.
Problem
In PDFs whose fonts have no usable Unicode map, Edit mode fills the box with invisible control codes that cover the original. Typing then fails with "Enter a single line of text.", and replacing the whole box fails with "This font can't display all of those characters." Steps and cause are in #120.
Change
For lines whose text contains control characters (tabs excluded):
FolioCenteredLinemark records this, so other redrawn lines keep their current placement.Two related changes:
Issue or approval
Fixes #120. No maintainer has replied yet. The replacement font and centered placement are open questions there; I'm happy to change either.
Centering suits short values such as amounts, but it moves the left edge of left-aligned lines when their length changes.
How I checked it
macOS only. Windows and Linux are untested apart from whatever CI reports.
npx tsc --noEmitandnpm run buildpass.npm test: 264 tests pass.npm run smokepassed twice on the final code. The new check uses a synthetic Type 3 PDF with noToUnicodetable. It covers blank input, centering, repeat edits, save and reopen, a small nominal font size, tilted text and a word split by a hyphen. An earlier version of the check, run on unchangedmain, failed because the edit box held control codes.checkLinkHistory, scroll position after Back) failed intermittently during development: about 3 of 21 smoke runs with versions of this change, and 0 of 7 onmain. Six alternating runs each, before the last review fixes, all passed. I don't know the cause, and I haven't shown that it happens without this change.Screenshots use a synthetic PDF.
Before:

While:

After:

Written by Claude Sonnet 5.5 in Claude Code.
🤖 Generated with Claude Code