I am a complete newbie to this engine and have a problem I have been given to solve. I came up with a non-ideal solution using java2d but think that using the gecko layout mechanism might be a better approach. Please let me know what you think, but don't bother commenting on the assignment, as it is something I was given, I did not make it up.

I have a (java) application servlet that is given text in blobs of well structured (not html, but with well-known parts) that represent articles that are to be "poured" into a box. I am given rules for how to display this text regarding things like font size, maximum number of lines, etc. There is also a minimum number of lines parameter.  Articles are "poured" into the box and adjusted as need be, by truncating the content where necessary to accomodate the text lines parameters. If the text was truncated, I need to mark the last line with a trailing ellipisis (...) that fits at the end of the last line of the content for that particular article. I need to fill the box as tight as possible.

I currently attempt to do this using java2d to figure out how to truncate the text so that I can then generate HTML to send it to the user's browser, after slicing and dicing the text for each article. BTW, we are allowed to assume that the user is viewing web pages with the default text size.

So, I think I just want to use the gecko layout engine to do the math for me, iteratively. Is this something that I can use the engine for, or should I take a different approach?

Thanks.
Dean


Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to