39#ifndef DISTI_INCLUDED_GLS_TEXT_H
40#define DISTI_INCLUDED_GLS_TEXT_H
62# define GLS_TEXT_SET_GEOMETRY_REFRESH GeometryRefresh();
64# 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 \
84class GlsGloFileAttribute;
88class 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
154 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
451#if !defined( GCC_2_95 )
529 String( std::string( s ) );
626 const float segmentX1,
627 const float segmentX2,
628 const float segmentY,
629 const float segmentThickness,
630 const float segmentShadowOffsetX,
631 const float segmentShadowOffsetY,
639 ,
color( segmentColor )
741 glBegin( GL_POLYGON );
742 glVertex2f( x1, y1 );
743 glVertex2f( x1, y2 );
744 glVertex2f( x2, y2 );
745 glVertex2f( x2, y1 );
769 virtual void OnCellDimensionChanged()
788 j = disti::GlsText::LEFT;
790 else if( str ==
"CENTER" )
792 j = disti::GlsText::CENTER;
794 else if( str ==
"RIGHT" )
796 j = disti::GlsText::RIGHT;
809 case disti::GlsText::LEFT:
812 case disti::GlsText::CENTER:
815 case disti::GlsText::RIGHT:
832 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
Definition: disti_metadata.h:87
virtual void Rotate(float angle, int axis=Z_AXIS)
Definition: gls_metadata_attributes.h:478
std::istream & ReadValue(std::istream &instr) override
std::ostream & WriteValue(std::ostream &outstr) override
DistiAttribDict * _dict
An observing pointer to a dictionary of attributes.
Definition: gls_metadata_attributes.h:480
Definition: dynamic_array.h:79
The Polygon class. Implements Polygons.
Definition: glpolygon.h:55
Definition: gls_color.h:53
Definition: gls_font_base.h:86
std::string Family() const
Definition: gls_font_base.h:274
Definition: gls_glo_file.h:1241
Definition: gls_runtime_font_base.h:66
Definition: gls_text.h:830
GlsText::CharAttr_t _charAttr
Character attribute structure to apply to text.
Definition: gls_text.h:882
bool OkToWrite() const override
Definition: gls_text.h:847
std::istream & ReadValue(std::istream &instr) override
Definition: gls_text.h:858
std::ostream & WriteValue(std::ostream &outstr) override
Definition: gls_text.h:852
GlsText * _text
Observing pointer to the text object holding the attributes.
Definition: gls_text.h:881
Definition: gls_text.h:597
float x2
Right side of the segment.
Definition: gls_text.h:600
float x1
Left side of the segment.
Definition: gls_text.h:599
float shadowOffsetY
Y offset of the shadow in logical units.
Definition: gls_text.h:604
LineSegment_t(const float segmentX1, const float segmentX2, const float segmentY, const float segmentThickness, const float segmentShadowOffsetX, const float segmentShadowOffsetY, const GlsColor &segmentColor)
Definition: gls_text.h:625
float thickness
Thickness of the segment in logical units.
Definition: gls_text.h:602
GlsColor color
Color the segment is to be drawn.
Definition: gls_text.h:605
float y
Vertical position of the segment.
Definition: gls_text.h:601
float shadowOffsetX
X offset of the shadow in logical units.
Definition: gls_text.h:603
Definition: gls_text.h:152
static const Vector XAXIS
Vector for the global X axis.
Definition: gls_text.h:647
float _cellWidth
Definition: gls_text.h:667
virtual CharAttr_t CharAttr(unsigned int index) const
Definition: gls_text.h:295
virtual void TextColor(const GlsColor &color)
virtual bool Halo() const
Definition: gls_text.h:384
virtual void String(const std::string &s)
GlsColor _haloColor
Definition: gls_text.h:683
void SetAvailableAttributes(unsigned int value) override
Justify_t
Different text justifications.
Definition: gls_text.h:169
virtual Justify_t Justify() const
Definition: gls_text.h:420
virtual char * FormatVarArgList(const int initialBufferLength, const char *format, va_list args)
std::vector< CharAttr_t > CharAttrCont_t
Typedef for a list of character attributes.
Definition: gls_text.h:645
virtual void Justify(Justify_t justification)
void CopyProperties(DisplayObject *src) override
virtual bool RequiresFontFile() const
Definition: gls_text.h:589
virtual void ShadowOffset(const Vector &offset)
virtual float Border() const
Definition: gls_text.h:243
float _lineSpacing
Definition: gls_text.h:689
Vector _shadowOffset
Definition: gls_text.h:709
virtual float CellWidth() const
Definition: gls_text.h:272
virtual GlsColor BgColor()
virtual void Font(GlsFontBase *font)
virtual Vector ShadowOffset()
Definition: gls_text.h:506
GlsText(const GlsText &that, const bool generateNames)
virtual void HaloColor(const GlsColor &color)
virtual void Char(Char_t code)
float _border
Definition: gls_text.h:656
void CopyGeometry(DisplayObject *src) override
bool _uppercase
Definition: gls_text.h:715
void SetValue(int spec, va_list &args) override
virtual void String(const char *s)
Definition: gls_text.h:527
ScopedPtr< RuntimeGlyphGenerationText > _runtimeGlyphGenerationText
Definition: gls_text.h:765
virtual float CharSpacing()
virtual GlsFontBase * Font() const
Definition: gls_text.h:363
virtual bool LockCellSize() const
Definition: gls_text.h:446
bool _needToRebuild
Definition: gls_text.h:701
virtual GlsColor TextColor()
virtual void SetRebuild()
Definition: gls_text.h:581
virtual void CellWidth(float width)
InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) override
float _cellHeight
Definition: gls_text.h:664
virtual void Uppercase(bool uppercase)
virtual bool Uppercase() const
Definition: gls_text.h:564
static const Char_t EOL
Carriage return (end of line) character.
Definition: gls_text.h:160
virtual void Border(const float &units)
virtual void CellHeight(float height)
virtual CharAttr_t CharAttribs() const
Definition: gls_text.h:288
virtual float CharScaling()
Vertex _currentVertices[NUM_VERTICES]
The corners of the text object.
Definition: gls_text.h:661
virtual void Inverse(const bool &inverse)
virtual float CellHeight() const
Definition: gls_text.h:258
virtual bool StrikeThru()
virtual bool ControlCellSize() const
Definition: gls_text.h:342
virtual void Baseline(const float &baselineShift)
static const Vector YAXIS
Vector for the global Y axis.
Definition: gls_text.h:648
CharAttrCont_t _chars
Definition: gls_text.h:659
virtual void CharScaling(const float &newScale)
bool _halo
Whether or not the halo effect is on.
Definition: gls_text.h:680
virtual GlsColor HaloColor() const
Definition: gls_text.h:395
bool _shadow
Whether or not the shadow effect is on.
Definition: gls_text.h:703
virtual void BgColor(const GlsColor &color)
virtual bool Shadow() const
Definition: gls_text.h:472
virtual void ConstrainCellRatio(bool constrain)
virtual std::string String() const
Definition: gls_text.h:537
static Vertex INITIAL_VERTICES[NUM_VERTICES]
Default corners for new text objects.
Definition: gls_text.h:650
virtual void ControlCellSize(bool control)
virtual bool WrapText() const
Definition: gls_text.h:575
virtual void ShadowDistance(const float &dist)
Definition: gls_text.h:493
virtual void CharSpacing(const float &horizontalSpacing)
bool _lockCellSize
Definition: gls_text.h:696
void GetCppInterfaceDescriptionFree(InterfaceListType *array) override
bool _wrapText
Definition: gls_text.h:727
void Rotate(const Vector &orig, float angle, const Vector &axis) override
bool _constrainRatio
Definition: gls_text.h:672
GlsFontBase::Char_t Char_t
Typedef shorthand for GlsFontBase::Char_t.
Definition: gls_text.h:158
virtual void Underline(const bool &underline)
virtual float LineSpacing() const
Definition: gls_text.h:432
GlsColor _shadowColor
Definition: gls_text.h:706
virtual void LineSpacing(float spacing)
Vector _vZ
Definition: gls_text.h:724
virtual void ShadowColor(const GlsColor &color)
virtual void Shadow(bool shadow)
GlsFontBase * _font
Definition: gls_text.h:678
virtual void Halo(bool halo)
virtual void FauxBold(const bool &bold)
virtual void LockCellSize(bool lock)
virtual void WrapText(bool wrap)
virtual void RecalcDirectionVectors()
virtual GlsColor ShadowColor() const
Definition: gls_text.h:483
virtual void InvalidateFont()
bool _controlCellSize
Definition: gls_text.h:675
static void DrawScalableLine(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
Definition: gls_text.h:738
virtual void StrikeThru(const bool &strike)
Justify_t _justify
Definition: gls_text.h:686
std::string _text
Definition: gls_text.h:712
Vector _vX
Definition: gls_text.h:718
Vector _vY
Definition: gls_text.h:721
virtual bool ConstrainCellRatio() const
Definition: gls_text.h:328
Definition: gls_unicode_font_base.h:65
The disti::GLPolygon class. Implements Polygons.
The Color class: Implements a 4 component RGBA color.
Macros and helper code to determine what subset of C++11/14/17 is available.
#define DISTI_SPECIAL_MEM_FUN_DELETE
Macro to wrap function deletion, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:245
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:487
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:221
The disti::GlsFontBase class and related classes.
The disti::GlsFontMan class.
#define GLS_RUNTIME_FONT_NAME_PREFIX
Definition: gls_font_man.h:52
#define GLS_UNICODE_FONT_NAME_PREFIX
Definition: gls_font_man.h:49
#define GLS_EXPORT
Macro denoting which functions should be visible from the runtime library.
Definition: gls_include.h:50
The disti::GlsRuntimeFontBase class and related classes.
std::istream & operator>>(std::istream &instr, disti::GlsText::CharAttr_t &c)
std::ostream & operator<<(std::ostream &outstr, const disti::GlsText::CharAttr_t &c)
The disti::GlsUnicodeFontBase class and related classes.
Definition: bmpimage.h:46
std::ostream & operator<<(std::ostream &outstr, const AttributeName &name)
GlsRuntimeFontBase * GetGlsRuntimeFontBase(const GlsFontBase *font)
Definition: gls_text.h:114
VertexNoColor Vector
Definition: gls_font_base.h:68
GlsTextInitializers_t
Initializers for text.
Definition: gls_text.h:92
std::istream & operator>>(std::istream &instr, GlsColor &color)
const GlsUnicodeFontBase * GetGlsUnicodeFontBase(const GlsFontBase *font)
Definition: gls_text.h:132
A smart pointer with unique ownership – poor man's std::unique_ptr.
Attributes for each character position in the grid.
Definition: gls_text.h:177
bool fauxBold
Whether or not faux bold is enabled.
Definition: gls_text.h:182
GlsColor bgColor
The background color.
Definition: gls_text.h:180
float scale
Scaled size of this character.
Definition: gls_text.h:184
bool inverse
Whether or not inverse is enabled.
Definition: gls_text.h:183
CharAttr_t & operator=(const CharAttr_t &r)
Char_t code
The code point for this character.
Definition: gls_text.h:178
float baselineShift
The base line shift in pixels.
Definition: gls_text.h:179
bool underline
Whether or not underline is enabled.
Definition: gls_text.h:187
void Clear()
Reset values to their defaults.
CharAttr_t(const CharAttr_t &r)
float spacing
Scale of spacing between this character.
Definition: gls_text.h:185
GlsColor fgColor
The foreground (glyph itself) color.
Definition: gls_text.h:181
bool strikeThru
Whether or not strike through is enabled.
Definition: gls_text.h:186
The DistiUnhideGlobalsDummyClass class.