fix(layout): correct Arabic/RTL font sizing, indent direction & mirroring#4
Open
dawidbudaszewski wants to merge 1 commit into
Open
fix(layout): correct Arabic/RTL font sizing, indent direction & mirroring#4dawidbudaszewski wants to merge 1 commit into
dawidbudaszewski wants to merge 1 commit into
Conversation
…ring Three related complex-script (RTL) rendering fixes that align SuperDoc with Word/Pages/Google Docs in both the editable and paginated layout-engine paths: - Complex-script font size & face: render runs flagged complex-script (w:rtl / w:cs) from w:szCs and the w:rFonts w:cs slot, instead of falling back to the Latin w:sz / ascii font (often a generator-emitted 12pt Times). Applied in super-converter/styles.js (editable) and layout-adapter paragraph.ts (layout). - Direction-aware indentation: resolve OOXML logical w:start/w:end vs physical w:left/w:right against paragraph direction so an RTL indent lands on the correct visual edge; fixes RTL signature blocks collapsing/wrapping under w:jc="both" (encodeCSSFromPPr). - RTL indent mirroring: mirrorIndentForRtl now only swaps left/right and no longer negates firstLine/hanging, fixing the first-line outdent in the paginated layout engine (bidi.ts). Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Three related complex-script (RTL) rendering fixes that align SuperDoc with Word / Pages / Google Docs, in both the editable and paginated layout-engine paths:
w:rtl/w:cs) now render fromw:szCsand thew:rFonts w:csslot (e.g.Qatar3), instead of falling back to the Latinw:sz/ ascii font (often a generator-emitted 12pt Times). Editable:super-converter/styles.js; layout:layout-adapter/attributes/paragraph.ts.w:start/w:endvs physicalw:left/w:rightagainst paragraph direction, so an RTL indent lands on the correct visual edge. Fixes RTL signature blocks collapsing/wrapping underw:jc="both"(encodeCSSFromPPr).mirrorIndentForRtlnow only swaps left/right and no longer negatesfirstLine/hanging, fixing the first-line outdent in the paginated layout engine (bidi.ts).Test plan
image/bidi/paragraph/stylesunit tests updated and greenPart of the
@scalefork release (SCALE_BRANCHES).Made with Cursor