[Checkins] SVN: z3c.rml/trunk/ - Added paragraph border support. Patch by Yuan Hong.
Stephan Richter
srichter at gmail.com
Thu Jul 22 14:53:12 EDT 2010
Log message for revision 114938:
- Added paragraph border support. Patch by Yuan Hong.
Changed:
U z3c.rml/trunk/CHANGES.txt
U z3c.rml/trunk/src/z3c/rml/stylesheet.py
A z3c.rml/trunk/src/z3c/rml/tests/expected/tag-para-border.pdf
A z3c.rml/trunk/src/z3c/rml/tests/input/tag-para-border.rml
-=-
Modified: z3c.rml/trunk/CHANGES.txt
===================================================================
--- z3c.rml/trunk/CHANGES.txt 2010-07-22 18:37:59 UTC (rev 114937)
+++ z3c.rml/trunk/CHANGES.txt 2010-07-22 18:53:12 UTC (rev 114938)
@@ -13,6 +13,8 @@
- Implemented ``linePlot3D`` directive. Patch by Faisal Puthuparackat.
+- Added paragraph border support. Patch by Yuan Hong.
+
- Bug: Fixed version number in reference.pt. Patch by Felix Schwarz.
- Bug: Write PDF documents in binary mode. Patch by Felix Schwarz.
Modified: z3c.rml/trunk/src/z3c/rml/stylesheet.py
===================================================================
--- z3c.rml/trunk/src/z3c/rml/stylesheet.py 2010-07-22 18:37:59 UTC (rev 114937)
+++ z3c.rml/trunk/src/z3c/rml/stylesheet.py 2010-07-22 18:53:12 UTC (rev 114938)
@@ -123,6 +123,25 @@
description=(u'When set to "CJK", invoke CJK word wrapping'),
required=False)
+ borderColor = attr.Color(
+ title=u'Border Color',
+ description=u'The color in which the paragraph border will appear.',
+ required=False)
+
+ borderWidth = attr.Measurement(
+ title=u'Paragraph Border Width',
+ description=u'The width of the paragraph border.',
+ required=False)
+
+ borderPadding = attr.Sequence(
+ title=u'Paragraph Border Padding',
+ description=u'Padding of the paragraph.',
+ value_type=attr.Integer(),
+ min_length=1,
+ max_length=4,
+ required=False)
+
+
class IParagraphStyle(IBaseParagraphStyle):
"""Defines a paragraph style and gives it a name."""
Added: z3c.rml/trunk/src/z3c/rml/tests/expected/tag-para-border.pdf
===================================================================
--- z3c.rml/trunk/src/z3c/rml/tests/expected/tag-para-border.pdf (rev 0)
+++ z3c.rml/trunk/src/z3c/rml/tests/expected/tag-para-border.pdf 2010-07-22 18:53:12 UTC (rev 114938)
@@ -0,0 +1,117 @@
+%PDF-1.4
+% ReportLab Generated PDF document http://www.reportlab.com
+% 'BasicFonts': class PDFDictionary
+1 0 obj
+% The standard fonts dictionary
+<< /F1 2 0 R
+ /F2 3 0 R
+ /F3 4 0 R >>
+endobj
+% 'F1': class PDFType1Font
+2 0 obj
+% Font Helvetica
+<< /BaseFont /Helvetica
+ /Encoding /WinAnsiEncoding
+ /Name /F1
+ /Subtype /Type1
+ /Type /Font >>
+endobj
+% 'F2': class PDFType1Font
+3 0 obj
+% Font Times-Bold
+<< /BaseFont /Times-Bold
+ /Encoding /WinAnsiEncoding
+ /Name /F2
+ /Subtype /Type1
+ /Type /Font >>
+endobj
+% 'F3': class PDFType1Font
+4 0 obj
+% Font Times-Roman
+<< /BaseFont /Times-Roman
+ /Encoding /WinAnsiEncoding
+ /Name /F3
+ /Subtype /Type1
+ /Type /Font >>
+endobj
+% 'Page1': class PDFPage
+5 0 obj
+% Page dictionary
+<< /Contents 9 0 R
+ /MediaBox [ 0
+ 0
+ 595.2756
+ 841.8898 ]
+ /Parent 8 0 R
+ /Resources << /Font 1 0 R
+ /ProcSet [ /PDF
+ /Text
+ /ImageB
+ /ImageC
+ /ImageI ] >>
+ /Rotate 0
+ /Trans << >>
+ /Type /Page >>
+endobj
+% 'R6': class PDFCatalog
+6 0 obj
+% Document Root
+<< /Outlines 10 0 R
+ /PageMode /UseNone
+ /Pages 8 0 R
+ /Type /Catalog >>
+endobj
+% 'R7': class PDFInfo
+7 0 obj
+<< /Author (\(anonymous\))
+ /CreationDate (D:20100722144802+05'00')
+ /Keywords ()
+ /Producer (ReportLab http://www.reportlab.com)
+ /Subject (\(unspecified\))
+ /Title (\(anonymous\)) >>
+endobj
+% 'R8': class PDFPages
+8 0 obj
+% page tree
+<< /Count 1
+ /Kids [ 5 0 R ]
+ /Type /Pages >>
+endobj
+% 'R9': class PDFStream
+9 0 obj
+% page stream
+<< /Filter [ /ASCII85Decode
+ /FlateDecode ]
+ /Length 349 >>
+stream
+Gas1Yb>,r/&A26<5Kki)e\mNgagDa(,RtOd"/[ei:m2S at LjhOr8Q10?H"F+kZTGM2Ob^j']kN%__:8u"(GIN#MCFp>>T6;HnD[,7+X'H)<M>;38<sl?29U&H_)jbVnjWqXk0?\)8LBcr#*oD5'>SN8$']g<&bt(Q5_,1uJImsY-s0Ja;22Z]OZcfb\)&0L=S9COI^joRKt5.]4#"f`Vta7g?@?OJK)WP"jmn at u!KX^S#^f$9(<[PhRXC33Ea\k'NdP#.K'18<Zt*clc%$?mh`<U]U%b>L7Z?ap1>I!hA%h:hn#ZuTG/+%X$G at f31@Me^N2t?JY_^DBIq5JJfbdQV$0N^ZFo~>endstream
+endobj
+% 'R10': class PDFOutlines
+10 0 obj
+<< /Count 0
+ /Type /Outlines >>
+endobj
+xref
+0 11
+0000000000 65535 f
+0000000113 00000 n
+0000000233 00000 n
+0000000398 00000 n
+0000000565 00000 n
+0000000732 00000 n
+0000001009 00000 n
+0000001144 00000 n
+0000001377 00000 n
+0000001482 00000 n
+0000001974 00000 n
+trailer
+<< /ID
+ % ReportLab generated PDF document -- digest (http://www.reportlab.com)
+ [(\256\221\002\2701\275\247\030O\013\024\220\224\365\016H) (\256\221\002\2701\275\247\030O\013\024\220\224\365\016H)]
+
+ /Info 7 0 R
+ /Root 6 0 R
+ /Size 11 >>
+startxref
+2026
+%%EOF
Added: z3c.rml/trunk/src/z3c/rml/tests/input/tag-para-border.rml
===================================================================
--- z3c.rml/trunk/src/z3c/rml/tests/input/tag-para-border.rml (rev 0)
+++ z3c.rml/trunk/src/z3c/rml/tests/input/tag-para-border.rml 2010-07-22 18:53:12 UTC (rev 114938)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE document SYSTEM "rml.dtd">
+
+<document
+ filename="tag-paraWordWrap.pdf"
+ xmlns:doc="http://namespaces.zope.org/rml/doc">
+
+ <template showBoundary="1">
+ <pageTemplate id="main">
+ <frame id="first" x1="5cm" y1="1cm" width="10cm" height="26cm"/>
+ </pageTemplate>
+ </template>
+
+ <stylesheet>
+ <paraStyle name="important"
+ borderColor="red"
+ borderWidth="2"
+ borderPadding="5 5" />
+ </stylesheet>
+
+ <story>
+ <title>Paragraph Borders</title>
+ <spacer length="1cm" />
+ <para style="important">
+ This is some important text. In this document all important text is
+ rendered in a red box.
+ </para>
+ </story>
+
+</document>
More information about the checkins
mailing list