o
    gi                     @   s`   d Z g dZdedefddZdedefddZg d	Zdedefd
dZdedefddZdS )uw  
In PDF, a font is classified as either nonsymbolic or symbolic according to whether all of its characters are
members of the standard Latin character set; see D.2, “Latin Character Set and Encodings”. This shall be
indicated by flags in the font descriptor; see 9.8.2, "Font Descriptor Flags". Symbolic fonts contain other
character sets, to which the encodings mentioned previously ordinarily do not apply. Such font programs have
built-in encodings that are usually unique to each font. The standard 14 fonts include two symbolic fonts,
Symbol and ZapfDingbats, whose encodings and character sets are documented in Annex D.
(       r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r       !   i "  #   i"  %   &   i"  (   )   *   +   ,   -   .   /   0   1   2   3   4   5   6   7   8   9   :   ;   <   =   >   ?   iE"  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  [   i4"  ]   i"  _   i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  {   |   }   ~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   i   i  i2   id"  iD   i"  i  c&  f&  e&  `&  !  i!  i!  !  i!        i3   ie"     i"  i"  i"      i`"  ia"  iH"  i&   i%  i %  i!  i5!  i!  i!  i!  i"  i"  i"  i)"  i*"  i"  i"  i"  i"  i"  i"  i	"  i "  i"        i"!  i"  i"  i"     i'"  i("  i!  i!  i!  i!  i!  i%  i)#  r   r   r   i"  i#  i#  i#  i#  i#  i#  i#  i#  i#  i#  r   i*#  i+"  i #  i#  i!#  i#  i#  i#  i#  i#  i#  i#  i#  i#  r   
byte_inputreturnc                 C   "   d}| D ]
}|t t| 7 }q|S )z
    This function decodes bytes using SymbolEncoding
    :param byte_input:  the input
    :return:            a str (representing the decoded bytes)
     )chrSYMBOL_ENCODING_LOOKUPr3   sb r<   X/home/ubuntu/.local/lib/python3.10/site-packages/borb/pdf/canvas/font/symbol_encoding.pysymbol_decode2      r>   	str_inputc              	   C   P   t  }| D ] }d}z	tt|}W n	 ty   Y nw |dkr%|| q|S )z
    This function encodes a str using SymbolEncoding
    :param str_input:   the input
    :return:            bytes (representing the encoded str)
    )	bytearrayr8   indexord
ValueErrorappendr@   r;   c
char_indexr<   r<   r=   symbol_encode>      
rK   (   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   i'  i'  i'  i'  i&  i'  i'  i'  i	'  i&  i&  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i '  i!'  i"'  i#'  i$'  i%'  i&'  i''  i&  i)'  i*'  i+'  i,'  i-'  i.'  i/'  i0'  i1'  i2'  i3'  i4'  i5'  i6'  i7'  i8'  i9'  i:'  i;'  i<'  i='  i>'  i?'  i@'  iA'  iB'  iC'  iD'  iE'  iF'  iG'  iH'  iI'  iJ'  iK'  i%  iM'  i%  iO'  iP'  iQ'  iR'  i%  i%  i%  iV'  i%  iX'  iY'  iZ'  i['  i\'  i]'  i^'  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ia'  ib'  ic'  id'  ie'  if'  ig'  r&   r'   r(   r)   i`$  ia$  ib$  ic$  id$  ie$  if$  ig$  ih$  ii$  iv'  iw'  ix'  iy'  iz'  i{'  i|'  i}'  i~'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  r+   r*   i!  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  r   i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  i'  r   c                 C   r5   )z
    This function decodes bytes using ZapfDingbats
    :param byte_input:  the input
    :return:            a str (representing the decoded bytes)
    r6   )r7   ZAPFDINGBATS_ENCODING_LOOKUPr9   r<   r<   r=   zapfdingbats_decodev   r?   rN   c              	   C   rA   )z
    This function encodes a str using ZapfDingbats
    :param str_input:   the input
    :return:            bytes (representing the encoded str)
    rB   )rC   rM   rD   rE   rF   rG   rH   r<   r<   r=   zapfdingbats_encode   rL   rO   N)	__doc__r8   bytesstrr>   rK   rM   rN   rO   r<   r<   r<   r=   <module>   s   
%%