예제 #1
0
 def to_png(self, *args, **kwargs):
     image_wrapper = self._original_to_png(*args, **kwargs)
     image = image_wrapper.get_image()
     new_width = helpers.pt_to_px(image_wrapper.get_width())
     new_height = helpers.pt_to_px(image_wrapper.get_height())
     image_wrapper.image = image.resize((new_width, new_height), Image.ANTIALIAS)
     #image_wrapper.scale_parameters(1.0/ANTIALIASING)
     return image_wrapper
예제 #2
0
파일: _field.py 프로젝트: PP-TSD/sdgen
 def pt_to_px(self, points):
     """Mapping :function:`pt_to_px` from :mod:`sdgen.lib.helpers`.
     
     Result of this method can be modified by setting antialiasing decorator
     on class.
     """
     return helpers.pt_to_px(points)
예제 #3
0
파일: character.py 프로젝트: PP-TSD/sdgen
    def _get_font(self, font_type, size, typeface):
        """Get font with given parameters."""
        font_path = helpers.get_font_path(font_type, typeface)

        if font_path:
            return ImageFont.truetype(font_path, helpers.pt_to_px(size))
        return ImageFont.load_default()
예제 #4
0
파일: _view.py 프로젝트: PP-TSD/sdgen
    def pt_to_px(self, points):
        """
        Converts points to pixels.

        .. deprecated:: 0.0.3
            Use :func:`helpers.pt_to_px` directly instead.
        """
        return helpers.pt_to_px(points)