quran-typesetter.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:quran-typesetter 作者: khaledhosny 项目源码 文件源码
def draw(self, cr, pos, text_width):
        self.strip()
        width = sum([box.width for box in self.boxes])
        # Center lines not equal to text width.
        if not math.isclose(width, text_width):
            pos.x -= (text_width - width)/2

        for box in self.boxes:
            # We start drawing from the right edge of the text block,
            # and move to the left, thus the subtraction instead of
            # addition below.
            pos.x -= box.width
            box.draw(cr, pos)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号