How to use the defcon.objects.base.BaseDictObject function in defcon

To help you get started, we’ve selected a few defcon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sugarlabs / edit-fonts-activity / defcon / objects / lib.py View on Github external
import weakref
from defcon.objects.base import BaseDictObject


class Lib(BaseDictObject):
    """
    This object contains arbitrary data.

    **This object posts the following notifications:**

    ===============
    Name
    ===============
    Lib.Changed
    Lib.BeginUndo
    Lib.EndUndo
    Lib.BeginRedo
    Lib.EndRedo
    Lib.ItemSet
    Lib.ItemDeleted
    Lib.Cleared
github robotools / defcon / Lib / defcon / objects / uniData.py View on Github external
from __future__ import absolute_import
import weakref
import unicodedata
from fontTools.agl import AGL2UV
from defcon.tools import unicodeTools
from defcon.objects.base import BaseDictObject


class UnicodeData(BaseDictObject):

    """
    This object serves Unicode data for the font.

    **This object posts the following notifications:**

    - UnicodeData.Changed

    This object behaves like a dict. The keys are Unicode values and the
    values are lists of glyph names associated with that unicode value::

        {
            65 : ["A"],
            66 : ["B"],
        }
github sugarlabs / edit-fonts-activity / defcon / objects / groups.py View on Github external
import weakref
from defcon.objects.base import BaseDictObject


class Groups(BaseDictObject):
    """
    This object contains all of the groups in a font.

    **This object posts the following notifications:**

    ===================
    Name
    ===================
    Groups.Changed
    Groups.BeginUndo
    Groups.EndUndo
    Groups.BeginRedo
    Groups.EndRedo
    Groups.GroupSet
    Groups.GroupDeleted
    Groups.Cleared
github sugarlabs / edit-fonts-activity / third_party / defcon / objects / guideline.py View on Github external
import weakref
from defcon.objects.base import BaseDictObject
from defcon.objects.color import Color
from defcon.tools.identifiers import makeRandomIdentifier


class Guideline(BaseDictObject):
    """
    This object represents a guideline.

    **This object posts the following notifications:**

    ===========================
    Name
    ===========================
    Guideline.Changed
    Guideline.XChanged
    Guideline.YChanged
    Guideline.AngleChanged
    Guideline.NameChanged
    Guideline.IdentifierChanged
    ===========================
github robotools / defcon / Lib / defcon / objects / groups.py View on Github external
from __future__ import absolute_import
import weakref
from defcon.objects.base import BaseDictObject
from defcon.tools.representations import kerningSide1GroupsRepresentationFactory, kerningSide2GroupsRepresentationFactory, glyphToKerningSide1GroupsRepresentationFactory, glyphToKerningSide2GroupsRepresentationFactory


class Groups(BaseDictObject):

    """
    This object contains all of the groups in a font.

    **This object posts the following notifications:**

    - Groups.Changed
    - Groups.BeginUndo
    - Groups.EndUndo
    - Groups.BeginRedo
    - Groups.EndRedo
    - Groups.GroupSet
    - Groups.GroupDeleted
    - Groups.Cleared
    - Groups.Updated
github sugarlabs / edit-fonts-activity / third_party / defcon / objects / image.py View on Github external
import weakref
from defcon.objects.base import BaseDictObject
from defcon.objects.color import Color

_defaultTransformation = {
    "xScale": 1,
    "xyScale": 0,
    "yxScale": 0,
    "yScale": 1,
    "xOffset": 0,
    "yOffset": 0
}


class Image(BaseDictObject):
    """
    This object represents an image reference in a glyph.

    **This object posts the following notifications:**

    ===========================
    Name
    ===========================
    Image.Changed
    Image.FileNameChanged
    Image.TransformationChanged
    Image.ColorChanged
    Image.ImageDataChanged
    ===========================

    During initialization an image dictionary, following the format defined
github sugarlabs / edit-fonts-activity / third_party / defcon / objects / anchor.py View on Github external
import weakref
from defcon.objects.base import BaseDictObject
from defcon.objects.color import Color
from defcon.tools.identifiers import makeRandomIdentifier


class Anchor(BaseDictObject):
    """
    This object represents an anchor point.

    **This object posts the following notifications:**

    ========================
    Name
    ========================
    Anchor.Changed
    Anchor.XChanged
    Anchor.YChanged
    Anchor.NameChanged
    Anchor.ColorChanged
    Anchor.IdentifierChanged
    ========================
github robotools / defcon / Lib / defcon / objects / kerning.py View on Github external
from __future__ import absolute_import
import weakref
from fontTools.ufoLib.kerning import lookupKerningValue
from defcon.objects.base import BaseDictObject


class Kerning(BaseDictObject):

    """
    This object contains all of the kerning pairs in a font.

    **This object posts the following notifications:**

    - Kerning.Changed
    - Kerning.BeginUndo
    - Kerning.EndUndo
    - Kerning.BeginRedo
    - Kerning.EndRedo
    - Kerning.PairSet
    - Kerning.PairDeleted
    - Kerning.Cleared
    - Kerning.Updated
github sugarlabs / edit-fonts-activity / defcon / objects / kerning.py View on Github external
import weakref
from defcon.objects.base import BaseDictObject


class Kerning(BaseDictObject):
    """
    This object contains all of the kerning pairs in a font.

    **This object posts the following notifications:**

    ===================
    Name
    ===================
    Kerning.Changed
    Kerning.BeginUndo
    Kerning.EndUndo
    Kerning.BeginRedo
    Kerning.EndRedo
    Kerning.PairSet
    Kerning.PairDeleted
    Kerning.Cleared
github robotools / defcon / Lib / defcon / objects / lib.py View on Github external
from __future__ import absolute_import
import weakref
from defcon.objects.base import BaseDictObject


class Lib(BaseDictObject):

    """
    This object contains arbitrary data.

    **This object posts the following notifications:**

    - Lib.Changed
    - Lib.BeginUndo
    - Lib.EndUndo
    - Lib.BeginRedo
    - Lib.EndRedo
    - Lib.ItemSet
    - Lib.ItemDeleted
    - Lib.Cleared
    - Lib.Updated