示例#1
0
    def scaleBy(self, factor):
        """
        Scales all kerning values by **factor**. **factor** will be an
        :ref:`type-int-float`, ``tuple`` or ``list``. The first value of the
        **factor** will be used to scale the kerning values.

            >>> myKerning.scaleBy(2)
            >>> myKerning.scaleBy((2,3))
        """
        factor = normalizers.normalizeTransformationScale(factor)
        self._scale(factor)
示例#2
0
文件: base.py 项目: moyogo/fontparts
    def scaleBy(self, value, origin=None):
        """
        Scale the object.

            >>> obj.transformBy(2.0)
            >>> obj.transformBy((0.5, 2.0), origin=(500, 500))

        **value** must be an iterable containing two
        :ref:`type-int-float` values defining the x and y
        values to scale the object by. **origin** defines the
        point at with the scale should originate. It must be
        a :ref:`type-coordinate` or ``None``. The default is
        ``(0, 0)``.
        """
        value = normalizers.normalizeTransformationScale(value)
        if origin is None:
            origin = (0, 0)
        origin = normalizers.normalizeCoordinateTuple(origin)
        self._scaleBy(value, origin=origin)
示例#3
0
    def scaleBy(self, value, origin=None):
        """
        Scale the object.

            >>> obj.scaleBy(2.0)
            >>> obj.scaleBy((0.5, 2.0), origin=(500, 500))

        **value** must be an iterable containing two
        :ref:`type-int-float` values defining the x and y
        values to scale the object by. **origin** defines the
        point at with the scale should originate. It must be
        a :ref:`type-coordinate` or ``None``. The default is
        ``(0, 0)``.
        """
        value = normalizers.normalizeTransformationScale(value)
        if origin is None:
            origin = (0, 0)
        origin = normalizers.normalizeCoordinateTuple(origin)
        self._scaleBy(value, origin=origin)
示例#4
0
 def _set_base_scale(self, value):
     value = normalizers.normalizeTransformationScale(value)
     self._set_scale(value)
示例#5
0
 def _get_base_scale(self):
     value = self._get_scale()
     value = normalizers.normalizeTransformationScale(value)
     return value
示例#6
0
文件: image.py 项目: moyogo/fontparts
 def _set_base_scale(self, value):
     value = normalizers.normalizeTransformationScale(value)
     self._set_scale(value)
示例#7
0
文件: image.py 项目: moyogo/fontparts
 def _get_base_scale(self):
     value = self._get_scale()
     value = normalizers.normalizeTransformationScale(value)
     return value