"Fossies" - the Fresh Open Source Software Archive

Member "reportlab-3.5.23/tools/docco/stylesheet.py" (23 Jul 2018, 6987 Bytes) of package /linux/privat/reportlab-3.5.23.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "stylesheet.py" see the Fossies "Dox" file reference documentation.

    1 #Copyright ReportLab Europe Ltd. 2000-2017
    2 #see license.txt for license details
    3 #history https://bitbucket.org/rptlab/reportlab/history-node/tip/src/reportlab/tools/docco/stylesheet.py
    4 #standard stylesheet for our manuals
    5 from reportlab.lib.styles import StyleSheet1, ParagraphStyle
    6 from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT, TA_JUSTIFY
    7 from reportlab.lib import colors
    8 
    9 
   10 def getStyleSheet():
   11     """Returns a stylesheet object"""
   12     stylesheet = StyleSheet1()
   13 
   14     stylesheet.add(ParagraphStyle(name='Normal',
   15                                   fontName='Times-Roman',
   16                                   fontSize=10,
   17                                   leading=12,
   18                                   spaceBefore=6)
   19                    )
   20 
   21     stylesheet.add(ParagraphStyle(name='Comment',
   22                                   fontName='Times-Italic')
   23                    )
   24 
   25     stylesheet.add(ParagraphStyle(name='Indent0',
   26                                   leftIndent=18,)
   27                    )
   28 
   29     stylesheet.add(ParagraphStyle(name='Indent1',
   30                                   leftIndent=36,
   31                                   firstLineIndent=0,
   32                                   spaceBefore=1,
   33                                   spaceAfter=7)
   34                    )
   35     
   36     stylesheet.add(ParagraphStyle(name='Indent2',
   37                                   leftIndent=50,
   38                                   firstLineIndent=0,
   39                                   spaceAfter=100)
   40                    )
   41 
   42     stylesheet.add(ParagraphStyle(name='BodyText',
   43                                   parent=stylesheet['Normal'],
   44                                   spaceBefore=6)
   45                    )
   46     stylesheet.add(ParagraphStyle(name='Italic',
   47                                   parent=stylesheet['BodyText'],
   48                                   fontName = 'Times-Italic')
   49                    )
   50 
   51     stylesheet.add(ParagraphStyle(name='Heading1',
   52                                   parent=stylesheet['Normal'],
   53                                   fontName = 'Times-Bold',
   54                                   alignment=TA_CENTER,
   55                                   fontSize=18,
   56                                   leading=22,
   57                                   spaceAfter=6),
   58                    alias='h1')
   59 
   60     stylesheet.add(ParagraphStyle(name='Heading2',
   61                                   parent=stylesheet['Normal'],
   62                                   fontName = 'Times-Bold',
   63                                   fontSize=14,
   64                                   leading=17,
   65                                   spaceBefore=12,
   66                                   spaceAfter=6),
   67                    alias='h2')
   68 
   69     stylesheet.add(ParagraphStyle(name='Heading3',
   70                                   parent=stylesheet['Normal'],
   71                                   fontName = 'Times-BoldItalic',
   72                                   fontSize=12,
   73                                   leading=14,
   74                                   spaceBefore=12,
   75                                   spaceAfter=6),
   76                    alias='h3')
   77 
   78     stylesheet.add(ParagraphStyle(name='Heading4',
   79                                   parent=stylesheet['Normal'],
   80                                   fontName = 'Times-BoldItalic',
   81                                   spaceBefore=10,
   82                                   spaceAfter=4),
   83                    alias='h4')
   84 
   85     stylesheet.add(ParagraphStyle(name='Title',
   86                                   parent=stylesheet['Normal'],
   87                                   fontName = 'Times-Bold',
   88                                   fontSize=32,
   89                                   leading=40,
   90                                   spaceAfter=36,
   91                                   alignment=TA_CENTER
   92                                   ),
   93                    alias='t')
   94 
   95     stylesheet.add(ParagraphStyle(name='Bullet',
   96                                   parent=stylesheet['Normal'],
   97                                   firstLineIndent=0,
   98                                   leftIndent=54,
   99                                   bulletIndent=18,
  100                                   spaceBefore=0,
  101                                   bulletFontName='Symbol'),
  102                    alias='bu')
  103 
  104     stylesheet.add(ParagraphStyle(name='Definition',
  105                                   parent=stylesheet['Normal'],
  106                                   firstLineIndent=0,
  107                                   leftIndent=36,
  108                                   bulletIndent=0,
  109                                   spaceBefore=6,
  110                                   bulletFontName='Times-BoldItalic'),
  111                    alias='df')
  112 
  113     stylesheet.add(ParagraphStyle(name='Code',
  114                                   parent=stylesheet['Normal'],
  115                                   fontName='Courier-Bold',
  116                                   fontSize=8,
  117                                   leading=8.8,
  118                                   leftIndent=36,
  119                                   firstLineIndent=0,
  120                                   hyphenationLang=''))
  121     
  122     stylesheet.add(ParagraphStyle(name='Link',
  123                                   parent=stylesheet['Code'],
  124                                   spaceAfter=7,
  125                                   spaceBefore=0,
  126                                   leftIndent=55))
  127 
  128     stylesheet.add(ParagraphStyle(name='FunctionHeader',
  129                                   parent=stylesheet['Normal'],
  130                                   fontName='Courier-Bold',
  131                                   fontSize=8,
  132                                   leading=8.8))
  133 
  134     stylesheet.add(ParagraphStyle(name='DocString',
  135                                   parent=stylesheet['Normal'],
  136                                   fontName='Courier',
  137                                   fontSize=8,
  138                                   leftIndent=18,
  139                                   leading=8.8))
  140 
  141     stylesheet.add(ParagraphStyle(name='DocStringIndent',
  142                                   parent=stylesheet['Normal'],
  143                                   fontName='Courier',
  144                                   fontSize=8,
  145                                   leftIndent=36,
  146                                   leading=8.8))
  147 
  148     stylesheet.add(ParagraphStyle(name='URL',
  149                                   parent=stylesheet['Normal'],
  150                                   fontName='Courier',
  151                                   textColor=colors.navy,
  152                                   alignment=TA_CENTER),
  153                    alias='u')
  154 
  155     stylesheet.add(ParagraphStyle(name='Centred',
  156                                   parent=stylesheet['Normal'],
  157                                   alignment=TA_CENTER
  158                                   ))
  159 
  160     stylesheet.add(ParagraphStyle(name='Caption',
  161                                   parent=stylesheet['Centred'],
  162                                   fontName='Times-Italic'
  163                                   ))
  164 
  165     return stylesheet