Example #1
0
    def _get_kerning(self):
        u"""Answer the (expanded) kerning table of the font.

        >>> from pagebot.toolbox.transformer import *
        >>> from pagebot.fonttoolbox.fontpaths import getTestFontsPath
        >>> fontPath = getTestFontsPath()
        >>> path = fontPath + '/djr/bungee/Bungee-Regular.ttf'
        >>> f = getFont(path, lazy=False)
        >>> len(f.kerning.keys())
        22827
        """
        if self._kerning is None:  # Lazy read.
            self._kerning = OTFKernReader(self.path).kerningPairs
        return self._kerning
Example #2
0
from pagebot.fonttoolbox.objects.font import Font
from pagebot.contributions.adobe.kerndump.getKerningPairsFromOTF import OTFKernReader

f = Font(u"/Library/Fonts/Upgrade-Medium.otf")

print len(f.kerning)

#print OTFKernReader(f.path).kerningPairs
okr = OTFKernReader(f.path)
okr.getClassPairs()
okr.getSinglePairs()
print okr.classPairs
#print okr.singlePairs
#print okr.pairPosList

Example #3
0
 def _get_kerning(self):
     if self._kerning is None:  # Lazy read.
         self._kerning = OTFKernReader(self.path).kerningPairs
     return self._kerning