+
    f7iP&  c                   s    R t ^ RIHtHtHt ^ RIHtHt ^ RIH	t	 RR.t
 ! R R4      t ! R R]]	4      t ! R	 R]]4      tRRR
/R lltR t]R8X  d    ^ RIt]! ]P$                  R,          4       R# R# )z~Pen calculating area, center of mass, variance and standard-deviation,
covariance and correlation, and slant, of glyph shapes.)sqrtdegreesatan)BasePenOpenContourError)
MomentsPenStatisticsPenStatisticsControlPenc                   s2   a  ] tR t^t o R tR tR tRtV tR# )StatisticsBasec                s&    V P                  4        R # N)_zeroself   &C/usr/lib64/python3.14/site-packages/fontTools/pens/statisticsPen.py__init__ZStatisticsBase.__init__   s    

    c                s    ^ V n         ^ V n        ^ V n        ^ V n        ^ V n        ^ V n        ^ V n        ^ V n        ^ V n        ^ V n	        R# )    N)
areameanXmeanY	varianceX	varianceYstddevXstddevY
covariancecorrelationslantr   r   r   r
   ZStatisticsBase._zero   sI    	


r   c                sP   \        V P                  4      V n        \        V P                  4      V n        \        V P                  4      ;V n        p\        V P                  4      ;V n        pW,          ^ 8X  d   \        R4      pM/V P                  W,          ,          p\        R\        ^V4      4      p\        V4      R8  d   TM^ V n
        V P                  ^ 8w  d   V P                  V P                  ,          M
\        R4      p\        V4      R8  d	   W@n        R# ^ V n        R# )r   ZNaNgMbP?Ni)absr   r   r    r   r   Zfloatr   ZmaxZminr   r   )r   r   r   r   r   s   &    r   _updateZStatisticsBase._update   s     T^^,T^^,!%dnn!55w!%dnn!55w !,K
 //W->?Kb#a"56K*-k*:T*A;q 15!0CDOOdnn,u 	 "%j4/U
Q
r   )
r   r   r   r   r   r   r   r   r   r   N)	__name__
__module____qualname____firstlineno__r   r
   r   __static_attributes____classdictcell__Z__classdict__   @r   r   r      s     
7 7r   r   c                   s:   a  ] tR t^7t o RtRR ltR tR tRtV t	R# )r   a&  Pen calculating area, center of mass, variance and
standard-deviation, covariance and correlation, and slant,
of glyph shapes.

Note that if the glyph shape is self-intersecting, the values
are not correct (but well-defined). Moreover, area will be
negative if contour directions are clockwise.Nc                s^    \         P                  ! WR 7       \        P                  V 4       R# )glyphsetN)r   r   r   r   r'      &&r   r   ZStatisticsPen.__init__@   s    D4%r   c                sR    \         P                  ! V 4       V P                  4        R # r	   )r   
_closePathr   r   r   r   r*   ZStatisticsPen._closePathD   s    d#r   c                s   V P                   pV'       g   V P                  4        R # V P                  V,          ;V n        pV P                  V,          ;V n        pV P                  V,          W",          ,
          V n        V P                  V,          W3,          ,
          V n	        V P                  V,          W#,          ,
          V n        \        P                  V 4       R # r	   )r   r
   momentXr   momentYr   momentXXr   momentYYr   momentXYr   r   r   )r   r   r   r   s   &   r   r   ZStatisticsPen._updateH   s    yyJJL "\\D00
U!\\D00
U -=-= --$.>t$r   )r   r   r   r   r   r	   )
r   r   r    r!   __doc__r   r*   r   r"   r#   r$   r%   r   r   r   7   s     5&% %r   c                   sX   a  ] tR t^]t o RtRR ltR tR tR tR t	R t
R	 tR
 tRtV tR# )r   aF  Pen calculating area, center of mass, variance and
standard-deviation, covariance and correlation, and slant,
of glyph shapes, using the control polygon only.

Note that if the glyph shape is self-intersecting, the values
are not correct (but well-defined). Moreover, area will be
negative if contour directions are clockwise.Nc                sj    \         P                  ! W4       \        P                  V 4       . V n        R # r	   )r   r   r   _nodesr(   r)   r   r   ZStatisticsControlPen.__init__f   s%    (%r   c                sV    V P                   P                  \        V!  4       Wn        R # r	   )r1   appendcomplex_startPointr   ptr)   r   _moveToZStatisticsControlPen._moveTok   s    7B<(r   c                sJ    V P                   P                  \        V!  4       R # r	   r1   r2   r3   r5   r)   r   _lineToZStatisticsControlPen._lineToo   s    7B<(r   c                s^    W3 F%  pV P                   P                  \        V!  4       K'  	  R # r	   r8   )r   pt1pt2r6   s   &&& r   _qCurveToOneZ!StatisticsControlPen._qCurveToOner   s$    *BKKw|, r   c                s`    WV3 F%  pV P                   P                  \        V!  4       K'  	  R # r	   r8   )r   r:   r;   Zpt3r6   s   &&&& r   _curveToOneZ StatisticsControlPen._curveToOnev   s&    S/BKKw|, "r   c                s    V P                  4       pWP                  8w  d   V P                  V P                  4       V P                  4        R # r	   )_getCurrentPointr4   r9   r   r   p0   & r   r*   ZStatisticsControlPen._closePathz   s7    ""$!!!LL))*r   c                s|    V P                  4       pWP                  8w  d   \        R 4      hV P                  4        R# )z.Glyph statistics not defined on open contours.N)r>   r4   r   r   r?   rA   r   _endPathZStatisticsControlPen._endPath   s1    ""$!!!"#STTr   c           	     sz   V P                   p\        V4      p\        R  \        WR,          VR,          ,           4       4       4      ^,          V n        \        V4      pVP
                  V,          ;V n        pVP                  V,          ;V n        pV^8  d   \        R V 4       4      VP
                  VP
                  ,          V,          ,
          V^,
          ,          ;V n	        p\        R V 4       4      VP                  VP                  ,          V,          ,
          V^,
          ,          ;V n
        p\        R V 4       4      VP
                  VP                  ,          V,          ,
          V^,
          ,          ;V n        pM^ ;V n	        p^ ;V n
        p^ ;V n        p\        P                  V 4       R# )c              3   s   "   T FF  w  rVP                   VP                  ,          VP                   VP                  ,          ,
          x  KH  	  R # 5ir	   realimag).0r@   Zp1s   &  r   	<genexpr>/StatisticsControlPen._update.<locals>.<genexpr>   s;      ?FB 277"RWWrww%666?s   AA   NN:NrJ   Nc              3   Z   "   T F!  qP                   VP                   ,          x  K#  	  R # 5ir	   )rD   rF   ZprA   r   rG   rH           3UFFQVVOOU   )+c              3   rK   r	   )rE   rL   rA   r   rG   rH      rM   rN   c              3   sZ   "   T F!  qP                   VP                  ,          x  K#  	  R # 5ir	   rC   rL   rA   r   rG   rH      rM   rN   N)r1   lenZsumZzipr   rD   r   rE   r   r   r   r   r   r   )	r   ZnodesZnZsumNodesr   r   r   r   r   s	   &        r   r   ZStatisticsControlPen._update   s   J  !%rU2Y)>?  	 		 u:%]]Q..
U%]]Q..
Uq5 3U33==8==0A56Q* DNY
 3U33==8==0A56Q* DNY 3U33==8==0A56Q, DOj
 *+*DNY)**DNY+,,DOjt$r   )r1   r4   r   r   r   r   r   r   r	   )r   r   r    r!   r0   r   r7   r9   r<   r=   r*   rB   r   r"   r#   r$   r%   r   r   r   ]   s7     5
)--)% )%r   Fcontrolc          
      sj   ^ RI Hp ^ RIHp ^ p^ p^ p	^ p
^ pV EF  pW,          pV'       d   \	        V R7      pM\        V R7      pV! W! RV,          4      4      pVP                  V4       \        VP                  4      pVP                  pVV,          pWP                  V,          ,          pV	V,          p	WP                  ,          p
WP                  V,          ,          pV'       d   K  \        4        \        RV4       R F!  p\        RV\        VV4      3,          4       K#  	  EK  	  V'       g   \        4        \        R4       \        RWq,          V	,          ,          4       \        R	W,          ,          4       \        R
W,          \        V4      ,          ,          4       V
\        V4      ,          p\        RV,          4       \        R\        \        V4      4      ) ,          4       W,          p\        RV,          4       \        R\        \        V4      4      ) ,          4       R# )r   )TransformPen)Scaler&   g      ?zglyph:z%s: %gzfont:z
weight: %gzweight (perceptual): %gz
width:  %gz
slant:  %gzslant angle:  %gzslant (perceptual):  %gzslant (perceptual) angle:  %gN)r   r+   r,   r-   r.   r/   r   r   r   r   r   r   r   r   r   )ZfontTools.pens.transformPenrQ   ZfontTools.misc.transformrR   r   r   Zdrawr   r   widthr   ZprintZgetattrrO   r   r   )r'   ZupemglyphsquietrP   rQ   rR   Zwght_sumZwght_sum_perceptualZwdth_sumZslnt_sumZslnt_sum_perceptualZ
glyph_nameZglyphZpenZtransformerr   rS   Zitemr   Zslant_perceptuals   &&&&$                r   _testrV      s   8.HHH
$&9C2C"3cDj(9:

;388}Dxx%//EIIyy500h
#
D" (dGC$6778#
/ T g	,(/H4
56	
#':'E
FG	,(/CK7
89s6{"E	,
	
U 44
45*5	
#&6
67	
)WT:J5K-L,L
LMr   c                s   V f   ^ RI pVP                  R,          p ^ RIpVP                  RR R7      pVP	                  RRRR7       VP	                  R	R
RRR7       VP	                  RRRR7       VP	                  RRRRR7       VP	                  RRRRR7       VP	                  RRRRR7       VP                  V 4      pVP                  pVP                  e   \        VP                  4      M^ p/ pVP                  P                  4        FA  pVP                  R4      p	V	^ ,          P                  4       p
\        V	^,          4      pWV
&   KC  	  ^ RIHp V! VP                  VR 7      pV'       g   VP                  4       p\!        VP#                  VR!7      VR",          P$                  VVP&                  VP(                  R#7       R# )$z.Report font glyph shape geometricsl statisticsNrI   zfonttools pens.statisticsPen)Zdescriptionfontzfont.ttfz
Font file.)metavarhelprT   z
glyph-namezGlyph names.Z*)rX   rY   Znargsz-yz<number>z1Face index into a collection to open. Zero based.z-cz	--controlZ
store_truez4Use the control-box pen instead of the Green therem.)ZactionrY   z-qz--quietz!Only report font-wide statistics.z--variationszAXIS=LOCZ zList of space separated locations. A location consist in the name of a variation axis, followed by '=' and a number. E.g.: wght=700 wdth=80. The default is the location of the base master.)rX   ZdefaultrY   Z=)TTFont)
fontNumber)locationZhead)rU   rP   )sysargvargparseZArgumentParserZadd_argumentZ
parse_argsrT   ZyZintZ
variationsZsplitZstripZfontTools.ttLibrZ   rW   ZgetGlyphOrderrV   ZgetGlyphSetZ
unitsPerEmrU   rP   )Zargsr]   r_   ZparserZoptionsrT   r[   r\   Ztag_vZfieldsZtagZvrZ   rW   s   &             r   mainr`      s    |xx|$$&D % F 
F
,^SVW
@  
 C	   i3V   L	   %G^^F#*99#8WYYaJH##))+S!Qiooq	N	 , '',,:6D##%	(+Vmmr   Z__main__NrI   )F)r0   Zmathr    r   r   ZfontTools.pens.basePenr   r   ZfontTools.pens.momentsPenr   Z__all__r   r   r   rV   r`   r   r]   r^   ) r   r   <module>ra      s   ; % $ < 02
3)7 )7X#%NJ #%LR%>7 R%j?N% ?ND>B z" r   