Initial revision
authorrgbecker
Tue, 15 Feb 2000 15:07:37 +0000
changeset 4 490f6b790498
parent 3 add1aaa421d0
child 5 5e321293413b
Initial revision
reportlab/demos/odyssey/00readme.txt
reportlab/demos/odyssey/odyssey.py
reportlab/demos/pythonpoint/lj8100.jpg
reportlab/demos/pythonpoint/monterey.py
reportlab/demos/pythonpoint/monterey.xml
reportlab/demos/pythonpoint/python.gif
reportlab/demos/pythonpoint/pythonpoint.py
reportlab/demos/pythonpoint/spectrum.png
reportlab/demos/pythonpoint/styles_horrible.py
reportlab/demos/pythonpoint/styles_modern.py
reportlab/demos/pythonpoint/vertpython.gif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/reportlab/demos/odyssey/00readme.txt	Tue Feb 15 15:07:37 2000 +0000
@@ -0,0 +1,7 @@
+This demo takes a large volume of text and prints it
+in the simplest way possible.  It is a demo of the
+basic technique of looping down a page manually and 
+breaking at the bottom.
+
+There are a large selection of online books at:
+	http://classics.mit.edu/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/reportlab/demos/odyssey/odyssey.py	Tue Feb 15 15:07:37 2000 +0000
@@ -0,0 +1,154 @@
+###############################################################################
+#
+#	ReportLab Public License Version 1.0
+#
+#   Except for the change of names the spirit and intention of this
+#   license is the same as that of Python
+#
+#	(C) Copyright ReportLab Inc. 1998-2000.
+#
+#
+# All Rights Reserved
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation for any purpose and without fee is hereby granted, provided
+# that the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of Robinson Analytics not be used
+# in advertising or publicity pertaining to distribution of the software
+# without specific, written prior permission. 
+# 
+#
+# Disclaimer
+#
+# ReportLab Inc. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+# IN NO EVENT SHALL ReportLab BE LIABLE FOR ANY SPECIAL, INDIRECT
+# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE. 
+#
+###############################################################################
+#	$Log: odyssey.py,v $
+#	Revision 1.1  2000/02/15 15:09:29  rgbecker
+#	Initial revision
+#
+__version__=''' $Id: odyssey.py,v 1.1 2000/02/15 15:09:29 rgbecker Exp $ '''
+#odyssey.py
+#
+#Demo/benchmark of PDFgen rendering Homer's Odyssey.
+
+
+
+#results on my humble P266 with 64MB:
+# Without page compression:
+# 239 pages in 3.76 seconds = 77 pages per second
+
+# With textOut rather than textLine, i.e. computing width
+# of every word as we would for wrapping:
+# 239 pages in 10.83 seconds = 22 pages per second
+
+# With page compression and textLine():
+# 239 pages in 39.39 seconds = 6 pages per second
+
+from pdfgen import canvas
+import time
+
+
+#from pagesizes import A4  #from PIDDLE distribution
+A4 = (595.275590551, 841.88976378)
+inch = INCH = 72
+cm = CM = inch / 2.54
+
+#precalculate some basics
+top_margin = A4[1] - inch
+bottom_margin = inch
+left_margin = inch
+right_margin = A4[0] - inch
+frame_width = right_margin - left_margin
+
+
+def drawPageFrame(canv):
+    canv.line(left_margin, top_margin, right_margin, top_margin)
+    canv.setFont('Times-Italic',12)
+    canv.drawString(left_margin, top_margin + 2, "Homer's Odyssey")
+    canv.line(left_margin, top_margin, right_margin, top_margin)
+
+
+    canv.line(left_margin, bottom_margin, right_margin, bottom_margin)
+    canv.drawCentredString(0.5*A4[0], 0.5 * inch,
+               "Page %d" % canv.getPageNumber())
+
+    
+
+def run():
+    started = time.time()
+    canv = canvas.Canvas('odyssey.pdf')
+    canv.setPageCompression(0)
+    drawPageFrame(canv)
+
+    #do some title page stuff
+    canv.setFont("Times-Bold", 36)
+    canv.drawCentredString(0.5 * A4[0], 7 * inch, "Homer's Odyssey")
+
+    canv.setFont("Times-Bold", 18)
+    canv.drawCentredString(0.5 * A4[0], 5 * inch, "Translated by Samuel Burton")
+
+    canv.setFont("Times-Bold", 12)
+    tx = canv.beginText(left_margin, 3 * inch)
+    tx.textLine("This is a demo-cum-benchmark for PDFgen.  It renders the complete text of Homer's Odyssey")
+    tx.textLine("from a text file.  On my humble P266, it does 77 pages per secondwhile creating a 238 page")
+    tx.textLine("document.  If it is asked to computer text metrics, measuring the width of each word as ")
+    tx.textLine("one would for paragraph wrapping, it still manages 22 pages per second.")
+    tx.textLine("")
+    tx.textLine("Andy Robinson, Robinson Analytics Ltd.")
+    canv.drawText(tx)
+    
+    canv.showPage()
+    #on with the text...
+    drawPageFrame(canv)
+    
+    canv.setFont('Times-Roman', 12)
+    tx = canv.beginText(left_margin, top_margin - 0.5*inch)
+    
+    data = open('odyssey.txt','r').readlines()
+    for line in data:
+        #this just does it the fast way...
+        tx.textLine(line)
+        #this forces it to do text metrics, which would be the slow
+        #part if we were wrappng paragraphs.
+        #canv.textOut(line)
+        #canv.textLine('')
+
+        #page breaking        
+        y = tx.getY()   #get y coordinate
+        if y < bottom_margin + 0.5*inch:
+            canv.drawText(tx)
+            canv.showPage()
+            drawPageFrame(canv)
+            canv.setFont('Times-Roman', 12)
+            tx = canv.beginText(left_margin, top_margin - 0.5*inch)
+
+            #page
+            pg = canv.getPageNumber()
+            if pg % 10 == 0:
+                print 'formatted page %d' % canv.getPageNumber()
+
+    print 'about to write to disk...'
+    
+    canv.save()
+    
+    finished = time.time()
+    elapsed = finished - started
+    pages = canv.getPageNumber()
+    speed =  pages / elapsed
+    print '%d pages in %0.2f seconds = %0.2f pages per second' % (
+                pages, elapsed, speed)
+    
+    
+
+
+
+if __name__=='__main__':
+    run()
Binary file reportlab/demos/pythonpoint/lj8100.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/reportlab/demos/pythonpoint/monterey.py	Tue Feb 15 15:07:37 2000 +0000
@@ -0,0 +1,206 @@
+###############################################################################
+#
+#	ReportLab Public License Version 1.0
+#
+#   Except for the change of names the spirit and intention of this
+#   license is the same as that of Python
+#
+#	(C) Copyright ReportLab Inc. 1998-2000.
+#
+#
+# All Rights Reserved
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation for any purpose and without fee is hereby granted, provided
+# that the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of Robinson Analytics not be used
+# in advertising or publicity pertaining to distribution of the software
+# without specific, written prior permission. 
+# 
+#
+# Disclaimer
+#
+# ReportLab Inc. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+# IN NO EVENT SHALL ReportLab BE LIABLE FOR ANY SPECIAL, INDIRECT
+# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE. 
+#
+###############################################################################
+#	$Log: monterey.py,v $
+#	Revision 1.1  2000/02/15 15:07:38  rgbecker
+#	Initial revision
+#
+__version__=''' $Id: monterey.py,v 1.1 2000/02/15 15:07:38 rgbecker Exp $ '''
+"""This builds the document for my talk at Monterey."""
+
+from piddle import *
+import platypus
+import textcanvas
+import pagesizes
+import pythonpoint_old
+    
+def myPageBorder(canvas, doc):
+    "Draws the standard border for this talk"
+    canvas.drawImage('vertpython.gif',0, pagesizes.A4[0], 144, -1)
+
+    canvas.drawString('copyright Robinson Analytics 1999',
+        pagesizes.A4[1] - 3.5 * inch,
+        pagesizes.A4[0] - 0.75*inch,
+        font=Font(italic=1)
+        )
+        
+    canvas.drawString('Printing with Python and PDFgen',
+        pagesizes.A4[1] - 4.5 * inch,
+        0.5*inch,
+        font=Font(size=18)
+        )
+    
+
+page1data = """/H1 Printing with Python
+!image lj8100.jpg
+/Center Andy Robinson, Robinson Analytics Ltd.
+/Center O'Reilly Python Conference, Monterey, 24 Aug 1999
+!page
+/H2 Background to this project
+
+o   London-based consultant and corporate developer
+o   want to do neat Python stuff in the daytime
+o   working for many years on financial modelling
+o   this is one of 6 modules in that system
+o   quickest to deliver, offers very wide benefits
+o   25% of architecture done, but already very useful
+o   don't worry, be crappy!
+
+!page
+/H2 Goal:  
+
+A reporting package on the Next Curve...
+o   Report on objects, not databases
+o   Scalable to million page runs
+o   Light enough to embed in any application
+o   Allow reuse of graphical objects across reports
+o   Open and Extensible
+o   Publication Quality
+o   Support all the world's languages
+
+!page
+
+/H2 Portable Document Format
+
+"The New PostScript"
+o   Free readers on all platforms
+o   Better than paper - view it, email it, print it
+o   'Final Form' for documents
+o   High end solution - no limits to quality
+
+...but you can't learn it in Notepad!
+
+!page
+/H1 PDFgen and PIDDLE
+
+!page
+/H2 Layer One: PDFgen
+o   makes PDF documents from pure Python
+o   wraps up PDF document structure
+o   exposes nice effects - page transitions, outline trees
+o   low level graphics primitives (PostScript model!)
+o   Fine control of text placement
+o   Supports Asian text
+o   Supports coordinate transforms
+... a foundation for other apps to build on
+Status: In use now, fairly stable, internal cleanup due
+
+!page
+/H2 PDF Image Support
+
+Python Imaging Library and zlib do the work - many formats.
+Images cached (like .pyc files) - very fast builds possible.
+!image python.gif
+
+!page
+
+/H2 Layer Two: PIDDLE
+
+Plug In Drawing, Does Little Else
+o   Easy Graphics Library
+o   Abstract Canvas interface
+o   Pluggable Back Ends
+o   Same code can do viewing and printing
+o   Standard set of test patterns
+o   Uses Python Imaging Library
+
+Back ends include Tkinter, wxPython, Mac, Pythonwin, 
+PDF, Postscript, OpenGL, Adobe Illustrator, and Python
+Imaging Library.  Really easy to add a new one!
+!page
+
+/H2 Layer Three: PLATYPUS 
+"Page Layout and Typography Using Scripts"
+Trying to work out the API now.
+Key concepts:
+o   Drawable Objects - can 'wrap to fit'
+o   Frames on page
+o   Frame consumes from a list of drawables until full
+o   Document Models e.g. SimpleFlowDocument
+
+XSL Flow Object model may be a good target.
+!page
+/H2 Drawable Objects
+
+Next layer of PIDDLE extensibility.  
+Each draws in its own coordinate system.
+o   paragraph, image, table
+o   chart libraries
+o   diagrams
+Open Source - let people contribute new ones. Anything you
+could have in a view can be a new drawable type.
+
+!page
+/H2 Style Sheet Driven
+
+Styles should use acquisition
+o   Paragraph Styles - Style Sheet Compulsory!
+o   Text Styles
+o   Table and Table Cell Styles
+
+
+!page
+
+/H1 Vision:
+o   XML to PDF in one step
+o   Publish to web and print from same source
+o   Publish books and Open Source documentation
+o   Financial and Scientific reporting tool
+o   Embedded reporting engine
+o   Volume reporting tool for business
+
+!page
+
+/H2 PythonPoint
+
+
+How I made this presentation...
+"""
+
+
+def run():
+    a4width, a4height = pagesizes.A4
+    mysize = (a4height, a4width)   # flip it to landscape
+    
+    doc = platypus.SimpleFlowDocument('monterey.pdf',mysize)
+    #doc.showBoundary = 1
+    doc.leftmargin =  2 * inch  # all default to one inch if not given
+    doc.onFirstPage = myPageBorder
+    doc.onNewPage = myPageBorder
+    
+    things_to_draw = pythonpoint_old.parsePPFtext(page1data)
+    
+    doc.build(things_to_draw)
+
+if __name__ == '__main__':
+    run()
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/reportlab/demos/pythonpoint/monterey.xml	Tue Feb 15 15:07:37 2000 +0000
@@ -0,0 +1,171 @@
+<presentation filename='monterey.pdf'>
+	<stylesheet module="styles_modern" function="getParagraphStyles"/>
+	
+	<!--sections define a colection of stuff to be drawn on all pages they contain.
+	They must begin with a graphics list-->
+	<section name='Main'>
+        <fixedimage filename='vertpython.gif' x='0' y='0' width='144' height='595'/>
+
+    <slide id="Slide001" title="Cover" effectname='Wipe'>
+        <!--put stuff here to be drawn on the page directly-->
+        <frame x="160" y="72" width="600" height="432" leftmargin="36" rightmargin="0">
+			<para/>
+			<para/>
+			<para/>
+            <para style='Title'>Printing with Python</para>
+			<image filename='lj8100.jpg'/>
+			<para style='BigCentered'>Andy Robinson, Robinson Analytics Ltd.</para>
+			<para style='BigCentered'>O'Reilly Python Conference, Monterey, 24th August 1999</para>
+        </frame>
+    </slide>
+
+    <slide id="Slide002" title="Background" effectname='Wipe'>
+        <frame x="160" y="72" width="600" height="432" leftmargin="36" rightmargin="0">
+			<para style='Heading2'>Background to the project:</para>
+			<para style='Bullet' bullettext=''>London-based consultant and corporate developer</para>
+			<para style='Bullet' bullettext=''>want to do neat Python stuff in the daytime</para>
+			<para style='Bullet' bullettext=''>working for many years on financial modelling</para>
+			<para style='Bullet' bullettext=''>this is one of 6 modules in that system</para>
+			<para style='Bullet' bullettext=''>quickest to deliver, offers very wide benefits</para>
+			<para style='Bullet' bullettext=''>25% of architecture done, but already very useful</para>
+			<para style='Bullet' bullettext=''>Release early, release often!</para>
+        </frame>
+    </slide>
+
+    <slide id="Slide003" title="Goal" effectname='Wipe'>
+        <fixedimage filename='vertpython.gif' x='0' y='0' width='144' height='595'/>
+        <frame x="160" y="72" width="600" height="432" leftmargin="36" rightmargin="0">
+			<para style='Heading2'>Goal:</para>
+			<para style='BodyText'>A Reporting Package on the Next Curve... </para>
+			<para style='Bullet' bullettext=''>Report on objects, not databases</para>
+			<para style='Bullet' bullettext=''>Scalable to million page runs</para>
+			<para style='Bullet' bullettext=''>Light enough to embed in any application</para>
+			<para style='Bullet' bullettext=''>Allow reuse of graphical objects across reports</para>
+			<para style='Bullet' bullettext=''>Open and extensible on several levels </para>
+			<para style='Bullet' bullettext=''>Publication quality</para>
+   			<para style='Bullet' bullettext=''>Support all the world's languages - one day</para>
+        </frame>
+    </slide>
+
+    <slide id="Slide004" title="Portable Document Format" effectname='Wipe'>
+        <frame x="160" y="72" width="600" height="432" leftmargin="36" rightmargin="0">
+			<para style='Heading2'>Portable Document Format</para>
+			<para style='Italic'>The New PostScript </para>
+			<para style='Bullet' bullettext=''>Free readers on all platforms</para>
+			<para style='Bullet' bullettext=''>Better than paper - view it, email it, print it</para>
+			<para style='Bullet' bullettext=''>'Final Form' for documents</para>
+			<para style='Bullet' bullettext=''>High end solution - no limits to quality</para>
+			<para style='Italic'>...but you can't learn it in Notepad!</para>
+        </frame>
+    </slide>
+
+    <slide id="Slide005" title="PDFgen and PIDDLE" effectname='Wipe'>
+        <frame x="160" y="72" width="600" height="432" leftmargin="36" rightmargin="0">
+			<para/>
+			<para/>
+			<para style='Title'>PDFgen and PIDDLE</para>
+		</frame>
+    </slide>
+
+    <slide id="Slide006" title="PDFgen layer" effectname='Wipe'>
+        <frame x="160" y="72" width="600" height="432" leftmargin="36" rightmargin="0">
+			<para style='Heading2'>Layer One - PDFgen</para>
+			<para style='Bullet' bullettext=''>makes PDF documents from pure Python</para>
+			<para style='Bullet' bullettext=''>wraps up PDF document structure</para>
+			<para style='Bullet' bullettext=''>exposes nice effects - page transitions, outline trees (RSN!)</para>
+			<para style='Bullet' bullettext=''>low level graphics promitives (postscript imaging model)</para>
+			<para style='Bullet' bullettext=''>Fine control of text placement</para>
+			<para style='Bullet' bullettext=''>Supports Asian text</para>
+   			<para style='Bullet' bullettext=''>Supports coordinate transformations and clipping</para>
+			<para style='Italic'>...a foundation for other apps to build on</para>
+        </frame>
+    </slide>
+
+    <slide id="Slide007" title="PDF Image Suuport" effectname='Wipe'>
+        <frame x="160" y="72" width="600" height="432" leftmargin="36" rightmargin="0">
+			<para style='Heading2'>PDFgen Image Support</para>
+			<para>Python Imaging Library and zlib do all the work - many formats.  Images 
+			cached (like .pyc files) - very fast builds possible.
+			</para>
+			<image filename='python.gif' width='588' height='200'/>
+        </frame>
+    </slide>
+
+    <slide id="Slide008" title="Layer Two: PIDDLE" effectname='Wipe'>
+        <frame x="160" y="72" width="600" height="432" leftmargin="36" rightmargin="0">
+			<para style='Heading2'>Layer Two: PIDDLE</para>
+			<para style='Italic'>Plug In Drawing, Does Little Else</para>
+			<para style='Bullet' bullettext=''>Easy Graphics Library</para>
+			<para style='Bullet' bullettext=''>Abstract Canvas Interface</para>
+			<para style='Bullet' bullettext=''>Pluggable Back Ends</para>
+			<para style='Bullet' bullettext=''>Same code can do viewing and printing</para>
+			<para style='Bullet' bullettext=''>Standard set of test patterns</para>
+			<para style='Bullet' bullettext=''>Uses Python Imaging Library</para>
+			<para style='BodyText'>
+				Back ends includeTkinter, wxPython, Mac, Pythonwin, PDF, PostScript,
+				OpenGL, Adobe Illustrator and PIL.  Really easy to add a new one!
+			</para>
+		</frame>
+    </slide>
+
+    <slide id="Slide009" title="Layer Three: PLATYPUS" effectname='Wipe'>
+        <frame x="160" y="72" width="600" height="432" leftmargin="36" rightmargin="0">
+			<para style='Heading2'>Layer Three: PLATYPUS</para>
+			<para style='Italic'>"Page Layout And Typography Using Scripts"</para>
+			<para style='BodyText'>Trying to work out the API now.  Key Concepts:</para>
+			<para style='Bullet' bullettext=''>Drawable objects - can 'wrap to fit'</para>
+			<para style='Bullet' bullettext=''>Frames on page</para>
+			<para style='Bullet' bullettext=''>Frame consumes from a list of drawables until full</para>
+			<para style='Bullet' bullettext=''>Document Models e.g. SimpleFlowDocument</para>
+			<para style='BodyText'>XSL Flow Object model may be a good target</para>
+		</frame>
+    </slide>
+
+    <slide id="Slide010" title="Drawable Objects" effectname='Wipe'>
+        <frame x="160" y="72" width="600" height="432" leftmargin="36" rightmargin="0">
+			<para style='Heading2'>Drawable Objects</para>
+			<para style='BodyText'>
+				Next layer of PIDDLE extensibility.  Each draws in its own 
+				coodinate system
+			</para>
+			<para style='Bullet' bullettext=''>paragraph, image, table</para>
+			<para style='Bullet' bullettext=''>chart libraries</para>
+			<para style='Bullet' bullettext=''>diagrams</para>
+			<para style='BodyText'>
+				Open Source - let people contribute new ones.  Anything you could 
+				have in a view can be a new drawable type.
+			</para>
+		</frame>
+    </slide>
+
+    <slide id="Slide011" title="Style Sheets" effectname='Wipe'>
+        <frame x="160" y="72" width="600" height="432" leftmargin="36" rightmargin="0">
+			<para style='Heading2'>Style Sheet Driven</para>
+			<para style='BodyText'>
+				Styles use instance inheritance
+			</para>
+			<para style='Bullet' bullettext=''>Paragraph Styles - Style Sheet Compulsory!</para>
+			<para style='Bullet' bullettext=''>Text Styles within a paragraph</para>
+			<para style='Bullet' bullettext=''>Table and Table Cell Styles</para>
+		</frame>
+    </slide>
+
+    <slide id="Slide012" title="Vision" effectname='Wipe'>
+        <frame x="160" y="72" width="600" height="432" leftmargin="36" rightmargin="0">
+			<para style='Heading2'>Vision</para>
+			<para style='Bullet' bullettext=''>XML to PDF in one step</para>
+			<para style='Bullet' bullettext=''>Publish to web and print from same source</para>
+			<para style='Bullet' bullettext=''>Financial and Scientific reporting tool</para>
+			<para style='Bullet' bullettext=''>Embedded reporting engine</para>
+			<para style='Bullet' bullettext=''>Volume reporting tool for business</para>
+		</frame>
+    </slide>
+
+    <slide id="Slide013" title="PythonPoint" effectname='Wipe'>
+        <frame x="160" y="72" width="600" height="432" leftmargin="36" rightmargin="0">
+			<para style='Heading2'>PythonPoint</para>
+			<para style='Italic'>How I made this presentation...</para>
+		</frame>
+    </slide>
+	</section>
+</presentation>
\ No newline at end of file
Binary file reportlab/demos/pythonpoint/python.gif has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/reportlab/demos/pythonpoint/pythonpoint.py	Tue Feb 15 15:07:37 2000 +0000
@@ -0,0 +1,740 @@
+###############################################################################
+#
+#	ReportLab Public License Version 1.0
+#
+#   Except for the change of names the spirit and intention of this
+#   license is the same as that of Python
+#
+#	(C) Copyright ReportLab Inc. 1998-2000.
+#
+#
+# All Rights Reserved
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation for any purpose and without fee is hereby granted, provided
+# that the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of Robinson Analytics not be used
+# in advertising or publicity pertaining to distribution of the software
+# without specific, written prior permission. 
+# 
+#
+# Disclaimer
+#
+# ReportLab Inc. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+# IN NO EVENT SHALL ReportLab BE LIABLE FOR ANY SPECIAL, INDIRECT
+# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE. 
+#
+###############################################################################
+#	$Log: pythonpoint.py,v $
+#	Revision 1.1  2000/02/15 15:08:55  rgbecker
+#	Initial revision
+#
+__version__=''' $Id: pythonpoint.py,v 1.1 2000/02/15 15:08:55 rgbecker Exp $ '''
+# xml parser stuff for PythonPoint
+# PythonPoint Markup Language!
+"""
+This is PythonPoint!
+
+The idea is a simple markup languages for describing
+presentation slides, and other documents which run
+page by page.  I expect most of it will be reusable
+in other page layout stuff.
+
+Look at the sample near the top, which shows how the presentation
+should be coded up.
+
+The parser turns the XML sample into an object tree.  There is a
+simple class hierarchy of items, the inner levels of which create
+drawable objects to go in the frames.
+
+"""
+
+import os
+import string
+import xmllib
+import pprint
+import imp
+
+from pdfgen import canvas
+from platypus import layout
+
+sample = """
+<presentation filename='pythonpoint.pdf'>
+  <section name = 'Main'>
+  	<!-- any graphics in the scetion go on all its paages as a backdrop -->
+    <rectangle x="20" y="510" width="800" height="65" fill="(0,0,1)"/>
+    <rectangle x="20" y="20" width="65" height="555" fill="(0,0,1)"/>
+        
+    <slide id="Slide001" title="My First Slide" effectname='Wipe'>
+        <frame x="96" y="72" width="700" height="432" leftmargin="36" rightmargin="36">
+            <para style='Heading1'>Welcome to PythonPoint</para>
+            <para style='BodyText'>...a library for creating presentation slides.</para>
+            <para style='BodyText'>
+                PythonPoint lets you create attractive and consistent presentation slides
+                on any platform.  It is a demo app built on top of the PDFgen PDF library
+                and the PLATYPUS Page Layout library.  Essentially, it converts slides
+                in an XML format to PDF.
+            </para>
+        </frame>
+    </slide>
+    <slide id="Slide002" title="XML Notation" effectname='Blinds' effectdirection='0'>
+        <frame x="96" y="72" width="700" height="432" leftmargin="36" rightmargin="36">
+            <para style='Heading1'>XML Notation</para>
+            <para style='BodyText'>You create slides in a text editor with 
+				a basic XML	syntax looking like this:
+			</para>
+            <prefmt style='Code'><![CDATA[
+<frame x="160" y="72" width="600" height="432"
+    leftmargin="36" rightmargin="36">
+    <para style='Heading1'>
+        Welcome to PythonPoint
+    </para>
+    <para style='BodyText'>
+        ...a library for creating presentation slides.
+    </para>
+</frame>        ]]>
+            </prefmt>
+            <para style='BodyText'>Pythonpoint then converts these into slides.  Just enter
+				"pythonpoint.py myfile.xml" to create a PDF document (usually called "myfile.pdf").
+			</para>
+
+			
+        </frame>
+    </slide>
+
+    <slide id="Slide003" title="Page Layout" effectname='Box'>
+        <frame x="96" y="72" width="700" height="432" leftmargin="36" rightmargin="36" border='true'>
+            <para style='Heading1'>Page Layout Model</para>
+            <para style='BodyText'>
+                The Page Layout model comes from PLATYPUS (Page Layout and Typography Using Scripts),
+                a key component of the toolkit.  This covers concepts such as:
+            </para>
+            <para style='Bullet' bullettext = ''>Reusable 'Drawable Objects'</para>
+            <para style='Bullet' bullettext = ''>Frames into which objects flow (like this)</para>
+            <para style='Bullet' bullettext = ''>Style Sheets for text, table cells, line styles etc.</para>
+            <para style='Bullet' bullettext = ''>Wrapping, page breaking an document management logic</para>
+            <para style='BodyText'>Everything is open and extensible.  I hope a library of reusable objects
+            such as charts and diagrams will grow up.</para>
+        </frame>
+    </slide>
+
+    <slide id="Slide004" title="Reuse" effectname='Wipe'>
+        <frame x="96" y="72" width="700" height="432" leftmargin="36" rightmargin="36">
+            <para style='Heading1'>Reuse and Consistency - Sections</para>
+            <para style='BodyText'>
+				You can create a 'section' spanning some or all tags in the presentation and place graphics
+				on this.  The blue border and title come from the section.  Here's how we did the border:
+			</para>
+			<prefmt style='Code'><![CDATA[
+<presentation filename='pythonpoint.pdf'>
+  <section name = 'Main'>
+  	<!-- any graphics in the section go on all its pages as a backdrop -->
+    <rectangle x="20" y="510" width="800" height="65" fill="(0,0,1)"/>
+    <rectangle x="20" y="20" width="65" height="555" fill="(0,0,1)"/>
+	...all slides go here...
+  </section>
+</presentation>	]]>
+           
+			</prefmt>
+			<para style='BodyText'> Thus you can re-brand an entire
+				presentation for a  new audience in seconds.
+            </para>
+		</frame>
+	</slide>
+
+    <slide id="Slide005" title="Styles" effectname='Dissolve'>
+        <frame x="96" y="72" width="700" height="432" leftmargin="36" rightmargin="36">
+            <para style='Heading1'>Style Sheets</para>
+            <para style='BodyText'>
+                Paragraph styles are defined externally.  You may specify a filename
+				from which to load a stylesheet with the stylesheet tag.
+            </para>
+            <para style='BodyText'>
+				Thus you can have different sizes and formats by switching stylesheets,
+				or colour and black-and-white options.
+            </para>
+			<para style='BodyText'>
+				When they are added, tables will be driven by line and cell styles in a 
+				similar way.
+            </para>
+			
+        </frame>
+    </slide>
+	
+    <slide id="Slide006" title="Special Effects" effectname='Dissolve'>
+        <frame x="96" y="72" width="700" height="432" leftmargin="36" rightmargin="36">
+            <para style='Heading1'>Special Effects</para>
+            <para style='BodyText'>
+                Acrobat Reader supports tags to define page transition effects.  If you
+				are reading this on screen, you should have seen a selection of these:
+            </para>
+	        <para style='Bullet' bullettext = ''>Split</para>
+	        <para style='Bullet' bullettext = ''>Blinds</para>
+	        <para style='Bullet' bullettext = ''>Box</para>
+	        <para style='Bullet' bullettext = ''>Wipe</para>
+	        <para style='Bullet' bullettext = ''>Dissolve</para>
+	        <para style='Bullet' bullettext = ''>Glitter</para>
+    		<para style='BodyText'>
+				Each has a range of options to fine-tune.
+            </para>
+			<para style='BodyText'>
+				When they are added, tables will be driven by line and cell styles in a 
+				similar way.
+            </para>
+			
+        </frame>
+    </slide>
+	
+	<slide id="Slide007" title="Future Features" effectname='Glitter'>
+        <frame x="96" y="72" width="700" height="432" leftmargin="36" rightmargin="36">
+            <para style='Heading1'>Features Coming Soon</para>
+            <para style='BodyText'>
+                This is the first version that runs.  A lot can now be added fairly easily:
+            </para>
+            <para style='Bullet' bullettext = ''>Preprocessor to let you enter paragraphs 
+				and bullets as one block of text, with less tag typing!</para>
+            <para style='Bullet' bullettext = ''>PIDDLE drawings</para>
+            <para style='Bullet' bullettext = ''>Inline images within the frames</para>
+            <para style='Bullet' bullettext = ''>'Object Graphics' tags with grouping and coordinate transformations</para>
+            <para style='Bullet' bullettext = ''>Speaker notes and a mode to print them</para>
+            <para style='Bullet' bullettext = ''>Tools to archive slides in a database and build presentations to order</para>
+            <para style='Italic' bullettext = ''>...what else can YOU think of?</para>
+        </frame>
+    </slide>
+
+  </section>
+</presentation>
+"""
+
+class PPMLParser(xmllib.XMLParser):
+    attributes = {
+        #this defines the available attributes for all objects,
+        #and their default values.  Although these don't have to
+        #be strings, the ones parsed from the XML do, so
+        #everything is a quoted string and the parser has to
+        #convert these to numbers where appropriate.
+        'stylesheet': {
+            'path':'None',
+            'module':'None',
+            'function':'getParagraphStyles'
+            },
+        'frame': {
+            'x':'0',
+            'y':'0',
+            'width':'0',
+            'height':'0',
+            'leftmargin':'0',
+            'rightmargin':'0',
+            'topmargin':'0',
+            'bottommargin':'0',
+            'border':'false'
+            },
+        'slide': {
+            'id':'None',
+            'title':'None',
+            'effectname':'None',   # Split, Blinds, Box, Wipe, Dissolve, Glitter
+            'effectdirection':'0',   # 0,90,180,270
+            'effectdimension':'H',   # H or V - horizontal or vertical
+            'effectmotion':'I',     # Inwards or Outwards
+            'effectduration':'1'    #seconds
+            },
+        'para': {
+            'style':'Normal',
+            'bullettext':''
+            },
+        'image': {
+            'filename':'',
+            'width':'None',
+            'height':'None'
+            },
+        'rectangle': {
+            'x':'0',
+            'y':'0',
+            'width':'100',
+            'height':'100',
+            'fill':'None',
+            'stroke':'None'
+            }
+        }
+    
+    def __init__(self):
+        self.presentations = []
+        self._curPres = None
+        self._curSection = None
+        self._curSlide = None
+        self._curFrame = None
+        self._curPara = None  #the only places we are interested in
+        self._curPrefmt = None
+        xmllib.XMLParser.__init__(self)
+
+    def getPresentation(self):
+        return self._curPres
+        
+    def handle_data(self, data):
+        #the only data should be paragraph text
+        if self._curPara:
+            self._curPara.rawtext = self._curPara.rawtext + data
+        if self._curPrefmt:
+            self._curPrefmt.rawtext = self._curPrefmt.rawtext + data
+            
+    def handle_cdata(self, data):
+        #just append to current paragraph text, so we can quote XML
+        if self._curPara:
+            self._curPara.rawtext = self._curPara.rawtext + data
+        if self._curPrefmt:
+            self._curPrefmt.rawtext = self._curPrefmt.rawtext + data
+        
+            
+    def start_presentation(self, args):
+        #print 'started presentation:', args['filename']
+        self._curPres = PPPresentation()
+        self._curPres.filename = args['filename']
+        if args.has_key('effect'):
+            self._curPres.effectName = args['effect']
+
+    def end_presentation(self):
+        #print 'ended presentation'
+        print 'Fully parsed presentation',self._curPres.filename
+
+    def start_stylesheet(self, attributes):
+        #makes it the current style sheet.
+        path = attributes['path']
+        if path=='None':
+            path = None
+        modulename = attributes['module']
+        funcname = attributes['function']
+        found = imp.find_module(modulename, path)
+        assert found, "StyleSheet %s not found" % modulename
+        (file, pathname, description) = found
+        mod = imp.load_module(modulename, file, pathname, description)
+        
+        #now get the function
+        func = getattr(mod, funcname)
+        setStyles(func())
+        print 'set global stylesheet to %s.%s()' % (modulename, funcname)
+        
+    def end_stylesheet(self):
+        pass
+
+    def start_section(self, attributes):
+        name = attributes['name']
+        self._curSection = PPSection(name)
+
+    def end_section(self):
+        self._curSection = None
+
+    def start_slide(self, args):
+        s = PPSlide()
+        s.id = args['id']
+        s.title = args['title']
+        if args['effectname'] <> 'None':
+            s.effectName = args['effectname']
+        s.effectDirection = string.atoi(args['effectdirection'])
+        s.effectDimension = args['effectdimension']
+        s.effectMotion = args['effectmotion']
+
+        #let it know its section, which may be none
+        s.section = self._curSection
+        self._curSlide = s
+        
+    def end_slide(self):
+        self._curPres.slides.append(self._curSlide)
+        self._curSlide = None
+
+    def start_frame(self, args):
+        self._curFrame = PPFrame(
+            string.atof(args['x']),
+            string.atof(args['y']),
+            string.atof(args['width']),
+            string.atof(args['height'])
+            )
+        self._curFrame.leftMargin = string.atof(args['leftmargin'])
+        self._curFrame.topMargin = string.atof(args['topmargin'])
+        self._curFrame.rightMargin = string.atof(args['rightmargin'])
+        self._curFrame.bottomMargin = string.atof(args['bottommargin'])
+        if args['border']=='true':
+            self._curFrame.showBoundary = 1
+
+    def end_frame(self):
+        self._curSlide.frames.append(self._curFrame)
+        self._curFrame = None
+
+    def start_para(self, args):
+        self._curPara = PPPara()
+        self._curPara.style = args['style']
+        self._curPara.bulletText = args['bullettext']
+
+    def end_para(self):
+        self._curFrame.content.append(self._curPara)
+        self._curPara = None
+
+    def start_prefmt(self, args):
+        self._curPrefmt = PPPreformattedText()
+        self._curPrefmt.style = args['style']
+
+    def end_prefmt(self):
+        self._curFrame.content.append(self._curPrefmt)
+        self._curPrefmt = None
+
+    def start_image(self, args):
+        self._curImage = PPImage()
+        self._curImage.filename = args['filename']
+        if args['width'] <> 'None':
+            self._curImage.width = string.atof(args['width'])
+        if args['height'] <> 'None':
+            self._curImage.height = string.atof(args['height'])
+        
+    def end_image(self):
+        self._curFrame.content.append(self._curImage)
+        self._curImage = None
+
+
+    ## the graphics objects - go into either the current section
+    ## or the current slide.
+    def start_fixedimage(self, args):
+        img = PPFixedImage()
+        img.filename = args['filename']
+        img.x = eval(args['x'])
+        img.y = eval(args['y'])
+        img.width = eval(args['width'])
+        img.height = eval(args['height'])
+        self._curFixedImage = img
+
+    def end_fixedimage(self):
+        if self._curSlide:
+            self._curSlide.graphics.append(self._curFixedImage)
+        elif self._curSection:
+            self._curSection.graphics.append(self._curFixedImage)
+        self._curFixedImage = None
+
+    def start_rectangle(self, args):
+        rect = PPRectangle(
+                    eval(args['x']),
+                    eval(args['y']),
+                    eval(args['width']),
+                    eval(args['height'])
+                    )
+        self._curRectangle = rect
+        self._curRectangle.fillColor = eval(args['fill'])
+        self._curRectangle.strokeColor = eval(args['stroke'])
+
+    def end_rectangle(self):
+        if self._curSlide:
+            self._curSlide.graphics.append(self._curRectangle)
+        elif self._curSection:
+            self._curSection.graphics.append(self._curRectangle)
+        self._curRectangle = None
+
+
+        
+class PPPresentation:
+    def __init__(self):
+        self.filename = None
+        self.description = None
+        self.slides = []
+        self.effectName = None
+        
+        #assume landscape        
+        self.pageWidth = layout.DEFAULT_PAGE_SIZE[1]  
+        self.pageHeight = layout.DEFAULT_PAGE_SIZE[0]  
+
+    def save(self):
+        """This writes out the PDF document"""
+        canv = canvas.Canvas(self.filename,
+                                pagesize = (self.pageWidth, self.pageHeight)
+                               )
+        canv.setPageCompression(0)
+            
+        for slide in self.slides:
+            slide.drawOn(canv)
+            canv.showPage()
+        canv.save()        
+
+class PPSection:
+    """A section can hold graphics which will be drawn on all
+    pages within it, before frames and other content are done.
+    In other words, a background template."""
+    def __init__(self, name):
+        self.name = name
+        self.graphics = []
+        
+    def drawOn(self, canv):
+        for graphic in self.graphics:
+            graphic.drawOn(canv)
+            
+        
+class PPSlide:
+    def __init__(self):
+        self.id = None
+        self.title = None
+        self.effectName = None
+        self.effectDirection = 0
+        self.effectDimension = 'H'
+        self.effectMotion = 'I'
+        self.frames = []
+        self.graphics = []
+        self.section = None
+
+    def drawOn(self, canv):
+        if self.effectName:
+            canv.setPageTransition(
+                        effectname=self.effectName,
+                        direction = self.effectDirection,
+                        dimension = self.effectDimension,
+                        motion = self.effectMotion
+                        )
+        
+        if self.section:
+            self.section.drawOn(canv)
+                
+        canv.drawRightString(800, 36, 'id: %s, title: %s' % (self.id, self.title))
+        for graphic in self.graphics:
+            graphic.drawOn(canv)
+            
+        for frame in self.frames:
+            frame.drawOn(canv)
+
+class PPFrame:
+    def __init__(self, x, y, width, height):
+        self.x = x
+        self.y = y
+        self.width = width
+        self.height = height
+        self.content = []
+
+        #others which can be set
+        self.leftMargin = 0
+        self.rightMargin = 0
+        self.topMargin = 0
+        self.bottomMargin = 0
+
+        self.showBoundary = 0        
+
+    def drawOn(self, canv):
+        #make a layout frame
+        frame = layout.SimpleFrame(canv, self.x, self.y, self.width, self.height)
+        frame.showBoundary = self.showBoundary
+        # terminology difference, must fix
+        frame.leftPadding = self.leftMargin
+        frame.topPadding = self.topMargin
+        frame.rightPadding = self.topMargin
+        frame.bottomPadding = self.bottomMargin
+        
+        #build a story for the frame
+        story = []
+        for thingy in self.content:
+            #ask it for any drawables
+            story.append(thingy.getDrawable())
+        #draw it
+        
+        frame.addFromList(story)
+
+        
+class PPPara:
+    """This is a placeholder for a paragraph."""
+    def __init__(self):
+        self.rawtext = ''
+        self.style = None
+
+    def getDrawable(self):
+        return layout.Paragraph(
+                    self.rawtext,
+                    getStyles()[self.style],
+                    self.bulletText
+                    )
+
+class PPImage:
+    """Flowing image within the text"""
+    def __init__(self):
+        self.filename = None
+        self.width = None
+        self.height = None
+
+    def getDrawable(self):
+        return layout.Image(self.filename, self.width, self.height)
+
+
+class PPDrawingElement:
+    """Base class for something which you draw directly on the page."""
+    def drawOn(selg, canv):
+        raise "NotImplementedError", "Abstract base class!"
+
+class PPRectangle:
+    def __init__(self, x, y, width, height):
+        self.x = x
+        self.y = y
+        self.width = width
+        self.height = height
+        self.fillColor = None
+        self.strokeColor = (1,1,1)
+
+    def drawOn(self, canv):
+        canv.saveState()
+        if self.fillColor:
+            r,g,b = self.fillColor
+            canv.setFillColorRGB(r,g,b)
+        if self.strokeColor:
+            r,g,b = self.strokeColor
+            canv.setStrokeColorRGB(r,g,b)
+        canv.rect(self.x, self.y, self.width, self.height,
+                    stroke=(self.strokeColor<>None),
+                    fill = (self.fillColor<>None)
+                    )
+        canv.restoreState()
+        
+class PPFixedImage(PPDrawingElement):
+    """You place this on the page, rather than flowing it"""
+    def __init__(self):
+        self.filename = None
+        self.x = 0
+        self.y = 0
+        self.width = None
+        self.height = None
+
+    def drawOn(self, canv):
+        if self.filename:
+            canv.drawInlineImage(
+                                self.filename,
+                                self.x,
+                                self.y,
+                                self.width,
+                                self.height
+                                   )
+                                   
+
+class PPPreformattedText:
+    """Use this for source code, or stuff you wo not want to wrap"""
+    def __init__(self):
+        self.rawtext = ''
+        self.style = None
+
+    def getDrawable(self):
+        return layout.Preformatted(self.rawtext, getStyles()[self.style])
+
+
+
+def getSampleStyleSheet():
+    """Returns a dictionary of styles to get you started.  We will
+    provide a way to specify a module of these."""
+    stylesheet = {}
+    ParagraphStyle = layout.ParagraphStyle
+    
+    para = ParagraphStyle('Normal', None)   #the ancestor of all
+    para.fontName = 'Times-Roman'
+    para.fontSize = 24
+    para.leading = 28
+    stylesheet['Normal'] = para
+
+    para = ParagraphStyle('BodyText', stylesheet['Normal'])
+    para.spaceBefore = 12
+    stylesheet['BodyText'] = para
+    
+    para = ParagraphStyle('BigCentered', stylesheet['Normal'])
+    para.spaceBefore = 12
+    para.alignment = layout.TA_CENTER
+    stylesheet['BigCentered'] = para
+
+    para = ParagraphStyle('Italic', stylesheet['BodyText'])
+    para.fontName = 'Times-Italic'
+    stylesheet['Italic'] = para
+
+    para = ParagraphStyle('Title', stylesheet['Normal'])
+    para.fontName = 'Times-Roman'
+    para.fontSize = 48
+    para.Leading = 58
+    para.spaceAfter = 36
+    para.alignment = layout.TA_CENTER
+    stylesheet['Title'] = para
+    
+    para = ParagraphStyle('Heading1', stylesheet['Normal'])
+    para.fontName = 'Times-Bold'
+    para.fontSize = 36
+    para.leading = 44
+    para.spaceAfter = 36
+    para.alignment = layout.TA_CENTER
+    stylesheet['Heading1'] = para
+    
+    para = ParagraphStyle('Heading2', stylesheet['Normal'])
+    para.fontName = 'Times-Bold'
+    para.fontSize = 28
+    para.leading = 34
+    para.spaceBefore = 24
+    para.spaceAfter = 12
+    stylesheet['Heading2'] = para
+    
+    para = ParagraphStyle('Heading3', stylesheet['Normal'])
+    para.fontName = 'Times-BoldItalic'
+    para.spaceBefore = 24
+    para.spaceAfter = 12
+    stylesheet['Heading3'] = para
+
+    para = ParagraphStyle('Bullet', stylesheet['Normal'])
+    para.firstLineIndent = 40
+    para.leftIndent = 80
+    para.spaceBefore = 6
+    #para.bulletFontName = 'Symbol'
+    para.bulletFontSize = 24
+    para.bulletIndent = 36
+    stylesheet['Bullet'] = para
+
+    para = ParagraphStyle('Definition', stylesheet['Normal'])
+    #use this for definition lists
+    para.firstLineIndent = 72
+    para.leftIndent = 72
+    para.bulletIndent = 0
+    para.spaceBefore = 12
+    para.bulletFontName = 'Helvetica-BoldOblique'
+    stylesheet['Definition'] = para
+
+    para = ParagraphStyle('Code', stylesheet['Normal'])
+    para.fontName = 'Courier'
+    para.fontSize = 16
+    para.leading = 18
+    para.leftIndent = 36
+    stylesheet['Code'] = para
+
+    return stylesheet
+
+#make a singleton and a function to access it        
+_styles = None
+def getStyles():
+    global _styles
+    if not _styles:
+        _styles = getSampleStyleSheet()
+    return _styles
+
+def setStyles(newStyleSheet):
+    global _styles
+    _styles = newStyleSheet
+
+        
+def test():
+    p = PPMLParser()
+    p.feed(sample)
+    p.getPresentation().save()
+
+def process(datafilename):
+    parser = PPMLParser()
+    rawdata = open(datafilename).read()
+    parser.feed(rawdata)
+    pres = parser.getPresentation()
+    pres.save()
+
+
+if __name__ == '__main__':
+    import sys
+    if len(sys.argv) > 1:
+        datafile = sys.argv[1]
+        if os.path.isfile(datafile):
+            process(datafile)   #see just above
+        else:
+            print 'Data file not found:',datafile
+    else:
+        print "Creating demo file pythonpoint.pdf"
+        test()
+    
Binary file reportlab/demos/pythonpoint/spectrum.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/reportlab/demos/pythonpoint/styles_horrible.py	Tue Feb 15 15:07:37 2000 +0000
@@ -0,0 +1,135 @@
+###############################################################################
+#
+#	ReportLab Public License Version 1.0
+#
+#   Except for the change of names the spirit and intention of this
+#   license is the same as that of Python
+#
+#	(C) Copyright ReportLab Inc. 1998-2000.
+#
+#
+# All Rights Reserved
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation for any purpose and without fee is hereby granted, provided
+# that the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of Robinson Analytics not be used
+# in advertising or publicity pertaining to distribution of the software
+# without specific, written prior permission. 
+# 
+#
+# Disclaimer
+#
+# ReportLab Inc. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+# IN NO EVENT SHALL ReportLab BE LIABLE FOR ANY SPECIAL, INDIRECT
+# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE. 
+#
+###############################################################################
+#	$Log: styles_horrible.py,v $
+#	Revision 1.1  2000/02/15 15:09:05  rgbecker
+#	Initial revision
+#
+__version__=''' $Id: styles_horrible.py,v 1.1 2000/02/15 15:09:05 rgbecker Exp $ '''
+# style_modern.py
+"""This is an example style sheet.  You can create your own, and
+have them loaded by the presentation.  A style sheet is just a
+dictionary, where they keys are style names and the values are
+layout.ParagraphStyle objects.
+
+You must provide a function called "getParagraphStyles()" to
+return it.  In future, we can put things like LineStyles,
+TableCellStyles etc. in the same modules.
+
+You might wish to have two parallel style sheets, one for colour
+and one for black and white, so you can switch your presentations
+easily.
+
+A style sheet MUST define a style called 'Normal'.
+"""
+
+from platypus import layout
+def getParagraphStyles():
+    """Returns a dictionary of styles based on Helvetica"""
+    stylesheet = {}
+    ParagraphStyle = layout.ParagraphStyle
+    
+    para = ParagraphStyle('Normal', None)   #the ancestor of all
+    para.fontName = 'Courier'
+    para.fontSize = 24
+    para.leading = 28
+    stylesheet['Normal'] = para
+
+    para = ParagraphStyle('BodyText', stylesheet['Normal'])
+    para.spaceBefore = 12
+    stylesheet['BodyText'] = para
+    
+    para = ParagraphStyle('BigCentered', stylesheet['Normal'])
+    para.spaceBefore = 12
+    para.alignment = layout.TA_CENTER
+    stylesheet['BigCentered'] = para
+
+    para = ParagraphStyle('Italic', stylesheet['BodyText'])
+    para.fontName = 'Courier-Oblique'
+    stylesheet['Italic'] = para
+
+    para = ParagraphStyle('Title', stylesheet['Normal'])
+    para.fontName = 'Courier'
+    para.fontSize = 48
+    para.Leading = 58
+    para.spaceAfter = 36
+    para.alignment = layout.TA_CENTER
+    stylesheet['Title'] = para
+    
+    para = ParagraphStyle('Heading1', stylesheet['Normal'])
+    para.fontName = 'Courier-Bold'
+    para.fontSize = 36
+    para.leading = 44
+    para.spaceAfter = 36
+    para.alignment = layout.TA_CENTER
+    stylesheet['Heading1'] = para
+    
+    para = ParagraphStyle('Heading2', stylesheet['Normal'])
+    para.fontName = 'Courier-Bold'
+    para.fontSize = 28
+    para.leading = 34
+    para.spaceBefore = 24
+    para.spaceAfter = 12
+    stylesheet['Heading2'] = para
+    
+    para = ParagraphStyle('Heading3', stylesheet['Normal'])
+    para.fontName = 'Courier-BoldOblique'
+    para.spaceBefore = 24
+    para.spaceAfter = 12
+    stylesheet['Heading3'] = para
+
+    para = ParagraphStyle('Bullet', stylesheet['Normal'])
+    para.firstLineIndent = 54
+    para.leftIndent = 72
+    para.spaceBefore = 6
+    #para.bulletFontName = 'Symbol'
+    para.bulletFontSize = 24
+    para.bulletIndent = 36
+    stylesheet['Bullet'] = para
+
+    para = ParagraphStyle('Definition', stylesheet['Normal'])
+    #use this for definition lists
+    para.firstLineIndent = 72
+    para.leftIndent = 72
+    para.bulletIndent = 0
+    para.spaceBefore = 12
+    para.bulletFontName = 'Couruer-BoldOblique'
+    stylesheet['Definition'] = para
+
+    para = ParagraphStyle('Code', stylesheet['Normal'])
+    para.fontName = 'Courier'
+    para.fontSize = 16
+    para.leading = 18
+    para.leftIndent = 36
+    stylesheet['Code'] = para
+
+    return stylesheet
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/reportlab/demos/pythonpoint/styles_modern.py	Tue Feb 15 15:07:37 2000 +0000
@@ -0,0 +1,136 @@
+###############################################################################
+#
+#	ReportLab Public License Version 1.0
+#
+#   Except for the change of names the spirit and intention of this
+#   license is the same as that of Python
+#
+#	(C) Copyright ReportLab Inc. 1998-2000.
+#
+#
+# All Rights Reserved
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation for any purpose and without fee is hereby granted, provided
+# that the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of Robinson Analytics not be used
+# in advertising or publicity pertaining to distribution of the software
+# without specific, written prior permission. 
+# 
+#
+# Disclaimer
+#
+# ReportLab Inc. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+# IN NO EVENT SHALL ReportLab BE LIABLE FOR ANY SPECIAL, INDIRECT
+# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE. 
+#
+###############################################################################
+#	$Log: styles_modern.py,v $
+#	Revision 1.1  2000/02/15 15:09:12  rgbecker
+#	Initial revision
+#
+__version__=''' $Id: styles_modern.py,v 1.1 2000/02/15 15:09:12 rgbecker Exp $ '''
+# style_modern.py
+"""This is an example style sheet.  You can create your own, and
+have them loaded by the presentation.  A style sheet is just a
+dictionary, where they keys are style names and the values are
+layout.ParagraphStyle objects.
+
+You must provide a function called "getParagraphStyles()" to
+return it.  In future, we can put things like LineStyles,
+TableCellStyles etc. in the same modules.
+
+You might wish to have two parallel style sheets, one for colour
+and one for black and white, so you can switch your presentations
+easily.
+
+A style sheet MUST define a style called 'Normal'.
+"""
+
+from platypus import layout
+
+def getParagraphStyles():
+    """Returns a dictionary of styles based on Helvetica"""
+    stylesheet = {}
+    ParagraphStyle = layout.ParagraphStyle
+ 
+    para = ParagraphStyle('Normal', None)   #the ancestor of all
+    para.fontName = 'Helvetica'
+    para.fontSize = 24
+    para.leading = 28
+    stylesheet['Normal'] = para
+
+    para = ParagraphStyle('BodyText', stylesheet['Normal'])
+    para.spaceBefore = 12
+    stylesheet['BodyText'] = para
+    
+    para = ParagraphStyle('BigCentered', stylesheet['Normal'])
+    para.spaceBefore = 12
+    para.alignment = layout.TA_CENTER
+    stylesheet['BigCentered'] = para
+
+    para = ParagraphStyle('Italic', stylesheet['BodyText'])
+    para.fontName = 'Helvetica-Oblique'
+    stylesheet['Italic'] = para
+
+    para = ParagraphStyle('Title', stylesheet['Normal'])
+    para.fontName = 'Helvetica'
+    para.fontSize = 48
+    para.Leading = 58
+    para.spaceAfter = 36
+    para.alignment = layout.TA_CENTER
+    stylesheet['Title'] = para
+    
+    para = ParagraphStyle('Heading1', stylesheet['Normal'])
+    para.fontName = 'Helvetica-Bold'
+    para.fontSize = 36
+    para.leading = 44
+    para.spaceAfter = 36
+    para.alignment = layout.TA_CENTER
+    stylesheet['Heading1'] = para
+    
+    para = ParagraphStyle('Heading2', stylesheet['Normal'])
+    para.fontName = 'Helvetica-Bold'
+    para.fontSize = 28
+    para.leading = 34
+    para.spaceBefore = 24
+    para.spaceAfter = 12
+    stylesheet['Heading2'] = para
+    
+    para = ParagraphStyle('Heading3', stylesheet['Normal'])
+    para.fontName = 'Helvetica-BoldOblique'
+    para.spaceBefore = 24
+    para.spaceAfter = 12
+    stylesheet['Heading3'] = para
+
+    para = ParagraphStyle('Bullet', stylesheet['Normal'])
+    para.firstLineIndent = 54
+    para.leftIndent = 72
+    para.spaceBefore = 6
+    #para.bulletFontName = 'Symbol'
+    para.bulletFontSize = 24
+    para.bulletIndent = 36
+    stylesheet['Bullet'] = para
+
+    para = ParagraphStyle('Definition', stylesheet['Normal'])
+    #use this for definition lists
+    para.firstLineIndent = 72
+    para.leftIndent = 72
+    para.bulletIndent = 0
+    para.spaceBefore = 12
+    para.bulletFontName = 'Helvetica-BoldOblique'
+    stylesheet['Definition'] = para
+
+    para = ParagraphStyle('Code', stylesheet['Normal'])
+    para.fontName = 'Courier'
+    para.fontSize = 16
+    para.leading = 18
+    para.leftIndent = 36
+    stylesheet['Code'] = para
+
+    return stylesheet
Binary file reportlab/demos/pythonpoint/vertpython.gif has changed