Exemplo n.º 1
0
def _registerFactory():
    # From https://github.com/typesupply/glyph-nanny/blob/master/Glyph%20Nanny.roboFontExt/lib/glyphNanny.py
    # always register if debugging
    # otherwise only register if it isn't registered
    if roboFontVersion >= "2.0b":
        from defcon import registerRepresentationFactory, Glyph
        if DEBUG:
            if "de.kutilek.RedArrow.report" in Glyph.representationFactories:
                for font in AllFonts():
                    for glyph in font:
                        glyph.naked().destroyAllRepresentations()
            registerRepresentationFactory(Glyph, "de.kutilek.RedArrow.report",
                                          RedArrowReportFactory)
        else:
            if "de.kutilek.RedArrow.report" not in Glyph.representationFactories:
                registerRepresentationFactory(Glyph,
                                              "de.kutilek.RedArrow.report",
                                              RedArrowReportFactory)
    else:
        from defcon import addRepresentationFactory, removeRepresentationFactory
        from defcon.objects import glyph as _xxxHackGlyph
        if DEBUG:
            if "de.kutilek.RedArrow.report" in _xxxHackGlyph._representationFactories:
                for font in AllFonts():
                    for glyph in font:
                        glyph.naked().destroyAllRepresentations()
                removeRepresentationFactory("de.kutilek.RedArrow.report")
            addRepresentationFactory("de.kutilek.RedArrow.report",
                                     RedArrowReportFactoryUFO2)
        else:
            if "de.kutilek.RedArrow.report" not in _xxxHackGlyph._representationFactories:
                addRepresentationFactory("de.kutilek.RedArrow.report",
                                         RedArrowReportFactoryUFO2)
    def _filterObjectToRepresentationFactory(self):
        theFilter = self._makeGlyphFilter()

        key = makeFilterKey(self.name)
        if key in _addedRepresentationFactories:
            removeRepresentationFactory(key)
        elif key not in _addedRepresentationFactories:
            _addedRepresentationFactories.append(key)
        addRepresentationFactory(key, theFilter)
Exemplo n.º 3
0
    def _filterObjectToRepresentationFactory(self):
        theFilter = self._makeGlyphFilter()

        key = makeFilterKey(self.name)
        if key in _addedRepresentationFactories:
            removeRepresentationFactory(key)
        elif key not in _addedRepresentationFactories:
            _addedRepresentationFactories.append(key)
        addRepresentationFactory(key, theFilter)
Exemplo n.º 4
0
def _registerFactory():
    # always register if debugging
    # otherwise only register if it isn't registered
    from defcon import addRepresentationFactory, removeRepresentationFactory
    from defcon.objects import glyph as _xxxHackGlyph
    if DEBUG:
        if "com.typesupply.GlyphNanny.Report" in _xxxHackGlyph._representationFactories:
            removeRepresentationFactory("com.typesupply.GlyphNanny.Report")
        addRepresentationFactory("com.typesupply.GlyphNanny.Report", GlyphNannyReportFactory)
    else:
        if "com.typesupply.GlyphNanny.Report" not in _xxxHackGlyph._representationFactories:
            addRepresentationFactory("com.typesupply.GlyphNanny.Report", GlyphNannyReportFactory)
Exemplo n.º 5
0
def _registerFactory():
    # always register if debugging
    # otherwise only register if it isn't registered
    from defcon import addRepresentationFactory, removeRepresentationFactory
    from defcon.objects import glyph as _xxxHackGlyph
    if DEBUG:
        if "com.typesupply.GlyphNanny.Report" in _xxxHackGlyph._representationFactories:
            removeRepresentationFactory("com.typesupply.GlyphNanny.Report")
        addRepresentationFactory("com.typesupply.GlyphNanny.Report",
                                 GlyphNannyReportFactory)
    else:
        if "com.typesupply.GlyphNanny.Report" not in _xxxHackGlyph._representationFactories:
            addRepresentationFactory("com.typesupply.GlyphNanny.Report",
                                     GlyphNannyReportFactory)
Exemplo n.º 6
0
def _unregisterFactory():
    if roboFontVersion >= "2.0b":
        from defcon import unregisterRepresentationFactory
        try:
            unregisterRepresentationFactory(RedArrowReportFactory,
                                            "de.kutilek.RedArrow.report")
        except:
            pass
    else:
        from defcon import removeRepresentationFactory
        try:
            removeRepresentationFactory("de.kutilek.RedArrow.report")
        except:
            pass
Exemplo n.º 7
0
def _registerFactory():
    # From https://github.com/typesupply/glyph-nanny/blob/master/Glyph%20Nanny.roboFontExt/lib/glyphNanny.py
    # always register if debugging
    # otherwise only register if it isn't registered
    from defcon import addRepresentationFactory, removeRepresentationFactory
    from defcon.objects import glyph as _xxxHackGlyph
    if DEBUG:
        if "de.kutilek.RedArrow.report" in _xxxHackGlyph._representationFactories:
            for font in AllFonts():
                for glyph in font:
                    glyph.naked().destroyAllRepresentations()
            removeRepresentationFactory("de.kutilek.RedArrow.report")
        addRepresentationFactory("de.kutilek.RedArrow.report", RedArrowReportFactory)
    else:
        if "de.kutilek.RedArrow.report" not in _xxxHackGlyph._representationFactories:
            addRepresentationFactory("de.kutilek.RedArrow.report", RedArrowReportFactory)
Exemplo n.º 8
0
def _unregisterFactory():
    from defcon import removeRepresentationFactory
    removeRepresentationFactory("de.netzallee.RedArrow.report")
Exemplo n.º 9
0
def _unregisterFactory():
    from defcon import removeRepresentationFactory
    try:
        removeRepresentationFactory("de.kutilek.RedArrow.report")
    except:
        pass
Exemplo n.º 10
0
def _unregisterFactory():
    from defcon import removeRepresentationFactory
    removeRepresentationFactory("de.netzallee.RedArrow.report")