I have got a string with TAB´s which i want to display in a EditBox.
It seems that CEGUI displaces all TAB´s with just one SPACE char.
Is there any chance to show the TAB´s correctly?
How can i use TAB in a text/editbox?
Moderators: CEGUI MVP, CEGUI Team
afaik there is no built-in support for tabs.
Also, when you inject a character into cegui it only checks the font to see if a codepoint is available for that character, and if it does not have one it is not even added to the string. In otherwords, it is up to your font to determine how the character is displayed. For example, while your font displays a space, my font displays nothing.
I'm not sure how difficult it would be to add this into cegui. I know that CEGUI can detect tabs, as you can pass CEGUI::Key::Tab into the inject methods; but how you tell cegui to 'render 4 spaces' (or whatever) when it encounters a tab, I have no idea; you would also have to adjust the left/right arrow key behavior to account for this (assuming the user can move the cursor).
Also, when you inject a character into cegui it only checks the font to see if a codepoint is available for that character, and if it does not have one it is not even added to the string. In otherwords, it is up to your font to determine how the character is displayed. For example, while your font displays a space, my font displays nothing.
I'm not sure how difficult it would be to add this into cegui. I know that CEGUI can detect tabs, as you can pass CEGUI::Key::Tab into the inject methods; but how you tell cegui to 'render 4 spaces' (or whatever) when it encounters a tab, I have no idea; you would also have to adjust the left/right arrow key behavior to account for this (assuming the user can move the cursor).
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Yeah, what constitutes a 'tab' is not something that's particularly simple to add. The correct implementation of a tab is a 'stop' point at a physical location offset from the start of a line, so just adding 'x' amount of space would not be acceptable for many people.
I'm not sure how you'd do it in for a freetype font, but one semi-solution could be to define an image for the 'tab' character that is empty except for the horizontal advance - which would move the start point of the characters following the tab.
I think once the extended text rendering is added implementing a tab will be much simpler, and (possibly) be included by default.
CE.
I'm not sure how you'd do it in for a freetype font, but one semi-solution could be to define an image for the 'tab' character that is empty except for the horizontal advance - which would move the start point of the characters following the tab.
I think once the extended text rendering is added implementing a tab will be much simpler, and (possibly) be included by default.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Who is online
Users browsing this forum: No registered users and 25 guests

