Skip to content

Class ExcelTextSettings

Namespace: OfficeOpenXml
Assembly: EPPlus.dll

This class contains settings for text measurement.

public class ExcelTextSettings

Inheritance

object ← ExcelTextSettings

Inherited Members

object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()

Fields

AutofitRows

The amount of rows to check for when autofitting, starts from top. A value set to 0 or lower means checking all rows in the column.

public int AutofitRows

Field Value

int

textLengthThreshold

A percentage of the widest text. Since characters in different fonts have different widths we use this threshold remove characters from the longer string for comparing to the current text. This is so we can skip obvious shorter strings and save time on calculating it's actual width.

public double textLengthThreshold

Field Value

double

Properties

AutofitScaleFactor

All measurements of texts will be multiplied with this value. Default is 1.

public float AutofitScaleFactor { get; set; }

Property Value

float

FallbackTextMeasurer

If the primary text measurer fails to measure the text, this one will be used.

public ITextMeasurer FallbackTextMeasurer { get; set; }

Property Value

ITextMeasurer

GenericTextMeasurer

Returns an instance of the internal generic text measurer

public ITextMeasurer GenericTextMeasurer { get; }

Property Value

ITextMeasurer

PrimaryTextMeasurer

This is the primary text measurer

public ITextMeasurer PrimaryTextMeasurer { get; set; }

Property Value

ITextMeasurer

WrappedTextAutofitMode

Determines how cells with WrapText enabled are measured when calculating column width in AutoFitColumns. The default is Skip, which ignores wrapped cells during autofit.

public eWrappedTextAutofitMode WrappedTextAutofitMode { get; set; }

Property Value

eWrappedTextAutofitMode