Rhino C++ API  8.14
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ON_TextBox Class Reference

#include <opennurbs_font.h>

Public Member Functions

 ON_TextBox ()=default
 
 ON_TextBox (const ON_TextBox &)=default
 
 ON_TextBox (ON_2dPoint bbmin, ON_2dPoint bbmax)
 
 ~ON_TextBox ()=default
 
void Dump (class ON_TextLog &text_log) const
 
bool IsSet () const
 
ON_TextBoxoperator= (const ON_TextBox &)=default
 

Static Public Member Functions

static const ON_TextBox Scale (const ON_TextBox &text_box, double scale)
 
static const ON_TextBox Translate (const ON_TextBox &text_box, const ON_2dex &delta)
 
static const ON_TextBox Translate (const ON_TextBox &text_box, const ON_2dVector &delta)
 
static const ON_TextBox Union (const ON_TextBox &lhs, const ON_TextBox &rhs)
 

Public Attributes

ON_2dex m_advance = ON_2dex::Zero
 
ON_2dex m_bbmax = ON_2dex::Unset
 
ON_2dex m_bbmin = ON_2dex::Unset
 
ON_2dex m_max_basepoint = ON_2dex::Zero
 

Static Public Attributes

static const ON_TextBox Unset
 

Constructor & Destructor Documentation

◆ ON_TextBox() [1/3]

ON_TextBox::ON_TextBox ( )
default

◆ ~ON_TextBox()

ON_TextBox::~ON_TextBox ( )
default

◆ ON_TextBox() [2/3]

ON_TextBox::ON_TextBox ( const ON_TextBox )
default

◆ ON_TextBox() [3/3]

ON_TextBox::ON_TextBox ( ON_2dPoint  bbmin,
ON_2dPoint  bbmax 
)

Member Function Documentation

◆ Dump()

void ON_TextBox::Dump ( class ON_TextLog text_log) const

◆ IsSet()

bool ON_TextBox::IsSet ( ) const

Returns: true if bounding box is set.

◆ operator=()

ON_TextBox& ON_TextBox::operator= ( const ON_TextBox )
default

◆ Scale()

static const ON_TextBox ON_TextBox::Scale ( const ON_TextBox text_box,
double  scale 
)
static

◆ Translate() [1/2]

static const ON_TextBox ON_TextBox::Translate ( const ON_TextBox text_box,
const ON_2dex delta 
)
static

◆ Translate() [2/2]

static const ON_TextBox ON_TextBox::Translate ( const ON_TextBox text_box,
const ON_2dVector delta 
)
static

Returns: A text box with m_bbmin, m_bbmax, m_max_basepoint are translated by delta. m_advance is not changed.

◆ Union()

static const ON_TextBox ON_TextBox::Union ( const ON_TextBox lhs,
const ON_TextBox rhs 
)
static

Parameters: lhs - [in] lhs.m_advance is ignored rhs - [in] rhs.m_advance is ignored Returns: Returned m_bbmin, m_bbmax, m_max_basepoint are the union of the lhs and rhs bounding box. Returned m_advance = (0,0)

Member Data Documentation

◆ m_advance

ON_2dex ON_TextBox::m_advance = ON_2dex::Zero

m_advance is a vector that specifies where the basepoint should be moved to after the text is rendered. m_advance.i and m_advance.j are always >= 0.
When glyphs are rendered right to left (Arabic and Hebrew being examples) or bottom to top, the rendering code must apply the correct sign. Some reasons for using positive advance values for every glyph is that left to right and right to left languages can be appear on a single line and the sign of y associated with "up" is sometimes positive and sometimes negative. ON_TextBox::Translate does not modify the vector m_advance. ON_TextBox::Union ignored input advance values and returns a box with advance = (0,0). 0 <= m_advance.i will be <= m_max_basepoint.i.

◆ m_bbmax

ON_2dex ON_TextBox::m_bbmax = ON_2dex::Unset

◆ m_bbmin

ON_2dex ON_TextBox::m_bbmin = ON_2dex::Unset

The use context determines the length units. Common units include font glyph design units, normalized font design units, various display units. Typically x increases to the right, y increases upwards. For glyph and text run boxes, (0,0) is the horizontal base

◆ m_max_basepoint

ON_2dex ON_TextBox::m_max_basepoint = ON_2dex::Zero

m_max_basepoint.i = maximum horizontal delta in any line. Increases to the right, decreases to the left. m_max_basepoint.i = vertical delta to baseline of bottom line. Increases upward, decreases downward.

◆ Unset

const ON_TextBox ON_TextBox::Unset
static