I too would prefer to use a subset of HTML to format the text though CSS would be a PITA to make right. Hell, even web browsers can't seem to make CSS work the same across all of them!arquivista wrote: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?)
The problems regarding bold and italic text in HTML could be solved by passing these resources to rich.new:
Code: Select all
local htmlCode = '<html><body><b>This is bold, and <i>this is bold italic</i></b><p/><img src="/images/cool_image.png"/><p/><font face="coolFont" size="20">big text with a cool font!</font></body></html>'
local resources = {
defaultFont = { -- this could be a default of the library so we don't need to pass it to rich.new
normal = '/fonts/Vera.ttf',
bold = '/fonts/VeraBd.ttf',
italic = '/fonts/VeraIt.ttf',
boldItalic = '/fonts/VeraBI.ttf'
},
coolFont = { normal = '/fonts/CoolFont.ttf' } -- don't need the bold and italic variations for this font
}
local rt = rich.new( htmlCode, resources )
Having said that, I'd be glad to have a rich text library available no matter what codification it uses to format the text, so thanks for your efforts Robin.
Cheers,
Andre