reportlab/platypus/paragraph.py
changeset 494 54257447cfe9
parent 488 a270e8b45200
child 496 bb47cf5c2739
equal deleted inserted replaced
493:89dbc0b19ede 494:54257447cfe9
     1 ###############################################################################
     1 #copyright ReportLab Inc. 2000
     2 #
     2 #see license.txt for license details
     3 #	ReportLab Public License Version 1.0
     3 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/platypus/paragraph.py?cvsroot=reportlab
     4 #
     4 #$Header: /tmp/reportlab/reportlab/platypus/paragraph.py,v 1.25 2000/10/25 08:57:45 rgbecker Exp $
     5 #   Except for the change of names the spirit and intention of this
     5 __version__=''' $Id: paragraph.py,v 1.25 2000/10/25 08:57:45 rgbecker Exp $ '''
     6 #   license is the same as that of Python
       
     7 #
       
     8 #	(C) Copyright ReportLab Inc. 1998-2000.
       
     9 #
       
    10 #
       
    11 # All Rights Reserved
       
    12 #
       
    13 # Permission to use, copy, modify, and distribute this software and its
       
    14 # documentation for any purpose and without fee is hereby granted, provided
       
    15 # that the above copyright notice appear in all copies and that both that
       
    16 # copyright notice and this permission notice appear in supporting
       
    17 # documentation, and that the name of ReportLab not be used
       
    18 # in advertising or publicity pertaining to distribution of the software
       
    19 # without specific, written prior permission.
       
    20 #
       
    21 #
       
    22 # Disclaimer
       
    23 #
       
    24 # ReportLab Inc. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
       
    25 # SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
       
    26 # IN NO EVENT SHALL ReportLab BE LIABLE FOR ANY SPECIAL, INDIRECT
       
    27 # OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
       
    28 # OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
       
    29 # OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
       
    30 # PERFORMANCE OF THIS SOFTWARE.
       
    31 #
       
    32 ###############################################################################
       
    33 #	$Log: paragraph.py,v $
       
    34 #	Revision 1.24  2000/10/23 23:55:27  rgbecker
       
    35 #	Added J Alet's bug case
       
    36 #
       
    37 #	Revision 1.23  2000/10/03 09:19:11  rgbecker
       
    38 #	Justified XPreformatteds are OK
       
    39 #	
       
    40 #	Revision 1.22  2000/10/02 13:13:21  rgbecker
       
    41 #	Splitting fixes. Mostly caused by XPreformatted not doing it right.
       
    42 #	
       
    43 #	Revision 1.21  2000/08/25 11:35:37  rgbecker
       
    44 #	Further tweaks of XPreformatted
       
    45 #	
       
    46 #	Revision 1.20  2000/08/24 18:21:47  rgbecker
       
    47 #	XPreformatted fixed empty lines and leading space
       
    48 #	
       
    49 #	Revision 1.19  2000/08/23 13:58:28  rgbecker
       
    50 #	Preparing for cleanup
       
    51 #	
       
    52 #	Revision 1.18  2000/08/17 15:50:37  rgbecker
       
    53 #	Various brutal changes to paragraph, canvas and textobject for speed/size
       
    54 #	
       
    55 #	Revision 1.17  2000/07/14 10:29:50  rgbecker
       
    56 #	The Paragraph.split method was wrongly assuming that the firstLineIndent
       
    57 #	should reset to zero. It should always reset to leftIndent!
       
    58 #	
       
    59 #	Revision 1.16  2000/07/03 15:39:51  rgbecker
       
    60 #	Documentation fixes
       
    61 #	
       
    62 #	Revision 1.15  2000/06/23 13:13:54  rgbecker
       
    63 #	Fixes to splitting code
       
    64 #	
       
    65 #	Revision 1.14  2000/06/19 23:51:23  andy_robinson
       
    66 #	Added UserDocTemplate class, and paragraph.getPlainText()
       
    67 #	
       
    68 #	Revision 1.13  2000/06/19 11:14:03  andy_robinson
       
    69 #	Global sequencer put in the 'story builder'.
       
    70 #	
       
    71 #	Revision 1.12  2000/06/13 13:03:31  aaron_watters
       
    72 #	more documentation changes
       
    73 #	
       
    74 #	Revision 1.11  2000/06/01 15:23:06  rgbecker
       
    75 #	Platypus re-organisation
       
    76 #	
       
    77 #	Revision 1.10  2000/05/31 10:12:20  rgbecker
       
    78 #	<bullet> xml tag added
       
    79 #	
       
    80 #	Revision 1.9  2000/05/16 16:15:16  rgbecker
       
    81 #	Changes related to removal of SimpleFlowDocument
       
    82 #	
       
    83 #	Revision 1.8  2000/05/16 15:58:27  rgbecker
       
    84 #	Fixed font setting bug
       
    85 #	
       
    86 #	Revision 1.7  2000/05/16 14:28:55  rgbecker
       
    87 #	Fixes/Changes to get testplatypus to work with new framework
       
    88 #	
       
    89 #	Revision 1.6  2000/05/15 13:36:11  rgbecker
       
    90 #	Splitting changes
       
    91 #	
       
    92 #	Revision 1.5  2000/05/13 16:03:23  rgbecker
       
    93 #	Fix extraspace calculation
       
    94 #	
       
    95 #	Revision 1.4  2000/05/12 15:13:41  rgbecker
       
    96 #	Fixes to alignment handling
       
    97 #	
       
    98 #	Revision 1.3  2000/05/11 14:04:34  rgbecker
       
    99 #	Removed usage of spaceBefore/After in wrap methods
       
   100 #	
       
   101 #	Revision 1.2  2000/04/19 13:14:06  rgbecker
       
   102 #	Fixed repeated breaklines bug
       
   103 #	
       
   104 #	Revision 1.1  2000/04/14 13:21:52  rgbecker
       
   105 #	Removed from layout.py
       
   106 #	
       
   107 __version__=''' $Id: paragraph.py,v 1.24 2000/10/23 23:55:27 rgbecker Exp $ '''
       
   108 import string
     6 import string
   109 from types import StringType, ListType
     7 from types import StringType, ListType
   110 from reportlab.pdfbase.pdfmetrics import stringWidth
     8 from reportlab.pdfbase.pdfmetrics import stringWidth
   111 from reportlab.platypus.paraparser import ParaParser, ParaFrag
     9 from reportlab.platypus.paraparser import ParaParser, ParaFrag
   112 from reportlab.platypus.flowables import Flowable
    10 from reportlab.platypus.flowables import Flowable