SFML community forums
General => SFML wiki => Topic started by: panithadrum on August 10, 2010, 09:00:40 pm
-
sfe::RichText Allows the user to draw paragraphs of text with mixed styles and colors.
The source code is found in this git repository: https://github.com/Skyrpex/RichText.
You are invited to contribute using the issue tracker (https://github.com/Skyrpex/RichText/issues).
Have fun!
-
I could have created a new thread, but I thought to give all the credit to panithadrum and keep the 'history' clear I'll bump this old thread. ;)
I've converted the class using an old version of SFML 2 from the old wiki to the latest SFML 2 version and added it to the GitHub wiki (unfortunatly the titles still don't get updated correctly).
- A RichText class (https://github.com/SFML/SFML/wiki/Source:-RichText)
This class can still get some improvements, so feel free to do so. ;)
-
I forgot about that class 8) Thanks for the conversion!
It would be cool if someone fixes the return carriage thing. Maybe I will do myself, but I'm quite busy this month.
-
unfortunatly the titles still don't get updated correctly
The GitHub guy answered me about this: they changed how title work, and now the page name is shown as the main title, regardless of whether there is a level-1 title (one #) or not.
So it seems that the whole naming convention has to be changed, you must use "human friendly" page names directly.
-
I forgot about that class 8) Thanks for the conversion!
It would be cool if someone fixes the return carriage thing. Maybe I will do myself, but I'm quite busy this month.
Hehe no problem, maybe I'll look into it.
@Laurent: Will you give out new directives?
-
Looks great!
I've 2-3 remarks though. ;D
Wouldn't vector be more efficient here (instead of list) ? (Insertion is only at the end so it's should be O(1) most of the time, and iteration is quite frequent in this class so it should be faster with continuous memory.) I know that at this scale it doesn't really matter which collection you use but it's a good programming practice.
On the style level, using a typedef std::somecollection<sf::Text> CollectionType; would allow changing the collection in one line editing.
Last remarque : using sf as the namespace is quite confusion IMHO. If someone sees an example alone he would think RichText is part of SFML itself and when he will try to use it he will get errors without understanding why.
And I say it again : great job, this is really useful !
-
Last remarque : using sf as the namespace is quite confusion IMHO. If someone sees an example alone he would think RichText is part of SFML itself and when he will try to use it he will get errors without understanding why.
Hehe I knew you would bring that up. ;D
But I fully agree with you. It kind of is like trying to put some code into the std namespace (which isn't allowed afaik). ;)
Btw Hirua, will you consider porting your sources from the old wiki to the new one?
-
It's probably quite another level but I guess it would be interesting to read real RTF files and to be able to display them. librtf (http://librtf.sourceforge.net/) seems to do a good part of the job.
-
Btw Hirua, will you consider porting your sources from the old wiki to the new one?
Yes, I might do that later this summer if I have enough free time (it has been on my mind since a few months now but time is running out so fast...).
-
I felt like creating a git repository so... https://github.com/Skyrpex/RichText
You are invited to contribute!
-
I felt like creating a git repository so... https://github.com/Skyrpex/RichText
Nice! :)
Btw you could update the first post of yours, adding the new wiki page & the git repository.
Also it's now questionable if the wiki page is really needed or if we should just link to your repository...
-
Btw you could update the first post of yours, adding the new wiki page & the git repository.
Done!
Also it's now questionable if the wiki page is really needed or if we should just link to your repository...
I've just edited the wiki page to link to the repository, but I think it should move from source code to projects.
-
I've just edited the wiki page to link to the repository, but I think it should move from source code to projects.
Then do so! :P
The wiki is the territory of the users. ;)
-
Hey guys!
FYI, I've released version 2.0.0 that mainly fixes the newline bug.
Have fun!