
    g~m                        d dl mZ d dlmZ d dlmZmZmZ d dlm	Z	 d dl
Z
d dlZ ej                  e      ZdZ G d de      Zd	Zd
Zedz   Zedz   ZdZeez   Zeez   Zeez   Zeez   Zeez   Zeez   Z G d de	j                        ZdZg ZdgZd ZddZd Z edk(  r4d dl!Z!d dl"Z" e"jF                   e!jH                         jJ                         yy)    )sstruct)otRound)safeEval
num2binary
binary2num)DefaultTableNz
	bFamilyType:        B
	bSerifStyle:        B
	bWeight:            B
	bProportion:        B
	bContrast:          B
	bStrokeVariation:   B
	bArmStyle:          B
	bLetterForm:        B
	bMidline:           B
	bXHeight:           B
c                       e Zd Zd Zd Zd Zy)Panosec           	          t        j                  t              \  }}}|D ]  }t        | ||j	                  |d             ! |D ]  }t        d|       y )Nr   z,Panose() got an unexpected keyword argument )r   	getformatpanoseFormatsetattrpop	TypeError)selfkwargs_namesnameks         \/var/www/dash_apps/app1/venv/lib/python3.12/site-packages/fontTools/ttLib/tables/O_S_2f_2.py__init__zPanose.__init__   sb    ''55! 	5DD$

4 34	5 	RAJ1%PQQ	R    c                     t        j                  t              \  }}}|D ]/  }|j                  |t	        | |             |j                          1 y )Nvalue)r   r   r   	simpletaggetattrnewline)r   writerttFontformatstringr   fixesr   s          r   toXMLzPanose.toXML#   sL    %,%6%6|%D"eU 	DTt)<=NN	r   c                 6    t        | |t        |d                y )Nr   )r   r   )r   r   attrscontentr!   s        r   fromXMLzPanose.fromXML)   s    dHU7^45r   N)__name__
__module____qualname__r   r$   r(    r   r   r
   r
      s    R6r   r
   a  
	>   # big endian
	version:                H       # version
	xAvgCharWidth:          h       # average character width
	usWeightClass:          H       # degree of thickness of strokes
	usWidthClass:           H       # aspect ratio
	fsType:                 H       # type flags
	ySubscriptXSize:        h       # subscript horizontal font size
	ySubscriptYSize:        h       # subscript vertical font size
	ySubscriptXOffset:      h       # subscript x offset
	ySubscriptYOffset:      h       # subscript y offset
	ySuperscriptXSize:      h       # superscript horizontal font size
	ySuperscriptYSize:      h       # superscript vertical font size
	ySuperscriptXOffset:    h       # superscript x offset
	ySuperscriptYOffset:    h       # superscript y offset
	yStrikeoutSize:         h       # strikeout size
	yStrikeoutPosition:     h       # strikeout position
	sFamilyClass:           h       # font family class and subclass
	panose:                 10s     # panose classification number
	ulUnicodeRange1:        L       # character range
	ulUnicodeRange2:        L       # character range
	ulUnicodeRange3:        L       # character range
	ulUnicodeRange4:        L       # character range
	achVendID:              4s      # font vendor identification
	fsSelection:            H       # font selection flags
	usFirstCharIndex:       H       # first unicode character index
	usLastCharIndex:        H       # last unicode character index
	sTypoAscender:          h       # typographic ascender
	sTypoDescender:         h       # typographic descender
	sTypoLineGap:           h       # typographic line gap
	usWinAscent:            H       # Windows ascender
	usWinDescent:           H       # Windows descender
z/
	ulCodePageRange1:   L
	ulCodePageRange2:   L
zt
	sxHeight:           h
	sCapHeight:         h
	usDefaultChar:      H
	usBreakChar:        H
	usMaxContext:       H
z?
	usLowerOpticalPointSize:    H
	usUpperOpticalPointSize:    H
z	>	# big endian
c                       e Zd ZdZdgZd Zd Zd Zd Zd Z	e
d        Zej                  d	        Ze
d
        Zej                  d        Ze
d        Zej                  d        Zd Zd ZddZd Zd ZddZd Zy)table_O_S_2f_2a$  OS/2 and Windows Metrics table

    The ``OS/2`` table contains a variety of font-wide metrics and
    parameters that may be useful to an operating system or other
    software for system-integration purposes.

    See also https://learn.microsoft.com/en-us/typography/opentype/spec/os2
    headc                    t        j                  t        ||       \  }}| j                  dk(  rt        j                  t        ||       \  }}n| j                  dv rt        j                  t
        ||       \  }}n| j                  dk(  rIt        j                  t        ||       \  }}| xj                  dz  c_        | xj                  dz  c_        n3| j                  dk7  r$ddl	m
} |j                  d| j                  z        t        |      rt        j                  d       t        j                  t         | j"                  t%                     | _        y )	N                  r   ttLib)unknown format for OS/2 table: version %sztoo much 'OS/2' table data)r   unpack2OS2_format_0versionOS2_format_1_additionOS2_format_2_additionOS2_format_5_additionusLowerOpticalPointSizeusUpperOpticalPointSize	fontToolsr9   
TTLibErrorlenlogwarningunpackr   panoser
   )r   datar!   dummyr9   s        r   	decompileztable_O_S_2f_2.decompile   s   oolD$?t<<1!//*?tLKE4\\Y&!//*?tLKE4\\Q!//*?tLKE4((B.(((B.(\\Q'"";dllJ  t9KK45nn\4;;Ir   c                    | j                  |       | j                  }|d   }| j                  dz  r$|j                  dz  st        j                  d       | j                  dz  r$|j                  dz  st        j                  d       | j                  dz  r$| j                  dz  rt        j                  d	       | j                  d
k  r/| j                  dz  r t        j                  d| j                         t        j                  t        | j                        | _        | j                  dk(  rt        j                  t        |       }n| j                  dk(  rt        j                  t        |       }n| j                  dv rt        j                  t        |       }n| j                  dk(  rk| j                  j                         }t        | j                   dz        |d<   t        | j"                  dz        |d<   t        j                  t$        |      }n$ddlm} |j+                  d| j                  z        || _        |S )Nr/   r1   r3   zNfsSelection bit 0 (italic) and head table macStyle bit 1 (italic) should match    zJfsSelection bit 5 (bold) and head table macStyle bit 0 (bold) should match@   !   zNfsSelection bit 6 (regular) is set, bits 0 (italic) and 5 (bold) must be clearr5   i  zWfsSelection bits 7, 8 and 9 are only defined in OS/2 table version 4 and up: version %sr   r2   r6   r7   rA   rB   r8   r:   )updateFirstAndLastCharIndexrI   fsSelectionmacStylerF   rG   r=   r   packr   r<   OS2_format_1OS2_format_2__dict__copyroundrA   rB   OS2_format_5rC   r9   rD   )r   r!   rI   r/   rJ   dr9   s          r   compileztable_O_S_2f_2.compile   s   ((0f~q 4==6+AKKB v%0AKK@ v%D,<,<|,KKK= <<! 0 0< ?KK:
 ll<=<<1<<d3D\\Q<<d3D\\Y&<<d3D\\Q""$A+01M1MPR1R+SA'(+01M1MPR1R+SA'(<<a0D'"";dllJ  r   c                    |j                  d       |j                          | j                  dk(  rt        }n1| j                  dv rt        }n| j                  dk(  rt
        }nt        }t        j                  |      \  }}}|D ]  }t        | |      }|dk(  rE|j                  d       |j                          |j                  ||       |j                  d       n{|dv r|j                  |t        |             nZ|dv r|j                  |t        |d	             n8|d
k(  r |j                  |t        |      dd        n|j                  ||       |j                           y )NzXThe fields 'usFirstCharIndex' and 'usLastCharIndex'
will be recalculated by the compilerr1   r2   r6   rI   )ulUnicodeRange1ulUnicodeRange2ulUnicodeRange3ulUnicodeRange4ulCodePageRange1ulCodePageRange2r   )fsTyperR      	achVendID)commentr   r=   rU   rV   rZ   r<   r   r   r   begintagr$   endtagr   r   repr)	r   r    r!   formatr"   r   r#   r   r   s	            r   r$   ztable_O_S_2f_2.toXML   sN   3	
 	<<1!F\\Y&!F\\Q!F!F%,%6%6v%>"eU 	DD$'Ex) FF+h'     Z-> ?22  Zr-B C$  T%[2-> ?  U 3NN-	r   c           	      N   |dk(  rDt               x| _        }|D ]-  }t        |t              s|\  }}}|j	                  ||||       / y |dv rt        | |t        |d                y |dk(  r t        | |t        d|d   z   dz                y t        | |t        |d                y )NrI   )r^   r_   r`   ra   rb   rc   rd   rR   r   rf   z''')r
   rI   
isinstancetupler(   r   r   r   )r   r   r&   r'   r!   rI   elements          r   r(   ztable_O_S_2f_2.fromXML   s    8#)8+DK&" Agu-+2(D%NN4@A  	
 	
 D$
5> :;[ D$w)?%)G HID$w 89r   c                 6   d|vry t               }t        |d   dg       D ]<  }|j                         s|j                  |j                  j                                > |r9t        |      }t        |      }t        d|      | _        t        d|      | _	        y y )Ncmaptables  )
setr   	isUnicodeupdaterr   keysminmaxusFirstCharIndexusLastCharIndex)r   r!   codestableminCodemaxCodes         r   rQ   z*table_O_S_2f_2.updateFirstAndLastCharIndex  s    VF^Xr: 	0E UZZ__./	0 %jG%jG$'$8D!#&vw#7D  r   c                     | j                   S NusMaxContextr   s    r   usMaxContexztable_O_S_2f_2.usMaxContex  s       r   c                     || _         y r   r   r   r   s     r   r   ztable_O_S_2f_2.usMaxContex  s
    !r   c                     | j                   S r   r{   r   s    r   fsFirstCharIndexztable_O_S_2f_2.fsFirstCharIndex  s    $$$r   c                     || _         y r   r   r   s     r   r   ztable_O_S_2f_2.fsFirstCharIndex  s
     %r   c                     | j                   S r   r|   r   s    r   fsLastCharIndexztable_O_S_2f_2.fsLastCharIndex!  s    ###r   c                     || _         y r   r   r   s     r   r   ztable_O_S_2f_2.fsLastCharIndex%  s
    $r   c                 v   t               }| j                  | j                  }}| j                  | j                  }}t        d      D ]p  }|d|z  z  r|j                  |       |d|z  z  r|j                  |dz          |d|z  z  r|j                  |dz          |d|z  z  s]|j                  |dz          r |S )z;Return the set of 'ulUnicodeRange*' bits currently enabled.rN   r1   rO   `   )ru   r^   r_   r`   ra   rangeadd)r   bitsul1ul2ul3ul4is          r   getUnicodeRangesztable_O_S_2f_2.getUnicodeRanges)  s    u'')=)=S'')=)=Sr 	!Aa1f~a1f~R a1f~R a1f~R 	! r   c                 @   d\  }}}}|D ]t  }d|cxk  rdk  rn n	|d|z  z  }d|cxk  rdk  rn n|d|dz
  z  z  }4d|cxk  rdk  rn n|d|dz
  z  z  }Nd|cxk  rdk  rn n|d|dz
  z  z  }ht        d|z         ||c| _        | _        ||c| _        | _        y	)
z9Set the 'ulUnicodeRange*' fields to the specified 'bits'.)r   r   r   r   r   rN   r1   rO   r   {   z#expected 0 <= int <= 122, found: %rN)
ValueErrorr^   r_   r`   ra   )r   r   r   r   r   r   bits          r   setUnicodeRangesztable_O_S_2f_2.setUnicodeRanges9  s    'S#s 
	NCC}"}qCxsRqS2X&sRqS2X&sSqS2X& !F!LMM
	N 69#2d258#2d2r   c                 4   t               }|d   j                  D ]<  }|j                         s|j                  |j                  j                                > |r!t        |d      }| j                         |z
  }nt        |      }| j                  |       |S )aL  Intersect the codepoints in the font's Unicode cmap subtables with
        the Unicode block ranges defined in the OpenType specification (v1.7),
        and set the respective 'ulUnicodeRange*' bits if there is at least ONE
        intersection.
        If 'pruneOnly' is True, only clear unused bits with NO intersection.
        rr   T)inverse)	ru   rs   rv   rw   rr   rx   intersectUnicodeRangesr   r   )r   r!   	pruneOnlyunicodesr~   emptyr   s          r   recalcUnicodeRangesz"table_O_S_2f_2.recalcUnicodeRangesJ  s     5F^** 	3E 

 12	3 *8TBE((*U2D)(3Dd#r   c                     t               }| j                  dk  r|S | j                  | j                  }}t	        d      D ]8  }|d|z  z  r|j                  |       |d|z  z  s%|j                  |dz          : |S )z<Return the set of 'ulCodePageRange*' bits currently enabled.r1   rN   )ru   r=   rb   rc   r   r   )r   r   r   r   r   s        r   getCodePageRangesz table_O_S_2f_2.getCodePageRanges]  sz    u<<!K(($*?*?Sr 	!Aa1f~a1f~R 		!
 r   c                     d\  }}|D ]A  }d|cxk  rdk  rn n	|d|z  z  }d|cxk  rdk  rn n|d|dz
  z  z  }4t        d|d       | j                  dk  rd| _        ||c| _        | _        y)	z:Set the 'ulCodePageRange*' fields to the specified 'bits'.)r   r   r   rN   r1   rO   z expected 0 <= int <= 63, found: rN)r   r=   rb   rc   )r   r   r   r   r   s        r   setCodePageRangesz table_O_S_2f_2.setCodePageRangesj  s    S 	MCC}"}qCxsRqS2X& #CC7!KLL	M <<!DL7:C4t4r   c                 "   t               }|d   j                  D ]<  }|j                         s|j                  |j                  j                                > t        |      }|r|| j                         z  }|sdh}| j                  |       |S )Nrr   r   )	ru   rs   rv   rw   rr   rx   calcCodePageRangesr   r   )r   r!   r   r   r~   r   s         r   recalcCodePageRangesz#table_O_S_2f_2.recalcCodePageRangesx  s    5F^** 	3E 

 12	3 "(+D**,,D 3Dt$r   c                     d}|j                  d      }|T|j                  j                         D cg c]  \  }}|dkD  s| }}}|r t        t	        |      t        |      z        }|| _        |S c c}}w )zRecalculate xAvgCharWidth using metrics from ttFont's 'hmtx' table.

        Set it to 0 if the unlikely event 'hmtx' table is not found.
        r   hmtx)getmetricsvaluesr   sumrE   xAvgCharWidth)r   r!   	avg_widthr   widthr   widthss          r   recalcAvgCharWidthz!table_O_S_2f_2.recalcAvgCharWidth  su    
 	zz&!,0LL,?,?,AOqUQYeOFO#CK#f+$=>	&	 Ps   A3A3NF)r)   r*   r+   __doc__dependenciesrL   r\   r$   r(   rQ   propertyr   setterr   r   r   r   r   r   r   r   r   r,   r   r   r.   r.   s   s     8LJ,,\%N:.8  ! ! " " % % & & $ $ % % >"&@ r   r.   ){))zBasic Latin)r      ))zLatin-1 Supplement)      ))zLatin Extended-A)   i  ))zLatin Extended-B)i  iO  ))zIPA Extensions)iP  i  )zPhonetic Extensions)i   i  )zPhonetic Extensions Supplement)i  i  ))zSpacing Modifier Letters)i  i  )zModifier Tone Letters)i   i  ))zCombining Diacritical Marks)i   io  )z&Combining Diacritical Marks Supplement)i  i  ))zGreek and Coptic)ip  i  ))Coptic)i,  i,  ))Cyrillic)i   i  )zCyrillic Supplement)i   i/  )zCyrillic Extended-A)i-  i-  )zCyrillic Extended-B)i@  i  ))Armenian)i0  i  ))Hebrew)i  i  ))Vai)i   i?  ))Arabic)i   i  )zArabic Supplement)iP  i  ))NKo)i  i  ))
Devanagari)i 	  i	  ))Bengali)i	  i	  ))Gurmukhi)i 
  i
  ))Gujarati)i
  i
  ))Oriya)i   i  ))Tamil)i  i  ))Telugu)i   i  ))Kannada)i  i  ))	Malayalam)i   i  ))Thai)i   i  ))Lao)i  i  ))Georgian)i  i  )zGeorgian Supplement)i -  i/-  ))Balinese)i   i  ))zHangul Jamo)i   i  ))zLatin Extended Additional)i   i  )zLatin Extended-C)i`,  i,  )zLatin Extended-D)i   i  ))zGreek Extended)i   i  ))zGeneral Punctuation)i    io   )zSupplemental Punctuation)i .  i.  ))zSuperscripts And Subscripts)ip   i   ))zCurrency Symbols)i   i   ))z'Combining Diacritical Marks For Symbols)i   i   ))zLetterlike Symbols)i !  iO!  ))zNumber Forms)iP!  i!  ))Arrows)i!  i!  )zSupplemental Arrows-A)i'  i'  )zSupplemental Arrows-B)i )  i)  )z Miscellaneous Symbols and Arrows)i +  i+  ))zMathematical Operators)i "  i"  )z#Supplemental Mathematical Operators)i *  i*  )z$Miscellaneous Mathematical Symbols-A)i'  i'  )z$Miscellaneous Mathematical Symbols-B)i)  i)  ))zMiscellaneous Technical)i #  i#  ))zControl Pictures)i $  i?$  ))zOptical Character Recognition)i@$  i_$  ))zEnclosed Alphanumerics)i`$  i$  ))zBox Drawing)i %  i%  ))zBlock Elements)i%  i%  ))zGeometric Shapes)i%  i%  ))zMiscellaneous Symbols)i &  i&  ))Dingbats)i '  i'  ))zCJK Symbols And Punctuation)i 0  i?0  ))Hiragana)i@0  i0  ))Katakana)i0  i0  )zKatakana Phonetic Extensions)i1  i1  ))Bopomofo)i 1  i/1  )zBopomofo Extended)i1  i1  ))zHangul Compatibility Jamo)i01  i1  ))zPhags-pa)i@  i  ))zEnclosed CJK Letters And Months)i 2  i2  ))zCJK Compatibility)i 3  i3  ))zHangul Syllables)i   i  ))zNon-Plane 0 *)i   i  ))
Phoenician)i 	 i	 ))zCJK Unified Ideographs)i N  i  )zCJK Radicals Supplement)i.  i.  )zKangxi Radicals)i /  i/  )z"Ideographic Description Characters)i/  i/  )z"CJK Unified Ideographs Extension A)i 4  iM  )z"CJK Unified Ideographs Extension B)i   iߦ )Kanbun)i1  i1  ))zPrivate Use Area (plane 0))i   i  ))zCJK Strokes)i1  i1  )zCJK Compatibility Ideographs)i   i  )z'CJK Compatibility Ideographs Supplement)i  i ))zAlphabetic Presentation Forms)i   iO  ))zArabic Presentation Forms-A)iP  i  ))zCombining Half Marks)i   i/  ))zVertical Forms)i  i  )zCJK Compatibility Forms)i0  iO  ))zSmall Form Variants)iP  io  ))zArabic Presentation Forms-B)ip  i  ))zHalfwidth And Fullwidth Forms)i   i  ))Specials)i  rt   ))Tibetan)i   i  ))Syriac)i   iO  ))Thaana)i  i  ))Sinhala)i  i  ))Myanmar)i   i  ))Ethiopic)i   i  )zEthiopic Supplement)i  i  )zEthiopic Extended)i-  i-  ))Cherokee)i  i  ))z%Unified Canadian Aboriginal Syllabics)i   i  ))Ogham)i  i  ))Runic)i  i  ))Khmer)i  i  )zKhmer Symbols)i  i  ))	Mongolian)i   i  ))zBraille Patterns)i (  i(  ))zYi Syllables)i   i  )zYi Radicals)i  iϤ  ))Tagalog)i   i  )Hanunoo)i   i?  )Buhid)i@  i_  )Tagbanwa)i`  i  ))z
Old Italic)i  i/ ))Gothic)i0 iO ))Deseret)i  iO ))zByzantine Musical Symbols)i  i )zMusical Symbols)i  i )zAncient Greek Musical Notation)i  iO ))z!Mathematical Alphanumeric Symbols)i  i ))zPrivate Use (plane 15))i   i )zPrivate Use (plane 16))i   i ))zVariation Selectors)i   i  )zVariation Selectors Supplement)i  i ))Tags)i   i  ))Limbu)i   iO  ))zTai Le)iP  i  ))zNew Tai Lue)i  i  ))Buginese)i   i  ))
Glagolitic)i ,  i_,  ))Tifinagh)i0-  i-  ))zYijing Hexagram Symbols)iM  iM  ))zSyloti Nagri)i   i/  ))zLinear B Syllabary)   i  )zLinear B Ideograms)i  i  )zAegean Numbers)i  i? ))zAncient Greek Numbers)i@ i ))Ugaritic)i i ))zOld Persian)i i ))Shavian)iP i ))Osmanya)i i ))zCypriot Syllabary)i  i? ))
Kharoshthi)i 
 i_
 ))zTai Xuan Jing Symbols)i  i_ ))	Cuneiform)i   i# )z!Cuneiform Numbers and Punctuation)i $ i$ ))zCounting Rod Numerals)i` i ))	Sundanese)i  i  ))Lepcha)i   iO  ))zOl Chiki)iP  i  ))
Saurashtra)i  iߨ  ))zKayah Li)i   i/  ))Rejang)i0  i_  ))Cham)i   i_  ))zAncient Symbols)i i ))zPhaistos Disc)i i ))Carian)i i )Lycian)i i )Lydian)i 	 i?	 ))zDomino Tiles)i0 i )zMahjong Tiles)i  i/ c                  ,   t         szt        t              D  cg c]  \  } }|D ]  \  }\  }}||| ff  }}}}} }t        |      D ]4  \  }\  }} t         j	                  |       t
        j	                  || f       6 t         t
        fS c c}}}}} w r   )_unicodeStarts	enumerateOS2_UNICODE_RANGESsortedappend_unicodeValues)r   blocksr   startstopunicodeRangess         r   _getUnicodeRangesr  l  s      ));<
 
V$*
 !=E4 T3K 
 
 

 #)"7 	/E;D#!!%(!!4+.	/ >))
s   Bc                 P   t        |       } t               \  }}t               }| D ]5  }|t        j                  ||         \  }}||k  s%|j                  |       7 t	        d | D              r|j                  d       |r$t        t        t        t                          |z
  S |S )aG  Intersect a sequence of (int) Unicode codepoints with the Unicode block
    ranges defined in the OpenType specification v1.7, and return the set of
    'ulUnicodeRanges' bits for which there is at least ONE intersection.
    If 'inverse' is True, return the the bits for which there is NO intersection.

    >>> intersectUnicodeRanges([0x0410]) == {9}
    True
    >>> intersectUnicodeRanges([0x0410, 0x1F000]) == {9, 57, 122}
    True
    >>> intersectUnicodeRanges([0x0410, 0x1F000], inverse=True) == (
    ...     set(range(len(OS2_UNICODE_RANGES))) - {9, 57, 122})
    True
    c              3   <   K   | ]  }d |cxk  xr dk  nc   yw)r   i   Nr,   ).0codes     r   	<genexpr>z)intersectUnicodeRanges.<locals>.<genexpr>  s     
;$7d%X%%
;s   9   )ru   r  bisectr   anyr   rE   r  )r   r   unicodestartsunicodevaluesr   r  r  r   s           r   r   r   z  s     8}H#4#6 M=5D !&--t"DE	c4<HHSM 
;(
;;9@3uS+,-.5JdJr   c                    t               }t        t        dd            j                  |       }t        d      | v }| D ]
  }|t        d      k(  r|r|j	                  d       &|t        d      k(  r(|r&|j	                  d       |sJ|j	                  d       \|t        d	      k(  rT|j	                  d
       t        d      | v r|r|j	                  d       t        d      | v s|s|j	                  d       |t        d      k(  rW|j	                  d       |rt        d      | v r|j	                  d       |st        d      | v s|j	                  d       #|t        d      k(  r*|r(|j	                  d       |sH|j	                  d       [|t        d      k(  r7|j	                  d       |s~t        d      | v s|j	                  d       |t        d      k(  rF|j	                  d       t        d      | v r|j	                  d       |s|j	                  d       |t        d      k(  r*|r(|j	                  d        |s|j	                  d!       ,|t        d"      k(  r|r|j	                  d#       O|t        d$      k(  r|j	                  d%       p|t        d&      k(  r|j	                  d'       |t        d(      k(  r|j	                  d)       |t        d*      k(  r|j	                  d+       |t        d,      k(  r|j	                  d-       |t        d.      k(  r|j	                  d/       |t        d0      k(  r|r|j	                  d1       8|t        d2      k(  r|r|r|j	                  d3       ]|t        d4      k(  r&|r$|j	                  d5       |j	                  d6       |s|st        d      | v s|t        d7      k(  r|j	                  d8       |t        d9      k(  r|j	                  d:       |t        d;      k(  s|j	                  d<        |r+t        d=      | v rt        d>      | v r|j	                  d?       |S )@zGiven a set of Unicode codepoints (integers), calculate the
    corresponding OS/2 CodePage range bits.
    This is a direct translation of FontForge implementation:
    https://github.com/fontforge/fontforge/blob/7b2c074/fontforge/tottf.c#L3158
    rN   ~   u   ┤   Þr   u   Ľr1   :   u   Бr3   u   Ѕr  u   ╜1   u   Άr4      ½0   u   √<   u   İr5   8   u   אr6   5   u   ر   3   =   u   ŗ   ;   u   ₫   u   ๅre   u   エ   u   ㄅ   u   ㄱ   u   央r7   u   곴   u   ♥      þ6   u   ╚>   ?      Å2      é4      õ7   u   ‰u   ∑   )ru   r   issubsetordr   )r   r   hasAscii
hasLineartunis        r   r   r     sQ    5D5t$%..x8HUx'J D#d)HHQKCI(HHQKCIHHQK4yH$5zX%*CIHHQKc$i83c%jH4CI(HHQKCIHHQKc%jH4CIHHQK5zX%CI(HHQKCJ8HHQKCJHHRLCJHHRLCJHHRLCJHHRLCJHHRLCJHHRLCJ8HHRL
 CI(zHHRLCJ8HHRLHHRL*Ux)?c$iD	!D	!IDL CJ(*s5zX/EKr   __main__r   )&fontTools.miscr   fontTools.misc.roundToolsr   fontTools.misc.textToolsr   r   r   fontTools.ttLib.tablesr   r  logging	getLoggerr)   rF   r   objectr
   r<   r>   r?   r@   	bigendianrU   rV   rZ   r.   r  r  r
  r  r   r   doctestsysexittestmodfailedr,   r   r   <module>rM     s3   " - E E /   g!6V 6( D       	333333!$99 !$99 !$99 a\.. aL	L ^ *K:Sl zCHH_W__%%& r   