Esempio n. 1
0
    def call_metapost_all_glyphs(self, master):
        writeGlobalParam(self.get_project())

        hasglyphs = False
        for glyph in master.get_glyphs():
            _glyphs = models.Glyph.filter(name=glyph.name)
            _glyphs = _glyphs.filter(models.Glyph.master_id.in_(map(lambda x: x.id, self._masters)))

            glyphs = []
            for m in self._masters:
                for g in _glyphs:
                    if g.master_id == m.id:
                        glyphs.append(g)
                        break

            if session.get('mfparser', '') == 'controlpoints':
                import xmltomf_new_2axes as xmltomf
                xmltomf.xmltomf1(self.get_lft_master(), *list(glyphs))
            else:
                import xmltomf
                xmltomf.xmltomf1(self.get_lft_master(), *list(glyphs))
            hasglyphs = True

        if hasglyphs:
            writeGlyphlist(master)
            makefont_single(self.get_lft_master())
Esempio n. 2
0
def prepare_master_environment(master):
    for f in os.listdir(working_dir('commons', user='******')):
        filename = working_dir(op.join('commons', f), user='******')
        try:
            shutil.copy2(filename, master.get_fonts_directory())
        except (IOError, OSError):
            raise
    writeGlobalParam(master.project)