Skip to content

Configurable measurement of WrapText cells in AutoFitColumns #2427

Description

@swmal

Currently, cells with WrapText enabled are ignored when calculating column width via AutoFitColumns(). We want to give users control over how such cells contribute to the calculated width.
Add a WrappedTextAutofitMode property to ExcelTextSettings, backed by an eWrappedTextAutofitMode enum with the following modes:

Skip — wrapped cells are ignored during autofit (default; preserves current behaviour).
FullText — the entire cell text is measured as a single line.
SplitNewLine — the text is split on explicit line breaks (CR, LF, CRLF); the widest resulting line drives the column width.
SplitWord — the text is split on whitespace (space, tab, line breaks) and hyphens (U+002D, U+2010); the widest resulting segment drives the column width. Visible break characters (hyphens) are included in the segment width; whitespace is not.

Applies to the generic font-metrics measurer.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions