18 #ifndef OPENNURBS_TEXT_H_INCLUDED 19 #define OPENNURBS_TEXT_H_INCLUDED 21 #if defined(ON_DLL_TEMPLATE) 27 #define ON_TEXT_BRACKET_FRACTION 44 void Internal_Destroy();
45 void Internal_CopyFrom(
77 bool IsValid(
class ON_TextLog* text_log =
nullptr )
const override;
81 const wchar_t* RtfString,
82 ON::AnnotationType annotation_type,
86 double text_rotation_radians
90 const wchar_t* RtfString,
91 ON::AnnotationType annotation_type,
95 bool ReplaceTextString(
96 const wchar_t* RtfString,
97 ON::AnnotationType annotation_type,
102 ON::AnnotationType annotation_type,
111 ON_SHA1_Hash DimStyleTextPositionPropertiesHash()
const;
118 bool EqualTextPositionProperties(
119 ON::AnnotationType annotation_type,
123 bool GetGlyphContours(
125 bool bSingleStrokeFont,
130 bool GetGlyphContours(
132 bool bSingleStrokeFont,
138 static ON::AnnotationType Internal_AlignmentAnnotationType(
139 ON::AnnotationType annotation_type
144 bool Internal_SetText(
170 bool Internal_ParseRtf(
171 const wchar_t* rtf_string,
173 bool bComposeAndUpdateRtf
175 bool Internal_ParseRtfDefault(
176 const wchar_t* rtf_string,
177 bool bComposeAndUpdateRtf
212 const ON_wString WrappedPlainTextWithFields()
const;
215 void Internal_SetRunTextHeight(
double height);
218 void GetAlignment(ON::TextHorizontalAlignment& horz, ON::TextVerticalAlignment& vert)
const;
219 void SetAlignment(ON::TextHorizontalAlignment horz, ON::TextVerticalAlignment vert);
222 double FormattingRectangleWidth()
const;
223 void SetFormattingRectangleWidth(
double width);
225 double TextRotationRadians()
const;
226 void SetTextRotationRadians(
double rotation);
228 double TextRotationDegrees()
const;
229 void SetTextRotationDegrees(
double rotation);
231 unsigned int EvaluationSerialNumber()
const;
232 void SetEvaluationSerialNumber(
unsigned int sn)
const;
234 void RealignTextRuns(ON::TextHorizontalAlignment new_h_align);
239 int Dimension()
const override;
241 ON::object_type ObjectType()
const override;
254 bool GetBBox(
double* boxmin,
double* boxmax,
bool bGrowBox =
false )
const override;
256 void ClearBoundingBox()
override;
258 bool Transform(
const ON_Xform& xform)
override;
261 bool WrapText(
double width)
const;
264 bool HasWrappedRuns()
const;
267 bool TextIsWrapped()
const;
268 void SetTextIsWrapped(
bool wrapped);
271 void Internal_DeleteWrappedRuns()
const;
273 const ON_wString Internal_GetPlainText(
bool evaluate_fields,
bool wrapped)
const;
279 bool Get2dSize(
bool raw,
double& width,
double& height)
const;
283 bool Get2dCorners(
ON_2dPoint corners[4])
const;
289 bool Get3dCorners(
ON_3dPoint corners[4])
const;
294 bool Get3dMaskCorners(
double border,
ON_3dPoint corners[4])
const;
297 bool Get3dUnderline(
ON_3dPoint ends[2],
double scaled_gap)
const;
306 ON_Mesh* Get2dPickMesh()
const;
307 ON_Mesh* Get3dPickMesh()
const;
316 const wchar_t* RtfText()
const;
341 double m_rect_width = 1.0e300;
342 double m_rotation_radians = 0.0;
343 double m_reserved_dbl = 0.0;
344 ON::TextHorizontalAlignment m_h_align = ON::TextHorizontalAlignment::Left;
345 ON::TextVerticalAlignment m_v_align = ON::TextVerticalAlignment::Bottom;
350 mutable bool m_bWrapText =
false;
359 mutable unsigned int m_run_evaluation_sn = 0;
362 mutable ON::AnnotationType m_annotation_type = ON::AnnotationType::Unset;
371 void Internal_ClearTextContentHash()
const;
378 ON__INT_PTR m_reserved0 = (ON__INT_PTR)0;
396 static bool MeasureTextContent(
ON_TextContent* text,
bool raw,
bool wrapped);
412 static bool MeasureTextRunArray(
414 ON::TextVerticalAlignment v_align,
415 ON::TextHorizontalAlignment h_align);
430 static bool CreateStackedText(
ON_TextRun* run);
431 static bool CreateStackedText(
434 const ON__UINT32* cp,
435 ON__UINT32 stack_delimiter = L
'/');
463 static double GetLinefeedHeight(
ON_TextRun& run);
466 static bool FormatDistanceAndTolerance(
468 ON::LengthUnitSystem units_in,
473 static bool FormatDistanceMeasurement(
475 ON::LengthUnitSystem units_in,
477 const wchar_t* user_text,
480 static bool FormatAngleMeasurement(
483 const wchar_t* user_text,
static const ON_BoundingBox EmptyBoundingBox
Definition: opennurbs_bounding_box.h:28
A range of text with all the same attributes.
Definition: opennurbs_textrun.h:66
Definition: opennurbs_array.h:36
Definition: opennurbs_sha1.h:19
Definition: opennurbs_textrun.h:363
static const ON_TextContent Empty
Definition: opennurbs_text.h:33
Definition: opennurbs_string.h:2020
Definition: opennurbs_dimensionstyle.h:218
Base class for all geometry classes that must provide runtime class id. Provides interface for common...
Definition: opennurbs_geometry.h:37
Definition: opennurbs_point.h:277
Definition: opennurbs_text.h:28
Definition: opennurbs_bounding_box.h:25
An ON_Font is a face in a font family. It corresponds to a Windows LOGFONT, a .NET System...
Definition: opennurbs_font.h:225
Definition: opennurbs_mesh.h:2188
Definition: opennurbs_array.h:409
Definition: opennurbs_textlog.h:20
Definition: opennurbs_archive.h:1783
Definition: opennurbs_point.h:460
Definition: opennurbs_textobject.h:18
static const ON_SHA1_Hash ZeroDigest
Definition: opennurbs_sha1.h:22