a Rich Text library for LÖVE

Showcase your libraries, tools and other projects that help your fellow love users.

Which license should richtext use?

Poll ended at Sat Oct 09, 2010 4:36 pm

Public Domain
4
22%
BSD
1
6%
MIT/X11
5
28%
LPCL
0
No votes
zlib
6
33%
LGPL
1
6%
Other (please specify in replies)
1
6%
 
Total votes: 18

pekka
Party member
Posts: 206
Joined: Thu Jan 07, 2010 6:48 am
Location: Oulu, Finland
Contact:

Re: Idea: RichText

Post by pekka »

You don't apparently think it necessary or interesting to see how the guys at Trolltech have solved these problems when designing Qt and its Rich Text facility. That's kind of unfortunate. But, you know, I don't really want to defend this idea. I'm perfectly fine with you not liking it. In fact, I assume you don't like it and won't continue this discussion.

I'm just not happy about letting really poor arguments stand. Let's just look at the facts here. Some people can use a SUBSET of HTML as a perfectly fine markup language in their apps. I've even seen people implement a light-weight browser in their games to browse the HTML documentation while the game is running. It can be done. It has been done.

If you choose to do something else, fine. Just try to make the decision sensibly.

I hope it's OK if I don't post to this thread anymore.

(The Argument Clinic sketch was there to suggest I am not getting angry or frustrated here. I just get the feeling I am not getting across to you, but I have no hard feelings about that. On to other things.)
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Idea: RichText

Post by Robin »

pekka wrote:You don't apparently think it necessary or interesting to see how the guys at Trolltech have solved these problems when designing Qt and its Rich Text facility.
No, it is interesting, just not relevant to what we're doing.
pekka wrote:I hope it's OK if I don't post to this thread anymore.
That's OK, although I hoped you'd stick around for more fundamental and important discussions.
pekka wrote:(The Argument Clinic sketch was there to suggest I am not getting angry or frustrated here. I just get the feeling I am not getting across to you, but I have no hard feelings about that. On to other things.)
Heh, I had exactly the same feeling. But yeah.

Now that I got my new laptop and put LÖVE on it etc., I can start implementing it. ^-^
Help us help you: attach a .love.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Idea: RichText

Post by Robin »

Fear not! I have started implementing RichText. It doesn't do anything yet, hell, I don't even know whether the syntax is right, but it's a start.

You may now commence commenting on my coding style, implementation choices and any horrible mistakes I will have made. :D
Attachments
richtext.lua
(2.93 KiB) Downloaded 128 times
Help us help you: attach a .love.
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: Idea: RichText

Post by nevon »

OMG Robin, wtf did you do!? :huh:
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Idea: RichText

Post by kikito »

I like how it looks.

Comments:
  • Some of those methods are going to be transformed into private ones later on, right?
  • That render method is huge. It might help splitting it into several smaller ones
When I write def I mean function.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Idea: RichText

Post by Robin »

kikito wrote:
  • Some of those methods are going to be transformed into private ones later on, right?
I'm not entirely sure what you mean. Local functions?
kikito wrote:
  • That render method is huge. It might help splitting it into several smaller ones
I know, this I absolutely intend to do soon. :roll:

Also: updated version.

I hope you folks want to help testing this once it reaches a testable state.
Attachments
richtext.lua
(3.64 KiB) Downloaded 100 times
Help us help you: attach a .love.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Idea: RichText

Post by kikito »

I'm not entirely sure what you mean. Local functions?
Yes, local functions. "parse" is probably something you want to keep private. I have not reviewed the latest code.
When I write def I mean function.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Idea: RichText

Post by Robin »

New version!
  • Implements colors
  • Implements PO2 fix
  • Splits up the render function
  • Checked for syntax errors
Attachments
richtext.lua
(4.44 KiB) Downloaded 113 times
Help us help you: attach a .love.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Idea: RichText

Post by Robin »

New version!

This time, it works! It really does! However, there are still some issues and edge cases. Example main.lua included, you can fool around with it to test more of the richtext lib.

Requires 0.7.0, just mentioning. :P

Code: Select all

-- issues/bugs: (*: open  /: probably fixed  ~: workaround found)
--  * still under-tested
--  * renderText() may be too monolithic
--  * word wrapping might not be optimal
--  * words keep their final space in wrapping, which may cause words to be wrapped too soon
--  ~ text doesn't seem to be aligned properly, found workaround by multiplying height by 1.5, might need to be fixed in LÖVE
--  * initial text color (other than white) has to be specified manually by starting text
Attachments
richtext.love
(4.19 KiB) Downloaded 148 times
Help us help you: attach a .love.
User avatar
arquivista
No longer with us
Posts: 266
Joined: Tue Jul 06, 2010 8:39 am
Location: Insert Geolocation tag here
Contact:

Re: Idea: RichText

Post by arquivista »

My humble opinion. Rich Text would be a nice addition indeed but I think basic html and basic css would bring more text benefits than rich text and nice way to include and present external info. And since Rich Text is still a proprietary system and HTML/CSS an open one I think LOVE that is a free-source/open systems adept should be more "oriented" to adopt another open system like HTML/CSS.
But to be honest first I would also love to see printf with justify option (probably hard to implement right?)
--------------------------------------------------------
To Do: Insert Signature Here
--------------------------------------------------------
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 3 guests