OwlCyberSecurity - MANAGER
Edit File: mathtext.cpython-38.pyc
U ��]� � @ s~ d Z ddlmZ ddlZddlmZ ddlZddlZddlZddl Z ddl Zddlm Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ e�� ddlm Z m!Z"m#Z#m$Z$ ddl%m&Z& ddl'm(Z( dd l)m*Z*m+Z+m,Z, dd l-m.Z.m/Z/m0Z0 ddl1m2Z2m3Z3m4Z4m5Z5m6Z6 e�7e8�Z9d�d d�Z:e �;d�e<�Z=G dd� de>�Z?G dd� de?�Z@G dd� de@�ZAG dd� de?�ZBG dd� de?�ZCG dd� de?�ZDG dd� de?�ZEG dd� de?�ZFG d d!� d!e>�ZGG d"d#� d#eG�ZHG d$d%� d%eH�ZIG d&d'� d'eH�ZJG d(d)� d)eJ�ZKG d*d+� d+eK�ZLG d,d-� d-eK�ZMG d.d/� d/eJ�ZNG d0d1� d1eN�ZOG d2d3� d3eG�ZPd4ZQd5eQ ZRd6ZSG d7d8� d8e>�ZTG d9d:� d:eT�ZUG d;d<� d<eT�ZVG d=d>� d>eT�ZWG d?d@� d@eT�ZXG dAdB� dBeT�ZYeYeYeXeUeUeUeUeUeUeUeVeVeVeVeVeVeVeYeYdC�ZZdDdE� Z[G dFdG� dGe\�Z]G dHdI� dIe>�Z^G dJdK� dKe^�Z_G dLdM� dMe_�Z`G dNdO� dOe_�ZaG dPdQ� dQe^�ZbG dRdS� dSeb�ZcG dTdU� dUe_�ZdG dVdW� dWed�ZeG dXdY� dYed�ZfG dZd[� d[e_�ZgG d\d]� d]eg�ZhG d^d_� d_eg�ZiG d`da� dae^�ZjG dbdc� dce>�Zkekddd5deddd�ekddd5dfddd�ekddd5dgddd�ekdddddd5de�ekdddddd5df�ekdddddd5dg�ekdddddddd�ekddd5dedhde�di�ek_lG djdk� dkej�ZmG dldm� dmej�ZnG dndo� doej�ZoG dpdq� dqej�ZpG drds� dsej�ZqG dtdu� duej�ZrG dvdw� dwej�ZsG dxdy� dyee�ZtG dzd{� d{ee�ZuG d|d}� d}e^�ZvG d~d� dee�ZwG d�d�� d�ee�ZxG d�d�� d�ee�ZyG d�d�� d�e>�Zzez� Z{d�d�� Z|G d�d�� d�e>�Z}G d�d�� d�e>�Z~d�d�d��ZdS )�aK :mod:`~matplotlib.mathtext` is a module for parsing a subset of the TeX math syntax and drawing them to a matplotlib backend. For a tutorial of its usage see :doc:`/tutorials/text/mathtext`. This document is primarily concerned with implementation details. The module uses pyparsing_ to parse the TeX expression. .. _pyparsing: http://pyparsing.wikispaces.com/ The Bakoma distribution of the TeX Computer Modern fonts, and STIX fonts are supported. There is experimental support for using arbitrary fonts, but results may vary without proper tweaking and metrics for those fonts. � )� namedtupleN)�StringIO)�Combine�Empty� FollowedBy�Forward�Group�Literal�oneOf� OneOrMore�Optional�ParseBaseException�ParseFatalException� ParserElement�QuotedString�Regex� StringEnd�Suppress� ZeroOrMore)�cbook�colors� get_data_path�rcParams)�AFM)�get_realpath_and_stat)�FT2Image�KERNING_DEFAULT�LOAD_NO_HINTING)�findfont�FontProperties�get_font)�latex_to_bakoma�latex_to_standard�tex2uni� latex_to_cmex�stix_virtual_fontsTc C sp |st | �S | dkrdS z t | �W S tk r6 Y nX zt| �d� W S tk rj td�| ���Y nX dS )aD Return the integer index (from the Unicode table) of *symbol*. Parameters ---------- symbol : str A single unicode character, a TeX command (e.g. r'\pi') or a Type1 symbol name (e.g. 'phi'). math : bool, default is True If False, always treat as a single unicode character. �-i"