st_scheme_template.py 文件源码

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

项目:sublimeTextConfig 作者: luoye-fe 项目源码 文件源码
def get_font_scale(self):
        """Get font scale."""

        scale = 1.0
        try:
            pref_scale = float(sublime.load_settings('Preferences.sublime-settings').get('mdpopups.font_scale', 0.0))
        except Exception:
            pref_scale = 0.0

        if sublime.platform() == 'windows' and pref_scale <= 0.0:
            try:
                import ctypes

                logpixelsy = 90
                dc = ctypes.windll.user32.GetDC(0)
                height = ctypes.windll.gdi32.GetDeviceCaps(dc, logpixelsy)
                scale = float(height) / 96.0
                ctypes.windll.user32.ReleaseDC(0, dc)
            except Exception:
                pass
        elif pref_scale > 0.0:
            scale = pref_scale

        return scale
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号