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
st_scheme_template.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录