+
    iX                       R t ^ RIHt . ROt^ RIHt ^ RIHt ^RIH	t	 ]'       d	   ^ RIH
t
Ht R tR tRR
 ltRR ltR tRR R lltRRR/R R l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]! ]P8                  4      ^8  d   ]P:                  ! ]! 4       4       ]P:                  ! ]P<                  ! 4       P>                  4       R	# R	# )z%Variation fonts interpolation models.)annotationsVariationModel)TYPE_CHECKING)noRound)VariationModelError)MappingSequencec                :    V  Uu. uF
  qf   K  VNK  	  up# u upi N )lstls   & w/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/fontTools/varLib/models.pynonNoner      s    ,s!AAs,,,s   c                j    \         ;QJ d    R  V  4       F  '       d   K   R# 	  R# ! R  V  4       4      # )c              3  (   "   T F  qR J x  K
  	  R # 5ir
   r   .0r   s   & r   	<genexpr>allNone.<locals>.<genexpr>   s     &#QDy#   FTall)r   s   &r   allNoner      s+    3&#&33&3&3&#&&&    Nc                  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  .   <"   T F
  pSV8H  x  K  	  R # 5ir
   r   )r   itemrefs   & r   r   allEqualTo.<locals>.<genexpr>    s     /343$;3s   FTc              3  :   <"   T F  pSS! V4      8H  x  K  	  R # 5ir
   r   )r   r   mappedmappers   & 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                    V '       g   R # \        V 4      p \        V4      p\        Y2TR7      #   \         d     R # i ; i)T)r"   )iternextStopIterationr#   )r   r"   itfirsts   &&  r   allEqualr*   &   sB    	cBR e//  s   / >>c                    \        V 4      \        V4      8X  g   Q h\        W4       UUu. uF  w  r#V'       g   K  VNK  	  upp# u uppi r
   lenzip)truthr   r   ts   &&  r   subListr1   1   s:    u:S!!!c///$!QAA////s
   AAFc               (    V ^8  d   QhRRRRRRRR/# )   vfloattriplezSequence[float]extrapolateboolreturnr   )formats   "r   __annotate__r;   6   s,     1 11%1481
1r   c           
        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8  d   WT8w  g!   W8  d   W48X  g   Q RV  RV RV RV R2	4       h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Ooops... v=z
, triple=())
ValueErrormaxmin)r4   r6   r7   lowerdefaultuppers   &&&   r   normalizeValuerE   6   s     #EE%%FTl"WTN"U4L:
 	
 Au%|u~	(ake>N00 0KE,	C:eWBwir%B	C 
 00r   validatec          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r3   locationzMapping[str, float]axesz(Mapping[str, tuple[float, float, float]]r7   r8   rF   r9   zdict[str, float]r   )r:   s   "r   r;   r;   W   s:     5 5!5
25 5
 5 5r   c               |   V'       dr   \        V P                  4       4      \        VP                  4       4      8:  g=   Q \        V P                  4       4      \        VP                  4       4      ,
          4       h/ 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}
)r7   )setkeysitemsgetrE   )rH   rI   r7   rF   outtagr6   r4   s   &&&$    r   normalizeLocationrQ   W   s    Z 8==?#s499;'77 	
X]]_9MPSIIKQ
 :
 	
7 Czz|LLQi(!!E $ Jr   c                `   V'       d   Vf   \        R4      hRpVP                  4        EF  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`9   g   Q hW,          p
W8X  d   Kd  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  dW   W8:  dQ   W8:  d&   Wx8  d    WZV,
          W,
          ,          ,          pEK  W8  d    WZV	,
          W,
          ,          ,          pEK-  W8:  g   W8:  d   Rp V# W8  d    WZV,
          W,
          ,          ,          pEKc  WZV	,
          W,
          ,          ,          pEK  	  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=   )	TypeErrorrM   rN   )rH   supportotr7   
axisRangesscalaraxisrB   peakrD   r4   axisMinaxisMaxs   &&&&&        r   supportScalarr\      sw   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                      ] tR t^t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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}]
NrV   c               	`   \        \        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  f   "   T F'  p\        \        VP                  4       4      4      x  K)  	  R # 5ir
   )tuplesortedrM   r   s   & r   r   *VariationModel.__init__.<locals>.<genexpr>  s#     ?Y5	*++Ys   /1zLocations must be unique.Nr=   )	axisOrder)key)   )r-   rK   r   origLocationsrc   r7   computeAxisRangesrL   rV   rM   getMasterLocationsSortKeyFuncra   	locationsindexmappingreverseMapping_computeMasterSupports
_subModels)selfrj   rc   r7   rV   locrX   allAxeskr4   keyFuncr   s   &&&&$       r   __init__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                4   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  (   "   T F  qR Jx  K
  	  R # 5ir
   r   r   r4   s   & r   r   -VariationModel.getSubModel.<locals>.<genexpr>9  s     15aTM5r   )r`   ro   rN   r   r1   rg   rc   )rp   rM   rd   subModels   &&  r   getSubModelVariationModel.getSubModel0  s     u;e151ee1511??&&s+%gc3E3E&FWH#+OOC ,,,r   c                	   / 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     )rL   rN   rA   r@   )rj   rV   rq   rX   rr   valuerZ   r[   s   &       r   rh    VariationModel.computeAxisRanges@  s    
#,D9C449DCa(#->>$#G #&u#6E8K#K
    
  Es    A>c                	6   / 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$&   WRV,          9  g   Q RV: RV: RV: 24       hW$,          P	                  V4       Ku  	  R pV! W!4      pV# )zBase master not found.r=   zValue "z" in axisPoints["z"] -->  c                "   a aa R  oVV V3R lpV# )c                *    V ^ 8  d   R# V ^ 8  d   ^# ^ # )r   re   r   )r4   s   &r   signJVariationModel.getMasterLocationsSortKeyFunc.<locals>.getKey.<locals>.sign]  s    Ur:a!e::r   c           	       <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  X   <"   T F  pVS9   d   SP                  V4      MR x  K!  	  R# 5i)i   N)rk   )r   rX   rc   s   & r   r   \VariationModel.getMasterLocationsSortKeyFunc.<locals>.getKey.<locals>.key.<locals>.<genexpr>n  s-      $/D 261B	-O$/s   '*c              3  B   <"   T F  pS! SV,          4      x  K  	  R # 5ir
   r   )r   rX   rq   r   s   & r   r   r   s  s      4?DSYKs   c              3  H   <"   T F  p\        SV,          4      x  K  	  R # 5ir
   )abs)r   rX   rq   s   & r   r   r   v  s      3>4CI;s   ")r-   rM   extendra   rL   r`   )	rq   rankrX   r   onPointAxesorderedAxesrc   
axisPointsr   s	   f     r   rd   IVariationModel.getMasterLocationsSortKeyFunc.<locals>.getKey.<locals>.key`  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   )r   rc   rd   r   s   ff @r   getKey<VariationModel.getMasterLocationsSortKeyFunc.<locals>.getKey\  s    ;6 Jr   )r   r-   r&   r%   add)rj   rc   r   rq   rX   r   r   rets   &&      r   ri   ,VariationModel.getMasterLocationsSortKeyFuncK  s    Y%&>??
C3x1}S	?DIE%$'5
 --T;@$
ST-  ' 	B Z+
r   c                	    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=   )rg   rM   rj   rk   rl   rm   ro   )
rp   master_listrl   idxnew_listrq   rs   r4   rj   r   s
   &&&       r   reorderMastersVariationModel.reorderMasters  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                	r   . V n         V P                  4       p\        V4       EF  w  r#\        VP	                  4       4      pVR V  EF;  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        F  pWW,          ^,          pWs9   g   Q hW7,          w  rp
YppW8  d   TpW,
          W,
          ,          pM W8  d   TpW,
          W,
          ,          pMKf  VV8  d   / pTpVV8X  g   Kz  WV3W&   K  	  VP                  4        F
  w  ppVW7&   K  	  EK>  	  V P                   P                  V4       EK  	  V P                  4        R # )NTFre   )supports_locationsToRegions	enumeraterK   rL   rM   append_computeDeltaWeights)rp   regionsiregionlocAxesprev_regionrelevantrX   rB   rY   rD   bestAxes	bestRatiovallocVnewLowernewUpperratior6   s   &                  r   rn   %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                	   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# r   )rj   rV   rM   r   )rp   rj   rV   r   rq   r   rX   r   s   &       r   r   "VariationModel._locationsToRegions  s    NN	__
CF!iik
!8$%t-=a-@#AFL$.$4Q$7q#AFL	 *
 NN6"  r   c                	    . 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   rj   r   r\   r   )rp   r   rq   deltaWeightjrT   rW   s   &      r   r   #VariationModel._computeDeltaWeights  sl    /FAK'bq(9:
&s46%+N ; $$[1 0r   roundc               	   \        V4      \        V P                  4      8X  g&   Q \        V4      \        V P                  4      34       h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# )rf   )r-   r   rm   r   rM   r   )
rp   masterValuesr   rl   rO   r   weightsdeltar   weights
   &&$       r   	getDeltasVariationModel.getDeltas  s    < C(9(9$:: 	
!!"=
 	
: %%#D$5$56JA ,E$]]_	Q;VOEVf_,E	 -
 JJuU|$ 7 
r   c               	d    V P                  V4      w  r1VP                  WR 7      VP                  3# )r   )r|   r   r   )rp   rM   r   models   &&$ r   getDeltasAndSupports#VariationModel.getDeltasAndSupports  s.    ''.u2ENNBBr   c           
         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().)r7   rV   )r   r\   r7   rV   )rp   rq   rT   s   && r   
getScalarsVariationModel.getScalars  sG      ==	
 ) $*:*:t )	
 	
 
s   +=c                z   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().)	r   reversedlistr   r   rM   ranger-   rl   )rp   targetLocationrO   r   r   r   r   s   &&     r   getMasterScalarsVariationModel.getMasterScalars   s     oon-"4	$2C2C(D#EFJA$]]_	#&6/) - G .33s8_=_4<<?##_=
 >s   "B8c                    Rp\        V 4      \        V4      8X  g   Q h\        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,   )valuesscalarsr4   r   rW   contributions   &&    r   interpolateFromValuesAndScalars.VariationModel.interpolateFromValuesAndScalars  sV     6{c'l*** 1ME >Ly ! 2 r   c                ,    \         P                  W4      # )z>Interpolate from deltas and scalars fetched from getScalars().)r   r   )deltasr   s   &&r   interpolateFromDeltasAndScalars.VariationModel.interpolateFromDeltasAndScalars(  s     ==fNNr   c                F    V P                  V4      pV P                  W#4      # )z)Interpolate from deltas, at location loc.)r   r   )rp   rq   r   r   s   &&& r   interpolateFromDeltas$VariationModel.interpolateFromDeltas-  s!    //#&33FDDr   c               F    V P                  V4      pV P                  W$4      # )z0Interpolate from master-values, at location loc.)r   r   )rp   rq   r   r   r   s   &&&$ r   interpolateFromMasters%VariationModel.interpolateFromMasters2  s#    '',33LJJr   c               H    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.r   )r   r   )rp   r   r   r   r   s   &&&$ r    interpolateFromMastersAndScalars/VariationModel.interpolateFromMastersAndScalars7  s%     :33FDDr   )
ro   rc   rV   r   r7   rj   rl   rg   rm   r   )NF)__name__
__module____qualname____firstlineno____doc__ru   r|   staticmethodrh   ri   r   rn   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__r   r   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                  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  8   <"   T F  qS8  g   K  Vx  K  	  R # 5ir
   r   r   rs   r4   s   & r   r   %piecewiseLinearMap.<locals>.<genexpr>L       %t!1uAAt   
c              3  8   <"   T F  qS8  g   K  Vx  K  	  R # 5ir
   r   r   s   & r   r   r   M  r   r   )rL   rA   r@   )r4   rl   rL   rs   abvavbs   f&      r   piecewiseLinearMapr   ?  s    <<>DDyqzD	A1u7:~!!D	A1u7:~!!%t%%A%t%%A	B	BbQU#qu---r   c                   ^ 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)descriptionz
--loglevelLEVELINFOz Logging level (defaults to INFO))metavarrC   helpT)requiredz-dz--designspaceDESIGNSPACE)r   typez-lz--locationsLOCATION+zFMaster locations as comma-separate coordinates. One must be all zeros.)r   nargsr   )level)pprint)DesignSpaceDocumentzOriginal locations:zNormalized locations:AZc              3  8   "   T F  p\        V4      x  K  	  R # 5ir
   )r5   ry   s   & r   r   main.<locals>.<genexpr>  s     ;lE!HHls   ,zSorted locations:z	Supports:)	fontToolsr   argparseArgumentParsermainr   add_argumentadd_mutually_exclusive_groupstr
parse_argsloglevelr  designspacefontTools.designspaceLibr  readsourcesrH   print	normalizer   ordchrrj   dictr.   splitr   r   )argsr   r  parsergroupr  r  docslocscrI   r   s   &            r   r  r  S  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<__main__)rE   rQ   r\   r   r   r
   )F)TFN) r   
__future__r   __all__typingr   fontTools.misc.roundToolsr   errorsr   r   r   r   r   r#   r*   r1   rE   rQ   r\   objectr   r   r  r   doctestsysr-   argvexittestmodfailedr   r   r   <module>r3     s    + " ! - ' (-'700
1B5
 5 5pNb\EV \E~
.(5p z
388}qHHW__%%& r   