当前位置: 首页>>代码示例>>Python>>正文


Python ParagraphStyle.font方法代码示例

本文整理汇总了Python中reportlab.lib.styles.ParagraphStyle.font方法的典型用法代码示例。如果您正苦于以下问题:Python ParagraphStyle.font方法的具体用法?Python ParagraphStyle.font怎么用?Python ParagraphStyle.font使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在reportlab.lib.styles.ParagraphStyle的用法示例。


在下文中一共展示了ParagraphStyle.font方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: drawMetadata

# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import font [as 别名]
    def drawMetadata(self):
        data = [('Artist', self.artist), ('Made', self.place), ('Date', self.date)]
        data = self.artist + ", " + self.date + ", " + self.place
#        self.canvas.setFont('TheSans', 12)
#        self.canvas.drawString(PAGE_HEIGHT*0.635, PAGE_WIDTH*0.86, data)

        parastyle = ParagraphStyle('pad')
        parastyle.textColor = 'black'
        parastyle.fontSize = 10
        parastyle.leading = 20
        parastyle.font = 'TheSans-Bold'
        paragraph = Paragraph(data, parastyle)
        paragraph.wrapOn(self.canvas, PAGE_HEIGHT*0.25, PAGE_WIDTH*0.1)
        paragraph.drawOn(self.canvas, PAGE_HEIGHT*0.635, PAGE_WIDTH*0.84)
开发者ID:vanda,项目名称:vamcolouring,代码行数:16,代码来源:colouring-in.py

示例2: drawParagraph

# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import font [as 别名]
    def drawParagraph(text, position):
        style = ParagraphStyle('test')
        style.font = 'Helvetica-Bold'

        font_size = 16
        while font_size > 0:
            style.fontSize = font_size
            style.leading = font_size

            para = Paragraph(text, style)
            (para_width, para_height) = para.wrap(CARD_INNER_WIDTH - COLUMN_WIDTH - CARD_IMAGE_WIDTH, CARD_INNER_HEIGHT)

            if para_height <= 48:
                para.drawOn(p, inner_left + COLUMN_WIDTH, inner_bottom + CARD_INNER_HEIGHT * position + 8 - para_height / 2)
                return

            font_size -= 1
开发者ID:eddarmitage,项目名称:codeforlife-portal,代码行数:19,代码来源:teach.py


注:本文中的reportlab.lib.styles.ParagraphStyle.font方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。