+
    iP&                         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                   2   a  ] tR t^t o R tR tR tRtV tR# )StatisticsBasec                &    V P                  4        R # N)_zeroselfs   &|/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/fontTools/pens/statisticsPen.py__init__StatisticsBase.__init__   s    

    c                    ^ 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   s   &r   r   StatisticsBase._zero   sI    	


r   c                P   \        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   NaNgMbP?N)absr   r   r   r   r   floatr   maxminr   r    )r   r   r   r   r    s   &    r   _update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____classdict__s   @r   r   r      s     
7 7r   r   c                   :   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                ^    \         P                  ! WR 7       \        P                  V 4       R# )glyphsetN)r   r   r   r   r6   s   &&r   r   StatisticsPen.__init__@   s    D4%r   c                R    \         P                  ! V 4       V P                  4        R # r   )r   
_closePathr)   r   s   &r   r:   StatisticsPen._closePathD   s    d#r   c                   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)   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/   r0   r1   s   @r   r   r   7   s     5&% %r   c                   X   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                j    \         P                  ! W4       \        P                  V 4       . V n        R # r   )r   r   r   _nodesr7   s   &&r   r   StatisticsControlPen.__init__f   s%    (%r   c                V    V P                   P                  \        V!  4       Wn        R # r   )rF   appendcomplex_startPointr   pts   &&r   _moveToStatisticsControlPen._moveTok   s    7B<(r   c                J    V P                   P                  \        V!  4       R # r   rF   rI   rJ   rL   s   &&r   _lineToStatisticsControlPen._lineToo   s    7B<(r   c                ^    W3 F%  pV P                   P                  \        V!  4       K'  	  R # r   rQ   )r   pt1pt2rM   s   &&& r   _qCurveToOne!StatisticsControlPen._qCurveToOner   s$    *BKKw|, r   c                `    WV3 F%  pV P                   P                  \        V!  4       K'  	  R # r   rQ   )r   rU   rV   pt3rM   s   &&&& r   _curveToOne StatisticsControlPen._curveToOnev   s&    S/BKKw|, "r   c                    V P                  4       pWP                  8w  d   V P                  V P                  4       V P                  4        R # r   )_getCurrentPointrK   rR   r)   r   p0s   & r   r:   StatisticsControlPen._closePathz   s7    ""$!!!LL))*r   c                |    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^   rK   r   r)   r_   s   & r   _endPathStatisticsControlPen._endPath   s1    ""$!!!"#STTr   c           	     z   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      "   T FF  w  rVP                   VP                  ,          VP                   VP                  ,          ,
          x  KH  	  R # 5ir   realimag).0r`   p1s   &  r   	<genexpr>/StatisticsControlPen._update.<locals>.<genexpr>   s;      ?FB 277"RWWrww%666?s   AA   NN:Nro   Nc              3   Z   "   T F!  qP                   VP                   ,          x  K#  	  R # 5ir   )rh   rj   ps   & r   rl   rm           3UFFQVVOOU   )+c              3   Z   "   T F!  qP                   VP                   ,          x  K#  	  R # 5ir   )ri   rq   s   & r   rl   rm      rs   rt   c              3   Z   "   T F!  qP                   VP                  ,          x  K#  	  R # 5ir   rg   rq   s   & r   rl   rm      rs   rt   N)rF   lensumzipr   rh   r   ri   r   r   r   r   r   r)   )	r   nodesnsumNodesr   r   r   r   r   s	   &        r   r)   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   )rF   rK   r   r   r   r   r   r   r   )r+   r,   r-   r.   rC   r   rN   rR   rW   r[   r:   rc   r)   r/   r0   r1   s   @r   r	   r	   ]   s7     5
)--)% )%r   Fcontrolc          
      j   ^ 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)Scaler5   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@   rA   r   r   r   r   r   r   r   r   r    )fontTools.pens.transformPenr   fontTools.misc.transformr   r	   r   drawr%   r   widthr    printgetattrrw   r   r   )r6   upemglyphsquietr~   r   r   wght_sumwght_sum_perceptualwdth_sumslnt_sumslnt_sum_perceptual
glyph_nameglyphpentransformerr   r   itemr    slant_perceptuals   &&&&$                r   _testr      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                   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 statisticsNrn   zfonttools pens.statisticsPen)descriptionfontzfont.ttfz
Font file.)metavarhelpr   z
glyph-namezGlyph names.*)r   r   nargsz-yz<number>z1Face index into a collection to open. Zero based.z-cz	--control
store_truez4Use the control-box pen instead of the Green therem.)actionr   z-qz--quietz!Only report font-wide statistics.z--variationszAXIS=LOC 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.)r   defaultr   =)TTFont)
fontNumber)locationhead)r   r~   )sysargvargparseArgumentParseradd_argument
parse_argsr   yint
variationssplitstripfontTools.ttLibr   r   getGlyphOrderr   getGlyphSet
unitsPerEmr   r~   )argsr   r   parseroptionsr   r   r   tag_vfieldstagvr   r   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   __main__Nrn   )F)rC   mathr   r   r   fontTools.pens.basePenr   r   fontTools.pens.momentsPenr   __all__r   r   r	   r   r   r+   r   r    r   r   <module>r      s   ; % $ < 02
3)7 )7X#%NJ #%LR%>7 R%j?N% ?ND>B z" r   