feat(odf): sub/superscript, percent line-height, first-line indent#611
Merged
Conversation
- style:text-position: new public FontPosition enum + TextStyle::font_position;
both value components are read - the position ("super"/"sub" or a signed
percent offset) and the optional relative font size, which scales the
inherited size like percent font-size does. Rendered as vertical-align.
- fo:line-height: percent values were dropped; they are relative to the font
size, matching CSS line-height semantics, so they now pass through.
Percent margins remain dropped.
- fo:text-indent: new ParagraphStyle::text_indent, rendered as text-indent.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KH4XvPFfdUvH7HMp8rmqZT
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 423c35174d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Addresses review feedback on #611: a CSS percentage line-height on the x-p block resolves against the block's (inherited) font size, while the document text font size is emitted on nested x-s spans. A unitless ratio inherits per element and recomputes against each element's own font size, matching ODF percent line-height semantics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AEvWWwe1EyeWH7ANHoAvPH
Regenerated after the sub/superscript, percent line-height (now emitted as a unitless ratio), and first-line indent changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AEvWWwe1EyeWH7ANHoAvPH
andiwand
enabled auto-merge (squash)
July 16, 2026 19:55
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.
🤖 Generated with Claude Code
Three low-hanging fruits from the ODF feature checklist (
src/odr/internal/odf/README.md):Superscript / subscript (
style:text-position)New public
FontPositionenum andTextStyle::font_position. Both value components are read: the position (super/sub, or a signed percent offset mapped by sign) and the optional relative font size, which scales the inherited size the same way percentfo:font-sizealready does. The HTML renderer emitsvertical-align:super/sub/baselineon the inlinex-sspans, so e.g.super 58%on a 12pt base renders asfont-size:6.96pt;vertical-align:super;.Percent line-height
fo:line-heightpercent values were dropped (// TODO). ODF percent line-height is relative to the font size, which is exactly CSSline-height: %semantics, so it now passes straight through. Percent margins remain dropped since their ODF semantics don't map to CSS.First-line indent (
fo:text-indent)New
ParagraphStyle::text_indent, read from paragraph properties and rendered astext-indent.Tests
Document.odt_text_positiononstyle-various-1.odt(super 58%/sub 58%paragraphs, including the 12pt → 6.96pt scaling)Document.odt_line_height_and_text_indentonfile-sample_100kB.odt(line-height:120%inherited viaText_20_body,0.25inheading indent)TextStyleand the renderer are shared).Note on reference outputs
Many odt fixtures use percent line-height, so their rendered output genuinely changes — the visual comparison against
test/data/reference-outputwill need the references regenerated when this lands.