Table of Contents

Class StringHelpers

Namespace
Dynamicweb.CoreUI.Helpers
Assembly
Dynamicweb.CoreUI.dll
public static class StringHelpers
Inheritance
StringHelpers
Inherited Members

Methods

EstimateWidth(string)

Estimates the aggregate visual width (in pixels) of the provided text.

public static int EstimateWidth(this string text)

Parameters

text string

The input text to measure.

Returns

int

The estimated width in pixels. Returns 0 for null or empty input. Characters not found in the map use Dynamicweb.CoreUI.Helpers.StringHelpers.FallbackWidth.

Remarks

This is a heuristic intended for layout calculations where exact glyph measurement is unnecessary or too costly. Actual rendered width may vary depending on the font, size, and rendering engine.

To top