
    djU                     8    d dl Z ddlmZmZ  G d d          ZdS )    N   )StyleWeightc                   n    e Zd Zededefd            Zededefd            Zededdfd            Z	dS )
PangoUtilsstringreturnc                     t           j        t           j        t           j        d}	 ||          S # t          $ r t          d| z            w xY w)zGInternally used function. Converts text to Pango Understandable Styles.)NORMALITALICOBLIQUEzThere is no Style Called %s)r   r   r   r   KeyErrorAttributeError)r   styless     K/home/agentuser/manim-venv/lib/python3.11/site-packages/manimpango/utils.py	str2stylezPangoUtils.str2style   sb     ll}
 

	I&>! 	I 	I 	I !>!GHHH	Is	   . Ac                 L   t           j        t           j        t           j        t           j        t           j        t           j        t           j        t           j        t           j	        t           j
        t           j        d}	 ||          S # t          $ r t          d| z            w xY w)zEInternally used function. Convert text to Pango Understandable Weight)r   BOLDTHIN
ULTRALIGHTLIGHTBOOKMEDIUMSEMIBOLD	ULTRABOLDHEAVY
ULTRAHEAVYz!There is no Font Weight Called %s)r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   weightss     r   
str2weightzPangoUtils.str2weight   s     mKK +\Km)\ +
 
	O6?" 	O 	O 	O !Dv!MNNN	Os   >B B#	file_nameNc                 &   t          | d          5 }|                                }ddd           n# 1 swxY w Y   t          j        dd|          }t          | d          5 }|                    |           ddd           dS # 1 swxY w Y   dS )z>Remove element from the SVG file in order to allow comparison.rNzZ M [^A-Za-z]*? "\/>zZ "/>w)openreadresubwrite)r    fprcontentfpws       r   remove_last_MzPangoUtils.remove_last_M*   s
    )S!! 	!ShhjjG	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!&0'7CC)S!! 	SIIg	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   266#BB
B
)
__name__
__module____qualname__staticmethodstrr   r   r   r   r,        r   r   r      s        
I# 
I% 
I 
I 
I \
I O3 O6 O O O \O(      \  r3   r   )r&   enumsr   r   r   r2   r3   r   <module>r5      sX    				                * * * * * * * * * *r3   