First test of the distance field methode for the font

This commit is contained in:
Edouard Dupin 2012-09-06 02:48:41 +02:00
parent 9587e21498
commit 6ed410d936
7 changed files with 30 additions and 28 deletions

View File

@ -41,6 +41,8 @@ typedef struct{
uint32_t diplayableLine; //!< NB Line that can be displayed uint32_t diplayableLine; //!< NB Line that can be displayed
}infoStatBuffer_ts; }infoStatBuffer_ts;
//#define TEXT_DISPLAY_TYPE OObject2DTextColored
#define TEXT_DISPLAY_TYPE OObject2DTextShader
class Buffer { class Buffer {
public: public:
@ -81,10 +83,10 @@ class Buffer {
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate) {}; virtual void GetInfo(infoStatBuffer_ts &infoToUpdate) {};
virtual void SetLineDisplay(uint32_t lineNumber) {}; virtual void SetLineDisplay(uint32_t lineNumber) {};
virtual int32_t Display(ewol::OObject2DTextColored& OOTextNormal, virtual int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::OObject2DTextColored& OOTextBold, ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::OObject2DTextColored& OOTextItalic, ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic, ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY) ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
{ {
return ERR_NONE; return ERR_NONE;

View File

@ -67,10 +67,10 @@ BufferEmpty::~BufferEmpty(void)
* @return --- * @return ---
* *
*/ */
int32_t BufferEmpty::Display(ewol::OObject2DTextColored& OOTextNormal, int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::OObject2DTextColored& OOTextBold, ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::OObject2DTextColored& OOTextItalic, ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic, ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY) ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
{ {
// Get color : // Get color :

View File

@ -32,10 +32,10 @@ class BufferEmpty : public Buffer {
public: public:
BufferEmpty(void); BufferEmpty(void);
virtual ~BufferEmpty(void); virtual ~BufferEmpty(void);
int32_t Display(ewol::OObject2DTextColored& OOTextNormal, int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::OObject2DTextColored& OOTextBold, ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::OObject2DTextColored& OOTextItalic, ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic, ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY); ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY);
}; };

View File

@ -206,7 +206,7 @@ void BufferText::SetLineDisplay(uint32_t lineNumber)
#define SEPARATION_SIZE_LINE_NUMBER (3) #define SEPARATION_SIZE_LINE_NUMBER (3)
void BufferText::DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY) void BufferText::DrawLineNumber(ewol::TEXT_DISPLAY_TYPE* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY)
{ {
char tmpLineNumber[50]; char tmpLineNumber[50];
sprintf(tmpLineNumber, "%*d", nbColomn, lineNumber); sprintf(tmpLineNumber, "%*d", nbColomn, lineNumber);
@ -277,10 +277,10 @@ int32_t BufferText::GetNumberOfLine(void)
* @return * @return
* *
*/ */
int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal, int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::OObject2DTextColored& OOTextBold, ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::OObject2DTextColored& OOTextItalic, ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic, ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, ewol::OObject2DColored& OOColored,
int32_t offsetX, int32_t offsetY, int32_t offsetX, int32_t offsetY,
int32_t sizeX, int32_t sizeY) int32_t sizeX, int32_t sizeY)
@ -319,7 +319,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
draw::Color & myColorSpace = ColorizeManager::Get(COLOR_CODE_SPACE); draw::Color & myColorSpace = ColorizeManager::Get(COLOR_CODE_SPACE);
draw::Color & myColorTab = ColorizeManager::Get(COLOR_CODE_TAB); draw::Color & myColorTab = ColorizeManager::Get(COLOR_CODE_TAB);
Colorize * selectColor = NULL; Colorize * selectColor = NULL;
ewol::OObject2DTextColored* OOTextSelected = NULL; ewol::TEXT_DISPLAY_TYPE* OOTextSelected = NULL;
int mylen = m_EdnBuf.Size(); int mylen = m_EdnBuf.Size();
int32_t x_base=nbColoneForLineNumber*letterWidth; int32_t x_base=nbColoneForLineNumber*letterWidth;

View File

@ -55,10 +55,10 @@ class BufferText : public Buffer {
void GetInfo(infoStatBuffer_ts &infoToUpdate); void GetInfo(infoStatBuffer_ts &infoToUpdate);
void SetLineDisplay(uint32_t lineNumber); void SetLineDisplay(uint32_t lineNumber);
int32_t Display(ewol::OObject2DTextColored& OOTextNormal, int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::OObject2DTextColored& OOTextBold, ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::OObject2DTextColored& OOTextItalic, ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic, ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, ewol::OObject2DColored& OOColored,
int32_t offsetX, int32_t offsetY, int32_t offsetX, int32_t offsetY,
int32_t sizeX, int32_t sizeY); int32_t sizeX, int32_t sizeY);
@ -114,7 +114,7 @@ class BufferText : public Buffer {
int32_t GetMousePosition(Vector2D<float> pos); int32_t GetMousePosition(Vector2D<float> pos);
void DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY); void DrawLineNumber(ewol::TEXT_DISPLAY_TYPE* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY);
void DrawCursor(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth, clipping_ts &clip); void DrawCursor(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth, clipping_ts &clip);
}; };

View File

@ -57,10 +57,10 @@ class CodeView :public ewol::WidgetScrooled
etk::Vector<Vector2D<float> > m_lineNumberList; etk::Vector<Vector2D<float> > m_lineNumberList;
void UpdateNumberOfLineReference(int32_t bufferID); void UpdateNumberOfLineReference(int32_t bufferID);
// drawing elements : // drawing elements :
ewol::OObject2DTextColored m_OObjectTextNormal; ewol::TEXT_DISPLAY_TYPE m_OObjectTextNormal;
ewol::OObject2DTextColored m_OObjectTextBold; ewol::TEXT_DISPLAY_TYPE m_OObjectTextBold;
ewol::OObject2DTextColored m_OObjectTextItalic; ewol::TEXT_DISPLAY_TYPE m_OObjectTextItalic;
ewol::OObject2DTextColored m_OObjectTextBoldItalic; ewol::TEXT_DISPLAY_TYPE m_OObjectTextBoldItalic;
ewol::OObject2DColored m_OObjectsColored; ewol::OObject2DColored m_OObjectsColored;
public: public:

View File

@ -148,7 +148,7 @@ MainWindows::MainWindows(void)
myCodeView->SetExpendY(true); myCodeView->SetExpendY(true);
myCodeView->SetFillX(true); myCodeView->SetFillX(true);
myCodeView->SetFillY(true); myCodeView->SetFillY(true);
myCodeView->SetFontSize(11); myCodeView->SetFontSize(48);
myCodeView->SetFontNameNormal( "Font/freefont/FreeMono.ttf"); myCodeView->SetFontNameNormal( "Font/freefont/FreeMono.ttf");
myCodeView->SetFontNameBold( "Font/freefont/FreeMonoBold.ttf"); myCodeView->SetFontNameBold( "Font/freefont/FreeMonoBold.ttf");
myCodeView->SetFontNameItalic( "Font/freefont/FreeMonoOblique.ttf"); myCodeView->SetFontNameItalic( "Font/freefont/FreeMonoOblique.ttf");