
    gu                         d dl mZ d dlZd dlZd dlmZ d dlmZ dZd Z	d Z
d Zd	 Zd
 Zej                  j                  dddg      d        Zej                  j                  dddg      d        Zy)    )BytesION)_afm)font_managers  StartFontMetrics 2.0
Comment Comments are ignored.
Comment Creation Date:Mon Nov 13 12:34:11 GMT 2017
FontName MyFont-Bold
EncodingScheme FontSpecific
FullName My Font Bold
FamilyName Test Fonts
Weight Bold
ItalicAngle 0.0
IsFixedPitch false
UnderlinePosition -100
UnderlineThickness 56,789
Version 001.000
Notice Copyright  2017 No one.
FontBBox 0 -321 1234 369
StartCharMetrics 3
C 0 ; WX 250 ; N space ; B 0 0 0 0 ;
C 42 ; WX 1141 ; N foo ; B 40 60 800 360 ;
C 99 ; WX 583 ; N bar ; B 40 -10 543 210 ;
EndCharMetrics
EndFontMetrics
c                  b    d} | j                  d      }t        j                  |      }|| k(  sJ y )Nu   приветutf8)encoder   _to_str)inp_strbyte_strrets      V/var/www/dash_apps/app1/venv/lib/python3.12/site-packages/matplotlib/tests/test_afm.pytest_nonascii_strr   $   s1     G~~f%H
,,x
 C'>>    c                  |    t        t              } t        j                  |       }|ddddddddd	d
ddg dddk(  sJ y )Ng       @zMyFont-BoldFontSpecificzMy Font Boldz
Test FontsBoldg        FigEdL@z001.000s   Copyright  2017 No one.)r   ii  iq     )s   StartFontMetricss   FontNames   EncodingSchemes   FullName
   FamilyNames   Weights   ItalicAngles   IsFixedPitchs   UnderlinePositions   UnderlineThicknesss   Versions   Notices   FontBBoxs   StartCharMetrics)r   AFM_TEST_DATAr   _parse_header)fhheaders     r   test_parse_headerr   .   s]    		B#F ")##"%1)   r   c                      t        t              } t        j                  |        t        j                  |       }|ddg dfddg dfddg d	fd
ddg dfddg dfddg d	fdfk(  sJ y )Ng     @o@space)r   r   r   r   g     ԑ@foo)(   <   i   ih  g     8@bar)r   ii     )r   *   c   )r   r   r   )r   r   r   r   _parse_char_metrics)r   metricss     r   test_parse_char_metricsr%   C   s    		Br&&r*GG\*e/0U/0	 '<0 2323	   r   c                      t        t              } t        j                  |       }|j                  d= |j                         dk(  sJ y )Nr   zMy Font)r   r   r   AFM_headerget_familyname)r   fonts     r   test_get_familyname_guessedr+   R   s<    		B88B<D]# I---r   c                      t        j                  t        t        j	                  dd                  } t        j                  d|       j                  dk(  sJ y )Ns   Weight Bold
s   Weight Custom
 normal)r   r'   r   r   replacefmafmFontPropertyweight)r*   s    r   &test_font_manager_weight_normalizationr3   Y   sL    88G.0BCE FDb$'..(:::r   afm_datas   nope
really nopes   StartFontMetrics 2.0
Comment Comments are ignored.
Comment Creation Date:Mon Nov 13 12:34:11 GMT 2017
FontName MyFont-Bold
EncodingScheme FontSpecificc                     t        |       }t        j                  t              5  t	        j
                  |       d d d        y # 1 sw Y   y xY w)N)r   pytestraisesRuntimeErrorr   r   )r4   r   s     r   test_bad_afmr9   _   s=     
	B	|	$ 2  s   AAs   StartFontMetrics 2.0
Comment Comments are ignored.
Comment Creation Date:Mon Nov 13 12:34:11 GMT 2017
Aardvark bob
FontName MyFont-Bold
EncodingScheme FontSpecific
StartCharMetrics 3s   StartFontMetrics 2.0
Comment Comments are ignored.
Comment Creation Date:Mon Nov 13 12:34:11 GMT 2017
ItalicAngle zero degrees
FontName MyFont-Bold
EncodingScheme FontSpecific
StartCharMetrics 3c                     t        |       }|j                  t        j                        5  t	        j
                  |       d d d        t        |j                        dk(  sJ y # 1 sw Y   $xY w)N   )r   at_levelloggingERRORr   r   lenrecords)r4   caplogr   s      r   test_malformed_headerrB   q   sZ    ( 
	B		' 2 v~~!### s   A$$A-)ior   r6   r=   
matplotlibr   r   r0   r   r   r   r%   r+   r3   markparametrizer9   rB    r   r   <module>rH      s        )0*.; 		 		&$'&$r   