本文整理汇总了Python中reportlab.lib.styles.ParagraphStyle.bulletFontName方法的典型用法代码示例。如果您正苦于以下问题:Python ParagraphStyle.bulletFontName方法的具体用法?Python ParagraphStyle.bulletFontName怎么用?Python ParagraphStyle.bulletFontName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reportlab.lib.styles.ParagraphStyle
的用法示例。
在下文中一共展示了ParagraphStyle.bulletFontName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: toParagraphStyle
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import bulletFontName [as 别名]
def toParagraphStyle(self, first, full=False):
style = ParagraphStyle('default%d' % self.UID(), keepWithNext=first.keepWithNext)
style.fontName = first.fontName
style.fontSize = first.fontSize
style.leading = max(first.leading, first.fontSize * 1.25)
style.backColor = first.backColor
style.spaceBefore = first.spaceBefore
style.spaceAfter = first.spaceAfter
style.leftIndent = first.leftIndent
style.rightIndent = first.rightIndent
style.firstLineIndent = first.firstLineIndent
style.textColor = first.textColor
style.alignment = first.alignment
style.bulletFontName = first.bulletFontName or first.fontName
style.bulletFontSize = first.fontSize
style.bulletIndent = first.bulletIndent
# Border handling for Paragraph
style.borderWidth = 0
if getBorderStyle(first.borderTopStyle):
style.borderWidth = max(first.borderLeftWidth, first.borderRightWidth, first.borderTopWidth, first.borderBottomWidth)
style.borderPadding = first.borderPadding # + first.borderWidth
style.borderColor = first.borderTopColor
# If no border color is given, the text color is used (XXX Tables!)
if (style.borderColor is None) and style.borderWidth:
style.borderColor = first.textColor
if full:
style.fontName = tt2ps(first.fontName, first.bold, first.italic)
return style
示例2: addPara
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import bulletFontName [as 别名]
def addPara(self, force=False):
# Cleanup the trail
for frag in reversed(self.fragList):
frag.text = frag.text.rstrip()
if frag.text:
break
if force or (self.text.strip() and self.fragList):
# Strip trailing whitespaces
# for f in self.fragList:
# f.text = f.text.lstrip()
# if f.text:
# break
# self.fragList[-1].lineBreak = self.fragList[-1].text.rstrip()
# Update paragraph style by style of first fragment
first = self.fragBlock
style = ParagraphStyle("default%d" % self.UID(), keepWithNext=first.keepWithNext)
style.fontName = first.fontName
style.fontSize = first.fontSize
style.leading = max(first.leading, first.fontSize * 1.25)
style.backColor = first.backColor
style.spaceBefore = first.spaceBefore
style.spaceAfter = first.spaceAfter
style.leftIndent = first.leftIndent
style.rightIndent = first.rightIndent
style.firstLineIndent = first.firstLineIndent
style.alignment = first.alignment
style.bulletFontName = first.fontName
style.bulletFontSize = first.fontSize
style.bulletIndent = first.bulletIndent
style.borderWidth = max(
first.borderLeftWidth, first.borderRightWidth, first.borderTopWidth, first.borderBottomWidth
)
style.borderPadding = first.borderPadding # + first.borderWidth
style.borderColor = first.borderTopColor
# borderRadius: None,
# print repr(self.text.strip()), style.leading, "".join([repr(x.text) for x in self.fragList])
# print first.leftIndent, first.listStyleType,repr(self.text)
# Add paragraph to story
para = PmlParagraph(
self.text, style, frags=self.fragAnchor + self.fragList, bulletText=copy.copy(first.bulletText)
)
para.outline = frag.outline
para.outlineLevel = frag.outlineLevel
para.outlineOpen = frag.outlineOpen
self.addStory(para)
self.fragAnchor = []
first.bulletText = None
self.clearFrag()
示例3: toParagraphStyle
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import bulletFontName [as 别名]
def toParagraphStyle(self, first):
style = ParagraphStyle('default%d' % self.UID(), keepWithNext=first.keepWithNext)
style.fontName = first.fontName
style.fontSize = first.fontSize
style.letterSpacing = first.letterSpacing
style.leading = max(first.leading + first.leadingSpace, first.fontSize * 1.25)
style.backColor = first.backColor
style.spaceBefore = first.spaceBefore
style.spaceAfter = first.spaceAfter
style.leftIndent = first.leftIndent
style.rightIndent = first.rightIndent
style.firstLineIndent = first.firstLineIndent
style.textColor = first.textColor
style.alignment = first.alignment
style.bulletFontName = first.bulletFontName or first.fontName
style.bulletFontSize = first.fontSize
style.bulletIndent = first.bulletIndent
style.wordWrap = first.wordWrap
# Border handling for Paragraph
# Transfer the styles for each side of the border, *not* the whole
# border values that reportlab supports. We'll draw them ourselves in
# PmlParagraph.
style.borderTopStyle = first.borderTopStyle
style.borderTopWidth = first.borderTopWidth
style.borderTopColor = first.borderTopColor
style.borderBottomStyle = first.borderBottomStyle
style.borderBottomWidth = first.borderBottomWidth
style.borderBottomColor = first.borderBottomColor
style.borderLeftStyle = first.borderLeftStyle
style.borderLeftWidth = first.borderLeftWidth
style.borderLeftColor = first.borderLeftColor
style.borderRightStyle = first.borderRightStyle
style.borderRightWidth = first.borderRightWidth
style.borderRightColor = first.borderRightColor
# If no border color is given, the text color is used (XXX Tables!)
if (style.borderTopColor is None) and style.borderTopWidth:
style.borderTopColor = first.textColor
if (style.borderBottomColor is None) and style.borderBottomWidth:
style.borderBottomColor = first.textColor
if (style.borderLeftColor is None) and style.borderLeftWidth:
style.borderLeftColor = first.textColor
if (style.borderRightColor is None) and style.borderRightWidth:
style.borderRightColor = first.textColor
style.borderPadding = first.borderPadding
style.paddingTop = first.paddingTop
style.paddingBottom = first.paddingBottom
style.paddingLeft = first.paddingLeft
style.paddingRight = first.paddingRight
style.fontName = tt2ps(first.fontName, first.bold, first.italic)
return style
示例4: toParagraphStyle
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import bulletFontName [as 别名]
def toParagraphStyle(self, first):
style = ParagraphStyle(
'default%d' % self.UID(), keepWithNext=first.keepWithNext)
copy_attrs(style, first,
('fontName', 'fontSize', 'letterSpacing', 'backColor',
'spaceBefore', 'spaceAfter', 'leftIndent', 'rightIndent',
'firstLineIndent', 'textColor', 'alignment',
'bulletIndent', 'wordWrap', 'borderTopStyle',
'borderTopWidth', 'borderTopColor',
'borderBottomStyle', 'borderBottomWidth',
'borderBottomColor', 'borderLeftStyle',
'borderLeftWidth', 'borderLeftColor',
'borderRightStyle', 'borderRightWidth',
'borderRightColor', 'paddingTop', 'paddingBottom',
'paddingLeft', 'paddingRight', 'borderPadding'
)
)
style.leading = max(
first.leading + first.leadingSpace, first.fontSize * 1.25)
style.bulletFontName = first.bulletFontName or first.fontName
style.bulletFontSize = first.fontSize
# Border handling for Paragraph
# Transfer the styles for each side of the border, *not* the whole
# border values that reportlab supports. We'll draw them ourselves in
# PmlParagraph.
# If no border color is given, the text color is used (XXX Tables!)
if (style.borderTopColor is None) and style.borderTopWidth:
style.borderTopColor = first.textColor
if (style.borderBottomColor is None) and style.borderBottomWidth:
style.borderBottomColor = first.textColor
if (style.borderLeftColor is None) and style.borderLeftWidth:
style.borderLeftColor = first.textColor
if (style.borderRightColor is None) and style.borderRightWidth:
style.borderRightColor = first.textColor
style.fontName = tt2ps(first.fontName, first.bold, first.italic)
return style
示例5: toParagraphStyle
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import bulletFontName [as 别名]
def toParagraphStyle(self, first, full=False):
style = ParagraphStyle('default%d' % self.UID(), keepWithNext=first.keepWithNext)
style.fontName = first.fontName
style.fontSize = first.fontSize
style.leading = max(first.leading, first.fontSize * 1.25)
style.backColor = first.backColor
style.spaceBefore = first.spaceBefore
style.spaceAfter = first.spaceAfter
style.leftIndent = first.leftIndent
style.rightIndent = first.rightIndent
style.firstLineIndent = first.firstLineIndent
style.textColor = first.textColor
style.alignment = first.alignment
style.bulletFontName = first.bulletFontName or first.fontName
style.bulletFontSize = first.fontSize
style.bulletIndent = first.bulletIndent
# Border handling for Paragraph
# Transfer the styles for each side of the border, *not* the whole
# border values that reportlab supports. We'll draw them ourselves in
# PmlParagraph.
style.borderTopStyle = first.borderTopStyle
style.borderTopWidth = first.borderTopWidth
style.borderTopColor = first.borderTopColor
style.borderBottomStyle = first.borderBottomStyle
style.borderBottomWidth = first.borderBottomWidth
style.borderBottomColor = first.borderBottomColor
style.borderLeftStyle = first.borderLeftStyle
style.borderLeftWidth = first.borderLeftWidth
style.borderLeftColor = first.borderLeftColor
style.borderRightStyle = first.borderRightStyle
style.borderRightWidth = first.borderRightWidth
style.borderRightColor = first.borderRightColor
# If no border color is given, the text color is used (XXX Tables!)
if (style.borderTopColor is None) and style.borderTopWidth:
style.borderTopColor = first.textColor
if (style.borderBottomColor is None) and style.borderBottomWidth:
style.borderBottomColor = first.textColor
if (style.borderLeftColor is None) and style.borderLeftWidth:
style.borderLeftColor = first.textColor
if (style.borderRightColor is None) and style.borderRightWidth:
style.borderRightColor = first.textColor
style.borderPadding = first.borderPadding
style.paddingTop = first.paddingTop
style.paddingBottom = first.paddingBottom
style.paddingLeft = first.paddingLeft
style.paddingRight = first.paddingRight
# This is the old code replaced by the above, kept for reference
#style.borderWidth = 0
#if getBorderStyle(first.borderTopStyle):
# style.borderWidth = max(first.borderLeftWidth, first.borderRightWidth, first.borderTopWidth, first.borderBottomWidth)
# style.borderPadding = first.borderPadding # + first.borderWidth
# style.borderColor = first.borderTopColor
# # If no border color is given, the text color is used (XXX Tables!)
# if (style.borderColor is None) and style.borderWidth:
# style.borderColor = first.textColor
if full:
style.fontName = tt2ps(first.fontName, first.bold, first.italic)
return style