+
     ]i
9  c                   sB   ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RIt^ RI	t
^ RI	HtHtHt ^ RIHt ^ RIHt ^ RIHtHt ^ RIHtHt ^ RIHt ^ R	IHt ^ R
IHtH t  ^ RI!H"t" ] ! R.4      R 4       t#]PH                  PK                  RR6R7.4      ]PH                  PK                  R^^*.4      R 4       4       t&R t'R t(R t)R t*R t+R t,R t-R t.R t/R t0]"R 4       t1R t2] ! R.4      R 4       t3] ! R.4      R  4       t4]
Pj                  Pm                  R!4      ]! R"R#.R$7      R% 4       4       t7]"R& 4       t8R' t9] ! R(.4      R) 4       t:R* t;] ! R+.R,R-7      R. 4       t<] ! R/.R0R-7      R1 4       t=]PH                  PK                  R2R8R9.4      R3 4       t>] ! R4.4      R5 4       t?R# ):    N)Path)pyplotrcParamsfont_manager)_get_data_path)FT2Font)findfontFontProperties)get_glyphs_subsetfont_as_file)PdfPages)	Rectangle)check_figures_equalimage_comparison)needs_usetexzpdf_use14corefonts.pdfc            	      s
   R \         R&   R\         R&   ^\         R&   R.\         R&   ^ \         R&   Rp \        P                  ! 4       w  rVP                  R	4       VP	                  R
R
V RR^R7       VP                  R
R
R7       R# )Tzpdf.use14corefontsz
sans-serifzfont.familyz	font.sizeZ	Helveticazfont.sans-serifpdf.compressionu   A three-line text positioned just above a blue line
and containing some French characters and the euro symbol:
"Merci pépé pour les 10 €"z0Test PDF backend with option use14corefonts=Trueg      ?ZcenterZbottom)ZhorizontalalignmentZverticalalignmentfontsize)Z	linewidthN)r   pltsubplots	set_titletextZaxhline)r   figax      H/usr/lib64/python3.14/site-packages/matplotlib/tests/test_backend_pdf.pytest_use14corefontsr      s    %)H!"*H]H[#.-H"#H"D llnGCLLCDGGCd&   JJscJ"    zfontname, fontfilefonttypec                 sp   \        \        \        V .R 7      4      4      P                  V8w  d   \        P
                  ! RV : R24       V\        R&   \        P                  ! 4       w  r4VP                  . R	O4       VP                  RV R7       VP                  \        P                  ! 4       RR7       R# )
familyFont  may be missingpdf.fonttypez
Axes Title)fontpdfformatN         )r   r   r   namepytestskipr   r   r   plotr   savefigioBytesIO)ZfontnameZfontfiler   r   r   s   &&&  r   test_embed_fontsr1   ,   s     H^H:678==IeH<78'H^llnGCGGILLHL-KK

UK+r   c                  s   \        \        P                  ! 4       4      ;_uu_ 4       p V P                  4       ^ 8X  g   Q h\        P
                  ! 4       w  rVP                  . RO4       VP                  V RR7       V P                  4       ^8X  g   Q hV P                  4        V P                  4       ^8X  g   Q h RRR4       R#   + '       g   i     R# ; i)r    r#   r$   Nr&   )r   r/   r0   Zget_pagecountr   r   r-   r.   )r#   r   r   r   r   test_multipage_pagecountr2   <   s    	"**,		3  "a''',,.
	C&  "a'''  "a''' 
 			s   BCC	c                  s   \         P                  ! 4       p \        V 4      ;_uu_ 4       p\        ^
4       F>  p\        P
                  ! 4       w  r4VP                  R4       VP                  VRR7       K@  	  RRR4       V P                  4       pVP                  R4      ^8X  g   Q h\        V4      R8  g   Q hR#   + '       g   i     LL; i)i
   zThis is a long titler#   r$   Ns	   startxrefi@  )r/   r0   r   ranger   r   r   r.   ZgetvalueZcountlen)Zpdfior#   Zir   r   s         r   test_multipage_properfinalizer7   G   s    JJLE	%CrAllnGCLL/0KKEK*  

 	A77< A%%%q6E>> 
s   AB;;C	c                 s   V R ,          p\        V4      ;_uu_ 4       p RRR4       VP                  4       '       d   Q hV R,          p\        V4      ;_uu_ 4       pVP                  \        P                  ! 4       4       RRR4       VP                  4       '       g   Q hR#   + '       g   i     L; i  + '       g   i     L=; i)za.pdfNzb.pdf)r   Zexistsr.   r   figure)Ztmp_pathZfnr#      &  r   test_multipage_keep_emptyr:   S   s}    	G	B	" 
yy{{? 
G	B	"CJJL! 
99;;; 
 
s   B"%B5"B2	5C	c                  s   \         P                  ! \         P                  ! R^^4      \         P                  ! R^^4      4      w  r\         P                  ! V^,          4      p\        P
                  ! 4       w  r4VP                  ^ ^4       VP                  V. R	OR7       VP                  VRRR
1,          . ROR7       R\        P                  R&   \        \        P                  ! 4       4      ;_uu_ 4       pVP                  VRR7       \        VP                  P                  4      ^8X  g   Q h RRR4       R\        P                  R&   \        \        P                  ! 4       4      ;_uu_ 4       pVP                  VRR7       \        VP                  P                  4      ^8X  g   Q h RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)   )ZextentNTzimage.composite_imager#   r$   F)r    r'   r    r'   i)r(   r)   r    r'   )npZmeshgridarangesinr   r   Zset_xlimimshowr   r   r/   r0   r.   r4   Z_fileZ_images)ZXZYZZr   r   r#   r6   r   test_composite_imagerA   a   sF    ;;ryyQ*BIIb!Q,?@DA
qAvAllnGCKK1IIaI%IIa"glI+,0CLL()	"**,		3C&399$$%*** 
  -2CLL()	"**,		3C&399$$%*** 
 		 
 	 
 		s   9:F:5:G:G
	G	c                  s*   \         P                  ! R 4      p \        P                  ! R\        P                  R7      p\        P
                  ! R4      VR&   R\        R&   \        P                  ! 4       pVP                  VRR7       \        P                  ! 4       pVP                  VRRR7       V P                  P                  V4      ;_uu_ 4       pVP                  w  pVP                   P#                  4       w  pV P%                  V4      pVP&                  '       g   Q hVP)                  4       p\        P*                  ! VP-                  R	4      4      p	R
R
R
4       \        P.                  P1                  VX	4       R
#   + '       g   i     L2; i)pikepdf   )ZdtypeTr   )Zresizer#   r8   )r%   ZdpiZRGBN)rC   r'   r)   ):NNNr    r    )r+   importorskipr=   ZzerosZuint8r>   r   r   r8   Zfigimager/   r0   r.   PdfopenpagesZimagesZvaluesZPdfImageZindexedZas_pil_imageZasarrayZconvertZtestingZassert_array_equal)
rB   Zdatar   bufr#   ZpageZimageZ	pdf_imageZ	pil_imageZrgbs
             r   test_indexed_imagerI   t   s   !!),G88Krxx0DIIcNDM"&H
**,CLLdL#
**,CKKExK0			#		#		##%$$U+	     **,	jj**512 
 JJ!!$, 
	s   BFF	c                 s   \         P                  ! R 4      pV P                  RR4       \        P                  ! 4       w  r#VP                  \        ^4      4       RRRRRRR	R
R\        P                  ! R^^\        P                  ! \        P                  ! ^ 4      4      R7      RR/p\        P                  ! 4       pVP                  WTRR7       VP                  P                  V4      ;_uu_ 4       pVP                  P!                  4        UUu/ uF  w  rxV\#        V4      bK  	  p	ppRRR4       X	RRRRRR\$        P&                   R2RR
RRRR\$        P&                   2RRRRR R!/	8X  g   Q hR# u uppi   + '       g   i     LV; i)"rB   SOURCE_DATE_EPOCH0AuthormeTitleMultipage PDFSubject	Test pageKeywordstest,pdf,multipageModDate  ZtzinfoTrappedTruer#   )metadatar%   N/Author/CreationDateD:19700101000000Z/CreatorMatplotlib v, https://matplotlib.org	/Keywords/ModDateD:19680801000000Z	/ProducerMatplotlib pdf backend v/Subject/Title/Trapped/True)r+   rD   setenvr   r   r-   r3   datetimetimezone	timedeltar/   r0   r.   rE   rF   docinfoitemsstrmpl__version__
ZmonkeypatchrB   r   r   ZmdrH   r#   ZkvZinfo
   &         r   test_savefig_metadataru      sl   !!),G*C0llnGCGGE!H 	$;(8$$!Qx001C1CA1FGI6
B **,CKKK/			#		#&)kk&7&7&9:&9da3q6	&9: 
 4,l3??"33KL)'//@AK/G
 
 
 
 ; 
	s   3E9E3
(E93E99F		c                  s   \         P                  ! 4       w  r\        P                  ! \        R R7      ;_uu_ 4        V P                  \        P                  ! 4       RRR/R7       RRR4       \        P                  ! \        RR7      ;_uu_ 4        V P                  \        P                  ! 4       RRR	/R7       RRR4       \        P                  ! \        R
R7      ;_uu_ 4        V P                  \        P                  ! 4       RRR/R7       RRR4       \        P                  ! \        RR7      ;_uu_ 4        V P                  \        P                  ! 4       RRR/R7       RRR4       R#   + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)z#Unknown infodict keyword: 'foobar'.)Zmatchr#   ZfoobarZinvalid)r%   rY   Nz%not an instance of datetime.datetime.rT   z
1968-08-01z'not one of {"True", "False", "Unknown"}rW   Zfooznot an instance of str.rN   i  )r   r   r+   ZwarnsZUserWarningr.   r/   r0   r   r        r   test_invalid_metadatarx      s=   llnGC	kA
C 
CBJJL(I9NO
C 
kC
E 
EBJJL'6 	 	8
E
 
kE
G 
GBJJL)U9KL
G 
k)B	C	CBJJL'4I 
D	C
C 
C 
C
E 
E

G 
G 
D	C	Cs/   *E2*F(*F>*F,2F	F	F)	,F=	c                 s   \         P                  ! R 4      pV P                  RR4       \        P                  ! 4       w  r#VP                  \        ^4      4       RRRRRRR	R
R\        P                  ! R^^\        P                  ! \        P                  ! ^ 4      4      R7      RR/p\        P                  ! 4       p\        WTR7      ;_uu_ 4       pVP                  V4       VP                  V4       RRR4       VP                  P                  V4      ;_uu_ 4       pVP                   P#                  4        UUu/ uF  w  rxV\%        V4      bK  	  p	ppRRR4       X	RRRRRR\&        P(                   R2RR
RRRR\&        P(                   2RRRRRR /	8X  g   Q hR#   + '       g   i     L; iu uppi   + '       g   i     Li; i)!rB   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   )rY   NrZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   )r+   rD   ri   r   r   r-   r3   rj   rk   rl   r/   r0   r   r.   rE   rF   rm   rn   ro   rp   rq   rr   rt   r   test_multipage_metadatary      s   !!),G*C0llnGCGGE!H 	$;(8$$!Qx001C1CA1FGI6
B **,C	#	#	#sCC 
$ 
		#		#&)kk&7&7&9:&9da3q6	&9: 
 4,l3??"33KL)'//@AK/G
 
 
 
 
$	#
 ; 
	s*   #FF8=F2
F8F/	2F88G	c            
      s  aa \         P                  ! R 4      p Ro\        P                  ! RR7      pVP	                  RRRS R2R7       VP	                  RRRS R	2R7       \
        P                  ! 4       ;_uu_ 4       pVP                  VR
R7       V P                  P                  V4      ;_uu_ 4       pVP                  ^ ,          P                  pR Fi  w  po\        VV3R lV 4       R4      pVf   Q h\        VRR4      e   Q hVP                  ^,          \        P                   ! V4      ^H,          8X  d   Ki  Q h	  RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)rB   &https://test_text_urls.matplotlib.org/Zfigsize皙?ztest plain 123plain)urlg?ztest mathtext $123$mathtextr#   r$   c              3   sh   <"   T F'  qP                   P                  S S 28X  g   K#  Vx  K)  	  R # 5iNZAZURI).0afragmenttest_urls   & r   	<genexpr>Z!test_text_urls.<locals>.<genexpr>   s)     M1##''z(5L*LQQs    2
2N
QuadPointsr(   r'   ))z0.1r}   )z0.4r   )r+   rD   r   r8   r   r/   r0   r.   rE   rF   rG   AnnotsnextgetattrRectdecimalDecimal)	rB   r   fdr#   annotsyannotr   r   s	          @@r   test_text_urlsr      s2   !!),G7H
**V
$CHHS#'z-?H@HHS#,XJh2GHH	Bu%[[b!!SYYq\((F  G8MM (((ulD9AAAzz!}(:R(????  G " 
 "! 
s+   ?7E(6BE	?E	E(E% E((E9	c            	      s  a \         P                  ! R 4      p Ro\        P                  ! RR7      pVP	                  RRR^-S R7       \
        P                  ! 4       ;_uu_ 4       pVP                  VRR7       V P                  P                  V4      ;_uu_ 4       pVP                  ^ ,          P                  p\        V3R lV 4       R	4      pVf   Q h\        VR
R	4      f   Q hVP                  ^ ,          VP                  ^,          \         P"                  ! R4      ,
          8X  g   Q h R	R	R	4       R	R	R	4       R	#   + '       g   i     L; i  + '       g   i     R	# ; i)rB   rz   r{   r|   ZN)Zrotationr~   r#   r$   c              3   sb   <"   T F$  qP                   P                  S 8X  g   K   Vx  K&  	  R # 5ir   r   r   r   r      & r   r   Z)test_text_rotated_urls.<locals>.<genexpr>  s"     ?FqccggH:&>Fs   /
/Nr   z0.00001)r'   r'   )r+   rD   r   r8   r   r/   r0   r.   rE   rF   rG   r   r   r   r   r   r   r   rB   r   r   r#   r   r   r            @r   test_text_rotated_urlsr     s   !!),G7H
**V
$CHHS#sRzH;	Bu%[[b!!SYYq\((F ?F?E $$$5,5AAA::a="W__Y%??@ @ @ " 
 "! 
s%   %7EBE 	.E EEE$	c            	      s  a \         P                  ! R 4      p Ro\        P                  ! RR7      pVP	                  RRRRS R2R7       \
        P                  ! 4       ;_uu_ 4       pVP                  VR	R
7       V P                  P                  V4      ;_uu_ 4       pVP                  ^ ,          P                  p\        V3R lV 4       R4      pVf   Q hVP                  ^,          \        P                  ! R4      ^H,          8X  g   Q h RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)rB   rz   r{   r|   gffffff?ztest tex $123$Ttex)usetexr~   r#   r$   c              3   sf   <"   T F&  qP                   P                  S R 28X  g   K"  Vx  K(  	  R# 5i)r   Nr   r   r   r   r   Z%test_text_urls_tex.<locals>.<genexpr>/  s'     BFqccggH:S1A&AFs   1
1Nz0.7r   )r+   rD   r   r8   r   r/   r0   r.   rE   rF   rG   r   r   r   r   r   r   r   r   test_text_urls_texr     s    !!),G7H
**V
$CHHS#'XJc:JHK	Bu%[[b!!SYYq\((F BFBE $$$::a=GOOE$:R$???? " 
 "! 
s%   '7D3A/D 	D3 D0+D33E	c                  s    \        \        \        P                  4      4      ;_uu_ 4       p V P	                  \
        P                  ! 4       4       R R R 4       R #   + '       g   i     R # ; ir   )r   r   osZdevnullr.   r   r8   )r#   s    r   test_pdfpages_fspathr   6  s9    	$rzz"	#	#sCJJL! 
$	#	#	#s   %AA+	zhatching_legend.pdfc                 s    \         P                  ! RR7      p \        ^ ^ .^ ^ RRR7      p\        ^ ^ .^ ^ RRR7      pV P                  WW.. RO4       R# )	z.Test for correct hatching on patches in legendr{   ZgreenZXXXX)Z	facecolorZhatchZblueN)r'   r(   ) r   r   r   )r   r8   r   Zlegend)r   r   Zbr   r   test_hatching_legendr   ;  sQ     **V
$C1a&!Q'@A1a&!Q&?AJJa|-.r   zgrayscale_alpha.pdfc                 sd   \         P                  R^R1R^R13,          w  r\         P                  ! V ^,          V^,          ,           ) 4      p\         P                  W"R8  &   \        P
                  ! 4       w  r4VP                  VRRR7       VP                  . 4       VP                  . 4       R# )z9Masking images with NaN did not work for grayscale imagesr|   noneZgray_r)ZinterpolationZcmapNi)	r=   ZogridZexpZnanr   r   r@   
set_xticks
set_yticks)Zxr   Zddr   r   s        r   test_grayscale_alphar   F  s     88BqGR"W$%DA	!Q$A+	B&&BBwKllnGCIIbXI6MM"MM"r   Zdefaultr#   Zeps)Z
extensionsc           	      s   V P                  4       pVP                  4        VP                  \        P                  ! \        P
                  ! R^^d4      4      RRR7       VP                  4       pVP                  4        R# )r;   rs   r   )ZcNr<   )Zadd_subplotZset_axis_offr-   r=   r?   Zlinspace)Zfig_testZfig_refZax_testZax_ref   &&  r   'test_pdf_eps_savefig_when_color_is_noner   R  s`     ""$GLLB3/0#L@  "F
r   c                 s
   \         P                  ! RRR7       \        P                  ! \        4      ;_uu_ 4        \         P
                  ! \        P                  ! 4       RR7       RRR4       R#   + '       g   i     R# ; i)z"Test failing latex subprocess callz$22_2_2$T)r   r#   r$   N)r   Zxlabelr+   ZraisesZRuntimeErrorr.   r/   r0    r   r   test_failing_latexr   \  sD     JJz$'	|	$	$BJJL/ 
%	$	$	$s   ,A11B	c                  s    \         P                  ! 4       w  rVP                  . . R R7       V P                  \        P
                  ! 4       RR7       R# )T)Z
rasterizedr#   r$   N)r   r   r-   r.   r/   r0   rv   rw   r   test_empty_rasterizedr   d  s7    llnGCGGBtG$KK

UK+r   zkerning.pdfc                  s    \         P                  ! 4       p R pV P                  ^ RV^R7       V P                  ^ RV^R7       R# )u   AVAVAVAVAVAVAVAV€AAVVg      ?)sizeg      ?N)r   r8   r   )r   r5   rw   r   test_kerningr   k  s:    
**,C!AHHQQQHHHQQRH r   c                  s$   \        \        R 4      4      p Rp\        V 4      pVP                  V4       \	        W4      ;_uu_ 4       p\        \        V4      4      pRRR4       XP                  V4       VP                  4       pVP                  4       p0 VmV Uu0 uF  p\        V4      kK  	  up8X  g   Q h\        V4      \        V4      8  g   Q hVP                  4       VP                  4       8X  g   Q hR#   + '       g   i     L; iu upi )zfonts/ttf/DejaVuSerif.ttfz%these should be subsetted! 1234567890N)
ro   r   r   Zset_textr	   r
   Zget_charmapZchrr4   Zget_num_glyphs)ZfpathZcharsZ	nosubfontZsubsetZsubfontZ	nosubcmapZsubcmapZkeys           r   test_glyphs_subsetr   s  s    :;<E3E Iu 
5	(	(F,v./ 
)U%%'I!!#G U8G4GSCG4444 w<#i.((( !!#y'?'?'AAAA 
)	( 5s   C:D:D
	zmulti_font_type3.pdfgffffff@)Ztolc                  st   \         P                  ! R .R7      p \        \         P                  ! V 4      4      P                  R8w  d   \
        P                  ! R4       \        P                  ! RRR .^R7       \        P                  ! R^R7       \        P                  ! 4       pVP                  R	R
R4       R# WenQuanYi Zen Heir   wqy-zenhei.ttczFont may be missingr"   DejaVu Sansr   r   r#   )r   333333?ffffff?u"   There are 几个汉字 in between!Nfmr   r   r   r*   r+   r,   r   rcr8   r   fpr   rw   r   test_multi_font_type3r     s    			#6"7	8BBKKO!!%55)*FF6=*=>RHFF51
**,CHHT5>?r   zmulti_font_type42.pdfg@c                  st   \         P                  ! R .R7      p \        \         P                  ! V 4      4      P                  R8w  d   \
        P                  ! R4       \        P                  ! RRR .^R7       \        P                  ! R^*R7       \        P                  ! 4       pVP                  R	R
R4       R# r   r   r   rw   r   test_multi_font_type42r     s    			#6"7	8BBKKO!!%55)*FF6=*=>RHFF52
**,CHHT5>?r   zfamily_name, file_namec                 s   \         P                  ! V .R 7      p\        \         P                  ! V4      4      P                  V8w  d   \
        P                  ! RV  R24       \        P                  ! RV .^R7       \        P                  ! 4       pVP                  RRR4       VP                  \        P                  ! 4       RR	7       R
# )r   r   r    r"   r   r   r   u   Привет мир!r#   r$   N)r   r   r   r   r*   r+   r,   r   r   r8   r   r.   r/   r0   )Zfamily_nameZ	file_namer   r   r   r   test_otf_font_smoker     s    
 
		;-	0BBKKO!!Y.eK=89FF6;-b1
**,CHHT501KK

UK+r   ztruetype-conversion.pdfc                 s   ^\         P                  R&   \        P                  ! 4       w  rVP	                  ^ ^ R\        \        4      P                  R4      ^PR7       VP                  . 4       VP                  . 4       R# )r)   r!   ZABCDEzmpltest.ttf)r"   r   N)
rp   r   r   r   r   r   Z__file__Z	with_namer   r   )Zrecwarnr   r   r9   r   test_truetype_conversionr     sc     $%CLL llnGCGGAq'h))-82  GMM"MM"r   )r   zDejaVuSans.ttf)r   r   )z	Noto SanszNotoSans-Regular.otf)ZFreeMonozFreeMono.otf)@rj   r   r/   r   Zpathlibr   Znumpyr=   r+   Z
matplotlibrp   r   r   r   r   r   Zmatplotlib.cbookr   Zmatplotlib.ft2fontr   Zmatplotlib.font_managerr   r   Z#matplotlib.backends._backend_pdf_psr	   r
   Zmatplotlib.backends.backend_pdfr   Zmatplotlib.patchesr   Zmatplotlib.testing.decoratorsr   r   Zmatplotlib.testing._markersr   r   ZmarkZparametrizer1   r2   r7   r:   rA   rI   ru   rx   ry   r   r   r   r   r   r   ZstyleZcontextr   r   r   r   r   r   r   r   r   r   r   r   <module>r      s8     	 	      , & < O 4 ( O 4 +,-# .#& -%+0  aW-, .	
,(	+&-0 FJ("J@6@4 @ @0"
 ()*/ +/ ()* + 9/ 0  0 0, =/"! #!B4 )*4	@ 5	@ *+5	@ 6	@ 1?689
,9
, ,-. /r   