100 Commits
Author SHA1 Message Date
Eric Kaden 96cf936b31 M12: XFA check boxes sit where their margins, caption and alignment put them (#4300)
* M12: XFA check boxes sit where their margins, caption and alignment put them

* M12: a check box's automatic caption room and auto height follow the box as drawn

* M12: a caption reserve of zero sizes the caption to its content, as no reserve does
2026-10-24 10:30:11 -04:00
Eric Kaden 2fc251193e M12: a test that a section whose first child moves to the next page takes its border along 2026-10-23 23:16:10 -04:00
Eric Kaden 63510e29eb test(ui): docstrings for the recovery tests' folder helper 2026-10-23 23:12:33 -04:00
Eric Kaden 4d190aaff8 M12: the parity note and test say which sections lose their border 2026-10-23 22:52:53 -04:00
Eric Kaden cafd507f29 M12: page breaks of a section's own keep the border around it, a leader is given room with its row, and what runs off a page costs its section the border 2026-10-23 22:51:54 -04:00
Eric Kaden 35716c6282 M12: a flowed table a page break cuts between its rows keeps its border on each page 2026-10-23 22:29:04 -04:00
Eric Kaden 3cf6b0e589 M12: docstrings for the layout helpers and test the flowed-border change touches 2026-10-23 22:21:38 -04:00
Eric Kaden cc6b042f0d M12: a flowed subform's repeated top margins give way to a child that fits a fresh content area only without them 2026-10-23 22:15:07 -04:00
Eric Kaden a7d86dea76 M12: a flowed subform's last part keeps its bottom margin inside the content area 2026-10-23 22:05:46 -04:00
Eric Kaden 6d7e887efe M6: a paste into a full field keeps the longest part that fits, across a change of font 2026-10-23 22:04:52 -04:00
Eric Kaden d7da5dfe29 M12: a flowed XFA subform a page break cuts gets a closed border on each page, its margins repeated 2026-10-23 21:54:55 -04:00
Eric Kaden f5e74991ed M12: flowed XFA subforms are drawn with their border and fill 2026-10-23 19:30:43 -04:00
Eric Kaden 64bdea4e61 M6: fields that don't scroll stop taking text when full 2026-10-23 19:25:32 -04:00
Eric Kaden 352ebb1477 M12: a backslash ends a web link's host, as web addresses read it 2026-10-23 17:28:22 -04:00
Eric Kaden 3355edad42 M12: only a link's own underline joins its pieces, and web links need a host 2026-10-23 17:19:25 -04:00
Eric Kaden 3cf6e5f716 M12: a link's pieces don't join across a rule, picture or field between them 2026-10-23 17:05:18 -04:00
Eric Kaden ac181479ef M12: a round check button's underline border stays an underline 2026-10-23 17:03:53 -04:00
Eric Kaden ba37d412e8 test(ui): recovery idle tests make folders that never share a name 2026-10-23 17:02:14 -04:00
Eric Kaden d91028a990 M12: a link's address is shared by its runs, words and spans, not copied 2026-10-23 16:47:19 -04:00
Eric Kaden 21f3241e6d M12: a round border as wide as its check button fills it as a disc 2026-10-23 16:45:40 -04:00
Eric Kaden 0008a18345 M12: XFA borders and rectangles with rounded corners are drawn rounded 2026-10-23 16:41:22 -04:00
Eric Kaden 1c4a481ea3 M12: round XFA check buttons draw a round background and border 2026-10-23 16:19:43 -04:00
Eric Kaden 0b8758eda3 M12: links in XFA rich text become clickable links 2026-10-23 16:16:40 -04:00
Eric Kaden 441d9005e3 M12: XFA text is measured at its standard-14 font's own widths 2026-10-23 14:08:42 -04:00
Eric Kaden 44b7e0a40f Merge remote-tracking branch 'upstream/main' into fix/exec-menu-attachments
# Conflicts:
#	crates/js/src/lib.rs
#	crates/js/src/tests.rs
#	parity/acrobat-features.toml
2026-10-23 10:43:34 -04:00
Eric Kaden c141c94c06 Merge remote-tracking branch 'upstream/main' into fix/util-scand
# Conflicts:
#	crates/js/src/lib.rs
#	crates/js/src/tests.rs
#	parity/acrobat-features.toml
2026-10-23 10:27:32 -04:00
Eric Kaden 8f292c66ae M6: scripts see xfa_version, and xfa_installed in XFA forms (#4142) 2026-10-23 10:19:09 -04:00
Eric Kaden 1b247a4812 M9: sign_list lists a hidden or NoView signature field as not visible (#4141) 2026-10-23 10:19:04 -04:00
Eric Kaden 8f82bfccec Merge remote-tracking branch 'upstream/main' into fix/exec-menu-attachments
# Conflicts:
#	crates/engine/src/tests.rs
2026-10-22 23:09:22 -04:00
Eric Kaden cf2f4ec766 Merge remote-tracking branch 'upstream/main' into fix/xfa-edit-picture-alternatives
# Conflicts:
#	crates/engine/src/tests.rs
2026-10-22 22:55:12 -04:00
Eric Kaden dd6d7feadb M12: a date is tried in the field's first pattern again only when its format refused it 2026-10-22 22:18:11 -04:00
Eric Kaden 91df3c01a8 Merge remote-tracking branch 'upstream/main' into fix/xfa-edit-picture-alternatives
# Conflicts:
#	crates/xfa/src/tests.rs
2026-10-22 21:54:56 -04:00
Eric Kaden 04bc36a610 M4: a question the user saw stays seen when an earlier save finishes behind it 2026-10-22 19:16:00 -04:00
Eric Kaden 95feaad269 M4: each document's save question asks for attention on its own
Quitting with several unsaved documents moves from one question to the next
without the prompt closing, so a question that opened in the background after
one the user saw asked for nothing (review feedback on #4155).
close_and_continue now marks the next document's question as new. A request
that still stands carries over to it instead of being sent again.
2026-10-22 19:04:12 -04:00
Eric Kaden 00a7d5b887 M4: a save prompt that opens in the background asks for the user's attention
Quitting from the Dock menu (or logging out, or an agent's ui.quit) while
another app is in front opens "Save changes?" in a window the user can't see,
so it looked as if PdfCraft hadn't quit. The prompt now sends a critical
user-attention request on the frame it opens while the window isn't focused:
the Dock icon bounces until PdfCraft is active, the Windows taskbar button
flashes until the window is in front, and X11 sets the urgency hint. Coming
back, or answering, sends Reset. This is what AppKit does by itself when an
inactive app presents a modal panel; PdfCraft's prompt is drawn by egui, so
AppKit never sees it.
2026-10-22 18:49:26 -04:00
Eric Kaden 6c0fd0f353 Merge remote-tracking branch 'upstream/main' into fix/util-scand
# Conflicts:
#	crates/js/src/lib.rs
2026-10-22 13:23:32 -04:00
Eric Kaden 9206174761 Merge remote-tracking branch 'upstream/main' into fix/xfa-layout-drops-usage-rights
# Conflicts:
#	parity/acrobat-features.toml
2026-10-22 11:31:44 -04:00
Eric Kaden e646bb8684 Merge remote-tracking branch 'upstream/main' into fix/exec-menu-attachments
# Conflicts:
#	parity/acrobat-features.toml
2026-10-22 11:31:44 -04:00
Eric Kaden a29dd8b94e Merge remote-tracking branch 'upstream/main' into fix/util-scand
# Conflicts:
#	parity/acrobat-features.toml
2026-10-22 11:31:44 -04:00
Eric Kaden 7a9c3b28c7 Merge remote-tracking branch 'upstream/main' into fix/util-scand 2026-10-22 11:04:00 -04:00
Eric Kaden ae69aea627 M6: doc comments on every Panel variant 2026-10-22 09:22:27 -04:00
Eric Kaden c9fa6a7627 M12: a date pattern whose date the first can't keep gives way to a later one 2026-10-22 09:01:48 -04:00
Eric Kaden 9dab857ca3 M12: only date clauses are other ways to type a date, and a date is rewritten only into a first pattern that keeps it 2026-10-22 08:48:21 -04:00
Eric Kaden 4665685446 Merge remote-tracking branch 'upstream/main' into fix/exec-menu-attachments
# Conflicts:
#	crates/engine/src/tests.rs
#	crates/js/src/tests.rs
#	crates/ui-egui/tests/forms.rs
2026-10-22 03:19:20 -04:00
Eric Kaden 4d22d2b74a M12: doc comments on the picture-alternatives tests 2026-10-22 03:17:40 -04:00
Eric Kaden b00ab835a6 Merge remote-tracking branch 'upstream/main' into fix/xfa-edit-picture-alternatives
# Conflicts:
#	crates/engine/src/tests.rs
#	crates/xfa/src/tests.rs
2026-10-22 03:17:29 -04:00
Eric Kaden 82115ed65c Merge remote-tracking branch 'upstream/main' into fix/util-scand
# Conflicts:
#	crates/js/src/tests.rs
2026-10-22 03:15:57 -04:00
Eric Kaden de6dba001b Merge remote-tracking branch 'upstream/main' into fix/xfa-layout-drops-usage-rights
# Conflicts:
#	parity/acrobat-features.toml
2026-10-22 03:15:22 -04:00
Eric Kaden 4ee87801b2 M6: util.scand's linear-time test allows a loaded runner (10 s) 2026-10-21 19:48:31 -04:00
Eric Kaden 628c827572 Merge remote-tracking branch 'upstream/main' into fix/util-scand
# Conflicts:
#	crates/js/src/formcalc.rs
2026-10-21 19:42:26 -04:00
Eric Kaden 526d87d85c M6: formattedValue formats only a value of the ISO date's own shape
2026-1-2 isn't an ISO date and stands as it is. A test also pins that
parentheses hold a picture's locale (date(en_US){YYYYMMDD} formats) and
that a clause without braces has no pattern.
2026-10-21 00:09:00 -04:00
Eric Kaden 21b6267129 M6: a display picture with month or weekday names leaves formattedValue raw
date{DD MMM YYYY} and date{EEE …} have parts formatted_value can't show
yet, so it gives the raw value instead of text like 20 mmm 2026.
2026-10-20 23:57:14 -04:00
Eric Kaden 6a8ea287aa M6: doc comments on the functions the formattedValue change touches 2026-10-20 23:37:21 -04:00
Eric Kaden c0a513eed8 M12: scripts read a date in its data picture as the ISO date
A date the field's data picture writes as 20261018 reaches scripts as
2026-10-18, the rawValue another viewer gives them, so a script that
checks String(rawValue).length == 10 works (DA Form 31's 10b TO).
Doc comments on the functions this branch touches.
2026-10-20 23:33:23 -04:00
Eric Kaden 7176ebde94 M6: XFA formattedValue shows a date in the field's display picture
Fields keep their <format><picture>. A date display picture turns the
ISO value into its pattern for scripts' formattedValue (JavaScript and
FormCalc), so date arithmetic on formattedValue works as forms expect.
Once a script sets the value, formattedValue gives that value. Number
and text display pictures still give the raw value.
2026-10-20 23:29:08 -04:00
Eric Kaden 572e01a71d M12: the wrapping test checks the text stays within its room 2026-10-20 09:39:32 -04:00
Eric Kaden b6cd6b44ca M6: doc comments for the functions around this change 2026-10-20 09:26:34 -04:00
Eric Kaden f9daeeb1fa M12: doc comments for the functions around this change 2026-10-20 09:25:19 -04:00
Eric Kaden 15eef03efc M12: doc comments for the functions around this change 2026-10-20 09:24:47 -04:00
Eric Kaden ad453129f0 M5: doc comments for the functions around this change 2026-10-20 09:23:23 -04:00
Eric Kaden ee91673162 M12: doc comments for the functions around this change 2026-10-20 09:21:31 -04:00
Eric Kaden ec14687c6d M12: a draw without text or a width keeps the width it has room for 2026-10-20 09:20:55 -04:00
Eric Kaden 56b316a7f4 Forms: a radio group's read-only button can't be chosen by a click 2026-10-20 00:35:54 -04:00
Eric Kaden 0a77db066c Forms: a radio group's read-only button is left unhighlighted on its own 2026-10-20 00:20:02 -04:00
Eric Kaden a3b942021f M12: doc comments, and words keeps its own 2026-10-19 23:46:56 -04:00
Eric Kaden 5cd7e816b9 M12: doc comments for the functions this change touches 2026-10-19 23:46:16 -04:00
Eric Kaden 24b55275a5 M12: doc comments for the functions this change touches 2026-10-19 23:46:14 -04:00
Eric Kaden a0ae8a3996 M6: doc comments for the functions this change touches 2026-10-19 23:43:02 -04:00
Eric Kaden 032febca2f M6: doc comments for the functions this change touches 2026-10-19 23:42:56 -04:00
Eric Kaden 77eb328c83 Forms: doc comments for the functions this change touches 2026-10-19 23:42:37 -04:00
Eric Kaden 15ab8c7a2c M12: doc comments for the functions this change touches 2026-10-19 23:42:22 -04:00
Eric Kaden 465bd0a717 M5: doc comments for the functions this change touches 2026-10-19 23:41:47 -04:00
Eric Kaden c90afe54cf M6: say why a form's Save opens Save As 2026-10-19 22:22:03 -04:00
Eric Kaden 0d0cce1bb0 Forms: Highlight fields marks only the fields that can be filled 2026-10-19 22:19:30 -04:00
Eric Kaden 9366af3bad M6: side panels have fixed automation ids, and the parity note says where Print works 2026-10-19 22:01:10 -04:00
Eric Kaden 35e04743d0 M12: showing an XFA subform leaves its unnamed hidden objects hidden 2026-10-19 21:27:47 -04:00
Eric Kaden 74326b455c M6: a field's own script may not open Save As 2026-10-19 21:02:37 -04:00
Eric Kaden e8eb840ec5 M6: form buttons show the side panels (execMenuItem ShowHide…) 2026-10-19 20:59:14 -04:00
Eric Kaden 0ca7fb9be9 M5: a button caption's characters its font's encoding can't hold are reported 2026-10-19 17:25:19 -04:00
Eric Kaden 3a5bcbdf97 M12: a date typed by another of an XFA field's edit patterns is kept in its first 2026-10-19 17:21:08 -04:00
Eric Kaden 24a45db045 M5: leave measuring form text in its own font to #2900 2026-10-19 16:59:50 -04:00
Eric Kaden bf88255c15 Merge remote-tracking branch 'upstream/main' into fix/xfa-date-bind-picture 2026-10-19 16:52:36 -04:00
Eric Kaden 86e44dc6d5 M6: util.scand reads dates as another viewer does 2026-10-19 16:36:47 -04:00
Eric Kaden 2556a3acb2 M6: the parity notes say button labels follow their /DA 2026-10-19 15:55:25 -04:00
Eric Kaden 37f43e947d M12: an XFA button's box is its whole field
A button was given its content area (inside its margins) as its widget
rectangle, though its border belongs to the field: DA Form 31's
Instructions button, with a 1.25 pt top margin, came out shorter than
the Attachments Menu button beside it. Its box is now the whole field;
the margins pad the caption.
2026-10-19 15:41:00 -04:00
Eric Kaden c0250b5956 M5: form text is measured in its own font, not always Helvetica
Appearance text in a simple font was measured with Helvetica's widths,
whatever the font: a bold or Times caption or value came out narrower
than drawn, so centered and right-aligned text slid right of where it
belongs. Text is now measured with the font's /Widths, or a standard
font's published widths.
2026-10-19 15:40:30 -04:00
Eric Kaden 6b4e396af3 M5: a push button's caption uses the font, size and color of its /DA
Button appearances always drew the caption in regular Helvetica, sized
from the button's height, whatever the field's /DA asked for: DA Form
31's 'Attachments Menu' (9 pt bold) came out at 4 pt. The caption now
takes the /DA's font from the form's /DR, its size (an automatic size
still fits the button) and its color, as text fields already do.
2026-10-19 15:34:27 -04:00
Eric Kaden da38e0da6f M12: an XFA button without a height is as tall as its caption
A button with no height was sized like a text field in its field font,
with text-field padding, so DA Form 31's Instructions button (10 pt
field font, 8 pt caption) came out about 17 pt tall and over the form
below it. It is now as tall as its caption, never below its minimum.
2026-10-19 15:26:37 -04:00
Eric Kaden 32bb14b952 M12: an XFA label or button without a width is as wide as its text
A draw or a button with no width took all the width available, so a
right-aligned label slid to the far side of its subform and a button
spread over what lay beside it: DA Form 31's Instructions button covered
its header and the email line, and its PERSONNEL/FINANCE line ran into
the field after it. They now grow to their text, unwrapped, within what
is available and never below their minimum width, as containers do.
2026-10-19 15:06:32 -04:00
Eric Kaden 6dc8ad933b M12: spaces alone stay on an XFA text line
A word of spaces alone draws nothing, but after a word whose own
trailing space ran past the box it failed the fit test and opened a
blank line, so the text measured a line taller than it draws. Such
words now always stay on the line, keeping their width.
2026-10-19 14:53:28 -04:00
Eric Kaden dd782bca1d M12: a non-interactive XFA field is measured at its text's horizontal scale
The layout draws a non-interactive field's text itself, condensed, but
measured its height at full width, so a condensed value reserved lines
it didn't use. Fields now measure and draw their text in one face:
scaled when the layout draws it, as designed when the forms layer does
(the over-page fallback included).
2026-10-19 14:42:37 -04:00
Eric Kaden b2f40e0442 M12: a space at the end of a line doesn't count when fitting XFA text
Words keep the space after them, and the line-fit test counted it, so a
label written with a trailing space wrapped when its box was a fraction
of a point narrower than the label plus that space: DA Form 31's 'a.
DATE ' and 'b. TIME ' put their second word on top of the field below.
A line now fits by what it draws, and alignment ignores every trailing
space, not just one.
2026-10-19 14:22:22 -04:00
Eric Kaden 162a891673 M12: XFA text honors its horizontal font scale
fontHorizontalScale on a font, and xfa-font-horizontal-scale in rich text,
condense the glyphs; PdfCraft ignored both, so condensed labels were laid
out at full width and overflowed or wrapped where the form fits them on
one line. Text is now measured at its scale and written with Tz, in a
graphics state of its own. Field values keep full width: the forms layer
draws them, and its appearances have no horizontal scaling.
2026-10-19 13:56:03 -04:00
Eric Kaden cddc327264 Merge branch 'main' of github.com:storytold/pdfcraft into fix/xfa-script-error-keeps-effects
# Conflicts:
#	parity/acrobat-features.toml
2026-10-19 13:23:34 -04:00
Eric Kaden d022254ce7 Merge branch 'main' of github.com:storytold/pdfcraft into fix/xfa-layout-drops-usage-rights
# Conflicts:
#	parity/acrobat-features.toml
2026-10-19 13:18:04 -04:00
Eric KadenandBrandon Thomas 0831d911b4 M6: a date typed without separators fills a yyyymmdd field (#3388)
* M6: a date typed without separators fills a yyyymmdd field

parse_date read each run of digits as one number, so 20261018 in a
yyyymmdd field was a single number with nothing left for the month and
the day, and the keystroke check refused it. Every date field on forms
that use the YYYYMMDD date format (US Army forms such as DA Form 31 among
them) refused every valid date.

order() now records each field's fixed width (4 for yyyy; 2 for yy, mm,
dd, HH, MM and ss) and whether the next field follows with nothing in
between. parse_date keeps runs of digits as text and splits a run between
such joined fields by those widths. Formats with separators, month names,
literal digits (dd.mm.26) and two-digit years behave as before.

A run of digits too long for a u32 used to be dropped silently, which let
"2026 99999999999" pass for yyyy; it is now read like any other number and
refused when it is left over or does not fit.

* chore(contributors): credit Eric Kaden by real name

* M6: separated runs of digits stay whole in a joined date format

With separators each run of digits is one field's number, as before this
branch: "2026-10-18" in a yymmdd field reads the year 2026, where the
first commit split the run into 20 and 26 and refused the date. A run is
now split between joined fields only when fewer runs were typed than the
fields still to fill, so "2610" and "261018" still split.

* M6: what is left of a split run of digits fills its field exactly

"202610018" in a yyyymmdd field split off 2026 and 10 and read the rest,
018, as day 18, so a nine-digit date passed. The rest of a split run now
has to be its field's width; a number typed on its own ("2026 10 018")
keeps its leeway.

* M6: a number typed on its own is split only when its rest fills the next field

The optional time fields of a format like yyyymmddHHMM counted as fields
still to fill, so "2026 10 018" split the day 018 into 01 and 8 and was
refused; on main the time defaults to 00:00. A run typed on its own is
now split only when what is left can fill the next field; the rest of a
run that was already split is split as before.

* M6: describe the undelimited-date tests without naming one form

The tests and their comments now say what they check (fields written side by side, such as yyyymmdd) instead of naming the form that showed the problem, and use a generic field label.

* M6: count date and time fields apart when deciding to split a run

Optional time fields counted towards the fields still to fill, so
"2026-10-18" in a yymmddHHMM field split the year into 20 and 26 and was
refused, where main reads it with the time left out. A run typed on its
own is now matched against the fields of its own kind: date runs against
date fields, time runs against time fields. What is left of a split run
goes on being split along the fields written side by side, so
"20261018143005" still fills yyyymmddHHMMss. A mix such as
"2026 1018 1430" (year apart, month and day joined, then a time) is still
refused, as on main.

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-19 13:00:52 -04:00
Eric Kaden a30dde2225 M6: the date picker follows a whole date typed while it is open (#3393)
The calendar took its month once, when it opened, so a date typed while
it was open showed only after leaving the field and coming back. It now
moves to a date as soon as the text becomes one, and stays on the month
it shows while the text is half typed or unchanged, so its arrows still
turn the months.
2026-10-19 12:58:15 -04:00
Eric Kaden caaf058815 M6: a secured form's notice bar still says it is a form (#3404) 2026-10-19 12:58:03 -04:00
Eric Kaden 8f0557d2bc M12: an XFA script that fails partway keeps what it changed before the error 2026-10-19 01:13:09 -04:00
Eric Kaden 93544ef1bf M12: the XFA notice bar starts its first layout note as a sentence
Layout notes are lowercase clauses joined with semicolons, and the bar
put the first right after the layout's own sentence ('11 fields. the
form's usage rights...'). The first note now starts with a capital.
2026-10-19 00:32:52 -04:00