
    Q?h                     B    S r SSKJr  SSKJr  S r\S:X  a  \" 5         gg)uq  
This is a utility to 'can' the widths data for certain CID fonts.
Now we're using Unicode, we don't need 20 CMAP files for each Asian
language, nor the widths of the non-normal characters encoded in each
font.  we just want a dictionary of the character widths in a given
font which are NOT 1000 ems wide, keyed on Unicode character (not CID).

Running off CMAP files we get the following widths...::

    >>> font = UnicodeCIDFont('HeiseiMin-W3')
    >>> font.stringWidth(unicode(','), 10)
    2.5
    >>> font.stringWidth(unicode('m'), 10)
    7.7800000000000002
    >>> font.stringWidth(u'東京', 10)
    20.0
    >>> 

    )defaultUnicodeEncodings)UnicodeCIDFontc            	      r   / n U R                  S5        [        R                  " 5        H  u  nu  p#[        SU< SU< SU< 35        [	        U5      nUR
                  R                  nUR                  R                  n0 nUR                  5        H,  u  pUR                  U	S5      n
U
S:w  d  M  X[        U5      '   M.     [        S[        U5      -  5        U R                  SU< S[        U5      < 35        M     SR                  U 5      S-   n[        S	S
5      R                  U5        [        S5        g )NzwidthsByUnichar = {}z	handling z : i  z$created font width map (%d items).  zwidthsByUnichar["z"] = 
zcanned_widths.pywzwrote canned_widths.py)appendr   itemsprintr   face_explicitWidthsencoding_cmapgetchrlenreprjoinopenwrite)buffontNamelanguageencNamefontwidthsByCIDcmapnonStandardWidthsByUnichar	codePointcidwidthsrcs               R/var/www/html/env/lib/python3.13/site-packages/reportlab/pdfbase/_can_cmap_data.pyrunr#      s   
CJJ%&)@)F)F)H%%88WEF h'ii//}}""%'""jjlNIOOC.E}=B3y>: + 	4s;U7VVW

8TB\=]^_' *I, ))C.4
C	C &&s+	
"#    __main__N)__doc__reportlab.pdfbase._cidfontdatar   reportlab.pdfbase.cidfontsr   r#   __name__ r$   r"   <module>r+      s,   ( C 5$< ZE r$   