[DEV] base update of the unichar rework
This commit is contained in:
parent
3b5943c1b2
commit
a8dae7592c
2
external/etk
vendored
2
external/etk
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 4b07b0501793357ffe59333c5d1b2229b1334b54
|
Subproject commit 5f8b094486e0812fef4c59d3d226ae32ba275c71
|
@ -652,7 +652,7 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
|
|||||||
if (m_stopTextPos < m_position.x()) {
|
if (m_stopTextPos < m_position.x()) {
|
||||||
ForceLineReturn();
|
ForceLineReturn();
|
||||||
}
|
}
|
||||||
float basicSpaceWidth = CalculateSize(' ').x();
|
float basicSpaceWidth = CalculateSize(etk::UniChar(' ')).x();
|
||||||
int32_t currentId = 0;
|
int32_t currentId = 0;
|
||||||
int32_t stop;
|
int32_t stop;
|
||||||
int32_t space;
|
int32_t space;
|
||||||
|
@ -136,7 +136,7 @@ bool ewol::FontFreeType::GetGlyphProperty(int32_t fontSize,
|
|||||||
// a small shortcut
|
// a small shortcut
|
||||||
FT_GlyphSlot slot = m_fftFace->glyph;
|
FT_GlyphSlot slot = m_fftFace->glyph;
|
||||||
// retrieve glyph index from character code
|
// retrieve glyph index from character code
|
||||||
int32_t glyph_index = FT_Get_Char_Index(m_fftFace, property.m_UVal);
|
int32_t glyph_index = FT_Get_Char_Index(m_fftFace, property.m_UVal.Get());
|
||||||
// load glyph image into the slot (erase previous one)
|
// load glyph image into the slot (erase previous one)
|
||||||
error = FT_Load_Glyph(m_fftFace, // handle to face object
|
error = FT_Load_Glyph(m_fftFace, // handle to face object
|
||||||
glyph_index, // glyph index
|
glyph_index, // glyph index
|
||||||
|
@ -303,7 +303,7 @@ int32_t ewol::TexturedFont::GetIndex(const uniChar_t charcode, const ewol::font:
|
|||||||
if (charcode < 0x20) {
|
if (charcode < 0x20) {
|
||||||
return 0;
|
return 0;
|
||||||
} else if (charcode < 0x80) {
|
} else if (charcode < 0x80) {
|
||||||
return charcode - 0x1F;
|
return charcode.Get() - 0x1F;
|
||||||
} else {
|
} else {
|
||||||
for (int32_t iii=0x80-0x20; iii < m_listElement[displayMode].Size(); iii++) {
|
for (int32_t iii=0x80-0x20; iii < m_listElement[displayMode].Size(); iii++) {
|
||||||
if ((m_listElement[displayMode])[iii].m_UVal == charcode) {
|
if ((m_listElement[displayMode])[iii].m_UVal == charcode) {
|
||||||
|
@ -112,7 +112,7 @@ void widget::Entry::CalculateMinMaxSize(void)
|
|||||||
ewol::Widget::CalculateMinMaxSize();
|
ewol::Widget::CalculateMinMaxSize();
|
||||||
// get generic padding
|
// get generic padding
|
||||||
vec2 padding = m_shaper.GetPadding();
|
vec2 padding = m_shaper.GetPadding();
|
||||||
int32_t minHeight = m_oObjectText.CalculateSize('A').y();
|
int32_t minHeight = m_oObjectText.CalculateSize(etk::UniChar('A')).y();
|
||||||
vec2 minimumSizeBase(20, minHeight);
|
vec2 minimumSizeBase(20, minHeight);
|
||||||
// add padding :
|
// add padding :
|
||||||
minimumSizeBase += padding*2.0f;
|
minimumSizeBase += padding*2.0f;
|
||||||
@ -167,7 +167,7 @@ void widget::Entry::OnRegenerateDisplay(void)
|
|||||||
vec2 tmpSizeText = tmpSizeShaper - padding * 2.0f;
|
vec2 tmpSizeText = tmpSizeShaper - padding * 2.0f;
|
||||||
vec2 tmpOriginText = (m_size - tmpSizeText) / 2.0f;
|
vec2 tmpOriginText = (m_size - tmpSizeText) / 2.0f;
|
||||||
// sometimes, the user define an height bigger than the real size needed ==> in this case we need to center the text in the shaper ...
|
// sometimes, the user define an height bigger than the real size needed ==> in this case we need to center the text in the shaper ...
|
||||||
int32_t minHeight = m_oObjectText.CalculateSize('A').y();
|
int32_t minHeight = m_oObjectText.CalculateSize(etk::UniChar('A')).y();
|
||||||
if (tmpSizeText.y()>minHeight) {
|
if (tmpSizeText.y()>minHeight) {
|
||||||
tmpOriginText += vec2(0,(tmpSizeText.y()-minHeight)/2.0f);
|
tmpOriginText += vec2(0,(tmpSizeText.y()-minHeight)/2.0f);
|
||||||
}
|
}
|
||||||
@ -377,18 +377,18 @@ bool widget::Entry::OnEventEntry(const ewol::EventEntry& _event)
|
|||||||
//return GenEventInputExternal(eventEnter, -1, -1);
|
//return GenEventInputExternal(eventEnter, -1, -1);
|
||||||
// remove curent selected data ...
|
// remove curent selected data ...
|
||||||
RemoveSelected();
|
RemoveSelected();
|
||||||
if( '\n' == _event.GetChar()
|
if( _event.GetChar() == '\n'
|
||||||
|| '\r' == _event.GetChar()) {
|
|| _event.GetChar() == '\r') {
|
||||||
GenerateEventId(eventEnter, m_data);
|
GenerateEventId(eventEnter, m_data);
|
||||||
return true;
|
return true;
|
||||||
} else if (0x7F == _event.GetChar()) {
|
} else if (_event.GetChar() == 0x7F) {
|
||||||
// SUPPR :
|
// SUPPR :
|
||||||
if (m_data.Size() > 0 && m_displayCursorPos<m_data.Size()) {
|
if (m_data.Size() > 0 && m_displayCursorPos<m_data.Size()) {
|
||||||
m_data.Remove(m_displayCursorPos, 1);
|
m_data.Remove(m_displayCursorPos, 1);
|
||||||
m_displayCursorPos = etk_max(m_displayCursorPos, 0);
|
m_displayCursorPos = etk_max(m_displayCursorPos, 0);
|
||||||
m_displayCursorPosSelection = m_displayCursorPos;
|
m_displayCursorPosSelection = m_displayCursorPos;
|
||||||
}
|
}
|
||||||
} else if (0x08 == _event.GetChar()) {
|
} else if (_event.GetChar() == 0x08) {
|
||||||
// DEL :
|
// DEL :
|
||||||
if (m_data.Size() > 0 && m_displayCursorPos != 0) {
|
if (m_data.Size() > 0 && m_displayCursorPos != 0) {
|
||||||
m_data.Remove(m_displayCursorPos-1, 1);
|
m_data.Remove(m_displayCursorPos-1, 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user