63 #define GLS_TEXT_SET_GEOMETRY_REFRESH GeometryRefresh();
65 #define GLS_TEXT_SET_GEOMETRY_REFRESH
68 #define SET_ALL_CHARS(attribute, value) \
70 for (CharAttrCont_t::iterator i = _chars.begin(); i != _chars.end(); ++i) \
72 i->attribute = value; \
74 GLS_TEXT_SET_GEOMETRY_REFRESH \
85 class GlsGloFileAttribute;
89 class RuntimeGlyphGenerationText;
94 GLS_TEXT_BORDER = GLS_LAST_INITIALIZER + 1,
97 GLS_TEXT_CONSTRAIN_CELL_RATIO,
98 GLS_TEXT_CONTROL_CELL_SIZE,
101 GLS_TEXT_LINESPACING,
102 GLS_TEXT_LOCK_CELL_SIZE,
108 GLS_LAST_TEXT_INITIALIZER = GLS_TEXT_WRAP
109 } GlsTextInitializers_t;
115 static GlsRuntimeFontBase* GetGlsRuntimeFontBase(
const GlsFontBase *font )
117 GlsRuntimeFontBase *rtf = NULL;
123 rtf =
static_cast< GlsRuntimeFontBase*
>( (GlsFontBase *)font );
133 static const GlsUnicodeFontBase* GetGlsUnicodeFontBase(
const GlsFontBase *font )
135 const GlsUnicodeFontBase *unf = NULL;
141 unf =
static_cast< const GlsUnicodeFontBase*
>( font );
157 typedef GlsFontBase::Char_t Char_t;
160 static GLS_EXPORT
const Char_t EOL;
162 enum { NUM_VERTICES = 4 };
190 GLS_EXPORT CharAttr_t(
const CharAttr_t& r);
193 GLS_EXPORT
void Clear();
196 GLS_EXPORT CharAttr_t& operator=(
const CharAttr_t& r);
206 typedef unsigned short char_type;
207 typedef int int_type;
208 typedef std::streampos pos_type;
209 typedef std::streamoff off_type;
210 typedef std::mbstate_t state_type;
212 static void assign(char_type& c1,
const char_type& c2)
217 static bool eq(
const char_type& c1,
const char_type& c2)
222 static bool lt(
const char_type& c1,
const char_type& c2)
227 static int compare(
const char_type* s1,
const char_type* s2,
size_t n)
237 return (*s1 - *(s2 - 1));
247 static size_t length(
const char_type* s)
257 static const char_type* find(
const char_type* s,
size_t n,
const char_type& a)
270 static char_type* move(char_type* s1,
const char_type* s2,
size_t n)
272 return static_cast<char_type*
>(memmove(s1, s2, n *
sizeof( char_type ) ));
275 static char_type* copy(char_type* s1,
const char_type* s2,
size_t n)
277 return static_cast<char_type*
>(memcpy(s1, s2, n *
sizeof( char_type ) ));
280 static char_type* assign(char_type* s,
size_t n, char_type a)
282 for(
size_t idx = 0u; idx < n; ++idx )
289 static char_type to_char_type(
const int_type& c)
291 return static_cast<char_type
>(c);
294 static int_type to_int_type(
const char_type& c)
296 return static_cast<int_type
>(c);
299 static bool eq_int_type(
const int_type& c1,
const int_type& c2)
304 static int_type eof()
306 return static_cast<int_type
>(EOF);
309 static int_type not_eof(
const int_type& c)
311 return (c == eof()) ? 0 : c;
315 typedef std::basic_string< unsigned short, CharTraitsUnsignedShort > UnicodeString;
319 typedef std::wstring UnicodeString;
325 GLS_EXPORT
GlsText(
const GlsText& that,
const bool generateNames );
339 GLS_EXPORT
void Baseline(
const float& baselineShift);
357 GLS_EXPORT
void Border(
const float& units);
387 GLS_EXPORT
void CellWidth(
float width );
398 GLS_EXPORT
void Char(Char_t code);
421 GLS_EXPORT
void CharScaling(
const float& newScale);
432 GLS_EXPORT
void CharSpacing(
const float& horizontalSpacing);
473 GLS_EXPORT
void Erase();
478 GLS_EXPORT
void FauxBold(
const bool& bold);
509 GLS_EXPORT
void Halo(
bool halo);
519 GLS_EXPORT
void HaloColor(
const glsColor& color);
521 glsColor HaloColor()
const
535 GLS_EXPORT
void Inverse(
const bool& inverse);
578 #if !defined(GCC_2_95)
587 virtual GLS_EXPORT
void SetValue(
int spec, va_list& args);
593 virtual GLS_EXPORT
void SetFromGloData(GlsGloFileAttribute &data);
599 GLS_EXPORT
void Shadow(
bool shadow);
609 GLS_EXPORT
void ShadowColor(
const glsColor& color);
611 glsColor ShadowColor()
const
631 GLS_EXPORT
void ShadowOffset(
const Vector& offset);
641 GLS_EXPORT
void StrikeThru(
const bool& strike);
650 GLS_EXPORT
void String(
const std::string& s);
682 GLS_EXPORT
void Underline(
const bool& underline);
691 GLS_EXPORT
void Uppercase(
bool uppercase);
692 bool Uppercase()
const
700 GLS_EXPORT
void WrapText(
bool wrap);
740 const float segmentX1,
741 const float segmentX2,
742 const float segmentY,
743 const float segmentThickness,
744 const float segmentShadowOffsetX,
745 const float segmentShadowOffsetY,
750 thickness(segmentThickness),
751 shadowOffsetX(segmentShadowOffsetX),
752 shadowOffsetY(segmentShadowOffsetY),
759 typedef std::vector<CharAttr_t> CharAttrCont_t;
761 static GLS_EXPORT
const Vector XAXIS;
762 static GLS_EXPORT
const Vector YAXIS;
764 static GLS_EXPORT
Vertex INITIAL_VERTICES[NUM_VERTICES];
775 Vertex _currentVertices[NUM_VERTICES];
886 GLS_EXPORT
char*
FormatVarArgList(
const int initialBufferLength,
const char* format, va_list args );
892 GLS_EXPORT
void RecalcDirectionVectors();
900 virtual GLS_EXPORT
void OnCellDimensionChanged()
905 void operator=( const
GlsText& ) DISTI_SPECIAL_MEM_FUN_DELETE;
912 inline std::istream& operator>>(
920 j = disti::GlsText::LEFT;
922 else if (str ==
"CENTER")
924 j = disti::GlsText::CENTER;
926 else if (str ==
"RIGHT")
928 j = disti::GlsText::RIGHT;
938 case disti::GlsText::LEFT:
941 case disti::GlsText::CENTER:
944 case disti::GlsText::RIGHT:
979 _charAttr = _text->CharAttr(0);
980 return _BaseClass::WriteValue(outstr);
987 _charAttr = _text->CharAttr(0);
989 _BaseClass::ReadValue(instr);
991 _text->Baseline(_charAttr.baselineShift);
992 _text->BgColor(_charAttr.bgColor);
993 _text->CharSpacing(_charAttr.spacing);
994 _text->TextColor(_charAttr.fgColor);
995 _text->FauxBold(_charAttr.fauxBold);
996 _text->Inverse(_charAttr.inverse);
997 _text->CharScaling(_charAttr.scale);
998 _text->StrikeThru(_charAttr.strikeThru);
999 _text->Underline(_charAttr.underline);
The DistiUnhideGlobalsDummyClass class.
virtual void Rotate(const Vector &orig, float angle, const Vector &axis)
Vector _vX
Definition: gls_text.h:834
void ShadowOffset(const Vector &offset)
virtual void SetValue(int spec, va_list &args)
bool _uppercase
Definition: gls_text.h:831
virtual bool OkToWrite() const
Definition: gls_text.h:972
bool ConstrainCellRatio() const
Definition: gls_text.h:447
#define GLS_UNICODE_FONT_NAME_PREFIX
Definition: gls_font_man.h:51
Definition: dynamic_array.h:63
virtual std::istream & ReadValue(std::istream &instr)
Definition: gls_text.h:982
char * FormatVarArgList(const int initialBufferLength, const char *format, va_list args)
The disti::GlsFontBase class and related classes.
The Polygon class. Implements Polygons.
Definition: glpolygon.h:56
bool _constrainRatio
Definition: gls_text.h:786
Attributes for each character position in the grid.
Definition: gls_text.h:173
Justify_t _justify
Definition: gls_text.h:801
float LineSpacing() const
Definition: gls_text.h:559
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
Definition: gls_text.h:958
void ShadowDistance(const float &dist)
Definition: gls_text.h:621
The disti::GLPolygon class. Implements Polygons.
float _cellHeight
Definition: gls_text.h:778
Definition: gls_text.h:152
std::string _text
Definition: gls_text.h:828
CharAttrCont_t _chars
Definition: gls_text.h:773
glsColor _shadowColor
Definition: gls_text.h:822
The Color class: Implements a 4 component RGBA color.
Justify_t
Different text justifications.
Definition: gls_text.h:165
float _lineSpacing
Definition: gls_text.h:804
Justify_t Justify() const
Definition: gls_text.h:547
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
float CellWidth() const
Definition: gls_text.h:390
bool LockCellSize() const
Definition: gls_text.h:573
The disti::GlsFontMan class.
VertexNoColor Vector
Definition: gls_font_base.h:68
bool _lockCellSize
Definition: gls_text.h:811
bool _controlCellSize
Definition: gls_text.h:789
float _border
Definition: gls_text.h:770
bool ControlCellSize() const
Definition: gls_text.h:461
CharAttr_t CharAttribs() const
Definition: gls_text.h:406
static void DrawScalableLine(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
Definition: gls_text.h:853
Definition: gls_text.h:204
bool WrapText() const
Definition: gls_text.h:703
virtual void Rotate(float angle, int axis=Z_AXIS)
GlsFontBase * Font() const
Definition: gls_text.h:486
Vector _vZ
Definition: gls_text.h:840
float _cellWidth
Definition: gls_text.h:781
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: gls_text.h:977
Definition: gls_color.h:54
CharAttr_t CharAttr(unsigned int index) const
Definition: gls_text.h:412
Vector _vY
Definition: gls_text.h:837
GlsFontBase * _font
Definition: gls_text.h:792
Definition: gls_metadata_attributes.h:556
The disti::GlsUnicodeFontBase class and related classes.
std::string String() const
Definition: gls_text.h:665
void SetRebuild()
Definition: gls_text.h:709
A smart pointer with unique ownership – poor man's std::unique_ptr.
virtual void CopyProperties(DisplayObject *src)
bool _wrapText
Definition: gls_text.h:843
ScopedPtr< RuntimeGlyphGenerationText > _runtimeGlyphGenerationText
Definition: gls_text.h:895
virtual void CopyGeometry(DisplayObject *src)
Vector _shadowOffset
Definition: gls_text.h:825
Macros and helper code to determine what subset of C++11/14/17 is available.
Definition: disti_metadata.h:83
bool _needToRebuild
Definition: gls_text.h:816
Definition: bmpimage.h:46
glsColor _haloColor
Definition: gls_text.h:798
void String(const char *s)
Definition: gls_text.h:655
float Border() const
Definition: gls_text.h:361
Definition: gls_text.h:717
The disti::GlsRuntimeFontBase class and related classes.
float CellHeight() const
Definition: gls_text.h:376
virtual void SetAvailableAttributes(unsigned int value)
Definition: gls_font_base.h:87
#define GLS_RUNTIME_FONT_NAME_PREFIX
Definition: gls_font_man.h:54