
    P/Phu                         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                            dddg          d             Zej                            dddg          d             ZdS )    )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                  l    d} |                      d          }t          j        |          }|| k    sJ d S )Nu   приветutf8)encoder   _to_str)inp_strbyte_strrets      Y/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/matplotlib/tests/test_afm.pytest_nonascii_strr   $   s:     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 d S )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   .   sz    			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 d S )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 2 232223	 	      r   c                      t          t                    } t          j        |           }|j        d= |                                dk    sJ d S )Nr   zMy Font)r   r   r   AFM_headerget_familyname)r   fonts     r   test_get_familyname_guessedr+   R   sI    			B8B<<D]#  I------r   c                      t          j        t          t                              dd                              } t          j        d|           j        dk    sJ d S )Ns   Weight Bold
s   Weight Custom
 normal)r   r'   r   r   replacefmafmFontPropertyweight)r*   s    r   &test_font_manager_weight_normalizationr3   Y   s_    8G.0BCCE E F 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            d S # 1 swxY w Y   d S )N)r   pytestraisesRuntimeErrorr   r   )r4   r   s     r   test_bad_afmr9   _   s     
		B	|	$	$  2                 s   A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          |           }|                    t          j                  5  t	          j        |           d d d            n# 1 swxY w Y   t          |j                  dk    sJ d S )N   )r   at_levelloggingERRORr   r   lenrecords)r4   caplogr   s      r   test_malformed_headerrB   q   s    ( 
		B		'	'  2               v~!######s   AAA)ior   r6   r=   
matplotlibr   r   r0   r   r   r   r%   r+   r3   markparametrizer9   rB    r   r   <module>rH      s-                 ) ) ) ) ) )0    *  . . .; ; ; 		    		 &$ $' &$ $ $r   