Changeset 242

Show
Ignore:
Timestamp:
07/03/08 07:37:26 (6 months ago)
Author:
tal
Message:
Made the various flags dynamic.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • packages/compositor/trunk/Lib/compositor/lookupList.py

    r240 r242  
    7070class LookupFlag(object): 
    7171 
    72     __slots__ = ["_gdef", "_flag", "_haveIgnore", 
    73                 "IgnoreBaseGlyphs", "IgnoreLigatures", "IgnoreMarks", 
    74                 "RightToLeft", "MarkAttachmentType"] 
     72    __slots__ = ["_gdef", "_flag"] 
    7573 
    7674    def __init__(self): 
    7775        self._gdef = None 
    7876        self._flag = None 
    79         self._haveIgnore = False 
    80         self.RightToLeft = False 
    81         self.IgnoreBaseGlyphs = False 
    82         self.IgnoreLigatures = False 
    83         self.IgnoreMarks = False 
    84         self.MarkAttachmentType = False 
    8577 
    8678    def loadFromFontTools(self, lookupFlag, gdef): 
    8779        self._gdef = gdef 
    8880        self._flag = lookupFlag 
    89         self._haveIgnore = lookupFlag & 0x0E 
    90         self.RightToLeft = lookupFlag & 0x0001 
    91         self.IgnoreBaseGlyphs = lookupFlag & 0x0002 
    92         self.IgnoreLigatures = lookupFlag & 0x0004 
    93         self.IgnoreMarks = lookupFlag & 0x0008 
    94         self.MarkAttachmentType = lookupFlag & 0xFF00 
    9581        return self 
     82 
     83    def _get_haveIgnore(self): 
     84        return bool(self._flag & 0x0E) 
     85 
     86    _haveIgnore = property(_get_haveIgnore) 
     87 
     88    def _get_RightToLeft(self): 
     89        return bool(self._flag & 0x0001) 
     90 
     91    RightToLeft = property(_get_RightToLeft) 
     92 
     93    def _get_IgnoreBaseGlyphs(self): 
     94        return bool(self._flag & 0x0002) 
     95 
     96    IgnoreBaseGlyphs = property(_get_IgnoreBaseGlyphs) 
     97 
     98    def _get_IgnoreLigatures(self): 
     99        return bool(self._flag & 0x0004) 
     100 
     101    IgnoreLigatures = property(_get_IgnoreLigatures) 
     102 
     103    def _get_IgnoreMarks(self): 
     104        return bool(self._flag & 0x0008) 
     105 
     106    IgnoreMarks = property(_get_IgnoreMarks) 
     107 
     108    def _get_MarkAttachmentType(self): 
     109        return bool(self._flag & 0xFF00) 
     110 
     111    MarkAttachmentType = property(_get_MarkAttachmentType) 
    96112 
    97113    def coversGlyph(self, glyphName):