class: ewol::compositing::TextBase
Description:
Constructor and Destructor:
+ TextBase (const std::string & _shaderName,
bool _loadProgram);
+ virtual ~TextBase ();
Synopsis:
# ewol::compositing::Drawing m_vectorialDraw;
+ virtual ewol::compositing::Drawing & getDrawing ();
# int32_t m_nbCharDisplayed;
# vec3 m_sizeDisplayStart;
# vec3 m_sizeDisplayStop;
# bool m_needDisplay;
# vec3 m_position;
# vec3 m_clippingPosStart;
# vec3 m_clippingPosStop;
# bool m_clippingEnable;
# etk::Color<> m_defaultColorFg;
# etk::Color<> m_defaultColorBg;
# etk::Color<> m_color;
# etk::Color<> m_colorBg;
# etk::Color<> m_colorCursor;
# etk::Color<> m_colorSelection;
# bool m_kerning;
# char32_t m_previousCharcode;
# float m_startTextpos;
# float m_stopTextPos;
# std::shared_ptr<ewol::resource::Program> m_GLprogram;
# int32_t m_GLPosition;
# int32_t m_GLMatrix;
# int32_t m_GLColor;
# int32_t m_GLtexture;
# int32_t m_GLtexID;
# int32_t m_GLtextWidth;
# int32_t m_GLtextHeight;
# int32_t m_selectionStartPos;
# int32_t m_cursorPos;
# std::vector<vec3> m_coord;
# std::vector<vec2> m_coordTex;
# std::vector<etk::Color<float>> m_coordColor;
+ virtual void loadProgram (const std::string & _shaderName);
+ 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);
+ virtual void drawD (bool _disableDepthTest) = 0;
+ virtual void drawMT (const mat4 & _transformationMatrix,
bool _enableDepthTest) = 0;
+ virtual void clear ();
+ virtual void reset ();
+ const vec3 & getPos ();
+ void setPos (const vec3 & _pos);
+ void setPos (const vec2 & _pos);
+ void setRelPos (const vec3 & _pos);
+ void setRelPos (const vec2 & _pos);
+ void setDefaultColorBg (const etk::Color<> & _color);
+ void setDefaultColorFg (const etk::Color<> & _color);
+ 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);
+ virtual void setFontSize (int32_t _fontSize) = 0;
+ virtual void setFontName (const std::string & _fontName) = 0;
+ virtual void setFont (std::string _fontName,
int32_t _fontSize) = 0;
+ virtual void setFontMode (enum ewol::font::mode _mode) = 0;
+ enum ewol::font::mode getFontMode ();
+ virtual float getHeight () = 0;
+ virtual float getSize () = 0;
+ virtual ewol::GlyphProperty* getGlyphPointer (char32_t _charcode) = 0;
+ void setFontBold (bool _status);
+ void setFontItalic (bool _status);
+ void setKerningMode (bool _newMode);
+ void print (const std::string & _text);
+ void print (const std::u32string & _text);
+ void printDecorated (const std::string & _text);
+ void printDecorated (const std::u32string & _text);
+ void printHTML (const std::string & _text);
+ void printHTML (const std::u32string & _text);
+ void print (const std::string & _text,
const std::vector<TextDecoration> & _decoration);
+ void print (const std::u32string & _text,
const std::vector<TextDecoration> & _decoration);
+ virtual void printChar (const char32_t & _charcode) = 0;
+ void forceLineReturn ();
# void parseHtmlNode (exml::Element* _element);
+ void setTextAlignement (float _startTextpos,
float _stopTextPos,
enum ewol::compositing::aligneMode _alignement);
+ void disableAlignement ();
+ enum ewol::compositing::aligneMode getAlignement ();
+ vec3 calculateSizeHTML (const std::string & _text);
+ vec3 calculateSizeHTML (const std::u32string & _text);
+ vec3 calculateSizeDecorated (const std::string & _text);
+ vec3 calculateSizeDecorated (const std::u32string & _text);
+ vec3 calculateSize (const std::string & _text);
+ vec3 calculateSize (const std::u32string & _text);
+ vec3 calculateSize (const char32_t & _charcode);
# virtual vec3 calculateSizeChar (const char32_t & _charcode) = 0;
+ void printCursor (bool _isInsertMode,
float _cursorSize);
# 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);
# std::u32string m_htmlCurrrentLine;
# std::vector<TextDecoration> m_htmlDecoration;
# TextDecoration m_htmlDecoTmp;
# void htmlAddData (const std::u32string & _data);
# void htmlFlush ();
+ void disableCursor ();
+ 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);
Object Hierarchy:
+ewol::Compositing
+--> ewol::compositing::TextBase
+--> ewol::compositing::TextDF
+--> ewol::compositing::Text
Detail:
m_vectorialDraw
# ewol::compositing::Drawing m_vectorialDraw;
This is used to draw background selection and other things ...
getDrawing
+ virtual ewol::compositing::Drawing & getDrawing ();
m_nbCharDisplayed
# int32_t m_nbCharDisplayed;
prevent some error in calculation size.
m_sizeDisplayStart
# vec3 m_sizeDisplayStart;
The start windows of the display.
m_sizeDisplayStop
# vec3 m_sizeDisplayStop;
The end windows of the display.
m_needDisplay
# bool m_needDisplay;
This just need the display and not the size rendering.
m_position
# vec3 m_position;
The current position to draw
m_clippingPosStart
# vec3 m_clippingPosStart;
Clipping start position
m_clippingPosStop
# vec3 m_clippingPosStop;
Clipping stop position
m_clippingEnable
# bool m_clippingEnable;
true if the clipping must be activated
m_defaultColorFg
# etk::Color<> m_defaultColorFg;
The text foreground color
m_defaultColorBg
# etk::Color<> m_defaultColorBg;
The text background color
m_color
# etk::Color<> m_color;
The text foreground color
m_colorBg
# etk::Color<> m_colorBg;
The text background color
m_colorCursor
# etk::Color<> m_colorCursor;
The text cursor color
m_colorSelection
# etk::Color<> m_colorSelection;
The text Selection color
font display property : Regular/Bold/Italic/BoldItalic
m_kerning
# bool m_kerning;
Kerning enable or disable on the next elements displayed
m_previousCharcode
# char32_t m_previousCharcode;
m_startTextpos
# float m_startTextpos;
start position of the Alignement (when \n the text return at this position)
m_stopTextPos
# float m_stopTextPos;
end of the alignement (when a string is too hight it cut at the word previously this virtual line and the center is perform with this one)
Current Alignement mode (justify/left/right ...)
m_GLprogram
# std::shared_ptr<ewol::resource::Program> m_GLprogram;
pointer on the opengl display program
m_GLPosition
# int32_t m_GLPosition;
openGL id on the element (vertex buffer)
m_GLMatrix
# int32_t m_GLMatrix;
openGL id on the element (transformation matrix)
m_GLColor
# int32_t m_GLColor;
openGL id on the element (color buffer)
m_GLtexture
# int32_t m_GLtexture;
openGL id on the element (Texture position)
m_GLtexID
# int32_t m_GLtexID;
openGL id on the element (texture ID)
m_GLtextWidth
# int32_t m_GLtextWidth;
openGL Id on the texture width
m_GLtextHeight
# int32_t m_GLtextHeight;
openGL Id on the texture height
m_selectionStartPos
# int32_t m_selectionStartPos;
start position of the Selection (if == m_cursorPos ==> no selection)
m_cursorPos
# int32_t m_cursorPos;
Cursor position (default no cursor == > -100)
m_coord
# std::vector<vec3> m_coord;
internal coord of the object
m_coordTex
# std::vector<vec2> m_coordTex;
internal texture coordinate for every point
m_coordColor
# std::vector<etk::Color<float>> m_coordColor;
internal color of the different point
loadProgram
+ virtual void loadProgram (const std::string & _shaderName);
load the openGL program and get all the ID needed
TextBase
+ TextBase (const std::string & _shaderName,
bool _loadProgram);
generic constructor
~TextBase
+ virtual ~TextBase ();
generic destructor
translate
+ void translate (const vec3 & _vect);
translate the current display of this element
Parameter [input]: _vect The translation vector to apply at the transformation matrix
rotate
+ void rotate (const vec3 & _vect,
float _angle);
rotate the curent display of this element
Parameter [input]: _vect The rotation vector to apply at the transformation matrix
scale
+ void scale (const vec3 & _vect);
scale the current diaplsy of this element
Parameter [input]: _vect The scaling vector to apply at the transformation matrix
draw
+ void draw (bool _disableDepthTest);
+ void draw (const mat4 & _transformationMatrix,
bool _enableDepthTest);
draw All the refistered text in the current element on openGL
drawD
+ virtual void drawD (bool _disableDepthTest) = 0;
+ virtual void drawMT (const mat4 & _transformationMatrix,
bool _enableDepthTest) = 0;
draw All the refistered text in the current element on openGL
clear
+ virtual void clear ();
clear all the registered element in the current element
reset
+ virtual void reset ();
clear all the intermediate result detween 2 prints
getPos
+ const vec3 & getPos ();
get the current display position (sometime needed in the gui control)
Return: the current position.
setPos
+ void setPos (const vec3 & _pos);
+ void setPos (const vec2 & _pos);
set position for the next text writen
Parameter [input]: _pos Position of the text (in 3D)
setRelPos
+ void setRelPos (const vec3 & _pos);
+ void setRelPos (const vec2 & _pos);
set relative position for the next text writen
Parameter [input]: _pos ofset apply of the text (in 3D)
setDefaultColorBg
+ void setDefaultColorBg (const etk::Color<> & _color);
set the default background color of the font (when reset, set this value ...)
Parameter [input]: _color Color to set on background
setDefaultColorFg
+ void setDefaultColorFg (const etk::Color<> & _color);
set the default Foreground color of the font (when reset, set this value ...)
Parameter [input]: _color Color to set on foreground
setColor
+ void setColor (const etk::Color<> & _color);
set the Color of the current foreground font
Parameter [input]: _color Color to set on foreground (for next print)
setColorBg
+ void setColorBg (const etk::Color<> & _color);
set the background color of the font (for selected Text (not the global BG))
Parameter [input]: _color Color to set on background (for next print)
setClippingWidth
+ void setClippingWidth (const vec3 & _pos,
const vec3 & _width);
+ void setClippingWidth (const vec2 & _pos,
const vec2 & _width);
Request a clipping area for the text (next draw only)
Parameter [input]: _pos Start position of the clipping
Parameter [input]: _width Width size of the clipping
setClipping
+ void setClipping (const vec3 & _pos,
const vec3 & _posEnd);
+ void setClipping (const vec2 & _pos,
const vec2 & _posEnd);
Request a clipping area for the text (next draw only)
Parameter [input]: _pos Start position of the clipping
Parameter [input]: _posEnd End position of the clipping
setClippingMode
+ void setClippingMode (bool _newMode);
enable/Disable the clipping (without lose the current clipping position)
_newMode The new status of the clipping
setFontSize
+ virtual void setFontSize (int32_t _fontSize) = 0;
Specify the font size (this reset the internal element of the current text (system requirement)
Parameter [input]: _fontSize New font size
setFontName
+ virtual void setFontName (const std::string & _fontName) = 0;
Specify the font name (this reset the internal element of the current text (system requirement)
Parameter [input]: _fontName Current name of the selected font
setFont
+ virtual void setFont (std::string _fontName,
int32_t _fontSize) = 0;
Specify the font property (this reset the internal element of the current text (system requirement)
Parameter [input]: fontName Current name of the selected font
Parameter [input]: fontSize New font size
setFontMode
+ virtual void setFontMode (enum ewol::font::mode _mode) = 0;
Specify the font mode for the next @ref print
Parameter [input]: mode The font mode requested
getFontMode
+ enum ewol::font::mode getFontMode ();
get the current font mode
Return: The font mode applied
getHeight
+ virtual float getHeight () = 0;
getSize
+ virtual float getSize () = 0;
getGlyphPointer
+ virtual ewol::GlyphProperty* getGlyphPointer (char32_t _charcode) = 0;
setFontBold
+ void setFontBold (bool _status);
enable or disable the bold mode
Parameter [input]: _status The new status for this display property
setFontItalic
+ void setFontItalic (bool _status);
enable or disable the italic mode
Parameter [input]: _status The new status for this display property
setKerningMode
+ void setKerningMode (bool _newMode);
set the activation of the Kerning for the display (if it existed)
Parameter [input]: _newMode enable/Diasable the kerning on this font.
print
+ void print (const std::string & _text);
+ void print (const std::u32string & _text);
display a compleat string in the current element.
Parameter [input]: _text The string to display.
printDecorated
+ void printDecorated (const std::string & _text);
+ void printDecorated (const std::u32string & _text);
display a compleat string in the current element with the generic decoration specification. (basic html data)
<br/>
<br/><br/><br/>
<center>
text exemple <b>in bold</b> other text <b>bold part <i>boldItalic part</i></b> an other thext
<font color="#FF0000">colored text <b>bold color text</b> <i>bold italic text</i> normal color text</font> the end of the string<br/>
an an other thext
</center>
<br/><br/><br/>
<left>
plop 1
</left>
<br/><br/><br/>
<right>
plop 2
</right>
<br/><br/><br/>
<justify>
Un exemple de text
</justify>
Note: 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
Parameter [input]: _text The string to display.
printHTML
+ void printHTML (const std::string & _text);
+ void printHTML (const std::u32string & _text);
display a compleat string in the current element with the generic decoration specification. (basic html data)
<html>
<body>
<br/>
<br/><br/><br/>
<center>
text exemple <b>in bold</b> other text <b>bold part <i>boldItalic part</i></b> an other thext
<font color="#FF0000">colored text <b>bold color text</b> <i>bold italic text</i> normal color text</font> the end of the string<br/>
an an other thext
</center>
<br/><br/><br/>
<left>
plop 1
</left>
<br/><br/><br/>
<right>
plop 2
</right>
<br/><br/><br/>
<justify>
Un exemple de text
</justify>
</body>
</html>
Note: 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
Parameter [input]: _text The string to display.
print
+ void print (const std::string & _text,
const std::vector<TextDecoration> & _decoration);
+ void print (const std::u32string & _text,
const std::vector<TextDecoration> & _decoration);
display a compleat string in the current element whith specific decorations (advence mode).
Parameter [input]: _text The string to display.
Parameter [input]: _decoration The text decoration for the text that might be display (if the vector is smaller, the last parameter is get)
printChar
+ virtual void printChar (const char32_t & _charcode) = 0;
display the current char in the current element (note that the kerning is availlable if the position is not changed)
Parameter [input]: _charcode Char that might be dispalyed
forceLineReturn
+ void forceLineReturn ();
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
parseHtmlNode
# void parseHtmlNode (exml::Element* _element);
This parse a tinyXML node (void pointer to permit to hide tiny XML in include).
Parameter [input]: _element the exml element.
setTextAlignement
+ void setTextAlignement (float _startTextpos,
float _stopTextPos,
enum ewol::compositing::aligneMode _alignement);
This generate the possibility to generate the big text property
Note: The text align in center change of line every display done (even if it was just a char)
Parameter [input]: _startTextpos The x text start position of the display.
Parameter [input]: _stopTextPos The x text stop position of the display.
Parameter [input]: _alignement mode of alignement for the Text.
disableAlignement
+ void disableAlignement ();
disable the alignement system
getAlignement
+ enum ewol::compositing::aligneMode getAlignement ();
get the current alignement property
Return: the curent alignement type
calculateSizeHTML
+ vec3 calculateSizeHTML (const std::string & _text);
+ vec3 calculateSizeHTML (const std::u32string & _text);
calculate a theoric text size
Parameter [input]: _text The string to calculate dimention.
Return: The theoric size used.
calculateSizeDecorated
+ vec3 calculateSizeDecorated (const std::string & _text);
+ vec3 calculateSizeDecorated (const std::u32string & _text);
calculate a theoric text size
Parameter [input]: _text The string to calculate dimention.
Return: The theoric size used.
calculateSize
+ vec3 calculateSize (const std::string & _text);
+ vec3 calculateSize (const std::u32string & _text);
calculate a theoric text size
Parameter [input]: _text The string to calculate dimention.
Return: The theoric size used.
calculateSize
+ vec3 calculateSize (const char32_t & _charcode);
# virtual vec3 calculateSizeChar (const char32_t & _charcode) = 0;
calculate a theoric charcode size
Parameter [input]: _charcode The ľUnicode value to calculate dimention.
Return: The theoric size used.
printCursor
+ void printCursor (bool _isInsertMode,
float _cursorSize);
draw a cursor at the specify position
Parameter [input]: _isInsertMode True if the insert mode is activated
Parameter [input]: _cursorSize The sizae of the cursor that might be set when insert mode is set [default 20]
extrapolateLastId
# 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);
calculate the element number that is the first out the alignement range
(start at the specify ID, and use start pos with current one)
Parameter [input]: _text The string that might be parsed.
Parameter [input]: _start The first elemnt that might be used to calculate.
Parameter [output]: _stop The last Id availlable in the current string.
Parameter [output]: _space Number of space in the string.
Parameter [output]: _freespace This represent the number of pixel present in the right white space.
Return: true if the rifht has free space that can be use for jystify.<br/>false if we find '\n'
m_htmlCurrrentLine
# std::u32string m_htmlCurrrentLine;
current line for HTML display
m_htmlDecoration
# std::vector<TextDecoration> m_htmlDecoration;
current decoration for the HTML display
m_htmlDecoTmp
# TextDecoration m_htmlDecoTmp;
current decoration
htmlAddData
# void htmlAddData (const std::u32string & _data);
add a line with the current m_htmlDecoTmp decoration
Parameter [input]: _data The cuurent data to add.
htmlFlush
# void htmlFlush ();
draw the current line
disableCursor
+ void disableCursor ();
remove the cursor display
setCursorPos
+ void setCursorPos (int32_t _cursorPos);
set a cursor at a specific position:
Parameter [input]: _cursorPos id of the cursor position
setCursorSelection
+ void setCursorSelection (int32_t _cursorPos,
int32_t _selectionStartPos);
set a cursor at a specific position with his associated selection:
Parameter [input]: _cursorPos id of the cursor position
Parameter [input]: _selectionStartPos id of the starting of the selection
setSelectionColor
+ void setSelectionColor (const etk::Color<> & _color);
change the selection color
Parameter [input]: _color New color for the Selection
setCursorColor
+ void setCursorColor (const etk::Color<> & _color);
change the cursor color
Parameter [input]: _color New color for the Selection
+ewol::Compositing
+--> ewol::compositing::TextBase
+--> ewol::compositing::TextDF
+--> ewol::compositing::Text
Detail:
m_vectorialDraw
# ewol::compositing::Drawing m_vectorialDraw;This is used to draw background selection and other things ...
getDrawing
+ virtual ewol::compositing::Drawing & getDrawing ();
m_nbCharDisplayed
# int32_t m_nbCharDisplayed;prevent some error in calculation size.
m_sizeDisplayStart
# vec3 m_sizeDisplayStart;The start windows of the display.
m_sizeDisplayStop
# vec3 m_sizeDisplayStop;The end windows of the display.
m_needDisplay
# bool m_needDisplay;This just need the display and not the size rendering.
m_position
# vec3 m_position;The current position to draw
m_clippingPosStart
# vec3 m_clippingPosStart;Clipping start position
m_clippingPosStop
# vec3 m_clippingPosStop;Clipping stop position
m_clippingEnable
# bool m_clippingEnable;true if the clipping must be activated
m_defaultColorFg
# etk::Color<> m_defaultColorFg;The text foreground color
m_defaultColorBg
# etk::Color<> m_defaultColorBg;The text background color
m_color
# etk::Color<> m_color;The text foreground color
m_colorBg
# etk::Color<> m_colorBg;The text background color
m_colorCursor
# etk::Color<> m_colorCursor;The text cursor color
m_colorSelection
# etk::Color<> m_colorSelection;The text Selection color font display property : Regular/Bold/Italic/BoldItalic
m_kerning
# bool m_kerning;Kerning enable or disable on the next elements displayed
m_previousCharcode
# char32_t m_previousCharcode;
m_startTextpos
# float m_startTextpos;start position of the Alignement (when \n the text return at this position)
m_stopTextPos
# float m_stopTextPos;end of the alignement (when a string is too hight it cut at the word previously this virtual line and the center is perform with this one) Current Alignement mode (justify/left/right ...)
m_GLprogram
# std::shared_ptr<ewol::resource::Program> m_GLprogram;pointer on the opengl display program
m_GLPosition
# int32_t m_GLPosition;openGL id on the element (vertex buffer)
m_GLMatrix
# int32_t m_GLMatrix;openGL id on the element (transformation matrix)
m_GLColor
# int32_t m_GLColor;openGL id on the element (color buffer)
m_GLtexture
# int32_t m_GLtexture;openGL id on the element (Texture position)
m_GLtexID
# int32_t m_GLtexID;openGL id on the element (texture ID)
m_GLtextWidth
# int32_t m_GLtextWidth;openGL Id on the texture width
m_GLtextHeight
# int32_t m_GLtextHeight;openGL Id on the texture height
m_selectionStartPos
# int32_t m_selectionStartPos;start position of the Selection (if == m_cursorPos ==> no selection)
m_cursorPos
# int32_t m_cursorPos;Cursor position (default no cursor == > -100)
m_coord
# std::vector<vec3> m_coord;internal coord of the object
m_coordTex
# std::vector<vec2> m_coordTex;internal texture coordinate for every point
m_coordColor
# std::vector<etk::Color<float>> m_coordColor;internal color of the different point
loadProgram
+ virtual void loadProgram (const std::string & _shaderName);load the openGL program and get all the ID needed
TextBase
+ TextBase (const std::string & _shaderName,generic constructor
bool _loadProgram);
~TextBase
+ virtual ~TextBase ();generic destructor
translate
+ void translate (const vec3 & _vect);translate the current display of this element
Parameter [input]: | _vect | The translation vector to apply at the transformation matrix |
rotate
+ void rotate (const vec3 & _vect,rotate the curent display of this element
float _angle);
Parameter [input]: | _vect | The rotation vector to apply at the transformation matrix |
scale
+ void scale (const vec3 & _vect);scale the current diaplsy of this element
Parameter [input]: | _vect | The scaling vector to apply at the transformation matrix |
draw
+ void draw (bool _disableDepthTest);draw All the refistered text in the current element on openGL
+ void draw (const mat4 & _transformationMatrix,
bool _enableDepthTest);
drawD
+ virtual void drawD (bool _disableDepthTest) = 0;draw All the refistered text in the current element on openGL
+ virtual void drawMT (const mat4 & _transformationMatrix,
bool _enableDepthTest) = 0;
clear
+ virtual void clear ();clear all the registered element in the current element
reset
+ virtual void reset ();clear all the intermediate result detween 2 prints
getPos
+ const vec3 & getPos ();get the current display position (sometime needed in the gui control)
Return: | the current position. |
setPos
+ void setPos (const vec3 & _pos);set position for the next text writen
+ void setPos (const vec2 & _pos);
Parameter [input]: | _pos | Position of the text (in 3D) |
setRelPos
+ void setRelPos (const vec3 & _pos);set relative position for the next text writen
+ void setRelPos (const vec2 & _pos);
Parameter [input]: | _pos | ofset apply of the text (in 3D) |
setDefaultColorBg
+ void setDefaultColorBg (const etk::Color<> & _color);set the default background color of the font (when reset, set this value ...)
Parameter [input]: | _color | Color to set on background |
setDefaultColorFg
+ void setDefaultColorFg (const etk::Color<> & _color);set the default Foreground color of the font (when reset, set this value ...)
Parameter [input]: | _color | Color to set on foreground |
setColor
+ void setColor (const etk::Color<> & _color);set the Color of the current foreground font
Parameter [input]: | _color | Color to set on foreground (for next print) |
setColorBg
+ void setColorBg (const etk::Color<> & _color);set the background color of the font (for selected Text (not the global BG))
Parameter [input]: | _color | Color to set on background (for next print) |
setClippingWidth
+ void setClippingWidth (const vec3 & _pos,Request a clipping area for the text (next draw only)
const vec3 & _width);
+ void setClippingWidth (const vec2 & _pos,
const vec2 & _width);
Parameter [input]: | _pos | Start position of the clipping | Parameter [input]: | _width | Width size of the clipping |
setClipping
+ void setClipping (const vec3 & _pos,Request a clipping area for the text (next draw only)
const vec3 & _posEnd);
+ void setClipping (const vec2 & _pos,
const vec2 & _posEnd);
Parameter [input]: | _pos | Start position of the clipping | Parameter [input]: | _posEnd | End position of the clipping |
setClippingMode
+ void setClippingMode (bool _newMode);enable/Disable the clipping (without lose the current clipping position)
_newMode The new status of the clipping
setFontSize
+ virtual void setFontSize (int32_t _fontSize) = 0;Specify the font size (this reset the internal element of the current text (system requirement)
Parameter [input]: | _fontSize | New font size |
setFontName
+ virtual void setFontName (const std::string & _fontName) = 0;Specify the font name (this reset the internal element of the current text (system requirement)
Parameter [input]: | _fontName | Current name of the selected font |
setFont
+ virtual void setFont (std::string _fontName,Specify the font property (this reset the internal element of the current text (system requirement)
int32_t _fontSize) = 0;
Parameter [input]: | fontName | Current name of the selected font | Parameter [input]: | fontSize | New font size |
setFontMode
+ virtual void setFontMode (enum ewol::font::mode _mode) = 0;Specify the font mode for the next @ref print
Parameter [input]: | mode | The font mode requested |
getFontMode
+ enum ewol::font::mode getFontMode ();get the current font mode
Return: | The font mode applied |
getHeight
+ virtual float getHeight () = 0;
getSize
+ virtual float getSize () = 0;
getGlyphPointer
+ virtual ewol::GlyphProperty* getGlyphPointer (char32_t _charcode) = 0;
setFontBold
+ void setFontBold (bool _status);enable or disable the bold mode
Parameter [input]: | _status | The new status for this display property |
setFontItalic
+ void setFontItalic (bool _status);enable or disable the italic mode
Parameter [input]: | _status | The new status for this display property |
setKerningMode
+ void setKerningMode (bool _newMode);set the activation of the Kerning for the display (if it existed)
Parameter [input]: | _newMode | enable/Diasable the kerning on this font. |
+ void print (const std::string & _text);display a compleat string in the current element.
+ void print (const std::u32string & _text);
Parameter [input]: | _text | The string to display. |
printDecorated
+ void printDecorated (const std::string & _text);display a compleat string in the current element with the generic decoration specification. (basic html data)
+ void printDecorated (const std::u32string & _text);
<br/> <br/><br/><br/> <center> text exemple <b>in bold</b> other text <b>bold part <i>boldItalic part</i></b> an other thext <font color="#FF0000">colored text <b>bold color text</b> <i>bold italic text</i> normal color text</font> the end of the string<br/> an an other thext </center> <br/><br/><br/> <left> plop 1 </left> <br/><br/><br/> <right> plop 2 </right> <br/><br/><br/> <justify> Un exemple de text </justify>
Note: 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
Parameter [input]: | _text | The string to display. |
printHTML
+ void printHTML (const std::string & _text);display a compleat string in the current element with the generic decoration specification. (basic html data)
+ void printHTML (const std::u32string & _text);
<html> <body> <br/> <br/><br/><br/> <center> text exemple <b>in bold</b> other text <b>bold part <i>boldItalic part</i></b> an other thext <font color="#FF0000">colored text <b>bold color text</b> <i>bold italic text</i> normal color text</font> the end of the string<br/> an an other thext </center> <br/><br/><br/> <left> plop 1 </left> <br/><br/><br/> <right> plop 2 </right> <br/><br/><br/> <justify> Un exemple de text </justify> </body> </html>
Note: 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
Parameter [input]: | _text | The string to display. |
+ void print (const std::string & _text,display a compleat string in the current element whith specific decorations (advence mode).
const std::vector<TextDecoration> & _decoration);
+ void print (const std::u32string & _text,
const std::vector<TextDecoration> & _decoration);
Parameter [input]: | _text | The string to display. | Parameter [input]: | _decoration | The text decoration for the text that might be display (if the vector is smaller, the last parameter is get) |
printChar
+ virtual void printChar (const char32_t & _charcode) = 0;display the current char in the current element (note that the kerning is availlable if the position is not changed)
Parameter [input]: | _charcode | Char that might be dispalyed |
forceLineReturn
+ void forceLineReturn ();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
parseHtmlNode
# void parseHtmlNode (exml::Element* _element);This parse a tinyXML node (void pointer to permit to hide tiny XML in include).
Parameter [input]: | _element | the exml element. |
setTextAlignement
+ void setTextAlignement (float _startTextpos,This generate the possibility to generate the big text property
float _stopTextPos,
enum ewol::compositing::aligneMode _alignement);
Note: The text align in center change of line every display done (even if it was just a char)
Parameter [input]: | _startTextpos | The x text start position of the display. | Parameter [input]: | _stopTextPos | The x text stop position of the display. | Parameter [input]: | _alignement | mode of alignement for the Text. |
disableAlignement
+ void disableAlignement ();disable the alignement system
getAlignement
+ enum ewol::compositing::aligneMode getAlignement ();get the current alignement property
Return: | the curent alignement type |
calculateSizeHTML
+ vec3 calculateSizeHTML (const std::string & _text);calculate a theoric text size
+ vec3 calculateSizeHTML (const std::u32string & _text);
Parameter [input]: | _text | The string to calculate dimention. |
Return: | The theoric size used. |
calculateSizeDecorated
+ vec3 calculateSizeDecorated (const std::string & _text);calculate a theoric text size
+ vec3 calculateSizeDecorated (const std::u32string & _text);
Parameter [input]: | _text | The string to calculate dimention. |
Return: | The theoric size used. |
calculateSize
+ vec3 calculateSize (const std::string & _text);calculate a theoric text size
+ vec3 calculateSize (const std::u32string & _text);
Parameter [input]: | _text | The string to calculate dimention. |
Return: | The theoric size used. |
calculateSize
+ vec3 calculateSize (const char32_t & _charcode);calculate a theoric charcode size
# virtual vec3 calculateSizeChar (const char32_t & _charcode) = 0;
Parameter [input]: | _charcode | The ľUnicode value to calculate dimention. |
Return: | The theoric size used. |
printCursor
+ void printCursor (bool _isInsertMode,draw a cursor at the specify position
float _cursorSize);
Parameter [input]: | _isInsertMode | True if the insert mode is activated | Parameter [input]: | _cursorSize | The sizae of the cursor that might be set when insert mode is set [default 20] |
extrapolateLastId
# bool extrapolateLastId (const std::string & _text,calculate the element number that is the first out the alignement range (start at the specify ID, and use start pos with current one)
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);
Parameter [input]: | _text | The string that might be parsed. | Parameter [input]: | _start | The first elemnt that might be used to calculate. | Parameter [output]: | _stop | The last Id availlable in the current string. | Parameter [output]: | _space | Number of space in the string. | Parameter [output]: | _freespace | This represent the number of pixel present in the right white space. |
Return: | true if the rifht has free space that can be use for jystify.<br/>false if we find '\n' |
m_htmlCurrrentLine
# std::u32string m_htmlCurrrentLine;current line for HTML display
m_htmlDecoration
# std::vector<TextDecoration> m_htmlDecoration;current decoration for the HTML display
m_htmlDecoTmp
# TextDecoration m_htmlDecoTmp;current decoration
htmlAddData
# void htmlAddData (const std::u32string & _data);add a line with the current m_htmlDecoTmp decoration
Parameter [input]: | _data | The cuurent data to add. |
htmlFlush
# void htmlFlush ();draw the current line
disableCursor
+ void disableCursor ();remove the cursor display
setCursorPos
+ void setCursorPos (int32_t _cursorPos);set a cursor at a specific position:
Parameter [input]: | _cursorPos | id of the cursor position |
setCursorSelection
+ void setCursorSelection (int32_t _cursorPos,set a cursor at a specific position with his associated selection:
int32_t _selectionStartPos);
Parameter [input]: | _cursorPos | id of the cursor position | Parameter [input]: | _selectionStartPos | id of the starting of the selection |
setSelectionColor
+ void setSelectionColor (const etk::Color<> & _color);change the selection color
Parameter [input]: | _color | New color for the Selection |
setCursorColor
+ void setCursorColor (const etk::Color<> & _color);change the cursor color
Parameter [input]: | _color | New color for the Selection |