Exemple #1
0
    def execute_single(self, master, glyph):
        if not glyph:
            raise Exception('no glyph defined `execute_single`')

        if self.mfparser == 'pen':
            import xmltomf_pen as xmltomf
            xmltomf.xmltomf1(master, glyph)

        if self.mfparser == 'controlpoints':
            import xmltomf_controlpoint as xmltomf
            xmltomf.xmltomf1(master, glyph)

        self.write_glyph_list(master, glyph.name)
        return self._create_outlines(master)
Exemple #2
0
    def execute_single(self, master, glyph):
        if not glyph:
            raise Exception('no glyph defined `execute_single`')

        if self.mfparser == 'pen':
            import xmltomf_pen as xmltomf
            xmltomf.xmltomf1(master, glyph)

        if self.mfparser == 'controlpoints':
            import xmltomf_controlpoint as xmltomf
            xmltomf.xmltomf1(master, glyph)

        self.write_glyph_list(master, glyph.name)
        return self._execute(master)
Exemple #3
0
    def execute_bulk(self, master):
        """ Run metapost for all glyphs with mf files containing points
            from concrete master.
        """
        for glyph in master.get_glyphs():
            if self.mfparser == 'pen':
                import xmltomf_pen as xmltomf
                xmltomf.xmltomf1(master, glyph)

            if self.mfparser == 'controlpoints':
                import xmltomf_controlpoint as xmltomf
                xmltomf.xmltomf1(master, glyph)

        self.write_glyph_list(master)
        return self._create_fonts(master)
Exemple #4
0
    def execute_bulk(self, master):
        """ Run metapost for all glyphs with mf files containing points
            from concrete master.
        """
        for glyph in master.get_glyphs():
            if self.mfparser == 'pen':
                import xmltomf_pen as xmltomf
                xmltomf.xmltomf1(master, glyph)

            if self.mfparser == 'controlpoints':
                import xmltomf_controlpoint as xmltomf
                xmltomf.xmltomf1(master, glyph)

        self.write_glyph_list(master)
        return self._execute(master)
Exemple #5
0
    def interpolated_metafont_generate(self, masters, *args, **kwargs):
        """ Fill mf files related on project mfparser with coords and
            needed metapost rules.
        """
        interpolated = kwargs.get('interpolated')

        glyphs = []
        for m in masters:
            for g in list(args):
                if g.master_id == m.id:
                    glyphs.append(g)
                    break

        primary_master = masters[0]
        if self.mfparser == 'controlpoints':
            import xmltomf_controlpoint as xmltomf
            xmltomf.xmltomf1(primary_master, *list(glyphs),
                             interpolated=interpolated)
        else:
            import xmltomf_pen as xmltomf
            xmltomf.xmltomf1(primary_master, *list(glyphs),
                             interpolated=interpolated)