ó
46ic        +   @  s  d  d l  m Z d  d l Z d  d l m Z d  d l j j Z e d e	 d e
 d e
 d e
 d e
 d	 e	 d
 e	 d e	 d e	 d e	 d e	 d e	 d e	 d e
 d e	 d e	 d e	 d e	 d e	 d e
 d e
  Z e	 e d <d   Z d e f d     YZ d e
 d  Z d S(   i’’’’(   t   print_functionN(   t   TAGt   alphat   imaget   pt   wt   fastt   bt   it   ut   at   plaint   fontt   colort   sizet   nwt   st   rtt   rbt   kt   cpst   spacet   vspacet    c         C  s}  t  j j } | r4 t t  } | j t  j j  n t } t j t |    } g  } xļ | D]ē \ } } | t	 k rz q\ n  | d d k r q\ n  | j
 d  d k r» | | j
 d   } n  | r| d d k r| sß d | S| d | d k rd | | d f S| j   q\ n  | | k r)d	 | S| | r\ | j |  q\ q\ W| ryd
 d j g  | D] } d | d ^ q] Sd S(   s   
    :doc: lint

    Checks the text tags in s for correctness. Returns an error string if there is
    an error, or None if there is no error.
    i    t   #t   =i’’’’t   /s4   Close text tag '%s' does not match an open text tag.i   s6   Close text tag '%s' does not match open text tag '%s'.s   Text tag '%s' is not known.s?   One or more text tags were left open at the end of the string: s   , t   'N(   t   renpyt   configt   custom_text_tagst   dictt	   text_tagst   updatet   textsupportt   tokenizet   unicodeR   t   findt   popt   appendt   joint   None(   R   t   custom_tagst   all_tagst   tokenst	   tag_stackt   typet   textR   (    (    s`   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\text\extras.pyt   check_text_tags?   s8    

,t   ParameterizedTextc           B  s)   e  Z d  Z d d  Z e Z d   Z RS(   sJ  
    :doc: text

    This is a displayable that can be shown with an additional string
    parameter, which then shows that string as if it was an image.
    This is usually used as part of the pre-defined ``text`` image.

    For example, one can do::

        show text "Hello, World" at truecenter
        with dissolve
        pause 1
        hide text
        with dissolve

    You can use ParameterizedText directly to define similar images with
    different style properties. For example, one can write::

        image top_text = ParameterizedText(xalign=0.5, yalign=0.0)
    t   defaultc         K  s   | |  _  | |  _ d  S(   N(   t   stylet
   properties(   t   selfR3   R4   (    (    s`   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\text\extras.pyt   __init__   s    	c         C  su   t  | j  d k r4 t d d j | j    n  | j d } t j j |  } t j j j	 | d |  j
 |  j S(   Ni   s%   '%s' takes a single string parameter.t    i    R3   (   t   lent   argst	   ExceptionR(   t   nameR   t   pythont   py_evalR/   t   TextR3   R4   (   R5   R9   t   paramt   string(    (    s`   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\text\extras.pyt
   _duplicate   s
    (   t   __name__t
   __module__t   __doc__R6   t   Truet   _duplicatableRA   (    (    (    s`   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\text\extras.pyR1   u   s   iN   c   	      C  s  d d l  } g  } xŗ t |   D]¬ } | j |  } | d k sL | d k rU d } n* | d k ry | rp d } q d } n d } t j   } t |  | _ d | _ d | _ | | _	 | | _
 | j |  q Wt j | t d  t j j j | | d | d t  t j |  S(	   s  
    Wraps the unicode string `s`, and returns a list of strings.

    `width`
        The number of half-width characters that fit on a line.
    `asian`
        True if we should make ambiguous width characters full-width, as is
        done in Asian encodings.
    i’’’’Nt   Ft   Wi   t   Ai
   i   (   t   unicodedataR$   t   east_asian_widthR"   t   Glypht   ordt	   charactert   ascentt   line_spacingt   widtht   advanceR'   t   annotate_unicodet   FalseR   R/   t   texwrapt   linebreak_text   linebreak_list(	   R   RQ   t   asianRJ   t   glyphst   ct   eawt   gwidtht   g(    (    s`   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\text\extras.pyt   textwrap   s*    							$(   t
   __future__R    t
   renpy.textR   t   renpy.text.textsupportR   R/   R"   R   RE   RT   R    R0   t   objectR1   R^   (    (    (    s`   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\text\extras.pyt   <module>   s:   	
	6'