Wt  4.11.1
Public Member Functions | List of all members
Wt::WTextItem Class Reference

The result of a font metrics computation. More...

#include <Wt/WPaintDevice.h>

Public Member Functions

 WTextItem (const WString &text, double width, double nextWidth=-1)
 Constructor.
 
WString text () const
 Returns the measured text. More...
 
double width () const
 Returns the measured width. More...
 
double nextWidth () const
 Returns the width for a next line-break boundary. More...
 

Detailed Description

The result of a font metrics computation.

See also
WPaintDevice::measureText()

Member Function Documentation

◆ nextWidth()

double Wt::WTextItem::nextWidth ( ) const

Returns the width for a next line-break boundary.

Returns the width until the next line-break boundary, or -1 if the underlying word boundary analysis does not support this.

◆ text()

WString Wt::WTextItem::text ( ) const

Returns the measured text.

If the item was measured with word breaking enabled, then the text may contain trailing whitespace that is not included in the width().

◆ width()

double Wt::WTextItem::width ( ) const

Returns the measured width.

Returns the text width, in device local coordinates (pixels).