[DEV] change the internal system of register font ==> use system font
This commit is contained in:
parent
cab24c59ac
commit
c3838996f3
@ -85,17 +85,8 @@ class Buffer {
|
|||||||
public:
|
public:
|
||||||
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate) {};
|
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate) {};
|
||||||
virtual void SetLineDisplay(uint32_t lineNumber) {};
|
virtual void SetLineDisplay(uint32_t lineNumber) {};
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
|
||||||
virtual int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
virtual int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
||||||
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)
|
||||||
|
|
||||||
#else
|
|
||||||
virtual int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
|
|
||||||
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
return ERR_NONE;
|
return ERR_NONE;
|
||||||
}
|
}
|
||||||
|
@ -67,25 +67,13 @@ BufferEmpty::~BufferEmpty(void)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
|
||||||
int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
||||||
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)
|
||||||
#else
|
|
||||||
int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
|
|
||||||
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
// Get color :
|
// Get color :
|
||||||
Colorize *myColor = NULL;
|
Colorize *myColor = NULL;
|
||||||
|
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
int32_t letterHeight = OOText.GetHeight();
|
||||||
int32_t letterHeight = OOText.GetHeight();
|
|
||||||
#else
|
|
||||||
int32_t letterHeight = OOTextNormal.GetHeight();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
etk::Vector2D<float> textPos;
|
etk::Vector2D<float> textPos;
|
||||||
textPos.x = 20;
|
textPos.x = 20;
|
||||||
@ -100,8 +88,8 @@ int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
|||||||
OOText.SetItalic(false);
|
OOText.SetItalic(false);
|
||||||
OOText.Text(textPos, tmpDisplay);
|
OOText.Text(textPos, tmpDisplay);
|
||||||
#else
|
#else
|
||||||
OOTextBold.SetColor(myColor->GetFG());
|
OOText.SetColor(myColor->GetFG());
|
||||||
OOTextBold.Text(textPos, tmpDisplay);
|
OOText.Text(textPos, tmpDisplay, ewol::font::Bold);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
myColor = ColorizeManager::Get("commentDoxygen");
|
myColor = ColorizeManager::Get("commentDoxygen");
|
||||||
@ -113,8 +101,8 @@ int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
|||||||
OOText.SetColor(myColor->GetFG());
|
OOText.SetColor(myColor->GetFG());
|
||||||
OOText.Text(textPos, tmpDisplay);
|
OOText.Text(textPos, tmpDisplay);
|
||||||
#else
|
#else
|
||||||
OOTextNormal.SetColor(myColor->GetFG());
|
OOText.SetColor(myColor->GetFG());
|
||||||
OOTextNormal.Text(textPos, tmpDisplay);
|
OOText.Text(textPos, tmpDisplay, ewol::font::Regular);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
OOColored.SetColor(draw::color::white);
|
OOColored.SetColor(draw::color::white);
|
||||||
|
@ -32,18 +32,8 @@ class BufferEmpty : public Buffer {
|
|||||||
public:
|
public:
|
||||||
BufferEmpty(void);
|
BufferEmpty(void);
|
||||||
virtual ~BufferEmpty(void);
|
virtual ~BufferEmpty(void);
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
|
||||||
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
||||||
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);
|
||||||
#else
|
|
||||||
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
|
|
||||||
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -277,32 +277,18 @@ int32_t BufferText::GetNumberOfLine(void)
|
|||||||
* @return
|
* @return
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
|
||||||
int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
||||||
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)
|
||||||
#else
|
|
||||||
int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
|
|
||||||
ewol::OObject2DColored& OOColored,
|
|
||||||
int32_t offsetX, int32_t offsetY,
|
|
||||||
int32_t sizeX, int32_t sizeY)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int32_t selStart, selEnd, selRectStart, selRectEnd;
|
int32_t selStart, selEnd, selRectStart, selRectEnd;
|
||||||
bool selIsRect;
|
bool selIsRect;
|
||||||
int32_t selHave;
|
int32_t selHave;
|
||||||
|
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
int32_t letterWidth = OOText.GetSize("A").x;
|
||||||
int32_t letterWidth = OOText.GetSize("A").x;
|
int32_t letterHeight = OOText.GetHeight();
|
||||||
int32_t letterHeight = OOText.GetHeight();
|
|
||||||
#else
|
|
||||||
int32_t letterWidth = OOTextNormal.GetSize("A").x;
|
|
||||||
int32_t letterHeight = OOTextNormal.GetHeight();
|
|
||||||
#endif
|
|
||||||
int32_t displayStartLineId = offsetY / letterHeight - 1;
|
int32_t displayStartLineId = offsetY / letterHeight - 1;
|
||||||
displayStartLineId = etk_max(0, displayStartLineId);
|
displayStartLineId = etk_max(0, displayStartLineId);
|
||||||
int32_t y = - offsetY + displayStartLineId*letterHeight;
|
int32_t y = - offsetY + displayStartLineId*letterHeight;
|
||||||
@ -330,9 +316,6 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& 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;
|
||||||
#ifndef APPL_BUFFER_FONT_DISTANCE_FIELD
|
|
||||||
ewol::TEXT_DISPLAY_TYPE* OOTextSelected = NULL;
|
|
||||||
#endif
|
|
||||||
int mylen = m_EdnBuf.Size();
|
int mylen = m_EdnBuf.Size();
|
||||||
int32_t x_base=nbColoneForLineNumber*letterWidth;
|
int32_t x_base=nbColoneForLineNumber*letterWidth;
|
||||||
int32_t idX = 0;
|
int32_t idX = 0;
|
||||||
@ -362,13 +345,8 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
|||||||
y -= letterHeight;
|
y -= letterHeight;
|
||||||
|
|
||||||
OOColored.clippingDisable();
|
OOColored.clippingDisable();
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
OOText.clippingDisable();
|
||||||
OOText.clippingDisable();
|
DrawLineNumber(&OOText, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
|
||||||
DrawLineNumber(&OOText, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
|
|
||||||
#else
|
|
||||||
OOTextNormal.clippingDisable();
|
|
||||||
DrawLineNumber(&OOTextNormal, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
|
|
||||||
#endif
|
|
||||||
int32_t pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER;
|
int32_t pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER;
|
||||||
|
|
||||||
clipping_ts drawClipping;
|
clipping_ts drawClipping;
|
||||||
@ -383,14 +361,7 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
|||||||
drawClippingTextArea.w = sizeX - drawClipping.x;
|
drawClippingTextArea.w = sizeX - drawClipping.x;
|
||||||
drawClippingTextArea.h = sizeY;
|
drawClippingTextArea.h = sizeY;
|
||||||
|
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
OOText.clippingSet(drawClippingTextArea);
|
||||||
OOText.clippingSet(drawClippingTextArea);
|
|
||||||
#else
|
|
||||||
OOTextNormal.clippingSet(drawClippingTextArea);
|
|
||||||
OOTextBold.clippingSet(drawClippingTextArea);
|
|
||||||
OOTextItalic.clippingSet(drawClippingTextArea);
|
|
||||||
OOTextBoldItalic.clippingSet(drawClippingTextArea);
|
|
||||||
#endif
|
|
||||||
OOColored.clippingSet(drawClippingTextArea);
|
OOColored.clippingSet(drawClippingTextArea);
|
||||||
|
|
||||||
// Clear the line intexation :
|
// Clear the line intexation :
|
||||||
@ -463,25 +434,26 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
|||||||
myStringToDisplay = displayChar;
|
myStringToDisplay = displayChar;
|
||||||
drawSize = OOText.Text(textPos, myStringToDisplay);
|
drawSize = OOText.Text(textPos, myStringToDisplay);
|
||||||
#else
|
#else
|
||||||
|
ewol::font::mode_te tmpMode = ewol::font::Regular;
|
||||||
if (true == selectColor->GetItalic() ) {
|
if (true == selectColor->GetItalic() ) {
|
||||||
if (true == selectColor->GetBold() ) {
|
if (true == selectColor->GetBold() ) {
|
||||||
OOTextSelected = &OOTextBoldItalic;
|
tmpMode = ewol::font::BoldItalic;
|
||||||
} else {
|
} else {
|
||||||
OOTextSelected = &OOTextItalic;
|
tmpMode = ewol::font::Italic;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (true == selectColor->GetBold() ) {
|
if (true == selectColor->GetBold() ) {
|
||||||
OOTextSelected = &OOTextBold;
|
tmpMode = ewol::font::Bold;
|
||||||
} else {
|
} else {
|
||||||
OOTextSelected = &OOTextNormal;
|
tmpMode = ewol::font::Regular;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tmpElementProperty.m_ySize = OOTextSelected->GetHeight();
|
tmpElementProperty.m_ySize = OOText.GetHeight();
|
||||||
//tmpElementProperty.m_yOffset += tmpElementProperty.m_ySize;
|
//tmpElementProperty.m_yOffset += tmpElementProperty.m_ySize;
|
||||||
OOTextSelected->SetColor(selectColor->GetFG());
|
OOText.SetColor(selectColor->GetFG());
|
||||||
// TODO : Remove this unreallistic leak of time
|
// TODO : Remove this unreallistic leak of time
|
||||||
myStringToDisplay = displayChar;
|
myStringToDisplay = displayChar;
|
||||||
drawSize = OOTextSelected->Text(textPos, myStringToDisplay);
|
drawSize = OOText.Text(textPos, myStringToDisplay, tmpMode);
|
||||||
#endif
|
#endif
|
||||||
//APPL_DEBUG("add element : " << tmpElementProperty.m_yOffset << "," << tmpElementProperty.m_xOffset);
|
//APPL_DEBUG("add element : " << tmpElementProperty.m_yOffset << "," << tmpElementProperty.m_xOffset);
|
||||||
m_elmentList.PushBack(tmpElementProperty);
|
m_elmentList.PushBack(tmpElementProperty);
|
||||||
@ -516,9 +488,9 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
|||||||
DrawLineNumber(&OOText, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
|
DrawLineNumber(&OOText, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
|
||||||
OOText.clippingEnable();
|
OOText.clippingEnable();
|
||||||
#else
|
#else
|
||||||
OOTextNormal.clippingDisable();
|
OOText.clippingDisable();
|
||||||
DrawLineNumber(&OOTextNormal, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
|
DrawLineNumber(&OOText, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
|
||||||
OOTextNormal.clippingEnable();
|
OOText.clippingEnable();
|
||||||
#endif
|
#endif
|
||||||
OOColored.clippingEnable();
|
OOColored.clippingEnable();
|
||||||
// add elements :
|
// add elements :
|
||||||
|
@ -54,20 +54,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);
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
|
||||||
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
||||||
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);
|
||||||
#else
|
|
||||||
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
|
|
||||||
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
|
|
||||||
ewol::OObject2DColored& OOColored,
|
|
||||||
int32_t offsetX, int32_t offsetY,
|
|
||||||
int32_t sizeX, int32_t sizeY);
|
|
||||||
#endif
|
|
||||||
void AddChar(uniChar_t unicodeData);
|
void AddChar(uniChar_t unicodeData);
|
||||||
void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
|
void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
|
||||||
void MouseSelectFromCursorTo(etk::Vector2D<float> pos);
|
void MouseSelectFromCursorTo(etk::Vector2D<float> pos);
|
||||||
|
@ -78,13 +78,11 @@ void CodeView::Init(void)
|
|||||||
ShortCutAdd("ctrl+shift+a", ednMsgGuiSelect, "NONE");
|
ShortCutAdd("ctrl+shift+a", ednMsgGuiSelect, "NONE");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
CodeView::CodeView(etk::UString fontName, int32_t fontSize) :
|
||||||
CodeView::CodeView(etk::UString fontName, int32_t fontSize) :
|
m_OObjectText(fontName, fontSize)
|
||||||
m_OObjectText(fontName, fontSize)
|
{
|
||||||
{
|
Init();
|
||||||
Init();
|
}
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CodeView::CodeView(void)
|
CodeView::CodeView(void)
|
||||||
{
|
{
|
||||||
@ -127,11 +125,7 @@ bool CodeView::CalculateMinSize(void)
|
|||||||
void CodeView::CalculateMaxSize(void)
|
void CodeView::CalculateMaxSize(void)
|
||||||
{
|
{
|
||||||
m_maxSize.x = 2048;
|
m_maxSize.x = 2048;
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
int32_t letterHeight = m_OObjectText.GetHeight();
|
||||||
int32_t letterHeight = m_OObjectText.GetHeight();
|
|
||||||
#else
|
|
||||||
int32_t letterHeight = m_OObjectTextNormal.GetHeight();
|
|
||||||
#endif
|
|
||||||
m_maxSize.y = BufferManager::Get(m_bufferID)->GetNumberOfLine() * letterHeight;
|
m_maxSize.y = BufferManager::Get(m_bufferID)->GetNumberOfLine() * letterHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,14 +133,7 @@ void CodeView::CalculateMaxSize(void)
|
|||||||
void CodeView::OnDraw(ewol::DrawProperty& displayProp)
|
void CodeView::OnDraw(ewol::DrawProperty& displayProp)
|
||||||
{
|
{
|
||||||
m_OObjectsColored.Draw();
|
m_OObjectsColored.Draw();
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
m_OObjectText.Draw();
|
||||||
m_OObjectText.Draw();
|
|
||||||
#else
|
|
||||||
m_OObjectTextNormal.Draw();
|
|
||||||
m_OObjectTextBold.Draw();
|
|
||||||
m_OObjectTextItalic.Draw();
|
|
||||||
m_OObjectTextBoldItalic.Draw();
|
|
||||||
#endif
|
|
||||||
WidgetScrooled::OnDraw(displayProp);
|
WidgetScrooled::OnDraw(displayProp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,14 +145,7 @@ void CodeView::OnRegenerateDisplay(void)
|
|||||||
// For the scrooling windows
|
// For the scrooling windows
|
||||||
CalculateMaxSize();
|
CalculateMaxSize();
|
||||||
|
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
m_OObjectText.Clear();
|
||||||
m_OObjectText.Clear();
|
|
||||||
#else
|
|
||||||
m_OObjectTextNormal.Clear();
|
|
||||||
m_OObjectTextBold.Clear();
|
|
||||||
m_OObjectTextItalic.Clear();
|
|
||||||
m_OObjectTextBoldItalic.Clear();
|
|
||||||
#endif
|
|
||||||
m_OObjectsColored.Clear();
|
m_OObjectsColored.Clear();
|
||||||
|
|
||||||
|
|
||||||
@ -178,18 +158,9 @@ void CodeView::OnRegenerateDisplay(void)
|
|||||||
} // else : nothing to do ...
|
} // else : nothing to do ...
|
||||||
|
|
||||||
// generate the objects :
|
// generate the objects :
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
BufferManager::Get(m_bufferID)->Display(m_OObjectText,
|
||||||
BufferManager::Get(m_bufferID)->Display(m_OObjectText,
|
m_OObjectsColored,
|
||||||
m_OObjectsColored,
|
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
|
||||||
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
|
|
||||||
#else
|
|
||||||
BufferManager::Get(m_bufferID)->Display(m_OObjectTextNormal,
|
|
||||||
m_OObjectTextBold,
|
|
||||||
m_OObjectTextItalic,
|
|
||||||
m_OObjectTextBoldItalic,
|
|
||||||
m_OObjectsColored,
|
|
||||||
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
|
|
||||||
#endif
|
|
||||||
// set the current size of the windows
|
// set the current size of the windows
|
||||||
SetMaxSize(BufferManager::Get(m_bufferID)->GetMaxSize());
|
SetMaxSize(BufferManager::Get(m_bufferID)->GetMaxSize());
|
||||||
|
|
||||||
@ -435,41 +406,12 @@ void CodeView::OnLostFocus(void)
|
|||||||
|
|
||||||
void CodeView::SetFontSize(int32_t size)
|
void CodeView::SetFontSize(int32_t size)
|
||||||
{
|
{
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
m_OObjectText.SetSize(size);
|
||||||
m_OObjectText.SetSize(size);
|
|
||||||
#else
|
|
||||||
m_OObjectTextNormal.SetSize(size);
|
|
||||||
m_OObjectTextBold.SetSize(size);
|
|
||||||
m_OObjectTextItalic.SetSize(size);
|
|
||||||
m_OObjectTextBoldItalic.SetSize(size);
|
|
||||||
#endif
|
|
||||||
SetScrollingSize(size*3.0*1.46); // 1.46 is a magic nmber ...
|
SetScrollingSize(size*3.0*1.46); // 1.46 is a magic nmber ...
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
void CodeView::SetFontName(etk::UString fontName)
|
||||||
void CodeView::SetFontName(etk::UString fontName)
|
{
|
||||||
{
|
m_OObjectText.SetFont(fontName);
|
||||||
m_OObjectText.SetFont(fontName);
|
}
|
||||||
}
|
|
||||||
#else
|
|
||||||
void CodeView::SetFontNameNormal(etk::UString fontName)
|
|
||||||
{
|
|
||||||
m_OObjectTextNormal.SetFont(fontName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CodeView::SetFontNameBold(etk::UString fontName)
|
|
||||||
{
|
|
||||||
m_OObjectTextBold.SetFont(fontName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CodeView::SetFontNameItalic(etk::UString fontName)
|
|
||||||
{
|
|
||||||
m_OObjectTextItalic.SetFont(fontName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CodeView::SetFontNameBoldItalic(etk::UString fontName)
|
|
||||||
{
|
|
||||||
m_OObjectTextBoldItalic.SetFont(fontName);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
@ -39,9 +39,7 @@ class CodeView :public ewol::WidgetScrooled
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Init(void);
|
void Init(void);
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
CodeView(etk::UString fontName, int32_t fontSize);
|
||||||
CodeView(etk::UString fontName, int32_t fontSize);
|
|
||||||
#endif
|
|
||||||
CodeView(void);
|
CodeView(void);
|
||||||
virtual ~CodeView(void);
|
virtual ~CodeView(void);
|
||||||
/**
|
/**
|
||||||
@ -61,14 +59,7 @@ class CodeView :public ewol::WidgetScrooled
|
|||||||
etk::Vector<etk::Vector2D<float> > m_lineNumberList;
|
etk::Vector<etk::Vector2D<float> > m_lineNumberList;
|
||||||
void UpdateNumberOfLineReference(int32_t bufferID);
|
void UpdateNumberOfLineReference(int32_t bufferID);
|
||||||
// drawing elements :
|
// drawing elements :
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
ewol::TEXT_DISPLAY_TYPE m_OObjectText;
|
||||||
ewol::TEXT_DISPLAY_TYPE m_OObjectText;
|
|
||||||
#else
|
|
||||||
ewol::TEXT_DISPLAY_TYPE m_OObjectTextNormal;
|
|
||||||
ewol::TEXT_DISPLAY_TYPE m_OObjectTextBold;
|
|
||||||
ewol::TEXT_DISPLAY_TYPE m_OObjectTextItalic;
|
|
||||||
ewol::TEXT_DISPLAY_TYPE m_OObjectTextBoldItalic;
|
|
||||||
#endif
|
|
||||||
ewol::OObject2DColored m_OObjectsColored;
|
ewol::OObject2DColored m_OObjectsColored;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -106,14 +97,7 @@ class CodeView :public ewol::WidgetScrooled
|
|||||||
virtual void OnLostFocus(void);
|
virtual void OnLostFocus(void);
|
||||||
public:
|
public:
|
||||||
void SetFontSize(int32_t size);
|
void SetFontSize(int32_t size);
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
void SetFontName(etk::UString fontName);
|
||||||
void SetFontName(etk::UString fontName);
|
|
||||||
#else
|
|
||||||
void SetFontNameNormal(etk::UString fontName);
|
|
||||||
void SetFontNameBold(etk::UString fontName);
|
|
||||||
void SetFontNameItalic(etk::UString fontName);
|
|
||||||
void SetFontNameBoldItalic(etk::UString fontName);
|
|
||||||
#endif
|
|
||||||
private:
|
private:
|
||||||
void CalculateMaxSize(void);
|
void CalculateMaxSize(void);
|
||||||
protected:
|
protected:
|
||||||
|
@ -155,22 +155,11 @@ MainWindows::MainWindows(void)
|
|||||||
mySizerHori->SubWidgetAdd(mySizerVert2);
|
mySizerHori->SubWidgetAdd(mySizerVert2);
|
||||||
|
|
||||||
// main buffer Area :
|
// main buffer Area :
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
myCodeView = new CodeView("FreeMono", 24);
|
||||||
myCodeView = new CodeView("Font/freefont/FreeMono.ttf", 24);
|
|
||||||
#else
|
|
||||||
myCodeView = new CodeView();
|
|
||||||
#endif
|
|
||||||
myCodeView->SetExpendX(true);
|
myCodeView->SetExpendX(true);
|
||||||
myCodeView->SetExpendY(true);
|
myCodeView->SetExpendY(true);
|
||||||
myCodeView->SetFillX(true);
|
myCodeView->SetFillX(true);
|
||||||
myCodeView->SetFillY(true);
|
myCodeView->SetFillY(true);
|
||||||
#ifndef APPL_BUFFER_FONT_DISTANCE_FIELD
|
|
||||||
myCodeView->SetFontSize(11);
|
|
||||||
myCodeView->SetFontNameNormal( "Font/freefont/FreeMono.ttf");
|
|
||||||
myCodeView->SetFontNameBold( "Font/freefont/FreeMonoBold.ttf");
|
|
||||||
myCodeView->SetFontNameItalic( "Font/freefont/FreeMonoOblique.ttf");
|
|
||||||
myCodeView->SetFontNameBoldItalic("Font/freefont/FreeMonoBoldOblique.ttf");
|
|
||||||
#endif
|
|
||||||
mySizerVert2->SubWidgetAdd(myCodeView);
|
mySizerVert2->SubWidgetAdd(myCodeView);
|
||||||
|
|
||||||
// search area :
|
// search area :
|
||||||
|
@ -68,7 +68,8 @@ void APP_Init(void)
|
|||||||
ewol::ChangeSize(etk::Vector2D<int32_t>(800, 600));
|
ewol::ChangeSize(etk::Vector2D<int32_t>(800, 600));
|
||||||
etk::InitDefaultFolder(PROJECT_NAME);
|
etk::InitDefaultFolder(PROJECT_NAME);
|
||||||
|
|
||||||
ewol::font::SetDefaultFont("Font/freefont/FreeSerif.ttf");
|
ewol::font::SetDefaultFont("FreeSerif");
|
||||||
|
//ewol::font::SetDefaultFont("Font/freefont/FreeSerif.ttf");
|
||||||
//ewol::font::SetDefaultFont("Font/ACharmingFont.ttf");
|
//ewol::font::SetDefaultFont("Font/ACharmingFont.ttf");
|
||||||
#ifdef __TARGET_OS__Android
|
#ifdef __TARGET_OS__Android
|
||||||
ewol::font::SetDefaultSize(19);
|
ewol::font::SetDefaultSize(19);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user