Looking for a HTML like rendering library (wishlist)

L

Laszlo Nagy

Hello,

I'm looking for a library that can do the following:

* Parse a simple structured text file (XML or HTML etc.)
* Render its output to an image
* I would like to give the maximum width of the image (but not the
minimum)
* I would like to use my custom TrueType fonts, and some basic
formatting: colors, underline, numbered and bulleted lists
* I would like to embed some PNG (transparent) images, and align
them inside the text
* The library should be able to calculate the size of the image
before rendering
* The library should be able to render the image into memory
* It should be reasonably fast
* It should be independent of windowing toolkits (PIL is okay)


Why I need this: create widgets in GUI applications, for example:

* A label that can display formatted text
* A new grid cell renderer that can display small images and text as
well
* Hint window (tooltip) that has formatted text and images
* Create automatic signatures for e-mails (not GUI related)
* etc

I tried to implement something similar in pure Python, PyXRP and PIL. I
could do it, but either it was too slow (10 frames per sec on 300x300
final size) or consumed too much memory.
Do you know any alternative?

Thanks,

Laszlo
 
S

Stefan Behnel

Laszlo said:
I'm looking for a library that can do the following:

* Parse a simple structured text file (XML or HTML etc.)
* Render its output to an image
* I would like to give the maximum width of the image (but not the
minimum)
* I would like to use my custom TrueType fonts, and some basic
formatting: colors, underline, numbered and bulleted lists
* I would like to embed some PNG (transparent) images, and align
them inside the text
* The library should be able to calculate the size of the image
before rendering
* The library should be able to render the image into memory
* It should be reasonably fast
* It should be independent of windowing toolkits (PIL is okay)


Why I need this: create widgets in GUI applications, for example:

* A label that can display formatted text
* A new grid cell renderer that can display small images and text as
well
* Hint window (tooltip) that has formatted text and images
* Create automatic signatures for e-mails (not GUI related)
* etc

After reading this, I still do not understand why you want to do this with
images. Virtually any GUI toolkit can display text, most can natively display
HTML, just look at Qt for a good example.

So why not just use the native features?

Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top