Add configurable WrapText measurement to AutoFitColumns (#2427) - #2428
Merged
Conversation
…surement in AutoFitColumns; fix per-line East Asian width reset
JanKallman
added a commit
that referenced
this pull request
Aug 4, 2026
…2451) * Fixes issue #2392 (#2419) * Versioning moved to Directory.Build.props and Build-release.yml adjusted for v9 * Add link to security considerations for formulas * Update link for security considerations in SECURITY.md * Bug/s1060 (#2426) * Allow AppVersion in OfficeProperties to be set to null. #2393. * WIP * bug/s1063 SEARCH function Range on third arg (#2430) * Tracking down the issue * Found main issue. Arrays 3rd arg Search function * Simplified test * #2431 Fix formula cfvo load error in ext icon sets (#2432) Co-authored-by: swmal <{ID}+username}@users.noreply.github.com> * Add configurable WrapText measurement to AutoFitColumns (#2427) (#2428) * #2427 - Add WrappedTextAutofitMode enum for configurable WrapText measurement in AutoFitColumns; fix per-line East Asian width reset * Added tests. Might be correct despite failing test * Fixed failing test --------- Co-authored-by: Ossian Edström <ossian.edstrom@epplussoftware.com> Co-authored-by: Jan Källman <jan.kallman@epplussoftware.com> * Added DisableImageFunctionDownloads property to ParsingConfiguration. If true the IMAGE function will not download external content (#2436) Co-authored-by: swmal <{ID}+username}@users.noreply.github.com> * EPPlus version 8.6.2 * Updated version number on EPPlus.Interfaces and EPPlus.System.Drawing projects * Security updates 8.6.3 - System.Security.Cryptography.Xml (#2438) * Added DisableImageFunctionDownloads property to ParsingConfiguration. If true the IMAGE function will not download external content * Update System.Security.Cryptography.Xml to 8.0.4/9.0.18/10.0.10 for CVE-2026-47302/47304/50525/50527/50648. Bump version to 8.6.3. * Additional fixes för appveyor8.yml, fixedIssures.md and EPPlus project file --------- Co-authored-by: swmal <{ID}+username}@users.noreply.github.com> * #2443 - Fix header/footer picture loss when copying worksheets (#2444) Co-authored-by: swmal <{ID}+username}@users.noreply.github.com> * #2439 - Fix lookup regression when range starts before worksheet dimension; clamp both ends but keep range-relative offset (#2440) Co-authored-by: swmal <{ID}+username}@users.noreply.github.com> * #2441 - Added DisableImageFunctionDownloads property to ExcelCalculationOption (#2442) Co-authored-by: swmal <{ID}+username}@users.noreply.github.com> * Centralize version in Directory.Build.props; embed sub-project DLLs in package --------- Co-authored-by: Jan Källman <jan.kallman@epplussoftware.com> Co-authored-by: karlkallman <137038948+karlkallman@users.noreply.github.com> Co-authored-by: OssianEPPlus <122265629+OssianEPPlus@users.noreply.github.com> Co-authored-by: swmal <{ID}+username}@users.noreply.github.com> Co-authored-by: Ossian Edström <ossian.edstrom@epplussoftware.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.
Implements #2427.
Adds a
WrappedTextAutofitMode property toExcelTextSettings, backed by a neweWrappedTextAutofitModeenum, giving control over how cells withWrapTextenabled contribute to column width inAutoFitColumns().Modes:
Skip— wrapped cells are ignored during autofit (default; preserves current behaviour).FullText— the entire cell text is measured as a single line.SplitNewLine— split on explicit line breaks (CR, LF, CRLF); widest line drives the width.SplitWord— split on whitespace (space, tab, line breaks) and hyphens (U+002D, U+2010); widest segment drives the width. Visible hyphens are included in the segment width, whitespace is not.Changes:
New
eWrappedTextAutofitModeenum andWrappedTextAutofitModeproperty onExcelTextSettings, propagated to the measurer.Reworked
MeasureTextInternalto measure per segment; the widest segment determines the result.Fixed a pre-existing bug where East Asian character width accumulated across all lines instead of resetting per line.
Deprecated the internal
MeasureWrappedTextCellsflag via[Obsolete], mapping to the new enum.Tests: Added coverage for all four modes plus CRLF handling, widest-segment-first, hyphen-as-visible-boundary, and the East Asian per-line reset.
Notes:
Applies to the generic font-metrics measurer; the System.Drawing measurer currently ignores the setting (to be addressed before the next release).
MeasureWrappedTextCellsremoval and theITextMeasurerinterface cleanup are deferred to EPPlus 9.