rL iddlZddlZddlmZddlZddlZddlZddlm Z ddl m Z ddl m ZddlmZddlmZdZdZdZdZd Zd Zd Zd Zd ddddddddddddd ddddddddddd d!d"d#d"d$d%d&d'd(d)d*d+d,Zej<j?d-ejAejC.d/Z"did0d1d2d3d4d5d6d7d8d9d:d;dd=d?d@dAdBdCdDdEdFdGddHdIdJddKdLdMdd1dNdOdPdQdRdSdTdUdVddWdXdIdYdZid0dLd[d\d]d^d_d`daddbdcdddedfddgdhdidcdjdedkddldmdndodpdqdrddsdtdudvdVdwdxdyd1dzd{dd|d@d}dDdLdddd~d ddddddddddd dddid0d1d2d1d4dd6d7d8dd:d;ddd?ddAddCddEddGddHddJdTdKdLdMdd1ddddSd`ddTddVddddYdLdZid0dd[dd]d^d_d`daddbdddddfddgddiddjddkddlddndodpdqdrddsddddVdwddyd1ddddddddLddddd ddddddddddd d1ddddddddddddVd ddid0d1d2d1d4dd6d7d8dd:dddd?dYdAddCddEddGdLdHdIdJdTdKddMdd1dddddLddTdLdVddVddddZid0dTd[dd]dd_d`daddbdddddfddgddiddjddkddlddnddpddrddsddddwdwddyd1ddddddddLddddd ddddddddddd ddd,Z#ej<j?de#jCej<j?de#djCdZ$ej<j?dgddZ%d„Z&dÄZ'dĄZ(dńZ)ej<j?dgdǢdȄZ*ej<j?dgdɢe gdʢ˫d̄Z+ej<j?dddgdggddg.d҄Z,ej<j?dgdɢdӄZ-y)N)Path)ft2font)check_figures_equalcd}d}tjddgddgddgd d gD]\}}}}tj||}|j ||||t j |}|jt jk(sJ|j||fk(sJ|dk(s|dk(rt j|d k(rJt|dz||z t|dz||z z}t j|d |zk(rJy) N*di r) itertoolsproductrFT2Imagedraw_rect_fillednpasarraydtypeuint8shapesummin) widthheightx0y0x1y1imafilleds c/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/tests/test_ft2font.pytest_ft2image_draw_rect_filledr&s  E F#++QHq#hC1c(S -BB   eV , BB+ JJrNww"(("""ww65/))) 9c 66!9> !>"q&%(2-#b1ff2E2JKF66!9f , ,, -cVtjd}tj|}|j|k(sJ|j dk(sJ|j dk(sJ|jdk(sJ|jdk(sJ|jdk(sJ|jdk(sJ|jdk(sJ|jdk(sJtjjtjjztjj ztjj"ztjj$z}||j&vsJ|j(tj*j,k(sJ|j.sJ|j0dk(sJ|j2d k(sJ|j4d k(sJ|j6d k(sJ|j8d k(sJ|j:d k(sJ|j<dk(sJ|j>d k(sJ|j@dk(sJy)N DejaVu Sans DejaVuSansBookr raiQZmiP )LY )!fmfindfontrFT2Fontfnamepostscript_name family_name style_name num_facesnum_named_instances num_glyphsnum_fixed_sizes num_charmaps FaceFlagsSCALABLESFNT HORIZONTALKERNING GLYPH_NAMES face_flags style_flags StyleFlagsNORMALscalable units_per_EMunderline_positionunderline_thicknessascender descenderrmax_advance_widthmax_advance_heightbboxfilefontexpected_flagss r%test_ft2font_dejavu_attrsrZ"s ;;} %D ??4 D ::     < // /   } ,, , ??f $$ $ >>Q    # #q (( ( ??d "" "   1 $$ $    !! !''0073D3D3I3II''2235<5F5F5N5NO''334N T__ ,, ,   w1188 88 8 ===    $$ $  " "d ** *  # #r )) ) ==D  >>T !! ! ;;$    ! !T )) )  " "d ** * 991 11 1r'c tjd}tj|}|j|k(sJ|j dk(sJ|j dk(sJ|jdk(sJ|jdk(sJ|jdk(sJ|jdk(sJ|jdk(sJ|jdk(sJtjjtjjztjj ztjj"z}||j$vsJ|j&tj(j*k(sJ|j,sJ|j.dk(sJ|j0d k(sJ|j2d k(sJ|j4d k(sJ|j6d k(sJ|j8d k(sJ|j:dk(sJ|j<d k(sJ|j>dk(sJy)Ncmtt10Cmtt10Regularr rr r.iqi)#) r7r8rr9r:r;r<r=r>r?r@rArBrCrDrErFrHrIrJrKrLrMrNrOrPrQrRrrSrTrUrVs r%test_ft2font_cm_attrsrhDs ;;x D ??4 D ::     8 ++ +   x '' ' ??i '' ' >>Q    # #q (( ( ??c !! !   1 $$ $    !! !''0073D3D3I3II''2235<5F5F5R5RSN T__ ,, ,   w1188 88 8 ===    $$ $  " "d ** *  # #r )) ) ==D  >>T !! ! ;;$    ! !T )) )  " "d ** * 99/ // /r'c tjd}tj|}|j|k(sJ|j dk(sJ|j dk(sJ|jdk(sJ|jdk(sJ|jdk(sJ|jdk(sJ|jdk(sJ|jdk(sJtjjtjjztjj ztjj"z}||j$vsJ|j&tj(j*k(sJ|j,sJ|j.d k(sJ|j0d k(sJ|j2dk(sJ|j4d k(sJ|j6d k(sJ|j8d k(sJ|j:dk(sJ|j<d k(sJ|j>dk(sJy)NSTIXSizeTwoSym:boldSTIXSizeTwoSym-BoldSTIXSizeTwoSymBoldr rr`{/li j)r rq) r7r8rr9r:r;r<r=r>r?r@rArBrCrDrErFrHrIrJrKBOLDrMrNrOrPrQrRrrSrTrUrVs r%test_ft2font_stix_bold_attrsrwes ;;, -D ??4 D ::     #8 88 8   / // / ??f $$ $ >>Q    # #q (( ( ??b    1 $$ $    !! !''0073D3D3I3II''2235<5F5F5R5RSN T__ ,, ,   w1166 66 6 ===    $$ $  " "d ** *  # #r )) ) ==D  >>T !! ! ;;$    ! !T )) )  " "d ** * 99- -- -r'ctjtd5tjddddtjtd5tjt ddd|dz }|j dtjtd5|jd5}tj|ddddddtjtd5|jd5}tj|ddddddtjtd5|jd5}tj|ddddddtjd}tjtd 5tj|d dddtjtd 5tj|d dddtjtd 5tj|d dddtjtd 5tj|d gdddtjtd 5tj|d dddy#1swYxYw#1swYbxYw#1swYxYw#1swYxYw#1swYxYw#1swYxYw#1swYxYw#1swYxYw#1swY_xYw#1swY2xYw#1swYxYw#1swYxYw#1swYyxYw)Nz+to a font file or a binary-mode file objectmatchzinvalid-font.ttfzThis is not a valid font file.rtwtwbr)z"incompatible constructor argumentsg?z%hinting_factor must be greater than 0rr)_fallback_list)_kerning_factor) pytestraises TypeErrorrr9object write_textopenr7r8 ValueError)tmp_pathrWfds r%test_ft2font_invalid_argsrs y(U V y(U V"!" ( (DOO45 -- )V W ))D/ -- )V W ))D/ -- )V W ))D/ ;;} %D y(L M#c"# z)P Q!a ! y(L M3T23 y(L M2aS12 y(L M3c233?""##!!332233sKK,K->K K-?LK:'LL!$L:L!:L.4L;.M)M%M!KK K* %K--K7:L ?LLL L!!L+.L8;MMM!M*ctjd}tj|}|j dk(sJ|j dk(sJ|j dk(sJ|jd|j dk(sJ|j dk7sJ|j dk7sJ|j|j dk(sJ|j dk(sJ|j dk(sJy)Nr)rrrABabCDcdr) r7r8rr9get_num_glyphsget_width_heightget_bitmap_offsetset_textclear)rWrXs r%test_ft2font_clearrs ;;} %D ??4 D    A %% %  "f ,, ,  ! ! #v -- -MM*    A %% %  "f ,, ,  ! ! #v -- -JJL    A %% %  "f ,, ,  ! ! #v -- -r'ctjd}tj|dd}|j d|j }|j dd|j d|j td|Dk(sJ|j dd |j d|j td |Dk(sJy) Nr)r hinting_factorrrHc3NK|]}tjd|zdywr g?Nrapprox.0xs r% z(test_ft2font_set_size..+U1FMM!a%,F+U#% c3NK|]}tjd|zdywrrrs r%rz(test_ft2font_set_size..rr)r7r8rr9rrset_sizetuple)rWrXorigs r%test_ft2font_set_sizers ;;} %D ??41 EDMM*  "DMM"bMM*  "e+UPT+U&U UU UMM"cMM*  "e+UPT+U&U UU Ur'c 2d}tjd}tj|}|jdk(sJ|j |d|j }|jd|j }t|t|ksJ|jD]'\}}|||cxk(r|j|k(r$JJ|jd|j }||k(sJ|jd|j }t|t|ksJ|jD]'\}}|||cxk(r|j|k(r$JJ|jd|j }||k(sJdd d d d d dddddd }|jD]8\}} |j|| k(sJ|dk(rd}|j| |k(r8J|j |d|j } |jd|j }| |k(sJt| dksJtddD]} | | vs| |vr || | | k(rJgd} | D]\} }|| | |k(rJy)Nc>d}|D]}|dz}|t|z }|S)Nrr)ord)nameers r%encz"test_ft2font_charmaps..encs5  A !GA QKA r'r)r-unicrr rnr sii i iiiipi"i) non-existent-glyph-name plusminusRacute perthousand seveneighthstriagupuni01D3uni0417uni2A02u1D305u1F0A1rz.notdefarmnr ))i ))r)))i"r)r7r8rr9rBselect_charmap get_charmap set_charmaplenitemsget_char_indexget_name_indexget_glyph_namerange)rrWrXrafterchrglyph glyph_namesrindexroexamplesums r%test_ft2font_charmapsrs ;;} %D ??4 D    !! ! F $    DQ    E u:T "" "kkm> UCyE=T%8%8%======>Q    E 5==Q    E u:T "" "kkm> UCyE=T%8%8%======>Q    E 5==$% K#((*2 e""4(E111 , ,D""5)T111 2 F $    DQ    E 5== t9   1c]" D=ATM Aw$q'!!!" H"1Aw$q'!!!"r'zCopyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. DejaVu changes are in public domain r)r+z Version 2.35r*zDejaVu fonts teamzhttp://dejavu.sourceforge.netaFonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) Bitstream Vera Fonts Copyright ------------------------------ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. Arev Fonts Copyright ------------------------------ Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the modifications to the Bitstream Vera Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Tavmjong Bah" or the word "Arev". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Tavmjong Bah Arev" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the name of Tavmjong Bah shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from Tavmjong Bah. For further information, contact: tavmjong @ free . fr.z4http://dejavu.sourceforge.net/wiki/index.php/License) rr r rnr r-r z_Copyright (C) 1994, Basil K. Malyshev. All Rights Reserved.012BaKoMa Fonts Collection, Level-B.r\r^zFontMonger:cmtt10z 1.1/12-Nov-94r])rr r rnr r-raCopyright (c) 2001-2010 by the STI Pub Companies, consisting of the American Chemical Society, the American Institute of Physics, the American Mathematical Society, the American Physical Society, Elsevier, Inc., and The Institute of Electrical and Electronic Engineers, Inc. Portions copyright (c) 1998-2003 by MicroPress, Inc. Portions copyright (c) 1990 by Elsevier, Inc. All rights reserved.rlrmz$FontMaster:STIXSizeTwoSym-Bold:1.0.0rkz Version 1.0.0z\STIX Fonts(TM) is a trademark of The Institute of Electrical and Electronics Engineers, Inc.zbMicroPress Inc., with final additions and corrections provided by Coen Hoffman, Elsevier (retired)aArie de Ruiter, who in 1995 was Head of Information Technology Development at Elsevier Science, made a proposal to the STI Pub group, an informal group of publishers consisting of representatives from the American Chemical Society (ACS), American Institute of Physics (AIP), American Mathematical Society (AMS), American Physical Society (APS), Elsevier, and Institute of Electrical and Electronics Engineers (IEEE). De Ruiter encouraged the members to consider development of a series of Web fonts, which he proposed should be called the Scientific and Technical Information eXchange, or STIX, Fonts. All STI Pub member organizations enthusiastically endorsed this proposal, and the STI Pub group agreed to embark on what has become a twelve-year project. The goal of the project was to identify all alphabetic, symbolic, and other special characters used in any facet of scientific publishing and to create a set of Unicode-based fonts that would be distributed free to every scientist, student, and other interested party worldwide. The fonts would be consistent with the emerging Unicode standard, and would permit universal representation of every character. With the release of the STIX fonts, de Ruiter's vision has been realized.zhttp://www.stixfonts.orgzhttp://www.micropress-inc.comaAs a condition for receiving these fonts at no charge, each person downloading the fonts must agree to some simple license terms. The license is based on the SIL Open Font License . The SIL License is a free and open source license specifically designed for fonts and related software. The basic terms are that the recipient will not remove the copyright and trademark statements from the fonts and that, if the person decides to create a derivative work based on the STIX Fonts but incorporating some changes or enhancements, the derivative work ("Modified Version") will carry a different name. The copyright and trademark restrictions are part of the agreement between the STI Pub companies and the typeface designer. The "renaming" restriction results from the desire of the STI Pub companies to assure that the STIX Fonts will continue to function in a predictable fashion for all that use them. No copy of one or more of the individual Font typefaces that form the STIX Fonts(TM) set may be sold by itself, but other than this one restriction, licensees are free to sell the fonts either separately or as part of a package that combines other software or fonts with this font set.z*http://www.stixfonts.org/user_license.html)rr r rnr r-r rrrr)r)r\rjzfont_name, expected)idscZtj|}tj|}|j }|j D]W\}}|j ddd|f|jdk(sJ|j ddd|f|jdk(rWJ|ik(sJy)Nr rasciirni zutf-16be)r7r8rr9get_sfntrpopencode) font_nameexpectedrWrXsfntrvalues r%test_ft2font_get_sfntrs ;;y !D ??4 D ==?D~~'H exxAq$(ELL,AAAAxxAtT*+u||J/GGGG H 2::r'version)r r fontRevision)r iYcheckSumAdjustmenti[ magicNumberi<_flags unitsPerEmr.created)rl"modifiedxMinr3yMinr4xMaxr5yMaxr6macStyle lowestRecPPEMrfontDirectionHintindexToLocFormatr glyphDataFormatr,iThr+rr @iir )r numGlyphs maxPointsmaxComponentPointsmaxTwilightPoints maxContoursmaxComponentContoursmaxZones maxStoragemaxFunctionDefsmaxInstructionDefsmaxStackElementsmaxSizeOfInstructionsmaxComponentElementsmaxComponentDepth xAvgCharWidthi usWeightClassr usWidthClassr-fsTypeySubscriptXSizei3ySubscriptYSizeiySubscriptXOffsetySubscriptYOffsetiySuperscriptXSizeySuperscriptYSizeySuperscriptXOffsetySuperscriptYOffsetiyStrikeoutSizefyStrikeoutPositioni sFamilyClasspanoses  )lnNl}$i)`$ i sPfEd i) ulCharRange achVendID fsSelectionfsFirstCharIndexfsLastCharIndexr0r1r2iQiR) rascentdescentlineGapadvanceWidthMaxminLeftBearingminRightBearing xMaxExtentcaretSlopeRise caretSlopeRun caretOffsetmetricDataFormatnumOfLongHorMetrics)r rri~r/) format isFixedPitch italicAngleunderlinePositionunderlineThickness minMemType42 maxMemType42 minMemType1 maxMemType1)invalidheadmaxpzOS/2hheavheapostpcltiO!rnrdrerfrgrr_^r r i3iiqi+iBs  )rrrrsik&rarbrcirpr`liscmtt10s7) r fontNumberpitchxHeightstyle typeFamily capHeight symbolSettypeFacecharacterComplement strokeWeight widthType serifStylei}krro)rlQmrtrurq%iViii s )rnrrsSTIXi'rrrsiirheaderctj|}tj|}|j |t ||k(sJyN)r7r8rr9get_sfnt_table_expected_sfnt_tables)rrXrWrXs r%test_ft2font_get_sfnt_tabler]sD ;;y !D ??4 D   v &*? *J6*R RR Rr'z(left, right, unscaled, unfitted, default) )Ar^9r)r^Àr_r`r)r^Ár_r`r)r^Âr_r`r)r^Ãr_r`r)r^Är_r`r)Dr^iidi)T.i ii)XCikiyi)-Jric tjd}tj|dd}|j dd|j |j t||j t|tjj|k(sJ|j |j t||j t|tjj|k(sJ|j |j t||j t|tjj|k(sJtjtjd5tj }dddtjtjd5|j |j t||j t|t#|k(sJ dddtjtjd 5tj$}dddtjtjd5|j |j t||j t|t#|k(sJ dddtjtjd 5tj&}dddtjtjd5|j |j t||j t|t#|k(sJ dddy#1swYxYw#1swYxYw#1swYcxYw#1swYxYw#1swYxYw#1swYyxYw) Nr)r rrr zUse Kerning.UNSCALED insteadryzUse Kerning enum values insteadzUse Kerning.UNFITTED insteadzUse Kerning.DEFAULT instead)r7r8rr9r get_kerningrrKerningUNSCALEDUNFITTEDDEFAULTrwarnsmplMatplotlibDeprecationWarningKERNING_UNSCALEDintKERNING_UNFITTEDKERNING_DEFAULT)leftrightunscaledunfitteddefaultrWrXks r%test_ft2font_get_kerningrsG ;;} %D ??41 EDMM#s   D//D : //E ;#OO44 69A BB B   D//D : //E ;#OO44 69A BB B   D//D : //E ;#OO33 58? @@ @ c66: <%  $ $% c66= ?4 3 3CI > $ 3 3CJ ? #A(+34 444 c66: <%  $ $% c66= ?4 3 3CI > $ 3 3CJ ? #A(+34 444 c669 ;$  # #$ c66= ?3 3 3CI > $ 3 3CJ ? #A(+23 3333'%%44 %%44 $$33sKNAN(N5AOO?AON%(N25N?O OO#ctjd}tj|dd}|j d}t j j|t jd|jdk(sJ|jdk(sJ|jdk(sJ|jdk(sJ|j d}t j j|gd |jd k(sJ|jd k(sJ|jd k(sJ|jd k(sJy)Nr)r rrrr rz AADAT.XC-J) r)rnr)ir)i@r)i@r)i r)i r)i r)ir)ir)iirrV)rr) r7r8rr9rrtestingassert_array_equalemptyrr get_descentr)rWrXxyss r%test_ft2font_set_textrs/ ;;} %D ??41 ED -- CJJ!!#rxx'78  "f ,, ,    A %% %     "" "  ! ! #v -- - -- %CJJ!!  *+  "k 11 1    B && &     $$ $  ! ! #v -- -r'ctjd}tj|dd}|j t d|j |jt dfD]}|J|jdk(sJ|jdk(sJ|jdk(sJ|jdk(sJ|jdk(sJ|jdk(sJ|jd k(sJ|jd k(sJ|j d k(sJ|j"d k(rJ|j%d k(sJ|j'dk(sJ|j)dk(sJ|j+dk(sJy)Nr)r rrM@iiZ iri@)6ri>rr r)r7r8rr9 load_charr load_glyphrrr horiBearingX horiBearingY horiAdvancelinearHoriAdvance vertBearingX vertBearingY vertAdvancerUrrrr)rWrXrs r%test_ft2font_loadingrs ;;} %D ??41 ED..S*//$"5"5c#h"?@B /   {{c!!!||s"""!!Q&&&!!S(((  C'''&&&000!!T)))!!R'''  C'''zz.... /    A %% %  "f ,, ,     "" "  ! ! #v -- -r'c d}tj|Dcgc]+}|jddDcgc] }t|c}-c}}}|dz}t j d}t j|dd}|jd |jd |j}tjj||t j|dd}|jtd }t j|j d|j d}|j#|d d|d tjj||ycc}wcc}}w) N) 11 11 r 1 1 1 1 rr 1 11 1 r 1 1 rr 0rr)r rrrF) antialiased)rarrayreplaceryr7r8rr9rdraw_glyphs_to_bitmap get_imagerrrrrrdraw_glyph_to_bitmap) expected_strlinecrrWrXimagers r%test_ft2font_drawingrs- Lxx=I59c3/0AQ0H OH ;;} %D ??41 EDMM#51 NN EJJ!!%2 ??41 ED NN3s8 $E   X^^A.q0A BEeREuEJJ!!%2 1sE2 E-E2 -E2 ctjd}tj|dd}|j \}}|j dk(sJ|j dk(sJ|j td|j \}}tjgd}tjj||tj|j dtjjtjj }tjj"|d<tjj$|d <tjj||y) Nr)r rrrr~r)?"@)g@r)g@g@)g@r)!@r)r)`@r)r@)g @?)g0@r)?r)rr)rrr)rr)rr)r7r8rr9get_pathrrrrrrrfullmpathrLINETO code_typeMOVETO CLOSEPOLY)rWrXverticescodesexpected_verticesexpected_codess r%test_ft2font_get_pathr>s ;;} %D ??41 EDmmoOHe >>V ## # ;;%  NN3s8mmoOHe " JJ!!(,=>WW.44Q79J9J#(::#7#79N ))N1--N2JJ!!%8r'zfamily_name, file_name))WenQuanYi Zen Heizwqy-zenhei.ttc)Noto Sans CJK JPzNotoSansCJK.ttcz Noto Sans TCzNotoSansTC-Regular.otfctj|g}ttj|j|k7rt j d|d|ddtjd<tjd}|jd d d d |g|jd d d |gdD]'}|jtj|)y)NfamilyFont  ( ) is missingr` font.size)g@g?)figsize皙?g?"There are 几个汉字 in between!r)333333?)pngraw)r6)r7FontPropertiesrr8rrskippltrcParamsfiguretextsavefigioBytesIO)r< file_namefpfigfmts r%test_fallback_smokerZs  ;- 0B BKKO!!Y. eK=9+\BC "CLL **\ *CHHT4="K0 2HHT4= M #. BJJL -.r'))rz wqy-zenhei)r NotoSansCJKr)rpdfepssvg) extensionsctj|g}|ttj|jvrt j d|d|dgd}dtjd<d|ggd z}dg|gdgg}tt|||D]?\}\} } } |jd d d |zz | | |jd d d |zz | | Ay) Nrrrr)z There areu 几个汉字z in between!r`rr)rnrrg333333?) r7rrr8rrrrr enumeratezipr) fig_testfig_refr<rrr test_fonts ref_fontsjtxt test_fontref_fonts r%test_font_fallback_chineseros  ;- 0BR[[_-222 eK=9+\BC 7D "CLL +./!3J;--AI)2 j) ,*A% %CH  T3a<X > dC$q&L#i @ Ar' font_listz DejaVu SerifzDejaVu Sans Monoz two fontszone fontctj}|jddd||jj t d|DsJ|dj jdjdsJt |Dcgc] }||dj jdv"c}sJycc}w)Ng?uHello 🙃 World!rc3PK|]}t|jt ywrZ) isinstancemessage UserWarning)rwarns r%rz(test_fallback_missing..sIz$,, 4Is$&rz8Glyph 128579 (\N{UPSIDE-DOWN FACE}) missing from font(s)) rrrcanvasdrawallrargs startswith)recwarnrrrXs r%test_fallback_missingrs **,CHHR(H;JJOO II II I 1:   " "1 % 0 0 F HH H yIt **//22I JJ JIs%B=cVtj|g}ttj|j}||vrt j d|d|dd}tjtjjtjd|g}|j|}|jD]\\}}t|dkDr%t|jj|k(r7Jt|jjdk(r\Jy) Nrrrrrr)zDejaVuSans.ttf)r7rrr8rrrget_font fontManager_find_fonts_by_props _get_fontmaprrr:) r<rrfound_file_namerftfontmapcharrXs r%test__get_fontmapr s  ;- 0B2;;r?+00O' eK=9+\BC /D  ++   m[%A B  B ood#Gmmo= d t9s? #((O; ;; #((,<< << =r').rrpathlibrnumpyrr matplotlibrvrmatplotlib.testing.decoratorsrmatplotlib.font_manager font_managerr7matplotlib.pathpathrmatplotlib.pyplotpyplotrr&rZrhrwrrrr_expected_sfnt_namesmark parametrizerkeysrr\r]rrrrrrrrr r'r%rs   =$-$2D0B.B"3J . VO"h 3        +a D C  aqf 2        1   1   ) ) ;$ ' + & 9q9{wt.0D0J0J0L1668: :  v J  !*  :  R  $    )3O  E "4 *0 8>t    Q      q Cbr!"# $%($%!"   q T  S #1!  a  t  &7    %8    (;D  "1 '981G .  . 1F  <=A>  A$*M:./1):68K 8K==r'