Difference between revisions of "SDL's TextWrapper and TextSplitter"

From LinuxMCE
Jump to: navigation, search
m (SDL's TextWrapper and TextSlitter moved to SDL's TextWrapper and TextSplitter)
m
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 +
[[Category: Development]]
 
<table width="100%"> <tr><td bgcolor="#FFCFCF">This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007.  In general any information should apply to LinuxMCE.  However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.</td></tr> </table>The logic with text wrapping in Orbiter SDL is changed now. TextSplitter will slit a text in words. If between words there were spaces, the spaces will be preserved in the word, if not, no space will be added in the list with words. In TextWrapper, when the words are rendered, not extra space will be rendered.
 
<table width="100%"> <tr><td bgcolor="#FFCFCF">This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007.  In general any information should apply to LinuxMCE.  However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.</td></tr> </table>The logic with text wrapping in Orbiter SDL is changed now. TextSplitter will slit a text in words. If between words there were spaces, the spaces will be preserved in the word, if not, no space will be added in the list with words. In TextWrapper, when the words are rendered, not extra space will be rendered.
 +
  
 
Examples:
 
Examples:
 
1) if the text is "I am cool", will have three words: "I ", "am " and "cool".  
 
1) if the text is "I am cool", will have three words: "I ", "am " and "cool".  
 
2) if the text is "I_am_busy right now", the words can be: "I_am", "busy ", "right ", "now ".
 
2) if the text is "I_am_busy right now", the words can be: "I_am", "busy ", "right ", "now ".
 +
  
 
This change avoids the logic flaw from the old behavior when extra spaces appeared after non alpha-numeric chars.
 
This change avoids the logic flaw from the old behavior when extra spaces appeared after non alpha-numeric chars.
 
("I_am_busy right now" was splitted as "I_", "am_", "busy", "right", "now", which was rendered as: "I_ am_ busy right now".
 
("I_am_busy right now" was splitted as "I_", "am_", "busy", "right", "now", which was rendered as: "I_ am_ busy right now".
 +
 +
 +
(files location: src/Splitter/TextSplitter.cpp src/Splitter/TextWrapper.cpp)

Latest revision as of 04:32, 25 August 2009

This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007. In general any information should apply to LinuxMCE. However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.
The logic with text wrapping in Orbiter SDL is changed now. TextSplitter will slit a text in words. If between words there were spaces, the spaces will be preserved in the word, if not, no space will be added in the list with words. In TextWrapper, when the words are rendered, not extra space will be rendered.


Examples: 1) if the text is "I am cool", will have three words: "I ", "am " and "cool". 2) if the text is "I_am_busy right now", the words can be: "I_am", "busy ", "right ", "now ".


This change avoids the logic flaw from the old behavior when extra spaces appeared after non alpha-numeric chars. ("I_am_busy right now" was splitted as "I_", "am_", "busy", "right", "now", which was rendered as: "I_ am_ busy right now".


(files location: src/Splitter/TextSplitter.cpp src/Splitter/TextWrapper.cpp)