+
     ]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 \        P                  ! 4       w  rVP                  . RO4       VP                  V RR7       V P                  4        RRR4       R#   + '       g   i     R# ; i)r'   r#   r$   Nr&   )r   r/   r0   r   r   r-   r.   )r#   r   r   r   r   test_multipage_pagecountr2   <   sV    	"**,		3,,.
	C& 
 			s   AA??B	c                  sH   \         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R#   + '       g   i     L"; i)i
   zThis is a long titler#   r$   N)	r/   r0   r   ranger   r   r   r.   Zgetvalue)Zpdfior#   Zir   r   s         r   test_multipage_properfinalizer6   G   sk    JJLE	%CrAllnGCLL/0KKEK*  

 	A 
s   ABB!	c                 s2   V R ,          p\        V4      ;_uu_ 4       p RRR4       V R,          p\        V4      ;_uu_ 4       pVP                  \        P                  ! 4       4       RRR4       R#   + '       g   i     L[; i  + '       g   i     R# ; i)za.pdfNzb.pdf)r   r.   r   figure)Ztmp_pathZfnr#      &  r   test_multipage_keep_emptyr9   S   sa    	G	B	" 

 
G	B	"CJJL! 
 
 
s   A2%B2B	B	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       RRR4       R\        P                  R&   \        \        P                  ! 4       4      ;_uu_ 4       pVP                  VRR7       RRR4       R#   + '       g   i     Lg; 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.   )ZXZYZZr   r   r#   r5   r   test_composite_imager@   a   s    ;;ryyQ*BIIb!Q,?@DA
qAvAllnGCKK1IIaI%IIa"glI+,0CLL()	"**,		3C& 
  -2CLL()	"**,		3C& 
 		 
 	 
 		s   9E,E?,E<	?F	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'                  4       p\        P(                  ! VP+                  R	4      4      p	R
R
R
4       \        P,                  P/                  VX	4       R
#   + '       g   i     L2; i)pikepdf   )ZdtypeTr   )Zresizer#   r7   )r%   ZdpiZRGBN)rB   r'   r)   ):NNNr    r    )r+   importorskipr<   ZzerosZuint8r=   r   r   r7   Zfigimager/   r0   r.   PdfopenpagesZimagesZvaluesZPdfImageZas_pil_imageZasarrayZconvertZtestingZassert_array_equal)
rA   Zdatar   bufr#   ZpageZimageZ	pdf_imageZ	pil_imageZrgbs
             r   test_indexed_imagerH   t   s   !!),G88Krxx0DIIcNDM"&H
**,CLLdL#
**,CKKExK0			#		#		##%$$U+	**,	jj**512 
 JJ!!$, 
	s   A1E..E>	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       R# u uppi   + '       g   i     R# ; i)rA   SOURCE_DATE_EPOCH0AuthormeTitleMultipage PDFSubject	Test pageKeywordstest,pdf,multipageModDate  ZtzinfoTrappedTruer#   )metadatar%   N)r+   rC   setenvr   r   r-   r3   datetimetimezone	timedeltar/   r0   r.   rD   rE   docinfoitemsstr
ZmonkeypatchrA   r   r   ZmdrG   r#   ZkvZinfo
   &         r   test_savefig_metadatarc      s   !!),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: 
	: 
		s   3D;D5
(D;5D;;E	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%   rX   Nz%not an instance of datetime.datetime.rS   z
1968-08-01z'not one of {"True", "False", "Unknown"}rV   Zfooznot an instance of str.rM   i  )r   r   r+   ZwarnsZUserWarningr.   r/   r0   r   r        r   test_invalid_metadatarf      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       R#   + '       g   i     Lu; iu uppi   + '       g   i     R# ; i)rA   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   )rX   N)r+   rC   rY   r   r   r-   r3   rZ   r[   r\   r/   r0   r   r.   rD   rE   r]   r^   r_   r`   rb   r   test_multipage_metadatarg      s1   !!),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: 
		 
$	#
 ; 
		s*   #E!E:=E4
E:!E1	4E::F	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 F  w  po\        VV3R lV 4       R4      pK  	  RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)rA   &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r(   r'   ))z0.1rk   )z0.4rm   r+   rC   r   r7   r   r/   r0   r.   rD   rE   rF   ZAnnotsZnext)	rA   r   fdr#   annotsyannotrr   rs   s	          @@r   test_text_urlsr{      s    !!),G7H
**V
$CHHS#'z-?H@HHS#,XJh2GHH	Bu%[[b!!SYYq\((F  G8MM  G " 
 "! 
s%   ?7D6AD		7D	DDD-	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R	R	R	4       R	R	R	4       R	#   + '       g   i     L; i  + '       g   i     R	# ; i)rA   rh   ri   rj   ZN)Zrotationrl   r#   r$   c              3   sb   <"   T F$  qP                   P                  S 8X  g   K   Vx  K&  	  R # 5irn   ro   rp   rq   rs      & r   rt   Z)test_text_rotated_urls.<locals>.<genexpr>  s"     ?FqccggH:&>Fs   /
/N)r'   r'   rv   rA   r   rw   r#   rx   rz   rs            @r   test_text_rotated_urlsr     s    !!),G7H
**V
$CHHS#sRzH;	Bu%[[b!!SYYq\((F ?F?E " 
 "! 
s$   %7C54C"	C5"C2-C55D	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RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)rA   rh   ri   rj   gffffff?ztest tex $123$Ttex)usetexrl   r#   r$   c              3   sf   <"   T F&  qP                   P                  S R 28X  g   K"  Vx  K(  	  R# 5i)r   Nro   r|   r}   r   rt   Z%test_text_urls_tex.<locals>.<genexpr>/  s'     BFqccggH:S1A&AFs   1
1Nru   rv   r~   r   r   test_text_urls_texr     s    !!),G7H
**V
$CHHS#'XJc:JHK	Bu%[[b!!SYYq\((F BFBE " 
 "! 
s$   '7C74C$	C7$C4/C77D	c                  s    \        \        \        P                  4      4      ;_uu_ 4       p V P	                  \
        P                  ! 4       4       R R R 4       R #   + '       g   i     R # ; irn   )r   r   osZdevnullr.   r   r7   )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 legendri   ZgreenZXXXX)Z	facecolorZhatchZblueN)r'   r(   ) r   r   r   )r   r7   r   Zlegend)r   rq   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 imagesrj   noneZgray_r)ZinterpolationZcmapNi)	r<   ZogridZexpZnanr   r   r?   
set_xticks
set_yticks)Zxry   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:   ra   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   rd   re   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   r7   r   )r   r4   re   r   test_kerningr   k  s:    
**,C!AHHQQQHHHQQRH r   c                  sR   \        \        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R#   + '       g   i     LC; i)zfonts/ttf/DejaVuSerif.ttfz%these should be subsetted! 1234567890N)r_   r   r   Zset_textr	   r
   Zget_charmap)ZfpathZcharsZ	nosubfontZsubsetZsubfontZ	nosubcmapZsubcmaps          r   test_glyphs_subsetr   s  s    :;<E3E Iu 
5	(	(F,v./ 
)U%%'I!!#G 
)	(s   BB&	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   rcr7   r   fpr   re   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   re   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   r7   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)
mplr   r   r   r   r   Z__file__Z	with_namer   r   )Zrecwarnr   r   r8   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)@rZ   Zdecimalr/   r   Zpathlibr   Znumpyr<   r+   Z
matplotlibr   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   r6   r9   r@   rH   rc   rf   rg   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   