Mapper  0.9.0
API documentation
Public Member Functions | Public Attributes | List of all members
OpenOrienteering::TextObjectPartInfo Class Reference

TextObjectPartInfo contains layout information for a continuous sequence of printable characters in a longer text. More...

#include <text_object.h>

Collaboration diagram for OpenOrienteering::TextObjectPartInfo:
Collaboration graph
[legend]

Public Member Functions

double getX (int index) const
 The metrics of the font that is used to render the part. More...
 
int getIndex (double pos_x) const
 Find the index of the character corresponding to a particular position. More...
 

Public Attributes

QString part_text
 
int start_index
 The sequence of printable characters which makes up this part. More...
 
int end_index
 The index of the part's first character in the original string. More...
 
double part_x
 The index of the part's last character in the original string. More...
 
double width
 The left endpoint of the baseline of this part in text coordinates. More...
 
QFontMetricsF metrics
 The width of the rendered part in text coordinates. More...
 

Detailed Description

TextObjectPartInfo contains layout information for a continuous sequence of printable characters in a longer text.

Use the implicit initializer list constructor to create a new object of this class.

Member Function Documentation

◆ getIndex()

int OpenOrienteering::TextObjectPartInfo::getIndex ( double  pos_x) const

Find the index of the character corresponding to a particular position.

Parameters
pos_xthe position for which the index is requested
Returns
the character's index in the original string

◆ getX()

double OpenOrienteering::TextObjectPartInfo::getX ( int  index) const
inline

The metrics of the font that is used to render the part.

Get the horizontal position of a particular character in a part.

Parameters
indexthe index of the character in the original string
Returns
the character's horizontal position in text coordinates

Member Data Documentation

◆ end_index

int OpenOrienteering::TextObjectPartInfo::end_index

The index of the part's first character in the original string.

◆ metrics

QFontMetricsF OpenOrienteering::TextObjectPartInfo::metrics

The width of the rendered part in text coordinates.

◆ part_text

QString OpenOrienteering::TextObjectPartInfo::part_text

◆ part_x

double OpenOrienteering::TextObjectPartInfo::part_x

The index of the part's last character in the original string.

◆ start_index

int OpenOrienteering::TextObjectPartInfo::start_index

The sequence of printable characters which makes up this part.

◆ width

double OpenOrienteering::TextObjectPartInfo::width

The left endpoint of the baseline of this part in text coordinates.


The documentation for this class was generated from the following files: