Table of Contents

Method StringWidth

Namespace
Alternet.Common
Assembly
Alternet.Common.v9.dll

StringWidth(string)

Returns width of the given string.

public virtual int StringWidth(string text)

Parameters

text string

The text to calculate width.

Returns

int

Width of specified string.

StringWidth(string, int, int)

Returns width of the specified part of the given string.

public virtual int StringWidth(string text, int pos, int len)

Parameters

text string

The text to calculate width.

pos int

Position of the first character to start calculating.

len int

Length of the part of string to calculate width.

Returns

int

Width of the part of string.

StringWidth(string, int, out int, bool)

Returns width of the given string fitting into the given Width.

public virtual int StringWidth(string text, int width, out int count, bool exact)

Parameters

text string

The text to calculate width.

width int

Maximum layout area for the string.

count int

Receives number of character fitting into specified Width.

exact bool

Specifies whether the calculating should be precise.

Returns

int

Width of the part of string.

StringWidth(string, int, int, int, out int)

Returns width of the specified part of the given string fitting into the given Width.

public virtual int StringWidth(string text, int pos, int len, int width, out int count)

Parameters

text string

The text to calculate width.

pos int

Position of the first character to start calculating.

len int

Length of the part of string to calculate width.

width int

Maximum layout area for the string.

count int

Receives number of characters fitting into specified Width.

Returns

int

Width of the part of string.

StringWidth(string, int, int, int, out int, bool)

Returns width of the specified part of the given string fitting into the given Width.

public virtual int StringWidth(string text, int pos, int len, int width, out int count, bool exact)

Parameters

text string

The text to calculate width.

pos int

Position of the first character to start calculating.

len int

Length of the part of string to calculate width.

width int

Maximum layout area for the string.

count int

Receives number of characters fitting into the into the specified Width.

exact bool

Specifies whether the calculating should be precise.

Returns

int

Width of the part of string.

StringWidth(FontInfo?, string, int, int)

protected virtual int StringWidth(FontInfo? info, string text, int pos, int len)

Parameters

info FontInfo
text string
pos int
len int

Returns

int

StringWidth(FontInfo?, string, int, int, int, out int, bool)

protected virtual int StringWidth(FontInfo? info, string text, int pos, int len, int width, out int count, bool exact)

Parameters

info FontInfo
text string
pos int
len int
width int
count int
exact bool

Returns

int