highlight.py 文件源码

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

项目:porcupine 作者: Akuli 项目源码 文件源码
def __init__(self, textwidget, filetype_name_getter):
        self.textwidget = textwidget
        self._get_filetype_name = filetype_name_getter
        self.pygmentizer = PygmentizerProcess()

        # the tags use fonts from here
        self._fonts = {}
        for bold in (True, False):
            for italic in (True, False):
                # the fonts will be updated later, see _on_config_changed()
                self._fonts[(bold, italic)] = tkfont.Font(
                    weight=('bold' if bold else 'normal'),
                    slant=('italic' if italic else 'roman'))

        config.connect('pygments_style', self._on_config_changed)
        config.connect('font_family', self._on_config_changed)
        config.connect('font_size', self._on_config_changed)
        self._on_config_changed()
        self.textwidget.after(50, self._do_highlights)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号