示例#1
0
 def text_size(self, context):
     """
         overall on-screen size in pixels
     """
     dpi, font_id = context.user_preferences.system.dpi, 0
     if self.angle != 0:
         blf.enable(font_id, blf.ROTATION)
         blf.rotation(font_id, self.angle)
     blf.aspect(font_id, 1.0)
     blf.size(font_id, self.font_size, dpi)
     x, y = blf.dimensions(font_id, self.text)
     if self.angle != 0:
         blf.disable(font_id, blf.ROTATION)
     return Vector((x, y))
 def aspect(aspect, fontid=None):
     return blf.aspect(FontManager.load(fontid), aspect)
示例#3
0
 def aspect(aspect, fontid=None):
     return blf.aspect(FontManager.load(fontid), aspect)