[reportlab-users] Small improvements of z3c.rml
Stephan Richter
srichter at cosmos.phy.tufts.edu
Thu Jun 7 15:40:23 EDT 2007
On Tuesday 05 June 2007 10:00, Yuan HOng wrote:
> I just discovered z3c.rml for my project and find it a great product.
That's great to hear!
> In using it in my project, I made the following improvements to your
> code, and hope this will be useful for others.
>
> 1. I am creating Chinese PDF documents. The normal TTF for Chinese
> printing is 'simsun'. However, when we want to have bold in text, we
> switch to 'simhei'. To properly registered this, we need
> reportlab.lib.fonts.addMapping function. This is missing in the
> reportlab RML specification, and I added the directive as:
>
> <addMapping faceName="simsun" bold="1" italic="0" psName="simhei" />
Great. Could you create a small sample RML file demonstrating this feature?
This way the tag will be documented and tested at the same time. Please also
send me a rendered version. See z3c/rml/tests[input|expected].
> 2. Chinese and some other Asian text does not use space as word
> separator, so the default paragraph wrapping doesn't work for them. To
> correct this, reportlab 2.0 introduced the 'wordWrap' attribute to
> 'para' and 'paraStyle' directive. When set to 'CJK', it will cause the
> CJK wrapping algorithm to be used.
Yep, sounds good. Please create a small sample RML file demonstrating the
feature.
> 3. I can't find a way to left align the whole table in a frame.
> Reading the reportlab user guide I find the following:
>
> All flowables have an hAlign property: ('LEFT', 'RIGHT', 'CENTER' or
> 'CENTRE'). For
> paragraphs, which fill the full width of the frame, this has no
> effect. For tables, images or other objects which
> are less than the width of the frame, this determines their horizontal
> placement.
>
> So a <blockTable> should also support the 'alignment' attribute, just
> like a <para>. I added this, and it worked.
Great.
> Attached please find the svn diff output of my modifications against
> the current SVN trunk.
Cool.
I am very excited to hear that someone is using z3c.rml to produce Chinese
PDFs. Once you send me a couple sample.test RML/PDF files, I will check all
your changes into the trunk. It would be also cool to get a non-minimal
sample document from you, so we can show-off the Chinese language support!
> By the way, is <pageNumber> and other sequence tags working? I can't
> get them working.
No, I have not put any thought into how to correctly implement them. If you
want to take a stab at it, please feel free to do so.
Thanks a lot for your feedback and contribution!
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
More information about the reportlab-users
mailing list