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 \
82 #pragma GCC diagnostic push
83 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
90 class GlsGloFileAttribute;
94 class RuntimeGlyphGenerationText;
99 GLS_TEXT_BORDER = GLS_LAST_INITIALIZER + 1,
100 GLS_TEXT_CELL_HEIGHT,
102 GLS_TEXT_CONSTRAIN_CELL_RATIO,
103 GLS_TEXT_CONTROL_CELL_SIZE,
106 GLS_TEXT_LINESPACING,
107 GLS_TEXT_LOCK_CELL_SIZE,
113 GLS_LAST_TEXT_INITIALIZER = GLS_TEXT_WRAP
114 } GlsTextInitializers_t;
120 static GlsRuntimeFontBase* GetGlsRuntimeFontBase(
const GlsFontBase *font )
122 GlsRuntimeFontBase *rtf = NULL;
128 rtf =
static_cast< GlsRuntimeFontBase*
>( (GlsFontBase *)font );
138 static const GlsUnicodeFontBase* GetGlsUnicodeFontBase(
const GlsFontBase *font )
140 const GlsUnicodeFontBase *unf = NULL;
146 unf =
static_cast< const GlsUnicodeFontBase*
>( font );
162 typedef GlsFontBase::Char_t Char_t;
165 static GLS_EXPORT
const Char_t EOL;
167 enum { NUM_VERTICES = 4 };
195 GLS_EXPORT CharAttr_t(
const CharAttr_t& r);
198 GLS_EXPORT
void Clear();
201 GLS_EXPORT CharAttr_t& operator=(
const CharAttr_t& r);
211 typedef unsigned short char_type;
212 typedef int int_type;
213 typedef std::streampos pos_type;
214 typedef std::streamoff off_type;
215 typedef std::mbstate_t state_type;
217 static void assign(char_type& c1,
const char_type& c2)
222 static bool eq(
const char_type& c1,
const char_type& c2)
227 static bool lt(
const char_type& c1,
const char_type& c2)
232 static int compare(
const char_type* s1,
const char_type* s2,
size_t n)
242 return (*s1 - *(s2 - 1));
252 static size_t length(
const char_type* s)
262 static const char_type* find(
const char_type* s,
size_t n,
const char_type& a)
275 static char_type* move(char_type* s1,
const char_type* s2,
size_t n)
277 return static_cast<char_type*
>(memmove(s1, s2, n *
sizeof( char_type ) ));
280 static char_type* copy(char_type* s1,
const char_type* s2,
size_t n)
282 return static_cast<char_type*
>(memcpy(s1, s2, n *
sizeof( char_type ) ));
285 static char_type* assign(char_type* s,
size_t n, char_type a)
287 for(
size_t idx = 0u; idx < n; ++idx )
294 static char_type to_char_type(
const int_type& c)
296 return static_cast<char_type
>(c);
299 static int_type to_int_type(
const char_type& c)
301 return static_cast<int_type
>(c);
304 static bool eq_int_type(
const int_type& c1,
const int_type& c2)
309 static int_type eof()
311 return static_cast<int_type
>(EOF);
314 static int_type not_eof(
const int_type& c)
316 return (c == eof()) ? 0 : c;
320 typedef std::basic_string< unsigned short, CharTraitsUnsignedShort > UnicodeString;
324 typedef std::wstring UnicodeString;
330 GLS_EXPORT
GlsText(
const GlsText& that,
const bool generateNames );
344 GLS_EXPORT
void Baseline(
const float& baselineShift);
362 GLS_EXPORT
void Border(
const float& units);
392 GLS_EXPORT
void CellWidth(
float width );
403 GLS_EXPORT
void Char(Char_t code);
426 GLS_EXPORT
void CharScaling(
const float& newScale);
437 GLS_EXPORT
void CharSpacing(
const float& horizontalSpacing);
478 GLS_EXPORT
void Erase();
483 GLS_EXPORT
void FauxBold(
const bool& bold);
514 GLS_EXPORT
void Halo(
bool halo);
524 GLS_EXPORT
void HaloColor(
const glsColor& color);
526 glsColor HaloColor()
const
540 GLS_EXPORT
void Inverse(
const bool& inverse);
583 #if !defined(GCC_2_95)
592 virtual GLS_EXPORT
void SetValue(
int spec, va_list& args);
598 virtual GLS_EXPORT
void SetFromGloData(GlsGloFileAttribute &data);
604 GLS_EXPORT
void Shadow(
bool shadow);
614 GLS_EXPORT
void ShadowColor(
const glsColor& color);
616 glsColor ShadowColor()
const
636 GLS_EXPORT
void ShadowOffset(
const Vector& offset);
646 GLS_EXPORT
void StrikeThru(
const bool& strike);
655 GLS_EXPORT
void String(
const std::string& s);
687 GLS_EXPORT
void Underline(
const bool& underline);
696 GLS_EXPORT
void Uppercase(
bool uppercase);
697 bool Uppercase()
const
705 GLS_EXPORT
void WrapText(
bool wrap);
745 const float segmentX1,
746 const float segmentX2,
747 const float segmentY,
748 const float segmentThickness,
749 const float segmentShadowOffsetX,
750 const float segmentShadowOffsetY,
755 thickness(segmentThickness),
756 shadowOffsetX(segmentShadowOffsetX),
757 shadowOffsetY(segmentShadowOffsetY),
764 typedef std::vector<CharAttr_t> CharAttrCont_t;
766 static GLS_EXPORT
const Vector XAXIS;
767 static GLS_EXPORT
const Vector YAXIS;
769 static GLS_EXPORT
Vertex INITIAL_VERTICES[NUM_VERTICES];
780 Vertex _currentVertices[NUM_VERTICES];
891 GLS_EXPORT
char*
FormatVarArgList(
const int initialBufferLength,
const char* format, va_list args );
897 GLS_EXPORT
void RecalcDirectionVectors();
905 virtual GLS_EXPORT
void OnCellDimensionChanged()
910 void operator=( const
GlsText& ) DISTI_SPECIAL_MEM_FUN_DELETE;
917 inline std::istream& operator>>(
925 j = disti::GlsText::LEFT;
927 else if (str ==
"CENTER")
929 j = disti::GlsText::CENTER;
931 else if (str ==
"RIGHT")
933 j = disti::GlsText::RIGHT;
943 case disti::GlsText::LEFT:
946 case disti::GlsText::CENTER:
949 case disti::GlsText::RIGHT:
984 _charAttr = _text->CharAttr(0);
985 return _BaseClass::WriteValue(outstr);
992 _charAttr = _text->CharAttr(0);
994 _BaseClass::ReadValue(instr);
996 _text->Baseline(_charAttr.baselineShift);
997 _text->BgColor(_charAttr.bgColor);
998 _text->CharSpacing(_charAttr.spacing);
999 _text->TextColor(_charAttr.fgColor);
1000 _text->FauxBold(_charAttr.fauxBold);
1001 _text->Inverse(_charAttr.inverse);
1002 _text->CharScaling(_charAttr.scale);
1003 _text->StrikeThru(_charAttr.strikeThru);
1004 _text->Underline(_charAttr.underline);
1018 #pragma GCC diagnostic pop
The DistiUnhideGlobalsDummyClass class.
virtual void Rotate(const Vector &orig, float angle, const Vector &axis)
void ShadowOffset(const Vector &offset)
virtual void SetValue(int spec, va_list &args)
bool _uppercase
Definition: gls_text.h:836
virtual bool OkToWrite() const
Definition: gls_text.h:977
bool ConstrainCellRatio() const
Definition: gls_text.h:452
#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:987
char * FormatVarArgList(const int initialBufferLength, const char *format, va_list args)
Vector _Vz
Definition: gls_text.h:845
The disti::GlsFontBase class and related classes.
The Polygon class. Implements Polygons.
Definition: glpolygon.h:56
bool _constrainRatio
Definition: gls_text.h:791
Attributes for each character position in the grid.
Definition: gls_text.h:178
Justify_t _justify
Definition: gls_text.h:806
float LineSpacing() const
Definition: gls_text.h:564
std::auto_ptr< RuntimeGlyphGenerationText > _runtimeGlyphGenerationText
Definition: gls_text.h:900
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
Definition: gls_text.h:963
void ShadowDistance(const float &dist)
Definition: gls_text.h:626
The disti::GLPolygon class. Implements Polygons.
float _cellHeight
Definition: gls_text.h:783
Definition: gls_text.h:157
std::string _text
Definition: gls_text.h:833
CharAttrCont_t _chars
Definition: gls_text.h:778
glsColor _shadowColor
Definition: gls_text.h:827
Vector _Vx
Definition: gls_text.h:839
The Color class: Implements a 4 component RGBA color.
Justify_t
Different text justifications.
Definition: gls_text.h:170
float _lineSpacing
Definition: gls_text.h:809
Justify_t Justify() const
Definition: gls_text.h:552
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
float CellWidth() const
Definition: gls_text.h:395
bool LockCellSize() const
Definition: gls_text.h:578
The disti::GlsFontMan class.
VertexNoColor Vector
Definition: gls_font_base.h:68
bool _lockCellSize
Definition: gls_text.h:816
bool _controlCellSize
Definition: gls_text.h:794
float _border
Definition: gls_text.h:775
bool ControlCellSize() const
Definition: gls_text.h:466
CharAttr_t CharAttribs() const
Definition: gls_text.h:411
static void DrawScalableLine(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
Definition: gls_text.h:858
Definition: gls_text.h:209
bool WrapText() const
Definition: gls_text.h:708
virtual void Rotate(float angle, int axis=Z_AXIS)
GlsFontBase * Font() const
Definition: gls_text.h:491
float _cellWidth
Definition: gls_text.h:786
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: gls_text.h:982
Definition: gls_color.h:54
CharAttr_t CharAttr(unsigned int index) const
Definition: gls_text.h:417
Vector _Vy
Definition: gls_text.h:842
GlsFontBase * _font
Definition: gls_text.h:797
Definition: gls_metadata_attributes.h:556
The disti::GlsUnicodeFontBase class and related classes.
std::string String() const
Definition: gls_text.h:670
void SetRebuild()
Definition: gls_text.h:714
virtual void CopyProperties(DisplayObject *src)
bool _wrapText
Definition: gls_text.h:848
virtual void CopyGeometry(DisplayObject *src)
Vector _shadowOffset
Definition: gls_text.h:830
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:821
Definition: bmpimage.h:46
glsColor _haloColor
Definition: gls_text.h:803
void String(const char *s)
Definition: gls_text.h:660
float Border() const
Definition: gls_text.h:366
Definition: gls_text.h:722
The disti::GlsRuntimeFontBase class and related classes.
float CellHeight() const
Definition: gls_text.h:381
virtual void SetAvailableAttributes(unsigned int value)
Definition: gls_font_base.h:87
#define GLS_RUNTIME_FONT_NAME_PREFIX
Definition: gls_font_man.h:54