src/reportlab/platypus/paraparser.py
changeset 4136 16f067cf3dae
parent 4130 49161ce56cad
child 4181 0a8d6687fde6
equal deleted inserted replaced
4135:226667ad6b1f 4136:16f067cf3dae
   114     s = s.lower()
   114     s = s.lower()
   115     if s=='left': return TA_LEFT
   115     if s=='left': return TA_LEFT
   116     elif s=='right': return TA_RIGHT
   116     elif s=='right': return TA_RIGHT
   117     elif s=='justify': return TA_JUSTIFY
   117     elif s=='justify': return TA_JUSTIFY
   118     elif s in ('centre','center'): return TA_CENTER
   118     elif s in ('centre','center'): return TA_CENTER
   119     else: raise ValueError
   119     else: raise ValueError('illegal alignment %r' % s)
       
   120 
       
   121 def _bAnchor(s):
       
   122     s = s.lower()
       
   123     if not s in ('start','middle','end','numeric'):
       
   124         raise ValueError('illegal bullet anchor %r' % s)
       
   125     return s
   120 
   126 
   121 _paraAttrMap = {'font': ('fontName', None),
   127 _paraAttrMap = {'font': ('fontName', None),
   122                 'face': ('fontName', None),
   128                 'face': ('fontName', None),
   123                 'fontsize': ('fontSize', _num),
   129                 'fontsize': ('fontSize', _num),
   124                 'size': ('fontSize', _num),
   130                 'size': ('fontSize', _num),
   133                 'bfont': ('bulletFontName', None),
   139                 'bfont': ('bulletFontName', None),
   134                 'bfontsize': ('bulletFontSize',_num),
   140                 'bfontsize': ('bulletFontSize',_num),
   135                 'boffsety': ('bulletOffsetY',_num),
   141                 'boffsety': ('bulletOffsetY',_num),
   136                 'bindent': ('bulletIndent',_num),
   142                 'bindent': ('bulletIndent',_num),
   137                 'bcolor': ('bulletColor',toColor),
   143                 'bcolor': ('bulletColor',toColor),
       
   144                 'banchor': ('bulletAnchor',_bAnchor),
   138                 'color':('textColor',toColor),
   145                 'color':('textColor',toColor),
   139                 'backcolor':('backColor',toColor),
   146                 'backcolor':('backColor',toColor),
   140                 'bgcolor':('backColor',toColor),
   147                 'bgcolor':('backColor',toColor),
   141                 'bg':('backColor',toColor),
   148                 'bg':('backColor',toColor),
   142                 'fg': ('textColor',toColor),
   149                 'fg': ('textColor',toColor),
   149                 'fontsize': ('bulletFontSize',_num),
   156                 'fontsize': ('bulletFontSize',_num),
   150                 'offsety': ('bulletOffsetY',_num),
   157                 'offsety': ('bulletOffsetY',_num),
   151                 'indent': ('bulletIndent',_num),
   158                 'indent': ('bulletIndent',_num),
   152                 'color': ('bulletColor',toColor),
   159                 'color': ('bulletColor',toColor),
   153                 'fg': ('bulletColor',toColor),
   160                 'fg': ('bulletColor',toColor),
       
   161                 'anchor': ('bulletAnchor',_bAnchor),
   154                 }
   162                 }
   155 
   163 
   156 #things which are valid font attributes
   164 #things which are valid font attributes
   157 _fontAttrMap = {'size': ('fontSize', _num),
   165 _fontAttrMap = {'size': ('fontSize', _num),
   158                 'face': ('fontName', None),
   166                 'face': ('fontName', None),