示例#1
0
 def _round(self):
     """
     Subclasses may override this method.
     """
     x, y = self.offset
     x = normalizers.normalizeVisualRounding(x)
     y = normalizers.normalizeVisualRounding(y)
     self.offset = (x, y)
示例#2
0
    def _round(self, **kwargs):
        """
        This is the environment implementation of
        :meth:`BasePoint.round`.

        Subclasses may override this method.
        """
        self.x = normalizers.normalizeVisualRounding(self.x)
        self.y = normalizers.normalizeVisualRounding(self.y)
示例#3
0
    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.normalizeVisualRounding(v)
        return d
示例#4
0
    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.normalizeVisualRounding(
                        value / float(multiple))) * multiple
            self[pair] = value
示例#5
0
 def round(self):
     """
     Round coordinates.
     """
     x, y = self.anchor
     self.anchor = (normalizers.normalizeVisualRounding(x),
                    normalizers.normalizeVisualRounding(y))
     x, y = self.bcpIn
     self.bcpIn = (normalizers.normalizeVisualRounding(x),
                   normalizers.normalizeVisualRounding(y))
     x, y = self.bcpOut
     self.bcpOut = (normalizers.normalizeVisualRounding(x),
                    normalizers.normalizeVisualRounding(y))