def Process(self, basicKerning, outputFilename):
        hppOutputFilename = '%s.%s' % (outputFilename, 'hpp')
        cppOutputFilename = '%s.%s' % (outputFilename, 'cpp')

        className = IOUtil.GetFileNameWithoutExtension(outputFilename)

        hppContent = self.__BuildHPPContent(basicKerning, className)
        cppContent = self.__BuildCPPContent(basicKerning, className)
        IOUtil.WriteFileIfChanged(hppOutputFilename, hppContent)
        IOUtil.WriteFileIfChanged(cppOutputFilename, cppContent)
Exemple #2
0
    def Process(self, basicFont: BasicFont, outputFilename: str) -> None:
        hppOutputFilename = '{}.{}'.format(outputFilename, 'hpp')
        cppOutputFilename = '{}.{}'.format(outputFilename, 'cpp')

        className = IOUtil.GetFileNameWithoutExtension(outputFilename)

        hppContent = self.__BuildHPPContent(basicFont, className)
        cppContent = self.__BuildCPPContent(basicFont, className)
        IOUtil.WriteFileIfChanged(hppOutputFilename, hppContent)
        IOUtil.WriteFileIfChanged(cppOutputFilename, cppContent)
Exemple #3
0
def Process(formatPlugins, inputFilename, outputFilename, formatName):
    if outputFilename == None:
        outputFilename = IOUtil.GetFileNameWithoutExtension(inputFilename)

    formatPlugin = GetEntryByName(formatPlugins, formatName)

    # Read the json file and convert it into python objects
    content = IOUtil.ReadFileBinary(inputFilename)
    jsonDict = json.loads(content)
    atlas = BasicKerning(jsonDict, outputFilename)

    formatPlugin.Process(atlas, outputFilename)
def Process(formatPlugins: List[FormatPlugin], inputFilename: str,
            outputFilename: str, formatName: str,
            bitmapFontType: BitmapFontType) -> None:
    formatPlugin = GetEntryByName(formatPlugins, formatName)
    if outputFilename is None:
        outputFilename = IOUtil.GetFileNameWithoutExtension(inputFilename)

    if formatPlugin.PluginType == FormatPluginType.BasicFont:
        ProcessV1(formatPlugins, inputFilename, outputFilename, bitmapFontType,
                  formatPlugin)
    else:
        ProcessV2(formatPlugins, inputFilename, outputFilename, bitmapFontType,
                  formatPlugin)