24 ) |
24 ) |
25 from reportlab.lib.colors import white, black |
25 from reportlab.lib.colors import white, black |
26 from reportlab.lib.enums import TA_LEFT, TA_CENTER |
26 from reportlab.lib.enums import TA_LEFT, TA_CENTER |
27 from reportlab.lib.fonts import tt2ps |
27 from reportlab.lib.fonts import tt2ps |
28 from reportlab.rl_config import canvas_basefontname as _baseFontName, \ |
28 from reportlab.rl_config import canvas_basefontname as _baseFontName, \ |
29 baseUnderlineProportion as _baseUnderlineProportion, \ |
29 underlineWidth as _baseUnderlineWidth, \ |
30 spaceShrinkage |
30 underlineOffset as _baseUnderlineOffset, \ |
|
31 underlineGap as _baseUnderlineGap, \ |
|
32 strikeWidth as _baseStrikeWidth, \ |
|
33 strikeOffset as _baseStrikeOffset, \ |
|
34 strikeGap as _baseStrikeGap, \ |
|
35 spaceShrinkage, platypus_link_underline |
31 _baseFontNameB = tt2ps(_baseFontName,1,0) |
36 _baseFontNameB = tt2ps(_baseFontName,1,0) |
32 _baseFontNameI = tt2ps(_baseFontName,0,1) |
37 _baseFontNameI = tt2ps(_baseFontName,0,1) |
33 _baseFontNameBI = tt2ps(_baseFontName,1,1) |
38 _baseFontNameBI = tt2ps(_baseFontName,1,1) |
34 |
39 |
35 ########################################################### |
40 ########################################################### |
128 'textTransform':None, #uppercase lowercase (captitalize not yet) or None or absent |
133 'textTransform':None, #uppercase lowercase (captitalize not yet) or None or absent |
129 'endDots':None, #dots on the last line of left/right justified paras |
134 'endDots':None, #dots on the last line of left/right justified paras |
130 #string or object with text and optional fontName, fontSize, textColor & backColor |
135 #string or object with text and optional fontName, fontSize, textColor & backColor |
131 #dy |
136 #dy |
132 'splitLongWords':1, #make best efforts to split long words |
137 'splitLongWords':1, #make best efforts to split long words |
133 'underlineProportion': _baseUnderlineProportion, #set to non-zero to get proportional |
138 'underlineWidth': _baseUnderlineWidth, #underline width |
134 'bulletAnchor': 'start', #where the bullet is anchored ie start, middle, end or numeric |
139 'bulletAnchor': 'start', #where the bullet is anchored ie start, middle, end or numeric |
135 'justifyLastLine': 0, #n allow justification on the last line for more than n words 0 means don't bother |
140 'justifyLastLine': 0, #n allow justification on the last line for more than n words 0 means don't bother |
136 'justifyBreaks': 0, #justify lines broken with <br/> |
141 'justifyBreaks': 0, #justify lines broken with <br/> |
137 'spaceShrinkage': spaceShrinkage, #allow shrinkage of percentage of space to fit on line |
142 'spaceShrinkage': spaceShrinkage, #allow shrinkage of percentage of space to fit on line |
|
143 'strikeWidth': _baseStrikeWidth, #stroke width |
|
144 'underlineOffset': _baseUnderlineOffset, #fraction of fontsize to offset underlines |
|
145 'underlineGap': _baseUnderlineGap, #gap for double/triple underline |
|
146 'strikeOffset': _baseStrikeOffset, #fraction of fontsize to offset strikethrough |
|
147 'strikeGap': _baseStrikeGap, #gap for double/triple strike |
|
148 'linkUnderline': platypus_link_underline, |
|
149 #'underlineColor': None, |
|
150 #'strikeColor': None, |
138 } |
151 } |
139 |
152 |
140 class LineStyle(PropertySet): |
153 class LineStyle(PropertySet): |
141 defaults = { |
154 defaults = { |
142 'width':1, |
155 'width':1, |