+
    Zi;                    8   ^ RI Ht ^ RIHtHtHtHtHtHtH	t	H
t
Ht ^ RIHtHt ^ RIHt ^ RIHt ^ RIHt ^ RIHtHtHtHtHtHt ^ RIHtHtHtH t H!t!H"t" ^ R	I#H$t$ ^ R
I%H&t& ]'       d   ^ RI'H(t( ]! RR7      t)R R lt*]$] ! R R4      4       4       t+R R lt,R# )    )annotations)	TYPE_CHECKINGAnyDictIteratorKeysViewOptionalSequenceTypeoverload)definefield)GlyphSet)DEFAULT_LAYER_NAMEGlyph)Lib_convert_Lib_get_lib_get_tempLib_set_lib_set_tempLib)BoundingBox_deepcopy_unlazify_attrs_getstate_unlazify_attrs_prune_object_libs_setstate_attrsunionBounds)serde)T)	Converter___UFOLIB2_LAZY_GLYPH___)namec                    V ^8  d   QhRRRR/# )   valuez"dict[str, Glyph] | Sequence[Glyph]returnzdict[str, Glyph] )formats   "7/usr/lib/python3/dist-packages/ufoLib2/objects/layer.py__annotate__r+   -   s      = BR     c                   / p\        V \        4      '       d   \        4       pV P                  4        F  w  r4\        V\        4      '       g"   \        R \        V4      P                   24      hV\        Jdt   \        V4      pWR9   d   \        V: R24      hVP                  V4       VP                  f   W4n        M-VP                  V8w  d   \        RV RVP                   R24      hWAV&   K  	  V# V  F  p\        V\        4      '       g"   \        R \        V4      P                   24      hVP                  f   \        V: R24      hVP                  V9   d   \        RVP                   R24      hWAVP                  &   K  	  V# )Expected Glyph, found z can't be added twicez$glyph has incorrect name: expected 'z
', found ''# has no name; can't add it to Layerglyph named '' already exists)
isinstancedictsetitemsr   	TypeErrortype__name___GLYPH_NOT_LOADEDidKeyErroraddr#   _name
ValueError)r&   result	glyph_idsr#   glyphglyph_ids   &     r*   _convert_glyphsrD   -   so   !F%E	 ;;=KDeU++"8e9M9M8N OPP--e9("eY.C#DEEh'::%"&KZZ4'$%%)F*UZZLC  !4L )2 M EeU++"8e9M9M8N OPPzz! E9,O!PQQzzV#uzzl:JKLL!&5::  Mr,   c                     ] tR t^Mt$ Rt]! ]RR/R7      tR]R&   ]! ]	]
R7      tR]R	&   R
tR]R&    ]! ]]R7      tR]R&    RtR]R&    ]! ]]R7      tR]R&    ]! R
RRR7      tR]R&   ]! R
RRR7      tR]R&   R R lt]RPR R ll4       tR R lt]t]t]tR R ltR R  ltR! R" lt R# R$ lt!R% R& lt"R' R( lt#R) R* lt$RQR+ R, llt%R- R. lt&]'R/ R0 l4       t(]'RRR1 R2 ll4       t(])3R3 R4 llt(]*R5 R6 l4       t+]*! ],]-4      t.]*! ]/]04      t1]*R7 R8 l4       t2]*R9 R: l4       t3]*R; R< l4       t4R= R> lt5RSR? R@ llt6RA RB lt7RC RD lt8RTRE RF llt9RG RH lt:RURI RJ llt;RK RL lt<]=RM RN l4       t>ROt?R
# )VLayera  Represents a Layer that holds Glyph objects.

See http://unifiedfontobject.org/versions/ufo3/glyphs/layerinfo.plist/.

Note:
    Various methods that work on Glyph objects take a ``layer`` attribute, because
    the UFO data model prescribes that Components within a Glyph object refer to
    glyphs *within the same layer*.

Behavior:
    Layer behaves **partly** like a dictionary of type ``Dict[str, Glyph]``.
    Unless the font is loaded eagerly (with ``lazy=False``), the Glyph objects
    by default are only loaded into memory when accessed.

    To get the number of glyphs in the layer::

        glyphCount = len(layer)

    To iterate over all glyphs::

        for glyph in layer:
            ...

    To check if a specific glyph exists::

        exists = "myGlyphName" in layer

    To get a specific glyph::

        layer["myGlyphName"]

    To delete a specific glyph::

        del layer["myGlyphName"]
omit_if_defaultF)defaultmetadatastrr>   )factory	converterzDict[str, Glyph]_glyphsNzOptional[str]colorr   _libbool_default_tempLib)rH   initeqzOptional[bool]_lazyr   	_glyphSetc                   V ^8  d   QhRR/# r%   r'   Noner(   )r)   s   "r*   r+   Layer.__annotate__   s     ! !T !r,   c                	j    V P                   \        8X  d   V P                  '       g
   R V n        R# R# R# )TN)r>   r   rQ   selfs   &r*   __attrs_post_init__Layer.__attrs_post_init__   s'    ::++DMMM DM 5B+r,   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r%   r#   rJ   glyphSetr   lazyrP   rH   r'   rF   r(   )r)   s   "r*   r+   rZ      s4      "*26HL	r,   c                >   VP                  4       pV'       d   V Uu/ uF	  qf\        bK  	  ppM:/ pV F2  p\        V4      p	VP                  WV	P	                  4       4       WV&   K4  	  V ! WVR7      p
W:n        V'       d   W*n        VP                  V
4       V
# u upi )a  Instantiates a Layer object from a
:class:`fontTools.ufoLib.glifLib.GlyphSet`.

Args:
    name: The name of the layer.
    glyphSet: The GlyphSet object to read from.
    lazy: If True, load glyphs as they are accessed. If False, load everything
        up front.
)rH   )keysr:   r   	readGlyphgetPointPenrU   rV   readLayerInfo)clsr#   ra   rb   rH   
glyphNamesgnglyphs	glyphNamerB   r]   s   &&&&&      r*   read
Layer.read   s     ]]_
6@Aj++jFAFF'	i(""9U5F5F5HI$)y! ( 41
%Nt$ Bs   Bc                   V ^8  d   QhRR/# rX   r(   )r)   s   "r*   r+   rZ      s      $ r,   c                J    V P                   '       d
   V  F  pK  	  RV n         R# )zLoad all glyphs into memory.FN)rU   )r]   _s   & r*   unlazifyLayer.unlazify   s    ::: 
r,   c                    V ^8  d   QhRRRR/# )r%   r#   objectr'   rP   r(   )r)   s   "r*   r+   rZ      s     $ $ $D $r,   c                	    WP                   9   # NrM   r]   r#   s   &&r*   __contains__Layer.__contains__   s    ||##r,   c                    V ^8  d   QhRRRR/# )r%   r#   rJ   r'   rY   r(   )r)   s   "r*   r+   rZ      s        r,   c                	     V P                   V R # rw   rx   ry   s   &&r*   __delitem__Layer.__delitem__   s    LLr,   c                    V ^8  d   QhRRRR/# r%   r#   rJ   r'   r   r(   )r)   s   "r*   r+   rZ      s        r,   c                	b    V P                   V,          pV\        J d   V P                  V4      # V# rw   )rM   r:   	loadGlyph)r]   r#   glyph_objects   && r*   __getitem__Layer.__getitem__   s.    ||D),,>>$''r,   c               $    V ^8  d   QhRRRRRR/# )r%   r#   rJ   rB   r   r'   rY   r(   )r)   s   "r*   r+   rZ      s!     # # #E #d #r,   c                	    \        V\        4      '       g"   \        R \        V4      P                   24      hWn        W P                  V&   R# )r.   N)r3   r   r7   r8   r9   r>   rM   r]   r#   rB   s   &&&r*   __setitem__Layer.__setitem__   s>    %''4T%[5I5I4JKLL"Tr,   c                   V ^8  d   QhRR/# )r%   r'   zIterator[Glyph]r(   )r)   s   "r*   r+   rZ      s      / r,   c              #  	H   "   V P                    F  pW,          x  K  	  R # 5irw   rx   ry   s   & r*   __iter__Layer.__iter__   s     LLD* !s    "c                   V ^8  d   QhRR/# )r%   r'   intr(   )r)   s   "r*   r+   rZ      s     ! ! !r,   c                	,    \        V P                  4      # rw   )lenrM   r\   s   &r*   __len__Layer.__len__   s    4<<  r,   c                   V ^8  d   QhRR/# r%   r'   rJ   r(   )r)   s   "r*   r+   rZ      s     	
 	
# 	
r,   c                	J   \        V P                  4      pR P                  V P                  P                  V P                  P
                  V P                  V P                  '       d   RMRV^ 8X  d   RMRP                  Y^8  d   RMR4      \        \        V 4      4      4      # )z<{}.{} '{}' ({}{}) at {}>z	default,  emptyz
{} glyph{}s)
r   rM   r)   	__class__
__module__r9   r>   rQ   hexr;   )r]   ns   & r*   __repr__Layer.__repr__   sz    *11NN%%NN##JJ===KbAvG<#6#6qQ#B#O4M
 	
r,   c               $    V ^8  d   QhRRRRRR/# )r%   r#   rJ   rH   zT | Noner'   zT | Glyph | Noner(   )r)   s   "r*   r+   rZ      s"       h :J r,   c                :     W,          #   \          d    Tu # i ; i)z^Return the Glyph object for name if it is present in this layer,
otherwise return ``default``.r<   )r]   r#   rH   s   &&&r*   get	Layer.get   s#    	: 	N	s   
 c                   V ^8  d   QhRR/# )r%   r'   zKeysView[str]r(   )r)   s   "r*   r+   rZ      s     # #m #r,   c                6    V P                   P                  4       # )zReturns a list of glyph names.)rM   rd   r\   s   &r*   rd   
Layer.keys   s    ||  ""r,   c                    V ^8  d   QhRRRR/# )r%   keyrJ   r'   r   r(   )r)   s   "r*   r+   rZ      s    ))s)u)r,   c                	    R # rw   r(   )r]   r   s   &&r*   pop	Layer.pop   s    &)r,   c               $    V ^8  d   QhRRRRRR/# r%   r   rJ   rH   z	Glyph | Tr'   r(   )r)   s   "r*   r+   rZ      s    GGsGYGGr,   c                	    R # rw   r(   )r]   r   rH   s   &&&r*   r   r      s    DGr,   c               $    V ^8  d   QhRRRRRR/# r   r(   )r)   s   "r*   r+   rZ      s!      s Y i r,   c                Z     W,          pW V#   \          d    T\         J d   h Tp T# i ; i)zRemove and return glyph from layer.

Args:
    key: The name of the glyph.
    default: What to return if there is no glyph with the given name.
r   )r]   r   rH   rB   s   &&& r*   r   r      sB    	IE 	  	("E 	s    **c                   V ^8  d   QhRR/# r   r(   )r)   s   "r*   r+   rZ      s      c r,   c                    V P                   # )zThe name of the layer.)r>   r\   s   &r*   r#   
Layer.name   s     zzr,   c                   V ^8  d   QhRR/# )r%   r'   rP   r(   )r)   s   "r*   r+   rZ     s       r,   c                    V P                   # )zeRead-only property. To change the font's default layer use the
LayerSet.defaultLayer property setter.)rQ   r\   s   &r*   rH   Layer.default  s     }}r,   c                   V ^8  d   QhRR/# r%   r'   zBoundingBox | Noner(   )r)   s   "r*   r+   rZ     s     	 	* 	r,   c                P    RpV  F  p\        WP                  V 4      4      pK  	  V# )zzReturns the (xMin, yMin, xMax, yMax) bounding box of the layer,
taking the actual contours into account.

|defcon_compat|
N)r   	getBoundsr]   boundsrB   s   &  r*   r   Layer.bounds  s+     E )>?F r,   c                   V ^8  d   QhRR/# r   r(   )r)   s   "r*   r+   rZ     s     	 	$6 	r,   c                P    RpV  F  p\        WP                  V 4      4      pK  	  V# )z~Returns the (xMin, yMin, xMax, yMax) bounding box of the layer,
taking only the control points into account.

|defcon_compat|
N)r   getControlBoundsr   s   &  r*   controlPointBoundsLayer.controlPointBounds  s-     E )?)?)EFF r,   c                    V ^8  d   QhRRRR/# )r%   rB   r   r'   rY   r(   )r)   s   "r*   r+   rZ   %  s     = =e = =r,   c                .    V P                  VRRR7       R# )zHAppends glyph object to the this layer unless its name is already
taken.F)	overwritecopyN)insertGlyph)r]   rB   s   &&r*   addGlyphLayer.addGlyph%  s     	%e<r,   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r%   rB   r   r#   z
str | Noner   rP   r   r'   rY   r(   )r)   s   "r*   r+   rZ   *  s<     ) )) ) 	)
 ) 
)r,   c                ,   V'       d   VP                  4       pVe   W!n        VP                  f   \        V: R24      hV'       g5   VP                  V P                  9   d   \        RVP                   R24      hWP                  VP                  &   R# )aF  Inserts Glyph object into this layer.

Args:
    glyph: The Glyph object.
    name: The name of the glyph.
    overwrite: If True, overwrites (read: deletes) glyph with the same name if
        it exists. If False, raises KeyError.
    copy: If True, copies the Glyph object before insertion. If False, inserts
        as is.
Nr0   r1   r2   )r   r>   r#   r?   rM   r<   )r]   rB   r#   r   r   s   &&&&&r*   r   Layer.insertGlyph*  su    " JJLEK::y(KLMMUZZ4<<7]5::,6FGHH#(UZZ r,   c                    V ^8  d   QhRRRR/# r   r(   )r)   s   "r*   r+   rZ   E  s      c e r,   c                    \        V4      pV P                  P                  WVP                  4       4       W P                  V&   V# )zLoad and return Glyph object.)r   rV   re   rf   rM   r   s   && r*   r   Layer.loadGlyphE  s;     d  e.?.?.AB"Tr,   c                    V ^8  d   QhRRRR/# r   r(   )r)   s   "r*   r+   rZ   M  s      S U r,   c                x    WP                   9   d   \        RV R24      h\        V4      ;V P                   V&   pV# )z=Creates and returns new Glyph object in this layer with name.r1   r2   )rM   r<   r   r   s   && r*   newGlyphLayer.newGlyphM  s=    <<]4&0@ABB%*4[0TUr,   c               (    V ^8  d   QhRRRRRRRR/# )r%   r#   rJ   newNamer   rP   r'   rY   r(   )r)   s   "r*   r+   rZ   T  s(     & & &c &d &t &r,   c                    W8X  d   R# V'       g    W P                   9   d   \        RV R24      hV P                  V4      pW$n        W@P                   V&   R# )zRenames a Glyph object in this layer.

Args:
    name: The old name.
    newName: The new name.
    overwrite: If False, raises exception if newName is already taken.
        If True, overwrites (read: deletes) the old Glyph object.
Nztarget glyph named 'r2   )rM   r<   r   r>   )r]   r#   r   r   rB   s   &&&& r*   renameGlyphLayer.renameGlyphT  sL     ?W41':JKLL %Wr,   c                   V ^8  d   QhRR/# )r%   r'   r   r(   )r)   s   "r*   r+   rZ   g  s       r,   c                    \        4       # )z/Returns a new Glyph instance.

|defcon_compat|
r   r\   s   &r*   instantiateGlyphObjectLayer.instantiateGlyphObjectg  s    
 wr,   c               $    V ^8  d   QhRRRRRR/# )r%   ra   r   saveAsrP   r'   rY   r(   )r)   s   "r*   r+   rZ   n  s!     " "h " " "r,   c                    V P                   pV'       g=   \        VP                  4      P                  V4       F  pVP	                  V4       K  	  VP                  4        Fg  w  rEV\        J d   V'       d   V P                  V4      pMK+  \        VP                  \        V4      4       VP                  WEVP                  R7       Ki  	  VP                  4        VP                  V 4       V'       d
   RV n        R# R# )a#  Write Layer to a :class:`fontTools.ufoLib.glifLib.GlyphSet`.

Args:
    glyphSet: The GlyphSet object to write to.
    saveAs: If True, tells the writer to save out-of-place. If False, tells the
        writer to save in-place. This affects how resources are cleaned before
        writing.
)glyphObjectdrawPointsFuncN)rM   r5   contents
differencedeleteGlyphr6   r:   r   r   lib_fetch_glyph_identifiers
writeGlyph
drawPointswriteContentswriteLayerInforV   )r]   ra   r   rk   r#   rB   s   &&&   r*   writeLayer.writen  s     H--.99&A$$T* B!<<>KD)) NN40Euyy*B5*IJ8H8H    * 	 %!DN r,   c                    V ^8  d   QhRRRR/# )r%   rL   r!   r'   dict[str, Any]r(   )r)   s   "r*   r+   rZ     s      i N r,   c                	   / pV P                    F5  pVP                  W,          4      pW4P                  R 4      8X  g   Q hWBV&   K7  	  R V P                  /pRV P                  V P                  \
        8H  3RV/ 3RV P                  / 3RV P                  / 33 F$  w  rgpVP                  '       d	   Wx8w  g   K   WuV&   K&  	  V P                  e   V P                  VR&   V# )r#   rH   rk   r   tempLibrN   )
rM   unstructurer   r>   rQ   r   rO   rR   rG   rN   )	r]   rL   rk   
glyph_namegdr   r&   rH   s	   &&       r*   _unstructureLayer._unstructure  s    ,.,,J%%d&67Av...!": ' DJJ
 tzz5G'GHvr"DIIr"r*	$
C ,,,0@#$
 ::!AgJr,   c               (    V ^8  d   QhRRRRRRRR/# )	r%   datar   rh   zType[Layer]rL   r!   r'   rF   r(   )r)   s   "r*   r+   rZ     s,     
 

#.
;D
	
r,   c                	   T! V P                  R \        4      V P                  R/ 4      P                  4        UUu/ uF  w  r4W2P                  V\        4      bK  	  uppV P                  R4      VP                  V P                  R/ 4      \
        4      V P                  RR4      VP                  V P                  R/ 4      \
        4      R7      # u uppi )r#   rk   rN   r   rH   Fr   )r#   rk   rN   r   rH   r   )r   r   r6   	structurer   r   )r   rh   rL   kvs   &&&  r*   
_structureLayer._structure  s     &"45 !HHXr288::DA &&q%00: ((7###DHHUB$7=HHY.''B(?E

 
	
s   !C)rQ   rV   rU   )TFrw   ).)NTT)F)T)@r9   r   __qualname____firstlineno____doc__r   r   r>   __annotations__r4   rD   rM   rN   r   r   rO   rQ   rR   rU   rV   r^   classmethodrm   rr   r   __deepcopy__r   __getstate__r   __setstate__rz   r~   r   r   r   r   r   r   rd   r   r   r<   propertyr#   r   r   r   r   r   r   rH   r   r   r   r   r   r   r   r   r   r   staticmethodr   __static_attributes__r(   r,   r*   rF   rF   M   s   "H 1=NPU<VWE3W %do NGNE=*c\:D#:DHd #>Hc>4!$UuEE>E4e>Is>!
  : ,L+L"L$#!	
# ) )G G19 $   8X
&C|\2G 
 	 	 	 	=
)6&&":2 
 
r,   rF   c                    V ^8  d   QhRRRR/# )r%   rB   r   r'   zset[str]r(   )r)   s   "r*   r+   r+     s      E h r,   c                n   \        4       pV P                   F.  pVP                  f   K  VP                  VP                  4       K0  	  V P                   F.  pVP                  f   K  VP                  VP                  4       K0  	  V P
                   F`  pVP                  e   VP                  VP                  4       V F.  pVP                  f   K  VP                  VP                  4       K0  	  Kb  	  V P                   F.  pVP                  f   K  VP                  VP                  4       K0  	  V# )z*Returns all identifiers in use in a glyph.)r5   anchors
identifierr=   
guidelinescontours
components)rB   identifiersanchor	guidelinecontourpoint	components   &      r*   r   r     s     %K--(OOF--.   %%	+OOI001 & >>)OOG../E+ 0 01  " %%	+OOI001 & r,   N)-
__future__r   typingr   r   r   r   r   r	   r
   r   r   attrsr   r   fontTools.ufoLib.glifLibr   ufoLib2.constantsr   ufoLib2.objects.glyphr   ufoLib2.objects.libr   r   r   r   r   r   ufoLib2.objects.miscr   r   r   r   r   r   ufoLib2.serder   ufoLib2.typingr    cattrsr!   r:   rD   rF   r   r(   r,   r*   <module>r%     s    "
 
 
   - 0 '      9: @ c
 c
  c
Lr,   