ó
    oñ:i'K  ã                  ó¼  • S r SSKJr  SSKrSSKrSSKrSSKJrJrJ	r	J
r
JrJrJr  SSKJrJrJrJrJrJrJrJrJr  SSKJrJr  SSKJrJrJrJrJ r J!r!J"r"  \RF                  " \$5      r%\\\\/\&4   r'        SS jr(S	S	\(4         SS
 jjr)SS\(4         SS jjr*    SS jr+              SS jr,SS jr-      SS jr.      SS jr/g)zŒAllows building all the variable fonts of a DesignSpace version 5 by
splitting the document into interpolable sub-space, then into each VF.
é    )ÚannotationsN)ÚAnyÚCallableÚDictÚIteratorÚListÚTupleÚcast)	ÚAxisDescriptorÚAxisMappingDescriptorÚDesignSpaceDocumentÚDiscreteAxisDescriptorÚInstanceDescriptorÚRuleDescriptorÚSimpleLocationDictÚSourceDescriptorÚVariableFontDescriptor)Ú	StatNamesÚgetStatNames)ÚConditionSetÚRangeÚRegionÚgetVFUserRegionÚlocationInRegionÚregionInRegionÚuserRegionToDesignRegionc                óÊ   • UR                   =(       d    UR                  R                  S5      nUR                  =(       d    UR                  R                  S5      nU SU S3$ )zïDefault callable to synthesize an instance filename
when makeNames=True, for instances that don't specify an instance name
in the designspace. This part of the name generation can be overriden
because it's not specified by the STAT table.
ÚenÚ-z.ttf)Ú
familyNameÚfamilyNamesÚgetÚ	styleNameÚ
styleNames)ÚdocÚinstanceÚ	statNamesr    r#   s        Úa/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/fontTools/designspaceLib/split.pyÚdefaultMakeInstanceFilenamer)   )   sY   € ð ×$Ñ$×G¨	×(=Ñ(=×(AÑ(AÀ$Ó(G€JØ×"Ñ"×D i×&:Ñ&:×&>Ñ&>¸tÓ&D€IØˆ\˜˜9˜+ TÐ*Ð*ó    Tc           
   #  ó4  #   • / n0 nU R                    H~  n[        US5      (       a#  [        [        U5      nUR	                  U5        M7  [        [
        U5      n[        UR                  UR                  UR                  5      XVR                  '   M€     [        R                  " U Vs/ s H  ofR                  PM     sn6 nU HD  n[        XH5       V	V
s0 s H  u  pšU	R                  U
_M     nn	n
[        U 0 UEUESUUUS9nX¼4v •  MF     gs  snf s  sn
n	f 7f)a”  Split the given DS5 into several interpolable sub-designspaces.
There are as many interpolable sub-spaces as there are combinations of
discrete axis values.

E.g. with axes:
    - italic (discrete) Upright or Italic
    - style (discrete) Sans or Serif
    - weight (continuous) 100 to 900

There are 4 sub-spaces in which the Weight axis should interpolate:
(Upright, Sans), (Upright, Serif), (Italic, Sans) and (Italic, Serif).

The sub-designspaces still include the full axis definitions and STAT data,
but the rules, sources, variable fonts, instances are trimmed down to only
keep what falls within the interpolable sub-space.

Args:
  - ``makeNames``: Whether to compute the instance family and style
    names using the STAT data.
  - ``expandLocations``: Whether to turn all locations into "full"
    locations, including implicit default axis values where missing.
  - ``makeInstanceFilename``: Callable to synthesize an instance filename
    when makeNames=True, for instances that don't specify an instance name
    in the designspace. This part of the name generation can be overridden
    because it's not specified by the STAT table.

.. versionadded:: 5.0
ÚvaluesT©ÚkeepVFsÚ	makeNamesÚexpandLocationsÚmakeInstanceFilenameN)ÚaxesÚhasattrr
   r   Úappendr   r   ÚminimumÚmaximumÚdefaultÚnameÚ	itertoolsÚproductr,   ÚzipÚ_extractSubSpace)r%   r/   r0   r1   ÚdiscreteAxesÚinterpolableUserRegionÚaxisÚvalueCombinationsr,   ÚdiscreteAxisÚvalueÚdiscreteUserLocationÚsubDocs                r(   ÚsplitInterpolablerE   6   s!  é € ðD €LØ%'ÐØ—”ˆÜ�4˜×"Ñ"ô Ô.°Ó5ˆDØ×Ñ Ö%äœ¨Ó-ˆDÜ05Ø—‘Ø—‘Ø—‘ó1Ð"§9¡9Ó-ñ ô "×)Ò)ÁLÓ+QÂL¸D¯K¬KÁLÑ+QÐRÐÛ#ˆô (+¨<Ô'@ô 
â'@Ñ#�ð ×Ñ˜uÒ$Ù'@ð 	ñ  
ô "ØØ>Ð%Ð>Ð)=Ð>ØØØ+Ø!5ñ
ˆð #Ð*Ô*ò $ùò ,Rùó 
ùs   ‚B'DÂ)DÂ>DÃDÃ.*DFc           
   #  óÊ   #   • U R                  5        HK  n[        X5      n[        U USUUUS9n0 UR                  EUR                  EUl        UR                  U4v •  MM     g7f)að  Convert each variable font listed in this document into a standalone
designspace. This can be used to compile all the variable fonts from a
format 5 designspace using tools that can only deal with 1 VF at a time.

Args:
  - ``makeNames``: Whether to compute the instance family and style
    names using the STAT data.
  - ``expandLocations``: Whether to turn all locations into "full"
    locations, including implicit default axis values where missing.
  - ``makeInstanceFilename``: Callable to synthesize an instance filename
    when makeNames=True, for instances that don't specify an instance name
    in the designspace. This part of the name generation can be overridden
    because it's not specified by the STAT table.

.. versionadded:: 5.0
Fr-   N)ÚgetVariableFontsr   r<   Úlibr8   )r%   r/   r0   r1   ÚvfÚvfUserRegionÚvfDocs          r(   ÚsplitVariableFontsrL   y   si   é € ð. ×"Ñ"Ö$ˆÜ& sÓ/ˆÜ ØØØØØ+Ø!5ñ
ˆð ,�u—y‘yÐ+ B§F¡FÐ+ˆŒ	Ø�g‰g�uˆnÔò %ùs   ‚A!A#c                óp   • 0 n[        U 5       H$  u  p#[        U5       H  u  pESUl        XQU'   M     M&     U$ )zìConvert each variable font listed in this document into a standalone
format 4 designspace. This can be used to compile all the variable fonts
from a format 5 designspace using tools that only know about format 4.

.. versionadded:: 5.0
z4.1)rE   rL   ÚformatVersion)r%   ÚvfsÚ	_locationrD   ÚvfNamerK   s         r(   Úconvert5to4rR   ž   sB   € ð €CÜ.¨sÖ3Ñˆ	Ü/°Ö7‰MˆFØ"'ˆEÔØ�‹Kó 8ñ 4ð €Jr*   c               ó€  ^ ^^• [        5       nU U4S jnT R                   GH5  nXR                     n	[        U	[        5      (       d  M)  [        US5      (       d  M<  [        [        U5      nUR                  [        UR                  UR                  UR                  UR                  [        U	R                  UR                  5      U	R                  =(       d    UR                  [        U	R                   UR                   5      UR"                   V
Vs/ s H/  u  p«U	R                  U
s=::  a  U	R                   ::  d  M(  O  M,  X«4PM1     snn
S S S9
5        GM8     / =Ul        nUR                   Vs1 s H  oˆR                  iM     snmT R$                   GHÐ  n['        U4S jUR(                  R+                  5        5       5      (       d  M8  ['        U4S jUR,                  R+                  5        5       5      (       d-  [.        R1                  SUR(                  UR,                  5        M—  [3        5       nUR5                  UR(                  R+                  5       5        UR5                  UR,                  R+                  5       5        T R                   H   nUR                  U;  a  M  XR                     n	U	R                  UR                  :w  dC  U	R                  b  U	R                  UR                  :w  d  U	R                   UR                   :w  d  M€  [.        R1                  SUR                  5        M¢     UR7                  [9        UR(                  UR,                  S95        GMÓ     [;        T U5      n[=        T R>                  U5      Ul        T R@                  Ul         T RB                   HÄ  n[E        T RG                  URH                  5      U5      (       d  M/  URK                  [M        URN                  URP                  URR                  UR                  [U        X" U5      5      URV                  URX                  URZ                  UR\                  UR^                  UR`                  S	95        MÆ     URc                  5       nT Rc                  5       nUb  Ub  URd                  Ul2        U(       a®  T Rg                  5        Hš  n[i        T U5      n[k        UU5      (       d  M"  URm                  [o        UR                  URN                  URp                   Vs/ s H)  n[        UUR                     [        5      (       d  M'  UPM+     snURr                  S
95        Mœ     T Rt                   GH)  n[E        URw                  T 5      U5      (       d  M&  U(       Ga  [y        T URw                  T 5      5      nURX                  =(       d    URz                  R}                  S5      nURZ                  =(       d    UR~                  R}                  S5      nUR�                  [ƒ        S0 SURN                  =(       d
    U" T UU5      _SURP                  _SURR                  _SUR                  =(       d    U SU 3_ST(       a  0 OUR„                  _S[U        X" U5      5      _SU_SU_SUR†                  =(       d    UR†                  _SURˆ                  =(       d    URŠ                  R}                  S5      _SURŒ                  =(       d    URŒ                  _SURd                  =(       d    URz                  _SURŽ                  =(       d    UR~                  _SUR�                  =(       d    URŠ                  _SUR’                  =(       d    0 _SURr                  _65        GM3  UR�                  [ƒ        S0 SURN                  _SURP                  _SURR                  _SUR                  _ST(       a  0 OUR„                  _S[U        X" U5      5      _SURX                  _SURZ                  _SUR†                  _SURˆ                  _SURŒ                  _SURd                  _SURŽ                  _SUR�                  _SUR’                  _SURr                  _65        GM,     T Rr                  Ul9        U$ s  snn
f s  snf s  snf )Nc                óL   >• T(       a  U R                  T5      $ U R                  $ ©N)ÚgetFullDesignLocationÚdesignLocation)Úobjectr%   r0   s    €€r(   ÚmaybeExpandDesignLocationÚ3_extractSubSpace.<locals>.maybeExpandDesignLocationÂ   s#   ø€ ÞØ×/Ñ/°Ó4Ð4à×(Ñ(Ð(r*   r5   )
Útagr8   Ú
labelNamesÚhiddenr5   r7   r6   ÚmapÚaxisOrderingÚ
axisLabelsc              3  ó,   >#   • U  H	  oT;   v •  M     g 7frU   © ©Ú.0r?   Ú
subDocAxess     €r(   Ú	<genexpr>Ú#_extractSubSpace.<locals>.<genexpr>è   s   øé € ÐOÒ2N¨$˜:Ö%Ò2Nùó   ƒc              3  ó,   >#   • U  H	  oT;   v •  M     g 7frU   rb   rc   s     €r(   rf   rg   ê   s   øé € ÐPÒ2O¨$˜:Ö%Ò2Oùrh   zPIn axis mapping from input %s, some output axes are not in the variable-font: %szALimiting axis ranges used in <mapping> elements not supported: %s)ÚinputLocationÚoutputLocation)ÚfilenameÚpathÚfontr8   rW   Ú	layerNamer    r#   ÚmuteKerningÚmuteInfoÚmutedGlyphNames)r8   rl   ÚaxisSubsetsrH   r   rl   rm   rn   r8   Ú ÚuserLocationrW   r    r#   ÚpostScriptFontNameÚstyleMapFamilyNameÚstyleMapStyleNameÚlocalisedFamilyNameÚlocalisedStyleNameÚlocalisedStyleMapFamilyNameÚlocalisedStyleMapStyleNamerH   rb   )Jr   r2   r8   Ú
isinstancer   r3   r
   r   ÚaddAxisr[   r\   r]   Úmaxr5   r7   Úminr6   r^   ÚaxisMappingsÚallrj   Úkeysrk   ÚLOGGERÚerrorÚsetÚupdater4   r   r   Ú_subsetRulesBasedOnConditionsÚrulesÚrulesProcessingLastÚsourcesr   Úmap_backwardrW   Ú	addSourcer   rl   rm   rn   Ú_filterLocationro   r    r#   rp   rq   rr   ÚfindDefaultry   rG   r   r   ÚaddVariableFontr   rs   rH   Ú	instancesÚgetFullUserLocationr   r!   r"   r$   ÚaddInstancer   ru   rv   rw   ÚstyleMapFamilyNamesrx   rz   r{   r|   )r%   Ú
userRegionr.   r/   r0   r1   rD   rY   r?   ÚrangeÚuserÚdesignÚmappingsÚmappingÚmappingAxesÚdesignRegionÚsourceÚ	vfDefaultÚ
oldDefaultrI   rJ   Ú
axisSubsetr&   r'   r    r#   re   s   `   `                     @r(   r<   r<   ¯   s—  ú€ ô !Ó"€Fö)ð —•ˆØŸ9™9Ñ%ˆÜ�eœU×#Ó#¬°°i×(@Ó(@ô œ¨Ó-ˆDØ�N‰NÜàŸ™ØŸ™Ø#Ÿ™ØŸ;™;ä §¡¨t¯|©|Ó<Ø!ŸM™M×9¨T¯\©\Ü §¡¨t¯|©|Ó<ð -1¯HªHôâ,4™L˜DØ Ÿ=™=¨DÕA°E·M±MÑAó 'áAñ '˜›Ù,4òð "&Ø#ñ#÷ñ ð: &(Ð'€FÔ˜(Ø(.¯ªÓ4ª —)”)©Ñ4€JØ×#Õ#ˆÜÔO°'×2GÑ2G×2LÑ2LÔ2NÓO×OÑOÙÜÔP°'×2HÑ2H×2MÑ2MÔ2OÓP×PÑPÜ�L‰LØbØ×%Ñ%Ø×&Ñ&ôñ
 ä“eˆØ×Ñ˜7×0Ñ0×5Ñ5Ó7Ô8Ø×Ñ˜7×1Ñ1×6Ñ6Ó8Ô9Ø—H”HˆDØ�y‰y Ó+ÙØŸy™yÑ)ˆEà—‘ §¡Ó-Ø—M‘MÑ-°%·-±-À4Ç<Á<Ó2OØ—=‘= D§L¡LÕ0ä—‘ØWØ—I‘Iôñ ñ ð 	�‰Ü!Ø%×3Ñ3Ø&×5Ñ5ñ÷	
ñ; $ôP ,¨C°Ó<€LÜ0°·±¸LÓI€F„LØ!$×!8Ñ!8€FÔð —+”+ˆÜ × 0Ñ 0°×1FÑ1FÓ GÈ×TÑTÙà×ÑÜØŸ™Ø—[‘[Ø—[‘[Ø—[‘[Ü.ØÐ 9¸&Ó Aó ð !×*Ñ*Ø!×,Ñ,Ø ×*Ñ*Ø"×.Ñ.ØŸ™Ø &× 6Ñ 6ñö	
ñ	 ð. ×"Ñ"Ó$€IØ—‘Ó"€JØÑ Ñ!7Ø(2×(FÑ(Fˆ	Ô%ö à×&Ñ&Ö(ˆBÜ*¨3°Ó3ˆLÜ˜l¨J×7Ó7Ø×&Ñ&Ü*ØŸW™WØ!#§¡ð /1¯nªnó%â.< 
Ü)¨*°Z·_±_Ñ*EÄu×M÷ 'Ù.<ñ%ð
 ŸF™Fñ	öñ )ð" —M•MˆÜ × <Ñ <¸SÓ AÀ:×NÑNÙçÜ$ S¨(×*FÑ*FÀsÓ*KÓLˆIØ!×,Ñ,×O°	×0EÑ0E×0IÑ0IÈ$Ó0OˆJØ ×*Ñ*×L¨i×.BÑ.B×.FÑ.FÀtÓ.LˆIØ×ÑÜ"ò Ø%×.Ñ.÷ FÙ+¨C°¸9ÓEøðð "Ÿšðð "Ÿšð	ð
 "Ÿ™×E¨Z¨L¸¸)¸Ð*Eøðö (7¡¸H×<QÑ<Qøðô $3Ø"Ð$=¸hÓ$Gô$ðñ  *ðñ (ðð (0×'BÑ'B÷ (4Ø ×3Ñ3øðð (0×'BÑ'B÷ (?Ø ×4Ñ4×8Ñ8¸Ó>øðð  '/×&@Ñ&@÷ '3Ø ×2Ñ2øð#ð$ )1×(DÑ(D÷ )-Ø ×,Ñ,øð'ð( (0×'BÑ'B÷ (,Ø ×+Ñ+øð+ð, 19×0TÑ0T÷ 15Ø ×4Ñ4øð/ð0 08×/RÑ/R÷ 0Øøð3ð4 !Ÿšð5÷ð> ×ÑÜ"ò Ø%×.Ò.ðà!Ÿšðð "Ÿšðð "Ÿšð	ö
 (7¡¸H×<QÑ<Qøðô $3Ø"Ð$=¸hÓ$Gô$ðð  (×2Ò2ðð '×0Ò0ðð (0×'BÒ'Bðð (0×'BÒ'Bðð '/×&@Ò&@ðð )1×(DÒ(Dðð (0×'BÒ'Bðð  19×0TÒ0Tð!ð" 08×/RÒ/Rð#ð$ !Ÿšð%÷ñO "ð| —‘€F„Jà€MùóUùò 5ùòh%s$   Ä'b0Ä?b0Åb0Å2b6Ô&b;Õb;c                óÎ   • 0 nU  H\  nUR                  S5      UR                  S5      pC[        Ub  UO[        R                  * Ub  UO[        R                  5      XS   '   M^     U$ )Nr5   r6   r8   )r"   r   ÚmathÚinf)ÚconditionSetÚcÚ	conditionr5   r6   s        r(   Ú_conditionSetFromr§   ‡  sa   € Ø€AÛ!ˆ	Ø$Ÿ=™=¨Ó3°Y·]±]À9Ó5M�Ü$ØÑ*‰G´·±°	ØÑ*‰G´·±ó 
ˆ�FÑ
Óñ "ð €Hr*   c           	     ó`  • / nU  GH$  n[        UR                  / UR                  S9nUR                   HÌ  n[	        U5      n/ nSnUR                  5        H‚  u  pšX–;  a  M  [        U
[        [        45      (       a  X¦U	   ;   a  M1  SnM5  X¦U	   ;   a  M?  Xi   R                  U
5      nUb+  UR                  U	UR                  UR                  S.5        M€  SnM„     U(       a  M±  UR                  R                  U5        MÎ     UR                  (       d  GM  UR                  U5        GM'     U$ )N)r8   ÚconditionSetsÚsubsFT)r8   r5   r6   )r   r8   rª   r©   r§   Úitemsr}   ÚfloatÚintÚintersectionr4   r5   r6   )r‰   rœ   ÚnewRulesÚruleÚnewRuleÚconditionsetÚcsÚnewConditionsetÚdiscardConditionsetÚselectionNameÚselectionValuer®   s               r(   rˆ   rˆ   ’  s4  € ð$ &(€HÜˆÜ"0Ø—‘¨"°4·9±9ñ#
ˆð !×.Ô.ˆLÜ" <Ó0ˆBØ46ˆOØ"'ÐØ1=×1CÑ1CÖ1EÑ-�à Ó*áÜ˜n¬u´c¨l×;Ñ;à%¨MÑ):Ó:Ùð /3Ò+ð &¨MÑ):Ó:Ùà')Ñ'8×'EÑ'EÀnÓ'U˜à'Ñ3Ø+×2Ñ2à,9Ø/;×/CÑ/CØ/;×/CÑ/Cñ!"öð 37Ò/ñ; 2F÷< 'Ð&Ø×%Ñ%×,Ñ,¨_Ö=ñG /ðH × × Ò Ø�O‰O˜G×$ñS ðV €Or*   c                ó˜   • UR                  5        VVs0 s H'  u  p#X ;   d  M  [        X   [        5      (       d  M%  X#_M)     snn$ s  snnf rU   )r«   r}   r   )r•   Úlocationr8   rB   s       r(   rŽ   rŽ   Ó  sN   € ð $Ÿ>™>Ô+ôâ+‰KˆDØÑó 	ä",¨ZÑ-=¼u×"Eó 	ˆŠÙ+òð ùó s   ”A£A¼A)r%   r   r&   r   r'   r   ÚreturnÚstr)
r%   r   r/   Úboolr0   r¼   r1   ÚMakeInstanceFilenameCallablerº   z8Iterator[Tuple[SimpleLocationDict, DesignSpaceDocument]])
r%   r   r/   r¼   r0   r¼   r1   r½   rº   z)Iterator[Tuple[str, DesignSpaceDocument]])r%   r   rº   zDict[str, DesignSpaceDocument])r%   r   r•   r   r.   r¼   r/   r¼   r0   r¼   r1   r½   rº   r   )r¤   zList[Dict[str, Any]]rº   r   )r‰   úList[RuleDescriptor]rœ   r   rº   r¾   )r•   r   r¹   úDict[str, float]rº   r¿   )0Ú__doc__Ú
__future__r   r9   Úloggingr¢   Útypingr   r   r   r   r   r	   r
   ÚfontTools.designspaceLibr   r   r   r   r   r   r   r   r   Ú"fontTools.designspaceLib.statNamesr   r   ÚfontTools.designspaceLib.typesr   r   r   r   r   r   r   Ú	getLoggerÚ__name__r„   r»   r½   r)   rE   rL   rR   r<   r§   rˆ   rŽ   rb   r*   r(   Ú<module>rÉ      sÂ  ðñõ #ã Û Û ß C× CÑ C÷
÷ 
õ 
÷ G÷÷ ñ ð 
×	Ò	˜8Ó	$€à'ØÐ,¨iÐ8¸#Ð=ñ Ð ð

+Ø	ð
+Ø(:ð
+ØGPð
+àô
+ð Ø Ø9Tð	@+Ø	ð@+àð@+ð ð@+ð 7ð	@+ð
 >õ@+ðJ Ø!Ø9Tð	"Ø	ð"àð"ð ð"ð 7ð	"ð
 /õ"ðJØ	ðà#ôð"UØ	ðUàðUð ð	Uð
 ðUð ðUð 7ðUð ôUôpð>Øð>Ø/5ð>àô>ðBØðàðð õr*   