Skip to content

Edit Arabic text and keep it readable after saving - #87

Merged
mberman84 merged 1 commit into
mainfrom
codex/edit-arabic-text
Nov 11, 2026
Merged

mberman84 merged 1 commit into
mainfrom
codex/edit-arabic-text

Conversation

@mberman84

Copy link
Copy Markdown
Collaborator

Problem

In Edit mode, a reader could select an existing Arabic heading but could not change it. Some PDFs paint each glyph separately and use a single glyph for several letters. Reading those objects in painting order scrambles the text.

Change

Edit mode reads Arabic runs in logical order, including the PDF’s tagged text for ligatures. The inline editor uses the line’s right edge. Saved edits use a subset of an offline DejaVu font with contextual shaping and positioned diacritics. The replacement remains searchable, selectable, and editable after reopening the PDF. Other right-to-left scripts keep their existing protection.

Issue or approval

Closes #49.

How I checked it

On macOS I edited the heading in the reporter’s PDF, saved a copy, reopened it, and verified the new Arabic text. The cross-platform smoke test uses a synthetic PDF. It inserts a marked Arabic greeting with digits, deletes a word from a second line, checks the saved PDF’s extracted text, and edits the saved copy again.

TypeScript, the production build, 259 unit tests, the text-direction tests, and the hidden desktop smoke suite passed locally. The PR workflow runs on Windows, macOS, and Linux.

Before, selecting an Arabic heading shows a read-only message

After, the Arabic heading can be edited with joined letters, diacritics and numbers

Implemented and tested by GPT-6 in OpenAI Codex.

@mberman84
mberman84 merged commit c35f489 into main Nov 11, 2026
3 checks passed
@mberman84
mberman84 deleted the codex/edit-arabic-text branch November 11, 2026 05:08
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.

Arabic text editing is broken

1 participant