
    h~W                     h   S r / SQrSSKJr  SSKJr  S rS rSS	 jrSS
 jr	S r
SS jrSSS.S jjrSS jr " S S\5      rS rSS jr\S:X  aa  SSKrSSKr\" \R,                  5      S:  a  \R.                  " \" 5       5        \R.                  " \R0                  " 5       R2                  5        gg)z%Variation fonts interpolation models.)normalizeValuenormalizeLocationsupportScalarpiecewiseLinearMapVariationModel    )noRound   )VariationModelErrorc                 :    U  Vs/ s H	  oc  M  UPM     sn$ s  snf N )lstls     I/var/www/html/env/lib/python3.13/site-packages/fontTools/varLib/models.pynonNoner      s    ,s!As,,,s   c                 &    [        S U  5       5      $ )Nc              3   (   #    U  H  oS L v   M
     g 7fr   r   .0r   s     r   	<genexpr>allNone.<locals>.<genexpr>   s     &#QDy#   all)r   s    r   allNoner      s    &#&&&    Nc                 t   ^ ^^ Tc  [        U 4S jU 5       5      $ T" T 5      m[        UU4S jU 5       5      $ )Nc              3   .   >#    U  H
  nTU:H  v   M     g 7fr   r   )r   itemrefs     r   r   allEqualTo.<locals>.<genexpr>   s     /343$;3s   c              3   :   >#    U  H  nTT" U5      :H  v   M     g 7fr   r   )r   r   mappedmappers     r   r   r!      s     6#$v%#   r   )r    r   r$   r#   s   ` `@r   
allEqualTor&      s3    ~/3///C[F6#666r   c                 t    U (       d  g[        U 5      n [        U5      n[        X2US9$ ! [         a     gf = f)NT)r$   )iternextStopIterationr&   )r   r$   itfirsts       r   allEqualr-      sB    	cBR e//  s   * 
77c                     [        U 5      [        U5      :X  d   e[        X5       VVs/ s H  u  p#U(       d  M  UPM     snn$ s  snnf r   lenzip)truthr   r   ts       r   subListr4   *   s8    u:S!!!c///$!QA////s
   AAFc           
      @   Uu  p4nX4s=::  a  U::  d  O  [        SUS SUS SUS 35      eU(       d  [        [        X5      U5      n X:X  d  X5:X  a  gX:  a  X4:w  d
  X:  a  XT:X  a	  X-
  XC-
  -  $ X:  a  XT:w  d  X:  a  X4:X  d   SU  SU SU SU S3	5       eX-
  XT-
  -  $ )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)vtripleextrapolatelowerdefaultuppers         r   r   r   /   s     #EE%%FTl"WTN"U4L:
 	
 Au%|u~	(ake>N00 0KE,	C:eWBwir%B	C 
 00r   )validatec                b   U(       al  [        U R                  5       5      [        UR                  5       5      ::  d8   [        U R                  5       5      [        UR                  5       5      -
  5       e0 nUR                  5        H%  u  pVU R                  XVS   5      n[	        XvUS9XE'   M'     U$ )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	   )r=   )setkeysitemsgetr   )locationaxesr=   rA   outtagr<   r;   s           r   r   r   N   s    N 8==?#s499;'77 	
X]]_9MPSIIKQ
 :
 	
7 Czz|LLQi(!!E $ Jr   c                 V   U(       a  Uc  [        S5      eSnUR                  5        H  u  nu  pxn	U(       a5  US:X  a  M  Xx:  d  X:  a  M$  US:  a  U	S:  a  M2  U R                  US5      n
OX`;   d   eX   n
X:X  a  MW  U(       aq  XF   u  pX:  a1  X{::  a,  X::  a  X:  a  XZU	-
  X-
  -  -  nM  X:  a  XZU-
  X-
  -  -  nM  O5X:  a0  X::  a+  X::  a  Xx:  a  XZU-
  X-
  -  -  nM  X:  a  XZU	-
  X-
  -  -  nM  X::  d  X::  a  Sn  U$ X:  a  XZU-
  X-
  -  -  nM  XZU	-
  X-
  -  -  nM     U$ )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      ?r6   )	TypeErrorrE   rF   )rG   supportotr=   
axisRangesscalaraxisr>   peakr@   r;   axisMinaxisMaxs                r   r   r      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                       \ rS rSrSr SSS.S jjrS r\S 5       r\/ 4S j5       r	S	 r
S
 rS rS r\S.S jr\S.S jrS rS r\S 5       r\S 5       rS r\S.S jr\S.S jrSrg)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}]
N)rO   c                V   [        [        S U 5       5      5      [        U5      :w  a  [        S5      eXl        Ub  UO/ U l        X0l        UcU  U(       a  U R                  U5      nO<U VVs1 s H  oUR                  5         H  ofiM     M     nnnU Vs0 s H  ofS_M     nnX@l        U VVV	s/ s H/  oUR                  5        VV	s0 s H  u  pU	S:w  d  M  X_M     sn	nPM1     nnnn	U R                  XR                  S9n
[        XS9U l        U Vs/ s H  oR                  R                  U5      PM     snU l        U R                   Vs/ s H  oR                  U5      PM     snU l        U R!                  5         0 U l        g s  snnf s  snf s  sn	nf s  sn	nnf s  snf s  snf )Nc              3   f   #    U  H'  n[        [        UR                  5       5      5      v   M)     g 7fr   )tuplesortedrE   r   s     r   r   *VariationModel.__init__.<locals>.<genexpr>  s#     ?Y5	*++Ys   /1zLocations must be unique.)r	   r6   )	axisOrder)key)r0   rC   r
   origLocationsr]   r=   computeAxisRangesrD   rO   rE   getMasterLocationsSortKeyFuncrZ   	locationsindexmappingreverseMapping_computeMasterSupports
_subModels)selfrb   r]   r=   rO   locrQ   allAxeskr;   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   -"F	F0FFFF$F!F&Fc                     SU;  a  X4$ [        S U 5       5      nU R                  R                  U5      nUc7  [        [	        X R
                  5      U R                  5      nX0R                  U'   U[	        X!5      4$ )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   (   #    U  H  oS Lv   M
     g 7fr   r   r   r;   s     r   r   -VariationModel.getSubModel.<locals>.<genexpr>*  s     15aTM5r   )rY   rg   rF   r   r4   r_   r]   )rh   rE   r^   subModels       r   getSubModelVariationModel.getSubModel!  su     u;1511??&&s+%gc3E3E&FWH#+OOC ,,,r   c                    0 nU  VVs1 s H  o"R                  5         H  o3iM     M     nnnU  HK  nU HB  nUR                  US5      nUR                  X5U45      u  pg[        XV5      [        XW5      4X'   MD     MM     U$ s  snnf )Nr   )rD   rF   r:   r9   )rb   rO   ri   rQ   rj   valuerS   rT   s           r   r`    VariationModel.computeAxisRanges1  s    
#,D9C449DCa(#->>$#G #&u#6E8K#K
    
  Es   "B c                    0 U ;  a  [        S5      e0 nU  Hd  n[        U5      S:w  a  M  [        [        U5      5      nX4   nXB;  a  S1X$'   XRU   ;  d   SU< SU< SU< 35       eX$   R	                  U5        Mf     S nU" X!5      nU$ )NzBase master not found.r	   r6   zValue "z" in axisPoints["z"] -->  c                 "   ^ ^^ S mUU U4S jnU$ )Nc                 &    U S:  a  S$ U S:  a  S$ S$ )Nr   r\   r	   r   )r;   s    r   signJVariationModel.getMasterLocationsSortKeyFunc.<locals>.getKey.<locals>.signN  s    Ur:a!e::r   c           	        >^  [        T 5      nT R                  5        VVs/ s H  u  p#UT;   d  M  UTU   ;   d  M  UPM     nnnT Vs/ s H  o"T ;   d  M
  UPM     nnUR                  [        T R	                  5       5       Vs/ s H  o"T;  d  M
  UPM     sn5        U[        U5      * [        U4S jU 5       5      [        U5      [        U U4S jU 5       5      [        U 4S jU 5       5      4$ s  snnf s  snf s  snf )Nc              3   V   >#    U  H  nUT;   a  TR                  U5      OS v   M      g7f)i   N)rc   )r   rQ   r]   s     r   r   \VariationModel.getMasterLocationsSortKeyFunc.<locals>.getKey.<locals>.key.<locals>.<genexpr>_  s-      $/D 261B	-O$/s   &)c              3   :   >#    U  H  nT" TU   5      v   M     g 7fr   r   )r   rQ   ri   r|   s     r   r   r   d  s      4?DSYKr%   c              3   @   >#    U  H  n[        TU   5      v   M     g 7fr   )abs)r   rQ   ri   s     r   r   r   g  s      3>4CI;s   )r0   rE   extendrZ   rD   rY   )	ri   rankrQ   rw   onPointAxesorderedAxesr]   
axisPointsr|   s	   `     r   r^   IVariationModel.getMasterLocationsSortKeyFunc.<locals>.getKey.<locals>.keyQ  s   3x (+yy{'2z) .3z$7G.G '2  
 1:I	S[t	I""&,SXXZ&8R&8d	<QT&8R %% $/  +& 4?   3>  
 JRs'   C3C3C3		C9C9	C>C>r   )r   r]   r^   r|   s   `` @r   getKey<VariationModel.getMasterLocationsSortKeyFunc.<locals>.getKeyM  s    ;6 Jr   )r
   r0   r)   r(   add)rb   r]   r   ri   rQ   rw   r   rets           r   ra   ,VariationModel.getMasterLocationsSortKeyFunc<  s    Y%&>??
C3x1}S	?DIE%$'5
 --T;@$
ST-  ' 	B Z+
r   c                    U Vs/ s H  o1U   PM	     nnU Vs/ s H  o0R                   U   PM     snU l         U R                    VVVs/ s H/  oUR                  5        VVs0 s H  u  pgUS:w  d  M  Xg_M     snnPM1     nnnnU V	s/ s H  oR                  R                  U	5      PM     sn	U l        U R                   V	s/ s H  oR                  U	5      PM     sn	U l        0 U l        U$ s  snf s  snf s  snnf s  snnnf s  sn	f s  sn	f )Nr6   )r_   rE   rb   rc   rd   re   rg   )
rh   master_listrd   idxnew_listri   rk   r;   rb   r   s
             r   reorderMastersVariationModel.reorderMastersq  s     188$8AHI#005IBFBTBT
BT3iik6kdaQ#XTQTk6BT 	 
 :CCA,,Q/C;?>>J>aq1>J 9I6
 DJs4   C,C1	C<!C61C67C<$DD6C<c                    / U l         U R                  5       n[        U5       GH?  u  p#[        UR	                  5       5      nUS U  H  n[        UR	                  5       5      U:w  a  M"  SnUR                  5        H.  u  nu  pn
XW   S   U	:X  a  M  XU   S   s=:  a  U
:  a  M*  O  Sn  O   U(       d  Mo  0 nSnUR	                  5        HW  nXW   S   nXs;   d   eX7   u  pn
XnnX:  a  UnX-
  X-
  -  nOX:  a  UnX-
  X-
  -  nOM?  UU:  a  0 nUnUU:X  d  MQ  XU4X'   MY     UR                  5        H
  u  nnUX7'   M     M     U R                   R                  U5        GMB     U R                  5         g )NTr	   Fr\   )supports_locationsToRegions	enumeraterC   rD   rE   append_computeDeltaWeights)rh   regionsiregionlocAxesprev_regionrelevantrQ   r>   rR   r@   bestAxes	bestRatiovallocVnewLowernewUpperratior<   s                      r   rf   %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                     U R                   nU R                  n/ nU HO  n0 nUR                  5        H%  u  pgUS:  a  SXrU   S   4XV'   M  X&   S   US4XV'   M'     UR                  U5        MQ     U$ )Nr   r	   )rb   rO   rE   r   )rh   rb   rO   r   ri   r   rQ   r   s           r   r   "VariationModel._locationsToRegions  s    NN	__
CF!iik
!8$%t-=a-@#AFL$.$4Q$7q#AFL	 *
 NN6"  r   c                     / U l         [        U R                  5       H[  u  p0 n[        U R                  S U 5       H  u  pE[	        X%5      nU(       d  M  XcU'   M     U R                   R                  U5        M]     g r   )deltaWeightsr   rb   r   r   r   )rh   r   ri   deltaWeightjrM   rP   s          r   r   #VariationModel._computeDeltaWeights  sl    /FAK'bq(9:
&s46%+N ; $$[1 0r   roundc                   [        U5      [        U R                  5      :X  d%   [        U5      [        U R                  5      45       eU R                  n/ n[        U R                  5       HU  u  pVXU      nUR	                  5        H  u  pU	S:X  a	  XtU   -  nM  XtU   U	-  -  nM      UR                  U" U5      5        MW     U$ )Nr	   )r0   r   re   r   rE   r   )
rh   masterValuesr   rd   rI   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                ^    U R                  U5      u  p1UR                  XS9UR                  4$ )Nr   )rt   r   r   )rh   rE   r   models       r   getDeltasAndSupports#VariationModel.getDeltasAndSupports  s.    ''.u2ENNBBr   c           
          U R                    Vs/ s H"  n[        XU R                  U R                  S9PM$     sn$ s  snf )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=   rO   )r   r   r=   rO   )rh   ri   rM   s      r   
getScalarsVariationModel.getScalars  sG      ==	
 ) $*:*:t )	
 	
 
s   );c                 L   U R                  U5      n[        [        [        U R                  5      5      5       H/  u  p4UR                  5        H  u  pVX%==   X#   U-  -  ss'   M     M1     [        [        U5      5       Vs/ s H  o2U R                  U      PM     nnU$ s  snf )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   rE   ranger0   rd   )rh   targetLocationrI   r   r   r   r   s          r   getMasterScalarsVariationModel.getMasterScalars  s     oon-"4	$2C2C(D#EFJA$]]_	#&6/) - G .33s8_=_4<<?#_=
 >s   B!c                     Sn[        U 5      [        U5      :X  d   e[        X5       H  u  p4U(       d  M  X4-  nUc  UnM  X%-  nM     U$ )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scalarsr;   rw   rP   contributions         r   interpolateFromValuesAndScalars.VariationModel.interpolateFromValuesAndScalars  sV     6{c'l*** 1ME >Ly ! 2 r   c                 ,    [         R                  X5      $ )z>Interpolate from deltas and scalars fetched from getScalars().)r   r   )deltasr   s     r   interpolateFromDeltasAndScalars.VariationModel.interpolateFromDeltasAndScalars  s     ==fNNr   c                 F    U R                  U5      nU R                  X#5      $ )z)Interpolate from deltas, at location loc.)r   r   )rh   ri   r   r   s       r   interpolateFromDeltas$VariationModel.interpolateFromDeltas  s!    //#&33FDDr   c                F    U R                  U5      nU R                  X$5      $ )z0Interpolate from master-values, at location loc.)r   r   )rh   ri   r   r   r   s        r   interpolateFromMasters%VariationModel.interpolateFromMasters#  s#    '',33LJJr   c                B    U R                  XS9nU R                  XB5      $ )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   )rh   r   r   r   r   s        r    interpolateFromMastersAndScalars/VariationModel.interpolateFromMastersAndScalars(  s%     :33FDDr   )
rg   r]   rO   r   r=   rb   rd   r_   re   r   )NF)__name__
__module____qualname____firstlineno____doc__rm   rt   staticmethodr`   ra   r   rf   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__r   r   r   r   r      s    /d 6;JN<-    ;= 2 2h6$p	2 07 " 4; C

"  , O OE
 BI K
 PW E Er   r   c                 @  ^  UR                  5       nU(       d  T $ T U;   a  UT    $ [        U5      nT U:  a
  T X   -   U-
  $ [        U5      nT U:  a
  T X   -   U-
  $ [        U 4S jU 5       5      n[        U 4S jU 5       5      nX   nX   nXgU-
  T U-
  -  XT-
  -  -   $ )Nc              3   6   >#    U  H  oT:  d  M
  Uv   M     g 7fr   r   r   rk   r;   s     r   r   %piecewiseLinearMap.<locals>.<genexpr>=       %t!1uAAt   		c              3   6   >#    U  H  oT:  d  M
  Uv   M     g 7fr   r   r   s     r   r   r   >  r   r   )rD   r:   r9   )r;   rd   rD   rk   abvavbs   `       r   r   r   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                 Z   SSK Jn  SSKnUR                  S[        R
                  S9nUR                  SSSS	S
9  UR                  SS9nUR                  SSS[        S9  UR                  SSSSSS9  UR                  U 5      n U" U R                  S9  SSKJn  U R                  (       a  SSKJn  U" 5       nUR                  U R                  5        UR                    Vs/ s H  oR"                  PM     n	n[%        S5        U" U	5        UR'                  5         [%        S5        UR                    Vs/ s H  oR"                  PM     n	nU" U	5        O[)        [+        S5      [+        S5      S-   5       V
s/ s H  n
[-        U
5      PM     nn
U R.                   Vs/ s H.  n[1        [3        US UR5                  S 5       5       5      5      PM0     n	n[7        U	5      n[%        S!5        U" UR.                  5        [%        S"5        U" UR8                  5        gs  snf s  snf s  sn
f s  snf )#z*Normalize locations on a given designspacer   )configLoggerNzfonttools varLib.models)descriptionz
--loglevelLEVELINFOz Logging level (defaults to INFO))metavarr?   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Zr	   c              3   8   #    U  H  n[        U5      v   M     g 7fr   )floatrq   s     r   r   main.<locals>.<genexpr>r  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sourcesrG   print	normalizer   ordchrrb   dictr1   splitr   r   )argsr   r  parsergroupr   r   docslocscrH   r   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   !H4H7H#5H(__main__r   )F)TFN)r   __all__fontTools.misc.roundToolsr   errorsr
   r   r   r&   r-   r4   r   r   r   objectr   r   r  r   doctestsysr0   argvexittestmodfailedr   r   r   <module>r'     s    + . '-'700
1>/U /dNb\EV \E~
.(5p z
388}qHHW__%%& r   