Skip to content

[BUG] textRotation=90 in merged cell causes row height expansion #249

Description

@Neronuser

Summary

When a merged cell has textRotation=90 (vertical text), officecli renders the first row of the merged range at approximately 4x its specified height, even though customHeight="1" is set in the row dimensions XML.

Steps to reproduce

Script to create reproduction Excels:
create_repro.py

pip install openpyxl
python create_repro.py
echo "=== Rendering with textRotation=90 ==="
officecli view repro.xlsx screenshot --out repro_rotated.png --range "Sheet1!A1:I14"
echo "Output: repro_rotated.png"

echo ""
echo "=== Rendering without textRotation ==="
officecli view repro_no_rotation.xlsx screenshot --out repro_no_rotation.png --range "Sheet1!A1:I14"
echo "Output: repro_no_rotation.png"

This creates two workbooks:

  • repro.xlsx — merged cell I3:I12 with textRotation=90
  • repro_no_rotation.xlsx — same layout, textRotation=0

Expected behavior

Both files should render with identical row heights. The row height is explicitly set to 15pt with customHeight=true — the renderer should respect it regardless of text rotation.

Actual behavior

In repro.xlsx, row 3 (the first row of the merged range) renders at ~4x normal height. The text content ("Category Label") is short enough to fit within the merge vertically, so there is no reason for height expansion.

Removing textRotation=90 (keeping everything else identical) renders correctly.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions