Class: ewol::Text


Synopsis:

+  ewol::Drawing &  getDrawing              (void);
+ Text (const std::string & _fontName,
int32_t _fontSize);
+ ~Text (void);
+ void translate (const vec3 & _vect);
+ void rotate (const vec3 & _vect,
float _angle);
+ void scale (const vec3 & _vect);
+ void draw (bool _disableDepthTest);
+ void draw (const mat4 & _transformationMatrix,
bool _enableDepthTest);
+ void clear (void);
+ void reset (void);
+ const vec3 & getPos (void);
+ void setPos (const vec3 & _pos);
+ void setPos (const vec2 & _pos);
+ void setRelPos (const vec3 & _pos);
+ void setRelPos (const vec2 & _pos);
+ void setColor (const etk::Color<> & _color);
+ void setColorBg (const etk::Color<> & _color);
+ void setClippingWidth (const vec3 & _pos,
const vec3 & _width);
+ void setClippingWidth (const vec2 & _pos,
const vec2 & _width);
+ void setClipping (const vec3 & _pos,
const vec3 & _posEnd);
+ void setClipping (const vec2 & _pos,
const vec2 & _posEnd);
+ void setClippingMode (bool _newMode);
+ void setFontSize (int32_t _fontSize);
+ void setFontName (const std::string & _fontName);
+ void setFont (std::string _fontName,
int32_t _fontSize);
+ void setFontMode (enum ewol::font::mode _mode);
+ void setFontBold (bool _status);
+ void setFontItalic (bool _status);
+ void setKerningMode (bool _newMode);
+ void setDistanceFieldMode (bool _newMode);
+ void print (const std::string & _text);
+ void print (const std::u32string & _text);
+ void printDecorated (const std::string & _text);
+ void printHTML (const std::string & _text);
+ void print (const std::string & _text,
const std::vector & _decoration);
+ void print (const std::u32string & _text,
const std::vector & _decoration);
+ void print (const char32_t & _charcode);
+ void forceLineReturn (void);
+ void setTextAlignement (float _startTextpos,
float _stopTextPos,
enum ewol::Text::aligneMode _alignement);
+ void disableAlignement (void);
+ vec3 calculateSizeHTML (const std::string & _text);
+ vec3 calculateSizeDecorated (const std::string & _text);
+ vec3 calculateSize (const std::string & _text);
+ vec3 calculateSize (const char32_t & _charcode);
+ void printCursor (bool _isInsertMode,
float _cursorSize);
+ void disableCursor (void);
+ void setCursorPos (int32_t _cursorPos);
+ void setCursorSelection (int32_t _cursorPos,
int32_t _selectionStartPos);
+ void setSelectionColor (const etk::Color<> & _color);
+ void setCursorColor (const etk::Color<> & _color);
- void loadProgram (void);
- void parseHtmlNode (exml::Element * _element);
- bool extrapolateLastId (const std::string & _text,
const int32_t _start,
int32_t & _stop,
int32_t & _space,
int32_t & _freeSpace);
- bool extrapolateLastId (const std::u32string & _text,
const int32_t _start,
int32_t & _stop,
int32_t & _space,
int32_t & _freeSpace);
- void htmlAddData (const std::string & _data);
- void htmlFlush (void);

Object Hierarchy:

ewol::Compositing
    +--> ewol::Text

Detail:

getDrawing ()

ewol::Drawing & getDrawing(void);



ewol::Text ()

Text(const std::string & _fontName,
     int32_t _fontSize);

generic constructor


ewol::~Text ()

~Text(void);

generic destructor


translate ()

void translate(const vec3 & _vect);



rotate ()

void rotate(const vec3 & _vect,
            float _angle);



scale ()

void scale(const vec3 & _vect);



draw ()

void draw(bool _disableDepthTest);

draw All the refistered text in the current element on openGL


draw ()

void draw(const mat4 & _transformationMatrix,
          bool _enableDepthTest);



clear ()

void clear(void);

clear all the registered element in the current element


reset ()

void reset(void);

clear all the intermediate result detween 2 prints


getPos ()

const vec3 & getPos(void);

get the current display position (sometime needed in the gui control)


setPos ()

void setPos(const vec3 & _pos);

set position for the next text writen


setPos ()

void setPos(const vec2 & _pos);



setRelPos ()

void setRelPos(const vec3 & _pos);

set relative position for the next text writen


setRelPos ()

void setRelPos(const vec2 & _pos);



setColor ()

void setColor(const etk::Color<> & _color);

set the Color of the current foreground font


setColorBg ()

void setColorBg(const etk::Color<> & _color);

set the background color of the font (for selected Text (not the global BG))


setClippingWidth ()

void setClippingWidth(const vec3 & _pos,
                      const vec3 & _width);

Request a clipping area for the text (next draw only)


setClippingWidth ()

void setClippingWidth(const vec2 & _pos,
                      const vec2 & _width);



setClipping ()

void setClipping(const vec3 & _pos,
                 const vec3 & _posEnd);

Request a clipping area for the text (next draw only)


setClipping ()

void setClipping(const vec2 & _pos,
                 const vec2 & _posEnd);



setClippingMode ()

void setClippingMode(bool _newMode);

enable/Disable the clipping (without lose the current clipping position)
_newMode The new status of the clipping


setFontSize ()

void setFontSize(int32_t _fontSize);

Specify the font size (this reset the internal element of the current text (system requirement)


setFontName ()

void setFontName(const std::string & _fontName);

Specify the font name (this reset the internal element of the current text (system requirement)


setFont ()

void setFont(std::string _fontName,
             int32_t _fontSize);

Specify the font property (this reset the internal element of the current text (system requirement)


setFontMode ()

void setFontMode(enum ewol::font::mode _mode);

Specify the font mode for the next


setFontBold ()

void setFontBold(bool _status);

enable or disable the bold mode


setFontItalic ()

void setFontItalic(bool _status);

enable or disable the italic mode


setKerningMode ()

void setKerningMode(bool _newMode);

set the activation of the Kerning for the display (if it existed)


setDistanceFieldMode ()

void setDistanceFieldMode(bool _newMode);

Request the distance field mode for this text display


print ()

void print(const std::string & _text);

display a compleat string in the current element.


print ()

void print(const std::u32string & _text);



printDecorated ()

void printDecorated(const std::string & _text);

display a compleat string in the current element with the generic decoration specification. (basic html data)
	



text exemple in bold other text bold part boldItalic part an other thext colored text bold color text bold italic text normal color text the end of the string
an an other thext



plop 1


plop 2


Un exemple de text

Notes: This is parsed with tiny xml, then be carfull that the XML is correct, and all balises are closed ... otherwite the display can not be done


printHTML ()

void printHTML(const std::string & _text);

display a compleat string in the current element with the generic decoration specification. (basic html data)
	
		
			



text exemple in bold other text bold part boldItalic part an other thext colored text bold color text bold italic text normal color text the end of the string
an an other thext



plop 1


plop 2


Un exemple de text

Notes: This is parsed with tiny xml, then be carfull that the XML is correct, and all balises are closed ... otherwite the display can not be done


print ()

void print(const std::string & _text,
           const std::vector & _decoration);

display a compleat string in the current element whith specific decorations (advence mode).


print ()

void print(const std::u32string & _text,
           const std::vector & _decoration);



print ()

void print(const char32_t & _charcode);

display the current char in the current element (note that the kerning is availlable if the position is not changed)


forceLineReturn ()

void forceLineReturn(void);

This generate the line return == > it return to the alignement position start and at the correct line position ==> it might be use to not know the line height


setTextAlignement ()

void setTextAlignement(float _startTextpos,
                       float _stopTextPos,
                       enum ewol::Text::aligneMode _alignement);

This generate the possibility to generate the big text property
Notes: The text align in center change of line every display done (even if it was just a char)


disableAlignement ()

void disableAlignement(void);

disable the alignement system


calculateSizeHTML ()

vec3 calculateSizeHTML(const std::string & _text);

calculate a theoric text size


calculateSizeDecorated ()

vec3 calculateSizeDecorated(const std::string & _text);

calculate a theoric text size


calculateSize ()

vec3 calculateSize(const std::string & _text);

calculate a theoric text size


calculateSize ()

vec3 calculateSize(const char32_t & _charcode);

calculate a theoric charcode size


printCursor ()

void printCursor(bool _isInsertMode,
                 float _cursorSize);

draw a cursor at the specify position


disableCursor ()

void disableCursor(void);

remove the cursor display


setCursorPos ()

void setCursorPos(int32_t _cursorPos);

set a cursor at a specific position:


setCursorSelection ()

void setCursorSelection(int32_t _cursorPos,
                        int32_t _selectionStartPos);

set a cursor at a specific position with his associated selection:


setSelectionColor ()

void setSelectionColor(const etk::Color<> & _color);

change the selection color


setCursorColor ()

void setCursorColor(const etk::Color<> & _color);

change the cursor color


loadProgram ()

void loadProgram(void);

load the openGL program and get all the ID needed


parseHtmlNode ()

void parseHtmlNode(exml::Element * _element);

This parse a tinyXML node (void pointer to permit to hide tiny XML in include).


extrapolateLastId ()

bool extrapolateLastId(const std::string & _text,
                       const int32_t _start,
                       int32_t & _stop,
                       int32_t & _space,
                       int32_t & _freeSpace);

calculate the element number that is the first out the alignement range (start at the specify ID, and use start pos with current one)


extrapolateLastId ()

bool extrapolateLastId(const std::u32string & _text,
                       const int32_t _start,
                       int32_t & _stop,
                       int32_t & _space,
                       int32_t & _freeSpace);



htmlAddData ()

void htmlAddData(const std::string & _data);

add a line with the current m_htmlDecoTmp decoration


htmlFlush ()

void htmlFlush(void);

draw the current line