コード例 #1
0
 def _round(self):
     """
     Subclasses may override this method.
     """
     x, y = self.offset
     x = normalizers.normalizeRounding(x)
     y = normalizers.normalizeRounding(y)
     self.offset = (x, y)
コード例 #2
0
ファイル: component.py プロジェクト: moyogo/fontparts
 def _round(self):
     """
     Subclasses may override this method.
     """
     x, y = self.offset
     x = normalizers.normalizeRounding(x)
     y = normalizers.normalizeRounding(y)
     self.offset = (x, y)
コード例 #3
0
ファイル: guideline.py プロジェクト: gitter-badger/fontParts
    def _round(self, **kwargs):
        """
        This is the environment implementation of
        :meth:`BaseGuideline.round`.

        Subclasses may override this method.
        """
        self.x = normalizers.normalizeRounding(self.x)
        self.y = normalizers.normalizeRounding(self.y)
コード例 #4
0
ファイル: anchor.py プロジェクト: moyogo/fontparts
    def _round(self):
        """
        This is the environment implementation of
        :meth:`BaseAnchor.round`.

        Subclasses may override this method.
        """
        self.x = normalizers.normalizeRounding(self.x)
        self.y = normalizers.normalizeRounding(self.y)
コード例 #5
0
ファイル: kerning.py プロジェクト: moyogo/fontparts
    def asDict(self, returnIntegers=True):
        """
        Return the Kerning as a ``dict``.

        This is a backwards compatibility method.
        """
        d = {}
        for k, v in self.items():
            d[k] = v if not returnIntegers else normalizers.normalizeRounding(v)
        return d
コード例 #6
0
ファイル: kerning.py プロジェクト: composerjk/fontParts
    def _round(self, multiple=1):
        """
        This is the environment implementation of
        :meth:`BaseKerning.round`. **multiple** will be an ``int``.

        Subclasses may override this method.
        """
        for pair, value in self.items():
            value = int(normalizers.normalizeRounding(
                value / float(multiple))) * multiple
            self[pair] = value
コード例 #7
0
ファイル: kerning.py プロジェクト: composerjk/fontParts
    def asDict(self, returnIntegers=True):
        """
        Return the Kerning as a ``dict``.

        This is a backwards compatibility method.
        """
        d = {}
        for k, v in self.items():
            d[k] = v if not returnIntegers else normalizers.normalizeRounding(
                v)
        return d
コード例 #8
0
ファイル: kerning.py プロジェクト: moyogo/fontparts
    def _round(self, multiple=1):
        """
        This is the environment implementation of
        :meth:`BaseKerning.round`. **multiple** will be an ``int``.

        Subclasses may override this method.
        """
        for pair, value in self.items():
            value = int(normalizers.normalizeRounding(
                value / float(multiple))) * multiple
            self[pair] = value
コード例 #9
0
 def round(self):
     """
     Round coordinates.
     """
     x, y = self.anchor
     self.anchor = (normalizers.normalizeRounding(x),
                    normalizers.normalizeRounding(y))
     x, y = self.bcpIn
     self.bcpIn = (normalizers.normalizeRounding(x),
                   normalizers.normalizeRounding(y))
     x, y = self.bcpOut
     self.bcpOut = (normalizers.normalizeRounding(x),
                    normalizers.normalizeRounding(y))
コード例 #10
0
 def round(self):
     """
     Round coordinates.
     """
     x, y = self.anchor
     self.anchor = (normalizers.normalizeRounding(x),
                    normalizers.normalizeRounding(y))
     x, y = self.bcpIn
     self.bcpIn = (normalizers.normalizeRounding(x),
                   normalizers.normalizeRounding(y))
     x, y = self.bcpOut
     self.bcpOut = (normalizers.normalizeRounding(x),
                    normalizers.normalizeRounding(y))