Hi, I am writing a program which should include a "previewing system"
before the printing job. What I have to preview in only formatted text,
and the text editors included in the JVM would be fine if only the text
could be justified ; I only need :
- justification
- bold/italic
Really nothing else, and not even any editing feature (the user wants
only to see the document, not to change it). For the moment, I have to
very heavy solutions :
- include FOP in the whole stuff (I want to give a single big JAR to
the user, because it will be installed and reinstalled on several
machines by people having no idea of classpath), and transform my
XML document into XSL-FO before previewing it with a previewer
hacked from the "official" previewer of FOP (current solution)
- include ToastScript in the whole stuff, and convert my XML document
into PostScript (which I can do, by using some special PostScript
headers, like QuikScript (with no 'c' ;-) or tinydict.
What is sad is my document is a very simple XML one, that I could
convert easely to HTML or XHTML. Unfortunately the CSS2 support of Sun
hasn't the feature I want (justification). Do you know a little, simple,
free, HTML previewer having this feature, that I could ecapsulate in my
own program ?
Regards,

Signature
Thomas Baruchel
Pour m'écrire : http://cerbermail.com/?OEyHGNQFEa
John McGrath - 27 Mar 2005 23:53 GMT
> What I have to preview in only formatted text, and the text editors
> included in the JVM would be fine if only the text could be justified ;
> I only need :
> - justification
> - bold/italic
The bold and italic are not a problem, but unfortunately, justified is.
JTextPane is supposed to be able to handle that, but when you specify an
alignment of justified, it actually centers the text. This bug has been
outstanding for years. The Sun Bug Parade report is at:
http://bugs.sun.com/bugdatabase/view_bug.do;:WuuT?bug_id=4263904
An interesting note has been added to the report: "we are targeting to fix
this bug for mustang release". That is Java 6 (a.k.a. 1.6). So if you
can wait a year or so, ...

Signature
Regards,
John McGrath