+
    f7if:  c                   s    R t ^ RIHt ^ RIHt ^ RIHt ^ RIt ! R R]4      t^t	R t
]R 4       tR	 tR
 tR tR tR tRR ltR tR tRR ltR# )z-Helpers for instantiating name table records.)contextmanager)deepcopy)IntEnumNc                   s:    ] tR t^	t^t^t^t^t^t^t	^t
^t^tRtR# )NameID N)Z__name__Z
__module__Z__qualname__Z__firstlineno__FAMILY_NAMESUBFAMILY_NAMEUNIQUE_FONT_IDENTIFIERFULL_FONT_NAMEVERSION_STRINGPOSTSCRIPT_NAMETYPOGRAPHIC_FAMILY_NAMETYPOGRAPHIC_SUBFAMILY_NAME!VARIATIONS_POSTSCRIPT_NAME_PREFIXZ__static_attributes__r       G/usr/lib64/python3.14/site-packages/fontTools/varLib/instancer/names.pyr   r   	   s3    KNNNO !#(*%r   r   c                 s    . pR V 9   d   V R ,          pVP                    F  pVP                  VP                  4       K   	  VP                   FL  pVP                  VP                  4       VP
                  R8w  g   K1  VP                  VP
                  4       KN  	  RV 9   d   V R,          P                  pVP                  '       d   VP                  P                  MR F  pVP                  VP                  4       K   	  VP                  '       d   VP                  P                  MR F  pVP                  VP                  4       K   	  \        VRR4      pVe   VP                  V4       V Uu0 uF  q^8  g   K  VkK  	  up# u upi )fvar  STATElidedFallbackNameIDNr   )axesappendZ
axisNameIDZ	instancesZsubfamilyNameIDZpostscriptNameIDtableDesignAxisRecordAxisZ
AxisNameIDAxisValueArray	AxisValueValueNameIDZgetattr)	varfontZusedr   ZaxisZinstancestatvalueZelidedFallbackNameIDnameIDs	   &        r   getVariationNameIDsr       s@   DvIIDKK( HKK001((F2H556 ' v$$262G2G2GD))..RODKK( P6:6I6I6IT((22rQEKK))* R&t-CTJ+KK,-!%6v#FF666s   5FFc              #   s  "   ^RI Hp \        V 4      pRx  VP                  R4       V\        V 4      ,
          pV R,          P                   Uu. uF  qDP
                  V9  g   K  VNK  	  upV R,          P                  R&   RV 9   dd   \        ;QJ d-    R V R,          P                   4       F  '       g   K   RM"	  R	M! R V R,          P                   4       4      '       g   V R R# R# R# u upi 5i)
   )logNzPruning name tablename:NNNZltagc              3   sr   "   T F-  pVP                   ^ 8X  g   K  VP                  R8w  g   K)  Vx  K/  	  R# 5i)i    r   N)
platformIDlangID).0record   & r   	<genexpr>Z%pruningUnusedNames.<locals>.<genexpr>A   s8      
/  A% *0--6*A F/s   77
7TF) r"   r    Zinfonamesr   Zany)r   r"   ZorigNameIDsZexcluder'   s   &    r   pruningUnusedNamesr,   /   s     %g.K	HH!"/88G$V_22 26mm76R2 GFO! 
 s 
!&///
sss 
!&///
 
 

 
  s*   AC5C0'C0-(C5"C5;+C5'C5c                s   ^RI HpHp RV 9  d   \        R4      hV R,          P                  pVP
                  '       g   \        R4      hV R,          pV! V4      P                  V 4      pVP                  4       pVP                   Uu/ uF  qwP                  VP                  bK  	  ppV! / VCVC4      p	\        ;QJ d*    R V	P                  4        4       F  '       d   K   RM	  RM! R V	P                  4        4       4      '       g   Q hV! WI4      p
\        WJV	P                  4       4       V
 Uu. uF#  qP                  \         ,          '       d   K!  VNK%  	  p
p\#        V
4      p
\%        W
4       R	# u upi u upi )
a  Update instatiated variable font's name table using STAT AxisValues.

Raises ValueError if the STAT table is missing or an Axis Value table is
missing for requested axis locations.

First, collect all STAT AxisValues that match the new default axis locations
(excluding "elided" ones); concatenate the strings in design axis order,
while giving priority to "synthetic" values (Format 4), to form the
typographic subfamily name associated with the new default instance.
Finally, update all related records in the name table, making sure that
legacy family/sub-family names conform to the the R/I/B/BI (Regular, Italic,
Bold, Bold Italic) naming model.

Example: Updating a partial variable font:
| >>> ttFont = TTFont("OpenSans[wdth,wght].ttf")
| >>> updateNameTable(ttFont, {"wght": (400, 900), "wdth": 75})

The name table records will be updated in the following manner:
NameID 1 familyName: "Open Sans" --> "Open Sans Condensed"
NameID 2 subFamilyName: "Regular" --> "Regular"
NameID 3 Unique font identifier: "3.000;GOOG;OpenSans-Regular" -->         "3.000;GOOG;OpenSans-Condensed"
NameID 4 Full font name: "Open Sans Regular" --> "Open Sans Condensed"
NameID 6 PostScript name: "OpenSans-Regular" --> "OpenSans-Condensed"
NameID 16 Typographic Family name: None --> "Open Sans"
NameID 17 Typographic Subfamily name: None --> "Condensed"

References:
https://docs.microsoft.com/en-us/typography/opentype/spec/stat
https://docs.microsoft.com/en-us/typography/opentype/spec/name#name-ids
)
AxisLimitsaxisValuesFromAxisLimitsr   z6Cannot update name table since there is no STAT table.z<Cannot update name table since there are no STAT Axis Valuesr   c              3   sR   "   T F  qP                   VP                  8H  x  K  	  R # 5iN)ZminimumZmaximum)r&   vr(   r   r)   Z"updateNameTable.<locals>.<genexpr>y   s     J/I!yyAII%/Is   %'FTN)r*   r-   r.   
ValueErrorr   r   ZlimitAxesAndPopulateDefaultsZdefaultLocationr   axisTagZdefaultValueallZvaluescheckAxisValuesExistZpinnedLocationZFlagsELIDABLE_AXIS_VALUE_NAME_sortAxisValues_updateNameRecords)r   Z
axisLimitsr-   r.   r   r   ZpartialDefaultsaZfvarDefaultsZdefaultAxisCoordsZaxisValueTablesr0   s   &&          r   updateNameTabler9   I   sO   @ 7WQRR6?  DWXX6?D
 J'DDWMJ 002O7;yyAy!IIq~~-yLA"#Fl#Fo#FG3J/@/G/G/IJ333J/@/G/G/IJJJJJ.tGO0A0P0P0RS #"a''4L*L*L?   &o6Ow0 Bs   	E74E<E<c                 sT  a \        4       pV P                  P                  p\        4       pV P                  P                   F  pVP
                  R9   d.   VP                  WFP                  ,          P                  4       KA  VP
                  ^8X  g   KT  VP                   F.  pVP                  WGP                  ,          P                  4       K0  	  K  	  V F  pVP
                  p	VP
                  R9   di   WHP                  ,          P                  p
V	^8X  d   VP                  pMVP                  pV
S9   d$   VSV
,          8X  d   VP                  V
4       K  K  K  VP
                  ^8X  g   K  VP                   FS  pWGP                  ,          P                  p
V
S9   g   K(  VP                  SV
,          8X  g   KB  VP                  V
4       KU  	  EK  	  \        S4      V,
          V,          pV'       d+   RP                  V3R lV 4       4      p\        RV R24      hR# )r!   z, c              3   sB   <"   T F  pR V RSV,           2x  K  	  R# 5i)Z'z': Nr   )r&   i
axisCoordss   & r   r)   Z'checkAxisValuesExist.<locals>.<genexpr>   s"     K{!as#jm_5{s   zCannot find Axis Values {Z}N)r!   i      )setr   r   r   r   Formatadd	AxisIndexZAxisTagAxisValueRecordZNominalValueZValuejoinr1   )r   
axisValuesr;   ZseenZ
designAxesZ	hasValuesr   ZrecZaxisValueTableZaxisValueFormatr2   	axisValueZmissingAxesZmissings   &&f           r   r4   r4      s   5D&&++JI$$..<<9$MM*__5==>\\Q,,j7??@ -	 / %(//  I- !9!9:BBG!#*77	*00	*$j6I)I! *J$""a'%55$]]3;;j(SYY*W:M-MHHW% 6 %  z?T)Y6K))K{KK5gYbABB r   c                 s   . p\        4       p\        V  Uu. uF  q3P                  ^8X  g   K  VNK  	  upR RR7      pV FT  p\        R VP                   4       4      p\	        V4      pW&,          '       d   K:  W&,          pVP                  Wu34       KV  	  V  FB  pWT9   d   K  VP                  pW9  g   K  VP                  V4       VP                  W34       KD  	  \        V4       U	U
u. uF  w  rV
NK	  	  up
p	# u upi u up
p	i )i   c                 s,    \        V P                  4      # r/   )lenrA   )r0   s   &r   Z<lambda>Z!_sortAxisValues.<locals>.<lambda>   s    c!++,r   T)ZkeyZreversec              3   s8   "   T F  qP                   x  K  	  R # 5ir/   )r@   r&   Zrr(   r   r)   Z"_sortAxisValues.<locals>.<genexpr>   s     C/B!++/Bs   )r=   Zsortedr>   rA   Zminr   r@   r?   )rC   ZresultsZseenAxesr0   Zformat4ZvalZaxisIndexesZminIndexZ	axisIndexZ_rD   s   &          r   r6   r6      s     GuH0Jq((a-J0,G Cs/B/BCC{#%%#HNNH?+  >MM	$LL#NNI+,  +1/:/,!I/::) 	1( ;s   C?C?.Dc                 s  aa V R ,          pV R,          P                   pV Uu. uF  qDP                  NK  	  ppV Uu. uF  p\        W&4      '       g   K  VNK  	  ppV Uu. uF  qfV9  g   K  VNK  	  ppVP                  p	\        W)4      p
VP                  o\        R VP                   4       4      pV EF  o\        ;QJ d#    VV3R l^^V	3 4       F  '       d   K   RM	  RM! VV3R l^^V	3 4       4      '       g   KN  RP                  VV3R lV 4       4      pV'       d   RP                  VV3R lV 4       4      pMR	pV'       gB   V'       g:   V
'       d   S! V	.SO5!  P                  4       pMS! V	.SO5!  P                  4       pRP                  VV3R
 lV 4       4      p\        V VVV.SO5!   EK	  	  R	# u upi u upi u upi )r#   r   c              3   sf   "   T F'  qP                   VP                  VP                  3x  K)  	  R # 5ir/   )r$   	platEncIDr%   rF   r(   r   r)   %_updateNameRecords.<locals>.<genexpr>   s!     S?a\\1;;9?s   /1c              3   s8   <"   T F  pS! V.SO5!  x  K  	  R # 5ir/   r   )r&   r:   getNameplatform   & r   r)   rH      s      G2FQ71(x((2Fs   FT c              3   T   <"   T F  pS! V.SO5!  P                  4       x  K  	  R # 5ir/   	toUnicoder&   nrI   rJ   rK   r   r)   rH      s*      !
7C!GA!!++--|   %(c              3   rM   r/   rN   rP   rK   r   r)   rH      s+      );Ka%H%//11;KrR   Nc              3   rM   r/   rN   rP   rK   r   r)   rH      s*      $
7F!GA!!++--rR   )r   r   _isRibbir   rI   r=   r+   r3   rB   rO   _updateNameTableStyleRecords)r   rC   	nametabler   r8   ZaxisValueNameIDsrQ   ZribbiNameIDsZnonRibbiNameIDsZelidedNameIDZelidedNameIsRibbiZ	platformssubFamilyNametypoSubFamilyNamefamilyNameSuffixrI   rJ   s   &&             @@r   r7   r7      s   I6?  D/9:z!z:/J/!8I3IAA/LJ"2L"2Q|6Kqq"2OL,,L 9GS9??SSIsG1a2FGsssG1a2FGGG  !
7C!
 
  # );K) ! !% !  ' @x @ J J L$+L$D8$D$N$N$P!88 $
7F$
 
 	%		

 	
9  ;JLs   GG	G	!G.Gc                 sd    V P                  V^^R4      pVe   VP                  4       R9   d   R# R# )r<   	  TF)RegularZItalicZBoldzBold Italic)rI   rO   )rU   r   ZenglishRecords   && r   rS   rS      sF    %%faE:M $##%)UU 	 	r   c                 s   V R ,          pWEV3pVP                   ! \        P                  .VO5!  ;'       g#    VP                   ! \        P                  .VO5!  p	VP                   ! \        P                  .VO5!  ;'       g#    VP                   ! \        P
                  .VO5!  p
\        W.4      '       g   \        RV 24      hV	P                  4       p	V
P                  4       p
\        P                  T	\        P
                  T;'       g    R/pV'       dL   V	 RV 2P                  4       V\        P                  &   W\        P                  &   W;\        P                  &   M9\        P                  \        P                  3 F  pVP                  VR7       K  	  VP                  \        P                  4      ;'       g    V\        P                  ,          pVP                  \        P                  4      ;'       g    V\        P
                  ,          pV RV 2V\        P                  &   \        WW4      V\        P                  &   \        WV4      pV'       d   W\        P                   &   VP#                  4        F*  w  ppV'       g   Q V4       hVP$                  ! VV.VO5!   K,  	  RV 9  d"   VP                  \        P&                  4       R# R# )r#   z.Missing required NameIDs 1 and 2 for platform rZ   rL   )r   r   N)rI   r   r   r   r   r   r3   r1   rO   stripZremoveNamesZgetr   _updatePSNameRecordr
   _updateUniqueIdNameRecordr   ZitemsZsetNamer   )r   rX   rV   rW   r$   rG   r%   rU   rJ   ZcurrentFamilyNameZcurrentStyleNamenameIDsr   ZnewFamilyNameZnewStyleNameZuniqueIDZstrings   &&&&&&&          r   rT   rT     s    Iv.H!))&&)1 : :			6--	9	9  !(()),4 = =			600	<8	<  !455I(TUU)335'113 	-}99	G ):(;1=M<N&O&U&U&W""#2C../5F112
 **--
F !!!0	
 	F223RRwv?Q?Q7R  	F556XX'&BWBW:X  )6a~%FGF!!"&9'GF""# )8DH19--.!--/vv&&484 * WfFFG r   c                 s   V R ,          pVP                   ! \        P                  .VO5!  pV'       d   VP                  4       pMTpV RV 2p\        P
                  ! RRV4      p\        V4      ^8  d   VR,           R2# V# )r#   Z-z[^A-Za-z0-9-]r*   :Ni|   Nz...)rI   r   r   rO   resubrE   )r   Z
familyNameZ	styleNamerJ   rU   Zfamily_prefixpsNames   &&&&   r   r\   r\   J  s     I%%003;M %//1"a	{+F VV$c62F
6{S ,s##Mr   c                 s   V R ,          pVP                   ! \        P                  .VO5!  pV'       g   R# \        P                  \        P                  3 F  pVP                   ! V.VO5!  pV'       g   K!  VP                  4       VP                  4       9   g   KF  VP                  4       P                  VP                  4       WP                  ,          4      u # 	  \        W4      pV R,          P                  p\        P                  ! RRV4      P                  4       p	V\        P                  ,          p
V RV	 RV
 2# )r#   NzOS/2z[^\x00-\x7F]r*   ;)rI   r   r   r   r
   rO   Zreplacer   _fontVersion	achVendIDr_   r`   r[   )r   r^   rJ   rU   ZcurrentRecordr   
nameRecordZfontVersionrd   Zvendorra   s   &&&        r   r]   r]   d  s   I%%f&C&COhOM ((&*@*@A&&v99
!]%<%<%>> **,44$$&0A0A(B  B w1K))IVVOR399;FV++,F]!F81VH--r   c                 s   V R ,          P                   ! \        P                  .VO5!  pVf   V R,          P                  R # VP	                  4       P                  R4      ^ ,          pVP                  R4      P                  4       # )r#   Zheadz.3frb   zVersion )rI   r   r	   ZfontRevisionrO   ZsplitZlstripr[   )ZfontrJ   re   ZversionNumbers   &&  r   rc   rc   }  sv    f%%f&;&;GhGJv,++C01 ((*005a8M
+1133r   r<   r!   rY   )rf   )Z__doc__Z
contextlibr    Zcopyr   Zenumr   r_   r   r5   r    r,   r9   r4   r6   r7   rS   rT   r\   r]   rc   r   r   r   <module>rg      sv    3 %   		+W 	+  7.    2:1zCB;D/
dBHJ4.24r   