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 \
84 class GlsGloFileAttribute;
88 class RuntimeGlyphGenerationText;
93 GLS_TEXT_BORDER = GLS_LAST_INITIALIZER + 1,
96 GLS_TEXT_CONSTRAIN_CELL_RATIO,
97 GLS_TEXT_CONTROL_CELL_SIZE,
100 GLS_TEXT_LINESPACING,
101 GLS_TEXT_LOCK_CELL_SIZE,
107 GLS_LAST_TEXT_INITIALIZER = GLS_TEXT_WRAP
108 } GlsTextInitializers_t;
156 typedef GlsFontBase::Char_t Char_t;
159 static GLS_EXPORT
const Char_t EOL;
192 GLS_EXPORT CharAttr_t(
const CharAttr_t& r );
195 GLS_EXPORT
void Clear();
198 GLS_EXPORT CharAttr_t& operator=(
const CharAttr_t& r );
208 typedef unsigned short char_type;
209 typedef int int_type;
210 typedef std::streampos pos_type;
211 typedef std::streamoff off_type;
212 typedef std::mbstate_t state_type;
214 static void assign( char_type& c1,
const char_type& c2 )
219 static bool eq(
const char_type& c1,
const char_type& c2 )
224 static bool lt(
const char_type& c1,
const char_type& c2 )
229 static int compare(
const char_type* s1,
const char_type* s2,
size_t n )
239 return ( *s1 - *( s2 - 1 ) );
249 static size_t length(
const char_type* s )
259 static const char_type* find(
const char_type* s,
size_t n,
const char_type& a )
272 static char_type* move( char_type* s1,
const char_type* s2,
size_t n )
274 return static_cast<char_type*
>( memmove( s1, s2, n *
sizeof( char_type ) ) );
277 static char_type* copy( char_type* s1,
const char_type* s2,
size_t n )
279 return static_cast<char_type*
>( memcpy( s1, s2, n *
sizeof( char_type ) ) );
282 static char_type* assign( char_type* s,
size_t n, char_type a )
284 for(
size_t idx = 0u; idx < n; ++idx )
291 static char_type to_char_type(
const int_type& c )
293 return static_cast<char_type
>( c );
296 static int_type to_int_type(
const char_type& c )
298 return static_cast<int_type
>( c );
301 static bool eq_int_type(
const int_type& c1,
const int_type& c2 )
306 static int_type eof()
308 return static_cast<int_type
>( EOF );
311 static int_type not_eof(
const int_type& c )
313 return ( c == eof() ) ? 0 : c;
317 typedef std::basic_string<unsigned short, CharTraitsUnsignedShort> UnicodeString;
321 typedef std::wstring UnicodeString;
327 GLS_EXPORT
GlsText(
const GlsText& that,
const bool generateNames );
341 GLS_EXPORT
void Baseline(
const float& baselineShift );
359 GLS_EXPORT
void Border(
const float& units );
389 GLS_EXPORT
void CellWidth(
float width );
400 GLS_EXPORT
void Char( Char_t code );
423 GLS_EXPORT
void CharScaling(
const float& newScale );
434 GLS_EXPORT
void CharSpacing(
const float& horizontalSpacing );
475 GLS_EXPORT
void Erase();
480 GLS_EXPORT
void FauxBold(
const bool& bold );
511 GLS_EXPORT
void Halo(
bool halo );
521 GLS_EXPORT
void HaloColor(
const GlsColor& color );
523 GlsColor HaloColor()
const
537 GLS_EXPORT
void Inverse(
const bool& inverse );
580 #if !defined( GCC_2_95 )
586 virtual GLS_EXPORT
void Rotate(
const Vector& orig,
float angle,
const Vector& axis );
589 virtual GLS_EXPORT
void SetValue(
int spec, va_list& args );
601 GLS_EXPORT
void Shadow(
bool shadow );
611 GLS_EXPORT
void ShadowColor(
const GlsColor& color );
613 GlsColor ShadowColor()
const
633 GLS_EXPORT
void ShadowOffset(
const Vector& offset );
643 GLS_EXPORT
void StrikeThru(
const bool& strike );
652 GLS_EXPORT
void String(
const std::string& s );
659 String( std::string( s ) );
684 GLS_EXPORT
void Underline(
const bool& underline );
693 GLS_EXPORT
void Uppercase(
bool uppercase );
694 bool Uppercase()
const
702 GLS_EXPORT
void WrapText(
bool wrap );
741 , shadowOffsetX( 0.0f )
742 , shadowOffsetY( 0.0f )
747 const float segmentX1,
748 const float segmentX2,
749 const float segmentY,
750 const float segmentThickness,
751 const float segmentShadowOffsetX,
752 const float segmentShadowOffsetY,
757 , thickness( segmentThickness )
758 , shadowOffsetX( segmentShadowOffsetX )
759 , shadowOffsetY( segmentShadowOffsetY )
760 , color( segmentColor )
766 typedef std::vector<CharAttr_t> CharAttrCont_t;
768 static GLS_EXPORT
const Vector XAXIS;
769 static GLS_EXPORT
const Vector YAXIS;
771 static GLS_EXPORT
Vertex INITIAL_VERTICES[ NUM_VERTICES ];
782 Vertex _currentVertices[ NUM_VERTICES ];
867 glBegin( GL_POLYGON );
868 glVertex2f( x1, y1 );
869 glVertex2f( x1, y2 );
870 glVertex2f( x2, y2 );
871 glVertex2f( x2, y1 );
892 GLS_EXPORT
char*
FormatVarArgList(
const int initialBufferLength,
const char* format, va_list args );
898 GLS_EXPORT
void RecalcDirectionVectors();
905 virtual GLS_EXPORT
void OnCellDimensionChanged()
910 void operator=( const
GlsText& ) DISTI_SPECIAL_MEM_FUN_DELETE;
916 inline std::istream& operator>>(
924 j = disti::GlsText::LEFT;
926 else if( str ==
"CENTER" )
928 j = disti::GlsText::CENTER;
930 else if( str ==
"RIGHT" )
932 j = disti::GlsText::RIGHT;
942 case disti::GlsText::LEFT:
945 case disti::GlsText::CENTER:
948 case disti::GlsText::RIGHT:
983 _charAttr = _text->CharAttr( 0 );
984 return _BaseClass::WriteValue( outstr );
991 _charAttr = _text->CharAttr( 0 );
993 _BaseClass::ReadValue( instr );
995 _text->Baseline( _charAttr.baselineShift );
996 _text->BgColor( _charAttr.bgColor );
997 _text->CharSpacing( _charAttr.spacing );
998 _text->TextColor( _charAttr.fgColor );
999 _text->FauxBold( _charAttr.fauxBold );
1000 _text->Inverse( _charAttr.inverse );
1001 _text->CharScaling( _charAttr.scale );
1002 _text->StrikeThru( _charAttr.strikeThru );
1003 _text->Underline( _charAttr.underline );
The DistiUnhideGlobalsDummyClass class.
virtual void Rotate(const Vector &orig, float angle, const Vector &axis)
Vector _vX
Definition: gls_text.h:841
void ShadowOffset(const Vector &offset)
virtual void SetValue(int spec, va_list &args)
bool _uppercase
Definition: gls_text.h:838
virtual bool OkToWrite() const
Definition: gls_text.h:976
bool ConstrainCellRatio() const
Definition: gls_text.h:449
#define GLS_UNICODE_FONT_NAME_PREFIX
Definition: gls_font_man.h:50
Definition: dynamic_array.h:62
virtual std::istream & ReadValue(std::istream &instr)
Definition: gls_text.h:986
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:55
bool _constrainRatio
Definition: gls_text.h:793
Attributes for each character position in the grid.
Definition: gls_text.h:175
Justify_t _justify
Definition: gls_text.h:808
virtual bool RequiresFontFile() const
Definition: gls_text.h:718
float LineSpacing() const
Definition: gls_text.h:561
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
Definition: gls_text.h:962
void ShadowDistance(const float &dist)
Definition: gls_text.h:623
The disti::GLPolygon class. Implements Polygons.
float _cellHeight
Definition: gls_text.h:785
Definition: gls_text.h:151
std::string _text
Definition: gls_text.h:835
CharAttrCont_t _chars
Definition: gls_text.h:780
The Color class: Implements a 4 component RGBA color.
Justify_t
Different text justifications.
Definition: gls_text.h:167
float _lineSpacing
Definition: gls_text.h:811
Definition: gls_glo_file.h:982
Definition: gls_unicode_font_base.h:65
std::ostream & operator<<(std::ostream &outstr, const AttributeName &name)
Defines the stream out operator.
Justify_t Justify() const
Definition: gls_text.h:549
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
ScopedPtr< RuntimeGlyphGenerationText > _runtimeGlyphGenerationText
Definition: gls_text.h:901
void InvalidatePainter()
Definition: display.h:1717
GlsRuntimeFontBase * GetGlsRuntimeFontBase(const GlsFontBase *font)
Definition: gls_text.h:114
float CellWidth() const
Definition: gls_text.h:392
bool LockCellSize() const
Definition: gls_text.h:575
The disti::GlsFontMan class.
VertexNoColor Vector
Definition: gls_font_base.h:66
bool _lockCellSize
Definition: gls_text.h:818
bool _controlCellSize
Definition: gls_text.h:796
float _border
Definition: gls_text.h:777
bool ControlCellSize() const
Definition: gls_text.h:463
CharAttr_t CharAttribs() const
Definition: gls_text.h:408
GlsColor _haloColor
Definition: gls_text.h:805
Definition: gls_runtime_font_base.h:66
static void DrawScalableLine(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
Definition: gls_text.h:860
Definition: gls_text.h:206
bool WrapText() const
Definition: gls_text.h:705
Definition: gls_color.h:53
virtual void Rotate(float angle, int axis=Z_AXIS)
GlsFontBase * Font() const
Definition: gls_text.h:488
Vector _vZ
Definition: gls_text.h:847
float _cellWidth
Definition: gls_text.h:788
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: gls_text.h:981
CharAttr_t CharAttr(unsigned int index) const
Definition: gls_text.h:414
Vector _vY
Definition: gls_text.h:844
GlsFontBase * _font
Definition: gls_text.h:799
Definition: gls_metadata_attributes.h:594
The disti::GlsUnicodeFontBase class and related classes.
std::string String() const
Definition: gls_text.h:667
void SetRebuild()
Definition: gls_text.h:711
A smart pointer with unique ownership – poor man's std::unique_ptr.
virtual void CopyProperties(DisplayObject *src)
bool _wrapText
Definition: gls_text.h:850
const GlsUnicodeFontBase * GetGlsUnicodeFontBase(const GlsFontBase *font)
Definition: gls_text.h:132
std::string Family() const
Definition: gls_font_base.h:258
virtual void CopyGeometry(DisplayObject *src)
Vector _shadowOffset
Definition: gls_text.h:832
Macros and helper code to determine what subset of C++11/14/17 is available.
Definition: disti_metadata.h:84
bool _needToRebuild
Definition: gls_text.h:823
Definition: bmpimage.h:46
void String(const char *s)
Definition: gls_text.h:657
float Border() const
Definition: gls_text.h:363
Definition: gls_text.h:725
The disti::GlsRuntimeFontBase class and related classes.
float CellHeight() const
Definition: gls_text.h:378
virtual void SetAvailableAttributes(unsigned int value)
GlsColor _shadowColor
Definition: gls_text.h:829
Definition: gls_font_base.h:85
#define GLS_RUNTIME_FONT_NAME_PREFIX
Definition: gls_font_man.h:53