Skip to content

Fix PDF text attributes in logical children #7092

Merged
laurmaedje merged 3 commits intomainfrom
tag-tree-text-attrs
Oct 14, 2025
Merged

Fix PDF text attributes in logical children #7092
laurmaedje merged 3 commits intomainfrom
tag-tree-text-attrs

Conversation

@saecki
Copy link
Member

@saecki saecki commented Oct 10, 2025

Related comment

This fixes a bug with text attributes inside of logical children, and also resolves some inconsistencies with how footnote entries were previously handled in tagged PDF. Now they are in line with how realization/layouting handles them.

@saecki saecki marked this pull request as draft October 11, 2025 16:55
@saecki
Copy link
Member Author

saecki commented Oct 11, 2025

I want to come up with some more descriptive names for the logical parenting behaviors.

@saecki saecki force-pushed the tag-tree-text-attrs branch 3 times, most recently from b660ae6 to a289bfc Compare October 13, 2025 09:40
@saecki saecki marked this pull request as ready for review October 13, 2025 11:24
@saecki
Copy link
Member Author

saecki commented Oct 13, 2025

Well, I couldn't come up with better names 🫠, but I updated the documentation a bit.

@saecki saecki marked this pull request as draft October 13, 2025 12:45
@saecki saecki force-pushed the tag-tree-text-attrs branch from a289bfc to 4bf1ca9 Compare October 13, 2025 14:00
@saecki saecki marked this pull request as ready for review October 13, 2025 14:00
@saecki
Copy link
Member Author

saecki commented Oct 13, 2025

I've also refactored the text attribute computation a bit.

/// See [`FrameParent`].
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum LogicalChildKind {
Inherit,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems odd to me to have two parallel enums (this and FrameParent). Wouldn't it make more sense to have FrameParent be a tuple or struct consisting of a Location and this enum?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming being difficult perhaps also indicates that this is really only a bool: inherit. Or alternatively separate to indicate that it does not inherit the styles. Not sure which is the clearer default.

Copy link
Member Author

@saecki saecki Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've decided to go with an Inherit enum that has a yes and a no variant. I wanted to go with the boolean, but that way the documenation was attached to the field in FrameParent, and it seems to be more relevant in the PDF export.

@saecki saecki force-pushed the tag-tree-text-attrs branch from 4bf1ca9 to f9a3b5e Compare October 14, 2025 12:05
@laurmaedje laurmaedje added this pull request to the merge queue Oct 14, 2025
Merged via the queue into main with commit 689fe17 Oct 14, 2025
16 checks passed
@laurmaedje laurmaedje deleted the tag-tree-text-attrs branch October 14, 2025 14:11
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.

2 participants