Ejemplo n.º 1
0
def extractWOFFKerning(source,
                       destination,
                       leftGroupPrefix=defaultLeftKerningGroupPrefix,
                       rightGroupPrefix=defaultRightKerningGroupPrefix):
    return extractOpenTypeKerning(source,
                                  destination,
                                  leftGroupPrefix=leftGroupPrefix,
                                  rightGroupPrefix=rightGroupPrefix)
Ejemplo n.º 2
0
def extractFontFromWOFF(pathOrFile, destination, doGlyphs=True, doInfo=True, doKerning=True, doGroups=True, doFeatures=True, doLib=True, customFunctions=[]):
    from woffTools import WOFFFont
    source = WOFFFont(pathOrFile)
    if doInfo:
        extractOpenTypeInfo(source, destination)
    if doGlyphs:
        extractOpenTypeGlyphs(source, destination)
    if doKerning:
        kerning, groups = extractOpenTypeKerning(source, destination)
        destination.groups.update(groups)
        destination.kerning.clear()
        destination.kerning.update(kerning)
    for function in customFunctions:
        function(source, destination)
    source.close()
Ejemplo n.º 3
0
def extractFontFromTTX(pathOrFile, destination, doGlyphs=True, doInfo=True, doKerning=True, doGroups=True, doFeatures=True, doLib=True, customFunctions=[]):
    from fontTools.ttLib import TTFont, TTLibError
    source = TTFont()
    source.importXML(pathOrFile)
    if doInfo:
        extractOpenTypeInfo(source, destination)
    if doGlyphs:
        extractOpenTypeGlyphs(source, destination)
    if doKerning:
        kerning, groups = extractOpenTypeKerning(source, destination)
        destination.groups.update(groups)
        destination.kerning.clear()
        destination.kerning.update(kerning)
    for function in customFunctions:
        function(source, destination)
    source.close()   
Ejemplo n.º 4
0
def extractFontFromTTX(pathOrFile,
                       destination,
                       doGlyphs=True,
                       doInfo=True,
                       doKerning=True,
                       customFunctions=[]):
    from fontTools.ttLib import TTFont, TTLibError
    source = TTFont()
    source.importXML(pathOrFile)
    if doInfo:
        extractOpenTypeInfo(source, destination)
    if doGlyphs:
        extractOpenTypeGlyphs(source, destination)
    if doKerning:
        kerning, groups = extractOpenTypeKerning(source, destination)
        destination.groups.update(groups)
        destination.kerning.clear()
        destination.kerning.update(kerning)
    for function in customFunctions:
        function(source, destination)
    source.close()
Ejemplo n.º 5
0
def extractFontFromWOFF(pathOrFile,
                        destination,
                        doGlyphs=True,
                        doInfo=True,
                        doKerning=True,
                        doGroups=True,
                        doFeatures=True,
                        doLib=True,
                        customFunctions=[]):
    from woffTools import WOFFFont
    source = WOFFFont(pathOrFile)
    if doInfo:
        extractOpenTypeInfo(source, destination)
    if doGlyphs:
        extractOpenTypeGlyphs(source, destination)
    if doKerning:
        kerning, groups = extractOpenTypeKerning(source, destination)
        destination.groups.update(groups)
        destination.kerning.clear()
        destination.kerning.update(kerning)
    for function in customFunctions:
        function(source, destination)
    source.close()
Ejemplo n.º 6
0
def extractWOFFKerning(source, destination, leftGroupPrefix=defaultLeftKerningGroupPrefix, rightGroupPrefix=defaultRightKerningGroupPrefix):
    return extractOpenTypeKerning(source, destination, leftGroupPrefix=leftGroupPrefix, rightGroupPrefix=rightGroupPrefix)