+
    f7i~W  c                   sp   R t . ROt^ RIHt ^RIHt R tR tRR ltRR lt	R	 t
RR ltRRR
/R lltRR lt ! R R]4      tR tRR lt]R8X  dd   ^ RIt^ RIt]! ]P,                  4      ^8  d   ]P.                  ! ]! 4       4       ]P.                  ! ]P0                  ! 4       P2                  4       R# R# )z%Variation fonts interpolation models.VariationModel)noRound)VariationModelErrorc                 s:    V  Uu. uF
  qf   K  VNK  	  up# u upi N )lstl   & >/usr/lib64/python3.14/site-packages/fontTools/varLib/models.pynonNoner	      s    ,s!AAs,,,s   c                 sj    \         ;QJ d    R  V  4       F  '       d   K   R# 	  R# ! R  V  4       4      # )c              3   s(   "   T F  qR J x  K
  	  R # 5ir   r   .0r   r   r   	<genexpr>ZallNone.<locals>.<genexpr>   s     &#QDy#   FTZall)r      &r   allNoner      s+    3&#&33&3&3&#&&&    Nc                 s  a aa Sf;   \         ;QJ d    V 3R lV 4       F  '       d   K   R# 	  R# ! V 3R lV 4       4      # S! S 4      o\         ;QJ d     VV3R lV 4       F  '       d   K   R# 	  R# ! VV3R lV 4       4      # )Nc              3   s.   <"   T F
  pSV8H  x  K  	  R # 5ir   r   )r   itemref   & r   r   allEqualTo.<locals>.<genexpr>   s     /343$;3s   FTc              3   s:   <"   T F  pSS! V4      8H  x  K  	  R # 5ir   r   )r   r   mappedmapper   & r   r   r      s     6#$v%#s   r   )r   r   r   r   s   f&f@r   
allEqualTor      sc    ~s/3/ss/s/s/3///C[F36#63363636#666r   c                 s    V '       g   R # \        V 4      p \        V4      p\        Y2TR7      #   \         d     R # i ; i)T)r   )iternextZStopIterationr   )r   r   ZitZfirst   &&  r   allEqualr      sB    	cBR e//  s   / >>c                 s`    \        W4       UUu. uF  w  r#V'       g   K  VNK  	  upp# u uppi r   zip)Ztruthr   r   Ztr   r   subListr    *   s$    c///$!QAA////s   **Fc           	     s4   Vw  r4pY4u;8:  d   V8:  g   M \        RVR RVR RVR 24      hV'       g   \        \        W4      V4      p W8X  g   W58X  d   R# W8  d   W48w  g   W8  d   WT8X  d   W,
          WC,
          ,          # W,
          WT,
          ,          # )zNormalizes value based on a min/default/max triple.

>>> normalizeValue(400, (100, 400, 900))
0.0
>>> normalizeValue(100, (100, 400, 900))
-1.0
>>> normalizeValue(650, (100, 400, 900))
0.5
z8Invalid axis values, must be minimum, default, maximum: z3.3fz,         )Z
ValueErrormaxmin)vtripleextrapolatelowerdefaultuppers   &&&   r   normalizeValuer*   /   s     #EE%%FTl"WTN"U4L:
 	
 Au%|u~	(ake>N00
 00r   validatec               s    V'       d   / pVP                  4        F,  w  rVV P                  WV^,          4      p\        WvVR7      WE&   K.  	  V# )aC  Normalizes location based on axis min/default/max values from axes.

>>> axes = {"wght": (100, 400, 900)}
>>> normalizeLocation({"wght": 400}, axes)
{'wght': 0.0}
>>> normalizeLocation({"wght": 100}, axes)
{'wght': -1.0}
>>> normalizeLocation({"wght": 900}, axes)
{'wght': 1.0}
>>> normalizeLocation({"wght": 650}, axes)
{'wght': 0.5}
>>> normalizeLocation({"wght": 1000}, axes)
{'wght': 1.0}
>>> normalizeLocation({"wght": 0}, axes)
{'wght': -1.0}
>>> axes = {"wght": (0, 0, 1000)}
>>> normalizeLocation({"wght": 0}, axes)
{'wght': 0.0}
>>> normalizeLocation({"wght": -1}, axes)
{'wght': 0.0}
>>> normalizeLocation({"wght": 1000}, axes)
{'wght': 1.0}
>>> normalizeLocation({"wght": 500}, axes)
{'wght': 0.5}
>>> normalizeLocation({"wght": 1001}, axes)
{'wght': 1.0}
>>> axes = {"wght": (0, 1000, 1000)}
>>> normalizeLocation({"wght": 0}, axes)
{'wght': -1.0}
>>> normalizeLocation({"wght": -1}, axes)
{'wght': -1.0}
>>> normalizeLocation({"wght": 500}, axes)
{'wght': -0.5}
>>> normalizeLocation({"wght": 1000}, axes)
{'wght': 0.0}
>>> normalizeLocation({"wght": 1001}, axes)
{'wght': 0.0}
)r&   )itemsgetr*   )locationaxesr&   r+   outZtagr%   r$   s   &&&$    r   normalizeLocationr1   N   sH    N  Czz|LLQi(!!E $ Jr   c                sN   V'       d   Vf   \        R4      hRpVP                  4        EFv  w  pw  rxp	V'       d;   VR8X  d   K  Wx8  g   W8  d   K)  VR8  d
   V	R8  d   K9  V P                  VR4      p
MW,          p
W8X  d   K\  V'       d   WF,          w  rW8  dV   W{8:  dP   W8:  d%   W8  d   WZV	,
          W,
          ,          ,          pK  W8  d   WZV,
          W,
          ,          ,          pK  M[W8  dV   W8:  dP   W8:  d%   Wx8  d   WZV,
          W,
          ,          ,          pK  W8  d    WZV	,
          W,
          ,          ,          pEK$  W8:  g   W8:  d   Rp V# W8  d    WZV,
          W,
          ,          ,          pEKZ  WZV	,
          W,
          ,          ,          pEKy  	  V# )a  Returns the scalar multiplier at location, for a master
with support.  If ot is True, then a peak value of zero
for support of an axis means "axis does not participate".  That
is how OpenType Variation Font technology works.

If extrapolate is True, axisRanges must be a dict that maps axis
names to (axisMin, axisMax) tuples.

  >>> supportScalar({}, {})
  1.0
  >>> supportScalar({'wght':.2}, {})
  1.0
  >>> supportScalar({'wght':.2}, {'wght':(0,2,3)})
  0.1
  >>> supportScalar({'wght':2.5}, {'wght':(0,2,4)})
  0.75
  >>> supportScalar({'wght':2.5, 'wdth':0}, {'wght':(0,2,4), 'wdth':(-1,0,+1)})
  0.75
  >>> supportScalar({'wght':2.5, 'wdth':.5}, {'wght':(0,2,4), 'wdth':(-1,0,+1)}, ot=False)
  0.375
  >>> supportScalar({'wght':2.5, 'wdth':0}, {'wght':(0,2,4), 'wdth':(-1,0,+1)})
  0.75
  >>> supportScalar({'wght':2.5, 'wdth':.5}, {'wght':(0,2,4), 'wdth':(-1,0,+1)})
  0.75
  >>> supportScalar({'wght':3}, {'wght':(0,1,2)}, extrapolate=True, axisRanges={'wght':(0, 2)})
  -1.0
  >>> supportScalar({'wght':-1}, {'wght':(0,1,2)}, extrapolate=True, axisRanges={'wght':(0, 2)})
  -1.0
  >>> supportScalar({'wght':3}, {'wght':(0,2,2)}, extrapolate=True, axisRanges={'wght':(0, 2)})
  1.5
  >>> supportScalar({'wght':-1}, {'wght':(0,2,2)}, extrapolate=True, axisRanges={'wght':(0, 2)})
  -0.5
z2axisRanges must be passed when extrapolate is Trueg      ?r!   )Z	TypeErrorr,   r-   )r.   supportZotr&   
axisRangesscalaraxisr'   peakr)   r$   axisMinaxisMaxs   &&&&&        r   supportScalarr9      sm   D z)LMMF&-mmo""uEs{|t|s{us{T3'A A9)/G{u/?t|5yT\::F^5yT\::F $ !1?u|5yT\::F^5yT\::F:F M	 85yT\22F5yT\22FQ '6R Mr   c                   s   a  ] tR t^t o RtRRR/R lltR t]R 4       t]. 3R l4       t	R t
R	 tR
 tR tR]/R ltR]/R ltR tR t]R 4       t]R 4       tR tR]/R ltR]/R ltRtV tR# )r    a  Locations must have the base master at the origin (ie. 0).

If axis-ranges are not provided, values are assumed to be normalized to
the range [-1, 1].

If the extrapolate argument is set to True, then values are extrapolated
outside the axis range.

  >>> from pprint import pprint
  >>> axisRanges = {'wght': (-180, +180), 'wdth': (-1, +1)}
  >>> locations = [       {'wght':100},       {'wght':-100},       {'wght':-180},       {'wdth':+.3},       {'wght':+120,'wdth':.3},       {'wght':+120,'wdth':.2},       {},       {'wght':+180,'wdth':.3},       {'wght':+180},       ]
  >>> model = VariationModel(locations, axisOrder=['wght'], axisRanges=axisRanges)
  >>> pprint(model.locations)
  [{},
   {'wght': -100},
   {'wght': -180},
   {'wght': 100},
   {'wght': 180},
   {'wdth': 0.3},
   {'wdth': 0.3, 'wght': 180},
   {'wdth': 0.3, 'wght': 120},
   {'wdth': 0.2, 'wght': 120}]
  >>> pprint(model.deltaWeights)
  [{},
   {0: 1.0},
   {0: 1.0},
   {0: 1.0},
   {0: 1.0},
   {0: 1.0},
   {0: 1.0, 4: 1.0, 5: 1.0},
   {0: 1.0, 3: 0.75, 4: 0.25, 5: 1.0, 6: 0.6666666666666666},
   {0: 1.0,
    3: 0.75,
    4: 0.25,
    5: 0.6666666666666667,
    6: 0.4444444444444445,
    7: 0.6666666666666667}]
Nr3   c               s`   \        \        R  V 4       4      4      \        V4      8w  d   \        R4      hWn        Ve   TM. V n        W0n        VfT   V'       d   V P                  V4      pM9V UUu0 uF  qUP                  4        F  qfkK  	  K  	  pppV Uu/ uF  qfRbK  	  ppW@n        V UUU	u. uF/  qUP                  4        UU	u/ uF  w  rV	R8w  g   K  WbK  	  up	pNK1  	  pppp	V P                  WP                  R7      p
\        WR7      V n        V Uu. uF  qP                  P                  V4      NK  	  upV n        V P                   Uu. uF  qP                  V4      NK  	  upV n        V P!                  4        / V n        R# u uppi u upi u up	pi u up	ppi u upi u upi )c              3   sf   "   T F'  p\        \        VP                  4       4      4      x  K)  	  R # 5ir   )tuplesortedr,   r
   r   r   r   Z*VariationModel.__init__.<locals>.<genexpr>  s#     ?Y5	*++Ys   /1zLocations must be unique.Nr!   )	axisOrder)key)   )lensetr   origLocationsr<   r&   computeAxisRangeskeysr3   r,   getMasterLocationsSortKeyFuncr;   	locationsindexmappingreverseMapping_computeMasterSupports
_subModels)selfrF   r<   r&   r3   locr5   allAxeskr$   ZkeyFuncr   s   &&&&$       r   __init__ZVariationModel.__init__  sm    s?Y??@C	NR%&ABB&&/&;&!33I>
+4L9C449L8?@Gm
@$KTU9Cyy{?{tqa3hdad{?9	U44 5 
  	7 :CCA,,Q/C;?>>J>aq1>J##% M@ @U DJs6   1 FF1FFFF#F&F+Fc                s4   RV9  d   W3# \         ;QJ d    . R V 4       F  NK  	  5M! R V 4       4      pV P                  P                  V4      pVf8   \        \	        W P
                  4      V P                  4      pW0P                  V&   V\	        W!4      3# )zReturn a sub-model and the items that are not None.

The sub-model is necessary for working with the subset
of items when some are None.

The sub-model is cached.Nc              3   s(   "   T F  qR Jx  K
  	  R # 5ir   r   r   r$   r   r   r   Z-VariationModel.getSubModel.<locals>.<genexpr>*  s     15aTM5r   )r:   rK   r-   r    r    rB   r<   )rL   r,   r=   ZsubModelr   r   getSubModelZVariationModel.getSubModel!  s     u;e151ee1511??&&s+%gc3E3E&FWH#+OOC ,,,r   c                s   / pV  UUu0 uF  q"P                  4        F  q3kK  	  K  	  pppV  FK  pV FB  pVP                  V^ 4      pVP                  W5V34      w  rg\        WV4      \        WW4      3W&   KD  	  KM  	  V# u uppi     )rD   r-   r#   r"   )rF   r3   rM   r5   rN   valuer7   r8      &       r   rC   Z VariationModel.computeAxisRanges1  s    
#,D9C449DCa(#->>$#G #&u#6E8K#K
    
  Es    A>c                s    / V 9  d   \        R 4      h/ pV  FS  p\        V4      ^8w  d   K  \        \        V4      4      pW4,          pWB9  d   R0W$&   W$,          P	                  V4       KU  	  R pV! W!4      pV# )zBase master not found.r!   c                 s"   a aa R  oVV V3R lpV# )c                 s*    V ^ 8  d   R# V ^ 8  d   ^# ^ # )rT   r>   r   )r$   r   r   signZJVariationModel.getMasterLocationsSortKeyFunc.<locals>.getKey.<locals>.signN  s    Ur:a!e::r   c           	      s  <a  \        S 4      pS P                  4        UUu. uF   w  r#VS9   g   K  VSV,          9   g   K  VNK"  	  pppS Uu. uF  q"S 9   g   K  VNK  	  ppTP                  \        S P	                  4       4       Uu. uF  q"S9  g   K  VNK  	  up4       T\        V4      ) \
        ;QJ d    . V3R  lV 4       F  NK  	  5M! V3R  lV 4       4      \        V4      \
        ;QJ d    . V V3R lV 4       F  NK  	  5M! V V3R lV 4       4      \
        ;QJ d    . V 3R lV 4       F  NK  	  53# ! V 3R lV 4       4      3# u uppi u upi u upi )c              3   sX   <"   T F  pVS9   d   SP                  V4      MR x  K!  	  R# 5i)i   N)rG   )r   r5   r<   r   r   r   \VariationModel.getMasterLocationsSortKeyFunc.<locals>.getKey.<locals>.key.<locals>.<genexpr>_  s-      $/D 261B	-O$/s   '*c              3   sB   <"   T F  pS! SV,          4      x  K  	  R # 5ir   r   )r   r5   rM   rW   r   r   r   rX   d  s      4?DSYKs   c              3   sH   <"   T F  p\        SV,          4      x  K  	  R # 5ir   )Zabs)r   r5   rM   r   r   r   rX   g  s      3>4CI;s   ")r@   r,   Zextendr;   rD   r:   )	rM   Zrankr5   rU   ZonPointAxesZorderedAxesr<   
axisPointsrW   s	   f     r   r=   ZIVariationModel.getMasterLocationsSortKeyFunc.<locals>.getKey.<locals>.keyQ  s[   3x (+yy{'2z) .3z$7G.G D'2  
 1:I	S[tt	I""&,SXXZ&8R&8d	<QTT&8R %%E $/EE $/  +&E 4?EE 4?  E 3>E   3>  
 JRs(   EEEEE	EEr   )rY   r<   r=   rW   s   ff @r   getKeyZ<VariationModel.getMasterLocationsSortKeyFunc.<locals>.getKeyM  s    ;6 Jr   )r   r@   r   r   Zadd)rF   r<   rY   rM   r5   rU   rZ   Zrets   &&      r   rE   Z,VariationModel.getMasterLocationsSortKeyFunc<  s    Y%&>??
C3x1}S	?DIE%$'5
    ' 	B Z+
r   c                s    V Uu. uF  q1V,          NK  	  ppV Uu. uF  q0P                   V,          NK  	  upV n         V P                    UUUu. uF/  qUP                  4        UUu/ uF  w  rgVR 8w  g   K  WgbK  	  uppNK1  	  ppppV U	u. uF  qP                  P                  V	4      NK  	  up	V n        V P                   U	u. uF  qP                  V	4      NK  	  up	V n        / V n        V# u upi u upi u uppi u upppi u up	i u up	i )r!   )rB   r,   rF   rG   rH   rI   rK   )
rL   Zmaster_listrH   ZidxZnew_listrM   rO   r$   rF   r   s
   &&&       r   reorderMastersZVariationModel.reorderMastersq  s     188$$8AHI#0055IBFBTBT
BT3iik6kdaQ#XTQTk6BT 	 
 :CCA,,Q/C;?>>J>aq1>J 9I6
 DJs4   C/C4C?&C96C9<C?#DD9C?c                sb   . V n         V P                  4       p\        V4       EFw  w  r#\        VP	                  4       4      pVR V  EF3  p\        VP	                  4       4      V8w  d   K$  RpVP                  4        FA  w  pw  rp
WW,          ^,          V	8X  d   K  WV,          ^,          u;8  d
   V
8  d   K=  M Rp M	  V'       g   K  / pRpVP	                  4        Fx  pWW,          ^,          pW7,          w  rp
YppW8  d   TpW,
          W,
          ,          pM W8  d   TpW,
          W,
          ,          pMK^  VV8  d   / pTpVV8X  g   Kr  WV3W&   Kz  	  VP                  4        F
  w  ppVW7&   K  	  EK6  	  V P                   P                  V4       EKz  	  V P                  4        R # )NTFr>   )supports_locationsToRegions	enumeraterA   rD   r,   append_computeDeltaWeights)rL   regionsiregionZlocAxesZprev_regionZrelevantr5   r'   r6   r)   ZbestAxesZ	bestRatioZvallocVZnewLowerZnewUpperZratior%   s   &                  r   rJ   Z%VariationModel._computeMasterSupports~  s   **,"7+IA&++-(G&r{{'')*g528,,..D.5#)!,4 t#4Q#7?%??#( 3A   	',,.D%+A.C)/&E).hHz#&!$ =#&!$ = !y(#%$)		)*2()C% /( %-NN$4LD&#)FL %5[  +^ MM  (e ,f 	!!#r   c                s   V P                   pV P                  p. pV F`  p/ pVP                  4        F6  w  rgV^ 8  d   ^ WrV,          ^,          3WV&   K"  W&,          ^ ,          V^ 3WV&   K8  	  VP                  V4       Kb  	  V# rS   )rF   r3   r,   r_   )rL   rF   r3   ra   rM   rc   r5   rd   rV   r   r]   Z"VariationModel._locationsToRegions  s    NN	__
CF!iik
!8$%t-=a-@#AFL$.$4Q$7q#AFL	 *
 NN6"  r   c                s    . V n         \        V P                  4       F\  w  r/ p\        V P                  R V 4       F  w  rE\	        W%4      pV'       g   K  WcV&   K   	  V P                   P                  V4       K^  	  R # r   )deltaWeightsr^   rF   r\   r9   r_   )rL   rb   rM   ZdeltaWeightjr2   r4   s   &      r   r`   Z#VariationModel._computeDeltaWeights  sl    /FAK'bq(9:
&s46%+N ; $$[1 0r   roundc               s8   V P                   p. p\        V P                  4       Fr  w  rVWV,          ,          pVP                  4        F3  w  rV	^8X  d   WtV,          ,          pK  WtV,          V	,          ,          pK5  	  VP	                  V! V4      4       Kt  	  V# )r?   )rI   r^   re   r,   r_   )
rL   masterValuesrg   rH   r0   rb   weightsZdeltarf   weights
   &&$       r   	getDeltasZVariationModel.getDeltas  s    
 %%#D$5$56JA ,E$]]_	Q;VOEVf_,E	 -
 JJuU|$ 7 
r   c               sd    V P                  V4      w  r1VP                  WR 7      VP                  3# )rg   )rR   rk   r\   )rL   r,   rg   models   &&$ r   getDeltasAndSupportsZ#VariationModel.getDeltasAndSupports  s.    ''.u2ENNBBr   c           
     s    V P                    Uu. uF%  p\        WV P                  V P                  R7      NK'  	  up# u upi )zReturn scalars for each delta, for the given location.
If interpolating many master-values at the same location,
this function allows speed up by fetching the scalars once
and using them with interpolateFromMastersAndScalars().)r&   r3   )r\   r9   r&   r3   )rL   rM   r2   s   && r   
getScalarsZVariationModel.getScalars  sG      ==	
 ) $*:*:t )	
 	
 
s   +=c                sz   V P                  V4      p\        \        \        V P                  4      4      4       F?  w  r4VP                  4        F&  w  rVW%;;,          W#,          V,          ,          uu&   K(  	  KA  	  \        \        V4      4       Uu. uF  q2V P                  V,          ,          NK  	  ppV# u upi )a}  Return multipliers for each master, for the given location.
If interpolating many master-values at the same location,
this function allows speed up by fetching the scalars once
and using them with interpolateFromValuesAndScalars().

Note that the scalars used in interpolateFromMastersAndScalars(),
are *not* the same as the ones returned here. They are the result
of getScalars().)	ro   ZreversedZlistr^   re   r,   ranger@   rH   )rL   ZtargetLocationr0   rb   ri   rf   rj   s   &&     r   getMasterScalarsZVariationModel.getMasterScalars  s     oon-"4	$2C2C(D#EFJA$]]_	#&6/) - G .33s8_=_4<<?##_=
 >s   "B8c                sv    Rp\        W4       F'  w  r4V'       g   K  W4,          pVf   TpK  W%,          pK)  	  V# )a&  Interpolate from values and scalars coefficients.

If the values are master-values, then the scalars should be
fetched from getMasterScalars().

If the values are deltas, then the scalars should be fetched
from getScalars(); in which case this is the same as
interpolateFromDeltasAndScalars().
Nr   )Zvaluesscalarsr$   rU   r4   Zcontributions   &&    r   interpolateFromValuesAndScalarsZ.VariationModel.interpolateFromValuesAndScalars  s@      1ME >Ly ! 2 r   c                s,    \         P                  W4      # )z>Interpolate from deltas and scalars fetched from getScalars().)r    rs   )deltasrr   s   &&r   interpolateFromDeltasAndScalarsZ.VariationModel.interpolateFromDeltasAndScalars  s     ==fNNr   c                sF    V P                  V4      pV P                  W#4      # )z)Interpolate from deltas, at location loc.)ro   ru   )rL   rM   rt   rr   s   &&& r   interpolateFromDeltasZ$VariationModel.interpolateFromDeltas  s!    //#&33FDDr   c               sF    V P                  V4      pV P                  W$4      # )z0Interpolate from master-values, at location loc.)rq   rs   )rL   rM   rh   rg   rr      &&&$ r   interpolateFromMastersZ%VariationModel.interpolateFromMasters#  s#    '',33LJJr   c               sH    V P                  WR7      pV P                  WB4      # )zInterpolate from master-values, and scalars fetched from
getScalars(), which is useful when you want to interpolate
multiple master-values with the same location.rl   )rk   ru   )rL   rh   rr   rg   rt   rw   r    interpolateFromMastersAndScalarsZ/VariationModel.interpolateFromMastersAndScalars(  s%     :33FDDr   )
rK   r<   r3   re   r&   rF   rH   rB   rI   r\   )NF)__name__Z
__module__Z__qualname__Z__firstlineno____doc__rP   rR   ZstaticmethodrC   rE   r[   rJ   r]   r`   r   rk   rn   ro   rq   rs   ru   rv   rx   ry   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r    r       s     /bJN<-    ;= 2 2h6$p	2w "C7 C

"  , O OE
K K
Ew E Er   c                 s  a  VP                  4       pV'       g   S # S V9   d
   VS ,          # \        V4      pS V8  d   S W,          ,           V,
          # \        V4      pS V8  d   S W,          ,           V,
          # \        V 3R  lV 4       4      p\        V 3R lV 4       4      pW,          pW,          pWgV,
          S V,
          ,          WT,
          ,          ,           # )c              3   s8   <"   T F  qS8  g   K  Vx  K  	  R # 5ir   r   r   rO   r$   r   r   r   %piecewiseLinearMap.<locals>.<genexpr>=       %t!1uAAt   
c              3   s8   <"   T F  qS8  g   K  Vx  K  	  R # 5ir   r   r|   r   r   r   r}   >  r~   r   )rD   r#   r"   )r$   rH   rD   rO   ZaZbZvaZvbs   f&      r   piecewiseLinearMapr   0  s    <<>DDyqzD	A1u7:~!!D	A1u7:~!!%t%%A%t%%A	B	BbQU#qu---r   c                s   ^ RI Hp ^ RIpVP                  R\        P
                  R7      pVP                  RRRRR	7       VP                  R
R7      pVP                  RRR\        R7       VP                  RRRRRR7       VP                  V 4      p V! V P                  R7       ^ RIHp V P                  '       d   ^ RIHp V! 4       pVP                  V P                  4       VP                    Uu. uF  qP"                  NK  	  p	p\%        R4       V! V	4       VP'                  4        \%        R4       VP                    Uu. uF  qP"                  NK  	  p	pV! V	4       M\)        \+        R4      \+        R4      ^,           4       U
u. uF  p
\-        V
4      NK  	  pp
V P.                   Uu. uF.  p\1        \3        VR VP5                  R4       4       4      4      NK0  	  p	p\7        V	4      p\%        R4       V! VP.                  4       \%        R 4       V! VP8                  4       R# u upi u upi u up
i u upi )!z*Normalize locations on a given designspace)configLoggerNzfonttools varLib.models)Zdescriptionz
--loglevelZLEVELZINFOz Logging level (defaults to INFO))metavarr(   helpT)Zrequiredz-dz--designspaceZDESIGNSPACE)r   Ztypez-lz--locationsZLOCATIONZ+zFMaster locations as comma-separate coordinates. One must be all zeros.)r   Znargsr   )Zlevel)pprint)DesignSpaceDocumentzOriginal locations:zNormalized locations:ZAZZc              3   s8   "   T F  p\        V4      x  K  	  R # 5ir   )ZfloatrQ   r   r   r   Zmain.<locals>.<genexpr>r  s     ;lE!HHls   Z,zSorted locations:z	Supports:)Z	fontToolsr   argparseZArgumentParsermainr{   Zadd_argumentZadd_mutually_exclusive_groupZstrZ
parse_argsZloglevelr   ZdesignspaceZfontTools.designspaceLibr   ZreadZsourcesr.   ZprintZ	normalizerp   ZordZchrrF   Zdictr   Zsplitr    r\   )Zargsr   r   ZparserZgroupr   r   ZdocZsZlocsZcr/   rm   s   &            r   r   r   D  s   &$$!LL % F /	   ///>E	t_m#N	U   T"Dt}}%@!#!!"$'KK0Kq

K0#$t%&$'KK0Kq

K0t %c#hC1 => =1A =>GK~~
GU!DT;aggcl;<=~ 	 
 4 E	

5??	+
5>># 1
 1 ?
s   4H-H2H704H<Z__main__)r*   r1   r9   r   r    r   )F)TFN)r{   Z__all__ZfontTools.misc.roundToolsr   Zerrorsr   r	   r   r   r   r    r*   r1   r9   Zobjectr    r   r   rz   ZdoctestZsysr@   ZargvZexitZtestmodZfailedr   r   r   <module>r      s    + . '-'700
1>/U /dNb\EV \E~
.(5p z
388}qHHW__%%& r   