A range of text with all the same attributes. More...
#include <opennurbs_textrun.h>
Public Types | |
enum | RunDirection : unsigned char { RunDirection::kLtR = 0, RunDirection::kRtL = 1 } |
enum | RunType : unsigned char { RunType::kNone = 0, RunType::kText = 1, RunType::kNewline = 2, RunType::kSoftreturn = 3, RunType::kParagraph = 4, RunType::kColumn = 5, RunType::kField = 6, RunType::kFieldValue = 7, RunType::kFontdef = 8, RunType::kHeader = 9, RunType::kFonttbl = 10, RunType::kColortbl = 11 } |
enum | Stacked : unsigned char { Stacked::kNone = 0, Stacked::kStacked = 1, Stacked::kTop = 2, Stacked::kBottom = 3 } |
Public Member Functions | |
ON_TextRun ()=default | |
ON_TextRun (const ON_TextRun &src) | |
~ON_TextRun () | |
const ON_2dVector & | Advance () const |
const ON_BoundingBox & | BoundingBox () const |
bbox is stored as ON_BoundingBox, but is always 2d. z=0 More... | |
ON_Color | Color () const |
const wchar_t * | DisplayString () const |
The display string is the TextString() with formulae evaluated. More... | |
RunDirection | FlowDirection () const |
const ON_Font * | Font () const |
void | Get2dCorners (ON_2dPoint corners[4]) const |
bool | GetGlyphContours (const ON_Font *text_font, bool bSingleStrokeFont, const ON_Xform &text_xform, ON_ClassArray< ON_ClassArray< ON_SimpleArray< ON_Curve * > > > &run_contours) const |
double | HeightScale (const ON_Font *font) const |
void | Init (const class ON_Font *managed_font, double height, double stackscale, ON_Color color, bool bold, bool italic, bool underlined, bool strikethrough, bool deletedisplay=true) |
bool | IsActiveManagedTextRun () const |
bool | IsColumn () const |
bool | IsManagedTextRun () const |
bool | IsNewline () const |
Stacked | IsStacked () const |
bool | IsText () const |
bool | IsValid () const |
const ON_2dVector & | Offset () const |
ON_TextRun & | operator= (const ON_TextRun &src) |
void | SetAdvance (ON_2dVector advance) |
void | SetBoundingBox (ON_2dPoint pmin, ON_2dPoint pmax) |
void | SetColor (ON_Color color) |
void | SetDisplayString (const wchar_t *str) |
Returns string in m_display_string, which may be the result of parsing text fields. More... | |
void | SetFont (const ON_Font *font) |
void | SetOffset (ON_2dVector offset) |
void | SetStacked (Stacked stacked) |
void | SetStackedOff () |
void | SetStackFractionHeight (double stackscale) |
void | SetTextHeight (double h) |
void | SetType (ON_TextRun::RunType) |
void | SetUnicodeString (size_t count, const ON__UINT32 *cp) |
double | StackHeightFraction () const |
double | TextHeight () const |
ON_SHA1_Hash | TextRunContentHash () const |
ON_SHA1_Hash | TextRunContentHash (bool bEvaluateFields) const |
const wchar_t * | TextString () const |
RunType | Type () const |
const ON__UINT32 * | UnicodeString () const |
int | WrapTextRun (int call_count, int start_char_offset, double width, double &y_offset, double ¤twidth, class ON_TextRunArray &newruns) const |
Wrap text to a specified width in model space. More... | |
Static Public Member Functions | |
static size_t | CodepointCount (const ON__UINT32 *cp) |
static double | DefaultStackFractionHeight () |
static ON_TextRun * | GetManagedTextRun () |
ON_TextRun::NewTextRun() gets a text run from an efficiently managed pool. More... | |
static ON_TextRun * | GetManagedTextRun (const ON_TextRun &src) |
ON_TextRun::NewTextRun() gets a text run from an efficiently managed pool and copies src More... | |
static bool | ReturnManagedTextRun (ON_TextRun *managed_text_run) |
Return a managed ON_TextRun. More... | |
static ON_TextRun::RunDirection | RunDirectionFromUnsigned (unsigned int run_direction_as_unsigned) |
static ON_TextRun::RunType | RunTypeFromUnsigned (unsigned int run_type_as_unsigned) |
static ON_TextRun::Stacked | StackedFromUnsigned (unsigned int stacked_as_unsigned) |
Public Attributes | |
ON_2dVector | m_advance = ON_2dVector::ZeroVector |
ON_Color | m_color = ON_Color::UnsetColor |
double | m_height_scale = -1.0 |
double | m_indent = 0.0 |
double | m_left_margin = 0.0 |
int | m_line_index = -1 |
const ON_Font * | m_managed_font = nullptr |
ON_2dVector | m_offset = ON_2dVector::ZeroVector |
double | m_right_margin = 0.0 |
ON_StackedText * | m_stacked_text = nullptr |
double | m_stackscale = 0.7 |
Static Public Attributes | |
static const ON_TextRun | Empty |
Friends | |
class | ON_StackedText |
class | ON_TextBuilder |
A range of text with all the same attributes.
|
strong |
|
strong |
|
strong |
|
default |
ON_TextRun::~ON_TextRun | ( | ) |
ON_TextRun::ON_TextRun | ( | const ON_TextRun & | src | ) |
const ON_2dVector& ON_TextRun::Advance | ( | ) | const |
const ON_BoundingBox& ON_TextRun::BoundingBox | ( | ) | const |
bbox is stored as ON_BoundingBox, but is always 2d. z=0
|
static |
ON_Color ON_TextRun::Color | ( | ) | const |
|
static |
const wchar_t* ON_TextRun::DisplayString | ( | ) | const |
The display string is the TextString() with formulae evaluated.
RunDirection ON_TextRun::FlowDirection | ( | ) | const |
const ON_Font* ON_TextRun::Font | ( | ) | const |
void ON_TextRun::Get2dCorners | ( | ON_2dPoint | corners[4] | ) | const |
bool ON_TextRun::GetGlyphContours | ( | const ON_Font * | text_font, |
bool | bSingleStrokeFont, | ||
const ON_Xform & | text_xform, | ||
ON_ClassArray< ON_ClassArray< ON_SimpleArray< ON_Curve * > > > & | run_contours | ||
) | const |
|
static |
ON_TextRun::NewTextRun() gets a text run from an efficiently managed pool.
|
static |
ON_TextRun::NewTextRun() gets a text run from an efficiently managed pool and copies src
double ON_TextRun::HeightScale | ( | const ON_Font * | font | ) | const |
void ON_TextRun::Init | ( | const class ON_Font * | managed_font, |
double | height, | ||
double | stackscale, | ||
ON_Color | color, | ||
bool | bold, | ||
bool | italic, | ||
bool | underlined, | ||
bool | strikethrough, | ||
bool | deletedisplay = true |
||
) |
bool ON_TextRun::IsActiveManagedTextRun | ( | ) | const |
bool ON_TextRun::IsColumn | ( | ) | const |
bool ON_TextRun::IsManagedTextRun | ( | ) | const |
bool ON_TextRun::IsNewline | ( | ) | const |
Stacked ON_TextRun::IsStacked | ( | ) | const |
bool ON_TextRun::IsText | ( | ) | const |
bool ON_TextRun::IsValid | ( | ) | const |
const ON_2dVector& ON_TextRun::Offset | ( | ) | const |
ON_TextRun& ON_TextRun::operator= | ( | const ON_TextRun & | src | ) |
|
static |
Return a managed ON_TextRun.
|
static |
|
static |
void ON_TextRun::SetAdvance | ( | ON_2dVector | advance | ) |
void ON_TextRun::SetBoundingBox | ( | ON_2dPoint | pmin, |
ON_2dPoint | pmax | ||
) |
void ON_TextRun::SetColor | ( | ON_Color | color | ) |
void ON_TextRun::SetDisplayString | ( | const wchar_t * | str | ) |
Returns string in m_display_string, which may be the result of parsing text fields.
void ON_TextRun::SetFont | ( | const ON_Font * | font | ) |
void ON_TextRun::SetOffset | ( | ON_2dVector | offset | ) |
void ON_TextRun::SetStacked | ( | Stacked | stacked | ) |
void ON_TextRun::SetStackedOff | ( | ) |
void ON_TextRun::SetStackFractionHeight | ( | double | stackscale | ) |
void ON_TextRun::SetTextHeight | ( | double | h | ) |
void ON_TextRun::SetType | ( | ON_TextRun::RunType | ) |
void ON_TextRun::SetUnicodeString | ( | size_t | count, |
const ON__UINT32 * | cp | ||
) |
|
static |
double ON_TextRun::StackHeightFraction | ( | ) | const |
double ON_TextRun::TextHeight | ( | ) | const |
ON_SHA1_Hash ON_TextRun::TextRunContentHash | ( | ) | const |
ON_SHA1_Hash ON_TextRun::TextRunContentHash | ( | bool | bEvaluateFields | ) | const |
const wchar_t* ON_TextRun::TextString | ( | ) | const |
RunType ON_TextRun::Type | ( | ) | const |
const ON__UINT32* ON_TextRun::UnicodeString | ( | ) | const |
int ON_TextRun::WrapTextRun | ( | int | call_count, |
int | start_char_offset, | ||
double | width, | ||
double & | y_offset, | ||
double & | currentwidth, | ||
class ON_TextRunArray & | newruns | ||
) | const |
Wrap text to a specified width in model space.
|
friend |
|
friend |
|
static |
ON_2dVector ON_TextRun::m_advance = ON_2dVector::ZeroVector |
ON_Color ON_TextRun::m_color = ON_Color::UnsetColor |
double ON_TextRun::m_height_scale = -1.0 |
double ON_TextRun::m_indent = 0.0 |
double ON_TextRun::m_left_margin = 0.0 |
int ON_TextRun::m_line_index = -1 |
const ON_Font* ON_TextRun::m_managed_font = nullptr |
ON_2dVector ON_TextRun::m_offset = ON_2dVector::ZeroVector |
double ON_TextRun::m_right_margin = 0.0 |
ON_StackedText* ON_TextRun::m_stacked_text = nullptr |
double ON_TextRun::m_stackscale = 0.7 |