
    djo                        U d dl mZ d dlmZ ddlmZmZmZmZmZm	Z	 g dZ
 e            Zded<   ddZddZddZddZddZdS )    )annotations)	lru_cache   )RegisteredFont_fc_register_font_fc_unregister_font_list_fonts_register_font_unregister_font)fc_register_fontfc_unregister_font
list_fontsregister_fontunregister_fontregistered_fontsr   zset[RegisteredFont]r   	font_pathstrreturnNonec                ,    t          t          |           S )a  This function registers the font file using ``fontconfig`` so that
    it is available for use by Pango. On Linux it is aliased to
    :func:`register_font` and on Windows and macOS this would work only when
    using ``fontconfig`` backend.

    Parameters
    ==========
    font_path : :class:`str`
        Relative or absolute path to font file.

    Returns
    =======
    :class:`bool`
            True means it worked without any error.
            False means there was an unknown error

    Examples
    ========
    >>> register_font("/home/roboto.tff")
    True

    Raises
    ======
    AssertionError
        The :param:`font_path` specified doesn't exist.
    )r   r   r   s    S/home/agentuser/manim-venv/lib/python3.11/site-packages/manimpango/register_font.pyr   r      s    6 -y999    c                ,    t          t          |           S )a  This function unregister (removes) the font file using
    ``fontconfig``. It is mostly optional to call this.
    Mainly used in tests. On Linux it is aliased to
    :func:`unregister_font` and on Windows and macOS this
    would work only when using ``fontconfig`` backend.

    Parameters
    ==========
    font_path: :class:`str`
        For compatibility with the windows function.

    Returns
    =======
    :class:`bool`
            True means it worked without any error.
            False means there was an unknown error

    )r   r   r   s    r   r   r   ;   s    & /;;;r   c                ,    t          t          |           S )a  This function registers the font file using native OS API
    to make the font available for use by Pango. On Linux it is
    aliased to :func:`fc_register_font` and on Windows and macOS
    it uses the native API.

    Parameters
    ==========
    font_path: :class:`str`
        Relative or absolute path to font file.

    Returns
    =======
    :class:`bool`
            True means it worked without any error.
            False means there was an unknown error

    Examples
    ========
    >>> register_font("C:/home/roboto.tff")
    True

    Raises
    ======
    AssertionError
        The :param:`font_path` specified doesn't exist.
    )r
   r   r   s    r   r   r   Q   s    6 *I666r   c                ,    t          t          |           S )a  This function unregister (removes) the font file using native OS API.
    It is mostly optional to call this. Mainly used in tests. On Linux it is
    aliased to :func:`fc_unregister_font` and on Windows and macOS it uses
    the native API.

    Parameters
    ==========
    font_path: :class:`str`
        Relative or absolute path to font file.

    Returns
    =======
    :class:`bool`
            True means it worked without any error.
            False means there was an unknown error

    Examples
    ========
    >>> unregister_font("C:/home/roboto.tff")
    True

    Raises
    ======
    AssertionError
        The :param:`font_path` specified doesn't exist.

    )r   r   r   s    r   r   r   o   s    8 ,i888r   listc                       t          d          t                    t          t          t          d                               S )a  Lists the fonts available to Pango.
    This is usually same as system fonts but it also
    includes the fonts added through :func:`register_font`
    or :func:`fc_register_font`.

    Returns
    -------

    :class:`list` :
        List of fonts sorted alphabetically.
    N)maxsizec                    | j         S )N)path)xs    r   <lambda>zlist_fonts.<locals>.<lambda>   s    QV r   )key)r   r	   tuplesortedr    r   r   r   r      sK     0"9T""";//f%+;+;<<<==  r   N)r   r   r   r   )r   r   )
__future__r   	functoolsr   r
   r   r   r   r	   r   __all__setr   __annotations__r   r   r   r   r   r'   r   r   <module>r-      s   " " " " " " "                        ),  - - - -: : : :<< < < <,7 7 7 7<9 9 9 9>     r   