[fpc-pascal] HTML or RichText viewer components

ik idokan at gmail.com
Tue Jan 8 08:34:00 CET 2008


On Jan 8, 2008 9:10 AM, Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
> Hi,
>
> Has anybody got experience with HTML or RichText viewer components?
> Has anybody implemented something like this?
>
> I would like to start a HTML/RichText viewer component for fpGUI.
> Unfortunately I have no idea where to start.  I guess trying to make
> the component HTML 4 and maybe CSS1 complaint would be a good idea.
>
> This will obviously be a long term effort, but would come in very
> handy if fpGUI wanted to implement it's own HTML based Help Viewer or
> some Rich Text Viewer. There are lots of other uses for such a
> component as well.
>
> I need some guidelines of the development process of such a
> component.... Anybody got some thoughts. Here are some 'off the top of
> my head' steps to follow.
>
> 1. I guess first thing would be to get some HTML parser. There are
> lots available, so that should be fairly easy.

First create HTML 3.2 complaint.. it's easier then HTML 4(.1).
Then continue to HTML 4.1 :) The TV Pro have HTML 3.2 support...

>
> 2. Break down the document into parts (classes or some sort). Letters,
> Words, Lines, Paragraphs, Document.

There is a DOM. Please note that Om XHTML, the idea is that you have
the actual data as HTML (or XML) and the part of how to display it (as
CSS).

>
> 3. Next I guess would be to implement simple text formatting as a
> start - Bold, Italics, Underline, font color etc...

That's properties for text... If you are going to implement CSS, then
I belive it should arrive there rather then the HTML classes.

>
> 4. A lot more.... :)
>
>
> I guess I could look at Java or Qt class documentation for ideas of
> breaking down the classes.
>
> Anybody got some thoughts or code to offer? Maybe somebody saw a
> article explaining such a process (no matter the language).

Start slowly and simple... try to be able for example to understand
where are you are the document, and what you should do as the main
engine.
Also separate between the rendering and the parsing ! They are two
different things.

And last, make it library (and API) based as one feature, so we will
have a parsing and rendering engines to offer other languages, that
will might create a community all around this project (at some point
:))

>
>
> Regards,
>   - Graeme -
>
>
> _______________________________________________
> fpGUI - a cross-platform Free Pascal GUI toolkit
> http://opensoft.homeip.net/fpgui/



Ido
-- 
http://ik.homelinux.org/



More information about the fpc-pascal mailing list