API Reference
OfficeTextMeasurer
Deterministic, zero-dependency text measurer for Office layout estimates.
Inheritance
- Object
- OfficeTextMeasurer
Remarks
This measurer intentionally does not call operating-system font APIs. It provides stable Office-oriented estimates for layout decisions such as autofit and wrapping.
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Method OfficeTextMeasurer.Create
Methods
public static OfficeTextMeasurer Create(Nullable<OfficeFontInfo> fallbackFontInfo = null) #OfficeTextMeasurerCreates a deterministic text measurer.
Parameters
- fallbackFontInfo System.Nullable{OfficeIMO.Drawing.OfficeFontInfo} = null
public OfficeTextMeasurementStyle CreateDefaultStyle(Double dpi) #OfficeTextMeasurementStyleCreates a style from the measurer fallback font and a DPI value.
Parameters
- dpi System.Double
public OfficeTextMeasurementStyle CreateStyle(OfficeFontInfo fontInfo) #OfficeTextMeasurementStyleCreates a style from a font descriptor using the default DPI.
Parameters
- fontInfo OfficeIMO.Drawing.OfficeFontInfo
public OfficeTextMeasurementStyle CreateStyle(OfficeFontInfo fontInfo, Double dpi) #OfficeTextMeasurementStyleCreates a style from a font descriptor and DPI value.
Parameters
- fontInfo OfficeIMO.Drawing.OfficeFontInfo
- dpi System.Double
public OfficeTextMetrics Measure(String text, OfficeTextMeasurementStyle style) #OfficeTextMetricsMeasures text width and line metrics for the supplied style.
Parameters
- text System.String
- style OfficeIMO.Drawing.OfficeTextMeasurementStyle
public Double MeasureLineHeight(OfficeTextMeasurementStyle style) #DoubleMeasures a single-line text height in pixels for the supplied style.
Parameters
- style OfficeIMO.Drawing.OfficeTextMeasurementStyle
public Double MeasureLineHeightOrDefault(String text, OfficeTextMeasurementStyle style, Double fallback) #DoubleMeasures line height or returns the provided fallback when text is empty.
Parameters
- text System.String
- style OfficeIMO.Drawing.OfficeTextMeasurementStyle
- fallback System.Double
public Double MeasureWidth(String text, OfficeTextMeasurementStyle style) #DoubleMeasures text width in pixels for the supplied style.
Parameters
- text System.String
- style OfficeIMO.Drawing.OfficeTextMeasurementStyle
public Double MeasureWidthOrDefault(String text, OfficeTextMeasurementStyle style, Double fallback) #DoubleMeasures text width or returns the provided fallback when text cannot be measured.
Parameters
- text System.String
- style OfficeIMO.Drawing.OfficeTextMeasurementStyle
- fallback System.Double
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object