Skip to content

[Epic] Advanced Text, Auto-fit & Internationalization #16

Description

@MHoroszowski

Problem

The text-run API is incomplete in three orthogonal directions. Run-level features: superscript/subscript (scanny/python-pptx#1045), strikethrough (#574, #339), highlight, baseline shift, character spacing (spc), and kerning (kern) are absent or partial. Layout features: text columns (numCol), vertical text (vert), per-run column-spacing — <a:bodyPr> round-trips them but no Python API exposes them. Auto-fit & overflow: TextFrame.fit_text exists but crashes on long words (#168, #416) and there is no overflow-detection API to query whether content fits before saving (#715, #936). Internationalization: RTL paragraphs (#751) are not supported, and the <a:latin>/<a:ea>/<a:cs> typeface trio means setting Font.name only fixes Latin script — Asian fonts and complex-script fonts cannot be set independently (#343, #768, #420).

Sub-features

  • Font.superscript / Font.subscript (boolean → emits baseline= percentage)
  • Font.strike enum (none / single / double)
  • Font.highlight color setter
  • Font.character_spacing (spc=) and Font.kerning (kern=)
  • Independent Font.latin / Font.east_asian / Font.complex_script setters (existing Font.name continues setting only <a:latin>)
  • TextFrame.columns = N and TextFrame.column_spacing (<a:bodyPr numCol= colSpace=>)
  • TextFrame.text_direction enum (horizontal / vert / vert270 / wordArtVert / eaVert / mongolianVert)
  • Paragraph.rtl = True for right-to-left text (Arabic, Hebrew, Persian)
  • TextFrame.will_overflow() / TextFrame.overflow_info() returning a structured report (closes scanny/python-pptx#1114)
  • TextFrame.shrink_text_to_fit() — eager font-size autofit without relying on PowerPoint to recompute on open (closes scanny/python-pptx#1107)
  • Fix fit_text long-word crash (closes #168)

Prior art

Acceptance criteria

  • 35+ unit tests + 10 behave scenarios across the sub-features.
  • TextFrame.will_overflow() correctly reports overflow status for content >= 110% of frame height across 3 sample fonts.
  • A presentation authored with Paragraph.rtl = True and Arabic text renders right-to-left in PowerPoint.
  • East-Asian font set via Font.east_asian = "MS Gothic" round-trips correctly.
  • Backward compat: existing Font.name continues setting only the Latin slot.

Effort: L

Largest text-API surface in the roadmap. Phase A: run-level (sub/super, strike, highlight). Phase B: typography + i18n (latin/ea/cs trio, RTL). Phase C: layout (columns, vertical) and overflow detection.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:textFeature area: textepicMulti-feature roadmap epicprior-art:forkActive community fork has shipped thisprior-art:upstream-prOpen PR on scanny/python-pptx is candidate cherry-pickpriority:P1Important but not urgent

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions