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 );
740 , shadowOffsetX( 0.0f )
741 , shadowOffsetY( 0.0f )
746 const float segmentX1,
747 const float segmentX2,
748 const float segmentY,
749 const float segmentThickness,
750 const float segmentShadowOffsetX,
751 const float segmentShadowOffsetY,
756 , thickness( segmentThickness )
757 , shadowOffsetX( segmentShadowOffsetX )
758 , shadowOffsetY( segmentShadowOffsetY )
759 , color( segmentColor )
765 typedef std::vector<CharAttr_t> CharAttrCont_t;
767 static GLS_EXPORT
const Vector XAXIS;
768 static GLS_EXPORT
const Vector YAXIS;
770 static GLS_EXPORT
Vertex INITIAL_VERTICES[ NUM_VERTICES ];
781 Vertex _currentVertices[ NUM_VERTICES ];
866 glBegin( GL_POLYGON );
867 glVertex2f( x1, y1 );
868 glVertex2f( x1, y2 );
869 glVertex2f( x2, y2 );
870 glVertex2f( x2, y1 );
891 GLS_EXPORT
char*
FormatVarArgList(
const int initialBufferLength,
const char* format, va_list args );
897 GLS_EXPORT
void RecalcDirectionVectors();
904 virtual GLS_EXPORT
void OnCellDimensionChanged()
909 void operator=( const
GlsText& ) DISTI_SPECIAL_MEM_FUN_DELETE;
915 inline std::istream& operator>>(
923 j = disti::GlsText::LEFT;
925 else if( str ==
"CENTER" )
927 j = disti::GlsText::CENTER;
929 else if( str ==
"RIGHT" )
931 j = disti::GlsText::RIGHT;
941 case disti::GlsText::LEFT:
944 case disti::GlsText::CENTER:
947 case disti::GlsText::RIGHT:
982 _charAttr = _text->CharAttr( 0 );
983 return _BaseClass::WriteValue( outstr );
990 _charAttr = _text->CharAttr( 0 );
992 _BaseClass::ReadValue( instr );
994 _text->Baseline( _charAttr.baselineShift );
995 _text->BgColor( _charAttr.bgColor );
996 _text->CharSpacing( _charAttr.spacing );
997 _text->TextColor( _charAttr.fgColor );
998 _text->FauxBold( _charAttr.fauxBold );
999 _text->Inverse( _charAttr.inverse );
1000 _text->CharScaling( _charAttr.scale );
1001 _text->StrikeThru( _charAttr.strikeThru );
1002 _text->Underline( _charAttr.underline );
The DistiUnhideGlobalsDummyClass class.
virtual void Rotate(const Vector &orig, float angle, const Vector &axis)
Vector _vX
Definition: gls_text.h:840
void ShadowOffset(const Vector &offset)
virtual void SetValue(int spec, va_list &args)
bool _uppercase
Definition: gls_text.h:837
virtual bool OkToWrite() const
Definition: gls_text.h:975
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:985
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:792
Attributes for each character position in the grid.
Definition: gls_text.h:175
Justify_t _justify
Definition: gls_text.h:807
virtual bool RequiresFontFile() const
Definition: gls_text.h:717
float LineSpacing() const
Definition: gls_text.h:561
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
Definition: gls_text.h:961
void ShadowDistance(const float &dist)
Definition: gls_text.h:623
The disti::GLPolygon class. Implements Polygons.
float _cellHeight
Definition: gls_text.h:784
Definition: gls_text.h:151
std::string _text
Definition: gls_text.h:834
CharAttrCont_t _chars
Definition: gls_text.h:779
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:810
Definition: gls_glo_file.h:835
Definition: gls_unicode_font_base.h:65
Justify_t Justify() const
Definition: gls_text.h:549
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
ScopedPtr< RuntimeGlyphGenerationText > _runtimeGlyphGenerationText
Definition: gls_text.h:900
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:817
bool _controlCellSize
Definition: gls_text.h:795
float _border
Definition: gls_text.h:776
bool ControlCellSize() const
Definition: gls_text.h:463
CharAttr_t CharAttribs() const
Definition: gls_text.h:408
GlsColor _haloColor
Definition: gls_text.h:804
Definition: gls_runtime_font_base.h:66
static void DrawScalableLine(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
Definition: gls_text.h:859
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:846
float _cellWidth
Definition: gls_text.h:787
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: gls_text.h:980
CharAttr_t CharAttr(unsigned int index) const
Definition: gls_text.h:414
Vector _vY
Definition: gls_text.h:843
GlsFontBase * _font
Definition: gls_text.h:798
Definition: gls_metadata_attributes.h:591
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:849
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:831
Macros and helper code to determine what subset of C++11/14/17 is available.
Definition: disti_metadata.h:79
bool _needToRebuild
Definition: gls_text.h:822
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:724
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:828
Definition: gls_font_base.h:85
#define GLS_RUNTIME_FONT_NAME_PREFIX
Definition: gls_font_man.h:53