This patch is derived from upstream commit 13d84993717cffd64a2e1d7e3e6edb185973d559, which fixes non-deterministic test failures on i686-linux and armhf-linux. From 7a5d215022903151971df85e1ce947af42803c5b Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Thu, 2 Nov 2017 11:11:38 +0000 Subject: [PATCH] Remove Adobe Helvetica screen font, update Pcf font tests using freely available font --- Tests/fonts/10x20-ISO8859-1.pcf | Bin 0 -> 25860 bytes Tests/fonts/LICENSE.txt | 7 +++++++ Tests/fonts/helvO18.pcf | Bin 78412 -> 0 bytes Tests/images/high_ascii_chars.png | Bin 1457 -> 1286 bytes Tests/images/test_draw_pbm_target.png | Bin 0 -> 259 bytes Tests/test_font_pcf.py | 28 +++++++++++++++------------- 6 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 Tests/fonts/10x20-ISO8859-1.pcf delete mode 100644 Tests/fonts/helvO18.pcf create mode 100644 Tests/images/test_draw_pbm_target.png diff -ur -a --new-file b/Tests/fonts/10x20-ISO8859-1.pcf a/Tests/fonts/10x20-ISO8859-1.pcf --- b/Tests/fonts/10x20-ISO8859-1.pcf 1969-12-31 19:00:00.000000000 -0500 +++ a/Tests/fonts/10x20-ISO8859-1.pcf 2017-12-25 11:47:00.328290016 -0500 @@ -0,0 +1,25 @@ +fcp d dDId,Q U@W $[dd ,2>EKM[bqr}KKd *7OT +g +FONTNAME_REGISTRYFOUNDRYMiscFAMILY_NAMEFixedWEIGHT_NAMEMediumSLANTRSETWIDTH_NAMENormalADD_STYLE_NAMEPIXEL_SIZEPOINT_SIZERESOLUTION_XRESOLUTION_YSPACINGCAVERAGE_WIDTHCHARSET_REGISTRYISO8859CHARSET_ENCODING1X_HEIGHTCAP_HEIGHTCOPYRIGHTPublic domain font. Share and enjoy._GBDFED_INFOEdited with gbdfed 1.3.FONT-Misc-Fixed-Medium-R-Normal--20-200-75-75-C-100-ISO8859-1WEIGHTRESOLUTIONQUAD_WIDTH + + + + + + +߀P@0 p`P@0 p  ` + +P + + @ 0 p `P@0 p`P@0 p`P@0 p`P@ 0 ! !p!""`"##P##$@$$%0%%& &p&''`'((P(()@))*0**+ +p+,,`,--P--.@../0//0 0p011`122P223@3340445 5p566`677P778@889099: :p:;;`;<0>>? ?p?@@`@AAPAAB@BBC0CCD DpDEE`""E`s@@@@@@@s ?? U@U@U@U@U@U@U@U@U@U@fff~fff|``x```  <f``f<00000>  33  fv~~nf fff<<88883333333 00~|Vs 333 ?666 ?mlll? m? 9mo; 63666<8lfccw<   0  03333   00 33aaaaa33 <l 3aa0``3aaaa33cc````nsa33a``nsaaaa3 003aaa33aaa33aaaa3!3 0`0  0  0 3aaa 3agommmof`1 33aaaaaaaa|fcccf~caaac~3a```````a3~caaaaaaaaac~`````~``````````~``````3a```gaaaa3aaaaaaaaaaaa cc6aaccff|ffccaa````````````aassmmmmaaaaaqqyymmggccaa3aaaaaaaaa3~caaaac~`````3aaaaaaamg3~caaaac~fccaa3a``0a3 aaaaaaaaaaa3aaaa333 aaaaammmmssaaaa33 33aaaa33  0``?00000000000?00 ?? 3a 1?aaa>`````nsaaaasn1````13aaaa33a``1~>cccc>`?aaa?`````nsaaaaaa < 111`````cflx|fca< [mmmmmmnsaaaaaa3aaaa3nsaaaasn````3aaaa3o9000000?a`?a?~aaaaaa3aa33 aaammm3a3 3aaaaaaa3a3? 0? x  x  x9mg 3a``a3 ~|Vs݀ccc݀@a3? ? 3c0<f313333a^RPR^a3!?aa> 6ll6 ?3a^R^TVa3 33  6 0>6 6 cccccw}```?}}}=  68<6ccc6Hl6  6lH ` !r %O ` !r  Ap0 r %O 0aaa30 3aaaaaaa 3aaaaaaa 3 3aaaaaaa?& 3aaaaaaa33 33aaaaaaa33 3aaaaaaa66fffffffg3a```````a3 60 ````~```` ````~```` 3````~````33````~```` ? ? ? ? 3? ?33? ?~caaaaaaaac~?&aqyymmggcaa 3aaaaaaa3 3aaaaaaa3 33aaaaaaa3?&3aaaaaaa3333aaaaaaaa3Ac66cA3cceeeiiiq3>@ aaaaaaaaa3 aaaaaaaaa3 3aaaaaaaaa333aaaaaaaaaa3 aa33 000?11111?000113v6311136 ?a?aaa> ?a?aaa> 3?a?aaa>?&?a?aaa>33?a?aaa>33?a?aaa>;M <ll71````1 60 3a``1 3a``1 33a``1333a``10 <  <  3< 33< Dl88lF3aaa3?&nsaaaaaa0 3aaaa3 3aaaa3 33aaaa3?&3aaaa3333aaaa3  3eeii3>@ aaaaaa3 aaaaaa3 3aaaaaa333aaaaaa3 aaaaaa3a3000000>31113>000033aaaaaa3a3߁~y~zzqvz}z{wx}}z}wvvu||zsy~zzv{z| +  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ "*2:AKS[dmv +&/:AIS_it}   !#%')+-/1=GT`kqsuwy{}&4?FQX_iu +$.47@GNZdkr~ +$+5;>GNUakrydefaultcharuni25C6shadeuni2409uni240Cuni240Duni240Adegreeplusminusuni2424uni240BSF040000SF030000SF010000SF020000SF050000uni23BAuni23BBSF100000uni23BCuni23BDSF080000SF090000SF070000SF060000SF110000lessequalgreaterequalpinotequalsterlingperiodcenteredspaceexclamquotedblnumbersigndollarpercentampersandquotesingleparenleftparenrightasteriskpluscommahyphenperiodslashzeroonetwothreefourfivesixseveneightninecolonsemicolonlessequalgreaterquestionatABCDEFGHIJKLMNOPQRSTUVWXYZbracketleftbackslashbracketrightasciicircumunderscoregraveabcdefghijklmnopqrstuvwxyzbraceleftbarbracerightasciitildespaceexclamdowncentsterlingcurrencyyenbrokenbarsectiondieresiscopyrightordfeminineguillemotleftlogicalnothyphenregisteredmacrondegreeplusminustwosuperiorthreesuperioracutemuparagraphperiodcenteredcedillaonesuperiorordmasculineguillemotrightonequarteronehalfthreequartersquestiondownAgraveAacuteAcircumflexAtildeAdieresisAringAECcedillaEgraveEacuteEcircumflexEdieresisIgraveIacuteIcircumflexIdieresisEthNtildeOgraveOacuteOcircumflexOtildeOdieresismultiplyOslashUgraveUacuteUcircumflexUdieresisYacuteThorngermandblsagraveaacuteacircumflexatildeadieresisaringaeccedillaegraveeacuteecircumflexedieresisigraveiacuteicircumflexidieresisethntildeograveoacuteocircumflexotildeodieresisdivideoslashugraveuacuteucircumflexudieresisyacutethornydieresis + + + + + + + \ No newline at end of file diff -ur -a --new-file b/Tests/fonts/helvO18.pcf a/Tests/fonts/helvO18.pcf --- b/Tests/fonts/helvO18.pcf 2017-12-25 11:48:11.632643595 -0500 +++ a/Tests/fonts/helvO18.pcf 1969-12-31 19:00:00.000000000 -0500 @@ -1,90 +0,0 @@ -fcpdL(< F@T $!xd2$07=?MTcdozKKb - $262FPbg -g -FOUNDRYAdobeFAMILY_NAMEHelveticaWEIGHT_NAMEMediumSLANTOSETWIDTH_NAMENormalADD_STYLE_NAMEPIXEL_SIZEPOINT_SIZERESOLUTION_XRESOLUTION_YSPACINGPAVERAGE_WIDTHCHARSET_REGISTRYISO10646CHARSET_ENCODING1CAP_HEIGHTX_HEIGHTFACE_NAMEHelvetica ObliqueCOPYRIGHTCopyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.NOTICEHelvetica is a trademark of Linotype-Hell AG and/or its subsidiaries. _DEC_DEVICE_FONTNAMESPS=Helvetica-ObliqueRELATIVE_SETWIDTHRELATIVE_WEIGHTFULL_NAMEHelvetica ObliqueFONT-Adobe-Helvetica-Medium-O-Normal--18-180-75-75-P-98-ISO10646-1WEIGHTRESOLUTIONQUAD_WIDTHvvx|~{~u~|}u{}~|tx{{u|{{}~~vvvuuvtuuuuvuuvuu|||||||vvvvvv|}}y||~~48p$Xh8LT\0d4h(D|0hH(` @ | $ -\ - - - < t < \ d p 0 X 8@h(\4\4@D|8|$<PXTL0t@L\(`,p X$hT0 h !T>>> ?h??? @T@@@@DA|AABLBBB CTCCCD`DDD$EXEEE FDF|FFF0GxGGGHHHpHHHI8IIIJHJJJKHKKKLLLLL MtMM NPNxNNOLOOOO0PhPPP@QQQRdRRR8SSSTTTTTUdUUU,V|VVWXWWWXXXXX,YlYYY0ZlZZZ[<[t[[[[0\X\\\\](]8]H]T]`]p]t]]]]]]]]]]]]^<^H^`^h^^^(_l___8`x``a`aaa,bpbbb v<`0 n>  > 88`pp|p8p Ɲc333g7``08   < x       8 x  c> |~  8~0  |cc33aac3c3333 fv6  `0   ````000008llf cn {cxcpx ??    ```0000  l<>ffc =3c c c 8   x```l|<> ??    cs3c c css{k  p8|f   x0 `0 0 000 8````00``0 s & >8008Ffx0  8x  ~<0 #bD"@@ 1" <fx,6.l66l??0 #BD"DC!!" 333``0020 8d`00 0 0 0  |6<_ON,$$$   8ll666ll6  c 30   c30  8d ` 00#184`00``p8>``08``08 ``08 @``08 ``08``08 ``08< |   ` ``   0 8l ll    ?? 8< l l l f8 8000 8 8000 8 8000  @8 8000  8 8000 p8lg?8 <631c3 ` | |` |00 |`0fv6   ~ls0`cn`cn`cn`cncnpcn?11 | 0`c`c`cc 0  3 66 x0````00 8l<{0`   `   `      `0fl<8 00008   fl<8 ``08cn ```08pcn``08ppcn0< x`0c0< x0xc< x00c0< xx0c0     ffF3x   ?? x c pc 00c `8 8c00 x0c08 x`  `8 x 8 x`` 8 x``@  `` 0 <f  >>L> L> >  "6  000 00    000       6 3ffff3330`c>0x```0000  |~ ``@  l<>ffcl<>ffc0  0     00       ff <  8< l l l f`08< l l l f``@ 00 08< l l l f`0p 8    8< l l l f`x88 8000  `8 8000 p `8 8000 l8 x<ca?1? `0l| ``@ l|0 f<l|`0>~`0<>`>~0x<>>~0``l8<>006>~`<>0  00~~  x00 ?? 0  ?? >>` |`    |    |p      |p   ` |`    |`8 8   0`aac3c3333`c c css{k0xfv6 `   x0 fv6  `0 `0`0  `0 00`0  `0 ``0  <   ??  ``0000   a`c`c`c03060606 8 800?? 8 x000  < < ,|    0 `||  8 |>000 ```0000  0``08x0cn3  3 `8 8000 x00 |`   00 |   `00 |`   000 |`   0`00 |0`    ``08cn``0800cn> ``08?118 x 08 x` 0 |~ f< l<>ffc8 8000 pp08 8000 pp0x0```0000 8 x` 0`8< l l l f0```08`0pcn0  ``08?11g?8 <631c3 8l<{>~00 <>0   ?? 0 f< ``0800cn 0``l8c006 8 8000  @8 8000 `8 8000 008 8000 00|fv6    x0 ~c```0000~~    ``````0000800 ??    `p008l f c c ``0xlxlfc`000 33     L>l666$  0 0 0  |6``08pcn8$$``    {   00 {    {|`< | `0 |      x     ``x00     x|     `px0``l8     `x0x0` 0`c` `0c 0xc<f |2cL> 0``l8pc006 px ?? 8 x    `` 00`` ll  C`p 0``l8 p Dl8```0000 L>``000 L>`0ll 0 66  |~ `0 l<>ffc |~ `` l<>ffc |~  l<>ffc|   >  >  >000   3000  3 8l| 8 ``>~00<>>~00<>```0>~```0<>``>~```<>00>~0000<>000   ?? 0   ?? 0 >00~~  0  300~~  3 |   ll ||2   L> |0x   <f`` |``    |   0dcc33|2cs3cc33 cs3 `aac3c33330`c c css{kaac3c3333`c c css{k``aac3c3333c c css{kaac3c3333``c c css{kaac3c3333c c css{k00 ``  p8|f   p8|f00fv6 ``   x0 ` `0 0x`0  `0 00`0  `0 `0 > |66 ?? pc c css{kp   x0 ``08``cn ``08`0`cn` ``080``cn   ``080d`cn0``08``0xcn ```08`0pcn0` ```080`pcn ```080dpcn ```08``pcn 00c` 0dc` `0`c0`` 0``c` 0d`c` 000xc  8 8000 ``8 8000 `0``8 8000 0``  8 8000 0d``8 8000 ``0x 8 x000 `8 x000 0`@8 x000 `8 x000 `` |00    < < ,|   ` < < ,|0`      < < ,|    < < ,|00   00 0fv6 0`   x0 fv6    x0  0dfv6 `   x0 ????6 66$66$ 6000 ```000 008 <&2`04Lq    ``0   20 8d`00=3c s s 8< l aa??33800    333<3 33asom666 |~ ``08 ``0  <ff<` 0`0 88`pp` 8 <f` 6<x|8>38l f<px px cccpxccc" -  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  -    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  -    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~c,,yMMHM,,,,,,,,,,HHH,c -,A - -cc,M,,,,,,A,,,,M,NNHM,,,,,Mr,HMMHMMM,MMm,BBBc - - - - -H -c,,,,,,y,,,,,,,,,,,Hc,,,,,,,,,,,,,, -, -, -, -,,,,,&,,,,, -, -, -,MMMccc,,,,,,ccc, - -,,c,,H, -,,,,,,,,,y -, -, -, -, -,,,y -cc,,, -, -, -, -,,,,,M,MMMMMMMMMMMMMMMMM,,,,,,,,,,,,,,,c -,,,,,,,,,,AAAAAA,,,, -, -, -, -,,,MMMMcccc,,,,,ccc,,,,,,,,,,,,,,,, -, -, -, -, -, -, -, -, -,,,,,,M,dMM,,MMMM,,^MMMMMANcHHHHHHHHHHHH '.6@LVajou| - *4AMX^`bdfhjlnprtvxz|~!,3>ELVbpvy -!$-4;GQX_kuy"(+4;BNX_fr| !)07COZelsz*7COTY`gow~ $).5<CJWdkr~ -"+4;BO\cjot{   + 6 = D L T \ c k s {  - - - -# -+ -3 -; -C -K -S -[ -c -k -s -{ - - - - - - - - - - - - - - - - -   ' 3 ? L Y f s {    # + 3 ; C K S [ e o z -    ' / 7 ? G O W _ g o w  '/7?GOW_gow'/7?GOW_gow'/7?GOW_gow%,3=GOW_gow'/7?GOW_gow'/7?GOW_gow %-5=EMU]epw~ %4=IUcks{ $,4<DGJchar0spaceexclamquotedblnumbersigndollarpercentampersandquotesingleparenleftparenrightasteriskpluscommahyphenperiodslashzeroonetwothreefourfivesixseveneightninecolonsemicolonlessequalgreaterquestionatABCDEFGHIJKLMNOPQRSTUVWXYZbracketleftbackslashbracketrightasciicircumunderscoregraveabcdefghijklmnopqrstuvwxyzbraceleftbarbracerightasciitildespaceexclamdowncentsterlingcurrencyyenbrokenbarsectiondieresiscopyrightordfeminineguillemotleftlogicalnothyphenregisteredmacrondegreeplusminustwosuperiorthreesuperioracutemuparagraphperiodcenteredcedillaonesuperiorordmasculineguillemotrightonequarteronehalfthreequartersquestiondownAgraveAacuteAcircumflexAtildeAdieresisAringAECcedillaEgraveEacuteEcircumflexEdieresisIgraveIacuteIcircumflexIdieresisEthNtildeOgraveOacuteOcircumflexOtildeOdieresismultiplyOslashUgraveUacuteUcircumflexUdieresisYacuteThorngermandblsagraveaacuteacircumflexatildeadieresisaringaeccedillaegraveeacuteecircumflexedieresisigraveiacuteicircumflexidieresisethntildeograveoacuteocircumflexotildeodieresisdivideoslashugraveuacuteucircumflexudieresisyacutethornydieresisAmacronamacronAbreveabreveAogonekaogonekCacutecacuteCcircumflexccircumflexCdotaccentcdotaccentCcaronccaronDcarondcaronDcroatdcroatEmacronemacronEbreveebreveEdotaccentedotaccentEogonekeogonekEcaronecaronGcircumflexgcircumflexGbrevegbreveGdotaccentgdotaccentGcommaaccentgcommaaccentHcircumflexhcircumflexHbarhbarItildeitildeImacronimacronIbreveibreveIogonekiogonekIdotaccentdotlessiIJijJcircumflexjcircumflexKcommaaccentkcommaaccentkgreenlandicLacutelacuteLcommaaccentlcommaaccentLcaronlcaronLdotldotLslashlslashNacutenacuteNcommaaccentncommaaccentNcaronncaronnapostropheEngengOmacronomacronObreveobreveOhungarumlautohungarumlautOEoeRacuteracuteRcommaaccentrcommaaccentRcaronrcaronSacutesacuteScircumflexscircumflexScedillascedillaScaronscaronTcommaaccenttcommaaccentTcarontcaronTbartbarUtildeutildeUmacronumacronUbreveubreveUringuringUhungarumlautuhungarumlautUogonekuogonekWcircumflexwcircumflexYcircumflexycircumflexYdieresisZacutezacuteZdotaccentzdotaccentZcaronzcaronuni0186uni0189uni018Eflorinuni0197uni019Auni019Duni019FOhornohornUhornuhornuni01B5uni01B6uni01BBuni01BCuni01C0uni01C2uni01C3uni01CDuni01CEuni01CFuni01D0uni01D1uni01D2uni01D3uni01D4uni01D5uni01D6uni01D7uni01D8uni01D9uni01DAuni01DBuni01DCuni01DDuni01DEuni01DFuni01E0uni01E1uni01E2uni01E3uni01E4uni01E5Gcarongcaronuni01E8uni01E9uni01EAuni01EBuni01ECuni01EDuni01F0uni01F4uni01F5uni01F8uni01F9AringacutearingacuteAEacuteaeacuteOslashacuteoslashacuteScommaaccentscommaaccentTcommaaccenttcommaaccentuni021Euni021Funi0226uni0227uni0228uni0229uni022Auni022Buni022Cuni022Duni022Euni022Funi0230uni0231uni0232uni0233uni0250uni0259uni025Funi0265uni0275uni0279uni0287uni0289uni028Cuni028Duni028Euni029Euni02BBafii57929afii64937circumflexcaronuni02C8macronuni02CAuni02CBuni02CDuni02CEuni02CFbrevedotaccentringogonektildehungarumlautuni02EEuni037Etonosdieresistonosanoteleiamuuni1E00uni1E01uni1E02uni1E03uni1E04uni1E05uni1E06uni1E07uni1E08uni1E09uni1E0Auni1E0Buni1E0Cuni1E0Duni1E0Euni1E0Funi1E10uni1E11uni1E12uni1E13uni1E14uni1E15uni1E16uni1E17uni1E18uni1E19uni1E1Auni1E1Buni1E1Cuni1E1Duni1E1Euni1E1Funi1E20uni1E21uni1E22uni1E23uni1E24uni1E25uni1E26uni1E27uni1E28uni1E29uni1E2Auni1E2Buni1E2Cuni1E2Duni1E2Euni1E2Funi1E30uni1E31uni1E32uni1E33uni1E34uni1E35uni1E36uni1E37uni1E38uni1E39uni1E3Auni1E3Buni1E3Cuni1E3Duni1E3Euni1E3Funi1E40uni1E41uni1E42uni1E43uni1E44uni1E45uni1E46uni1E47uni1E48uni1E49uni1E4Auni1E4Buni1E4Cuni1E4Duni1E4Euni1E4Funi1E50uni1E51uni1E52uni1E53uni1E54uni1E55uni1E56uni1E57uni1E58uni1E59uni1E5Auni1E5Buni1E5Cuni1E5Duni1E5Euni1E5Funi1E60uni1E61uni1E62uni1E63uni1E64uni1E65uni1E66uni1E67uni1E68uni1E69uni1E6Auni1E6Buni1E6Cuni1E6Duni1E6Euni1E6Funi1E70uni1E71uni1E72uni1E73uni1E74uni1E75uni1E76uni1E77uni1E78uni1E79uni1E7Auni1E7Buni1E7Cuni1E7Duni1E7Euni1E7FWgravewgraveWacutewacuteWdieresiswdieresisuni1E86uni1E87uni1E88uni1E89uni1E8Auni1E8Buni1E8Cuni1E8Duni1E8Euni1E8Funi1E90uni1E91uni1E92uni1E93uni1E94uni1E95uni1E96uni1E97uni1E98uni1E99uni1EA0uni1EA1uni1EA4uni1EA5uni1EA6uni1EA7uni1EAAuni1EABuni1EACuni1EADuni1EAEuni1EAFuni1EB0uni1EB1uni1EB4uni1EB5uni1EB6uni1EB7uni1EB8uni1EB9uni1EBCuni1EBDuni1EBEuni1EBFuni1EC0uni1EC1uni1EC4uni1EC5uni1EC6uni1EC7uni1ECAuni1ECBuni1ECCuni1ECDuni1ED0uni1ED1uni1ED2uni1ED3uni1ED6uni1ED7uni1ED8uni1ED9uni1EDAuni1EDBuni1EDCuni1EDDuni1EE0uni1EE1uni1EE2uni1EE3uni1EE4uni1EE5uni1EE8uni1EE9uni1EEAuni1EEBuni1EEEuni1EEFuni1EF0uni1EF1Ygraveygraveuni1EF4uni1EF5uni1EF8uni1EF9uni2000uni2001uni2002uni2003uni2004uni2005uni2006uni2007uni2008uni2009uni200Auni200Buni2010uni2011figuredashendashemdashafii00208quoteleftquoterightquotesinglbasequotereversedquotedblleftquotedblrightquotedblbaseuni201Fdaggerdaggerdblbulletellipsisperthousandguilsinglleftguilsinglrightfractiononeinferiortwoinferiorthreeinferioruni20A5uni20A6uni20A9Eurouni20ADuni2103uni2109trademarkuni212Auni212Buni2132minusfractionperiodcentereduni2236uni2259uni225Anotequalequivalenceuni2262lessequalgreaterequaluni226Euni226Funi2270uni2271fifl \ No newline at end of file diff -ur -a --new-file b/Tests/fonts/LICENSE.txt a/Tests/fonts/LICENSE.txt --- b/Tests/fonts/LICENSE.txt 2017-12-25 11:48:11.632643595 -0500 +++ a/Tests/fonts/LICENSE.txt 2017-12-25 11:47:00.360290175 -0500 @@ -4,3 +4,10 @@ (from https://github.com/googlei18n/noto-fonts) All Noto fonts are published under the SIL Open Font License (OFL) v1.1 (http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL), which allows you to copy, modify, and redistribute them if you need to. + + +10x20-ISO8859-1.pcf + +(from https://packages.ubuntu.com/xenial/xfonts-base) + +"Public domain font. Share and enjoy." --- b/Tests/images/high_ascii_chars.png 2017-12-25 11:48:11.632643595 -0500 +++ a/Tests/images/high_ascii_chars.png 2017-12-25 11:47:00.452290631 -0500 @@ -1,7 +1,7 @@ PNG  - IHDRv|xIDATx[(3=h29]"@2nLYN($ mnc"!2\a> dQ%%/7݄ -^UpM՞D$\s/k=Z Inlp_${Vax"pwxg*>3l! Iq WdTI PoeTs[.]ĄVq3okżA4!Y[q8Gl>Ud# ŝQJ}Ns`UV~^RrtEwŝi@{!9+?Q6c -^/m Y1}˞4oW{b D rw~,mٍVaE4iEӐ[$lēswOu(|!u3Ra @%V(D́ y`Cklժʒ`.8,^'̭yE34Y.*}\ԇg` wWJ{}-x[/`$ӂqCDCd?L038Bi6nWX  S:83HI|;e>ۂ%̓ ?.9xM5 )A y\.֦H03s)5\}mn7x pޑY"q0P:^Y_Xxߏ\VXՅlc˔glD_YYΦ-2?gfgpT*zV<ҧv;}Ldb@B䞤%<K94"ct=cb J)l;[`(90Cq}Z,Ǣ9CMt&#noCuZmÈlu~}kp;O*ӦbVIg17 M6VDN"*~uұFLEsc(_؎ХQ|\(t) M`_bZ$ծFN̒F =*EDazn].i Bjg*tԾU!o -a6]8Ńt{tZF2 l͞vƛT]B@+hڸL -gjr3Xb|$eǹU]@;/`:% rfO GŐ+\z1re?XJl{}Ήn8WΠrT,~"{:uv vݰI̦o!f@Dv'noiˑϿ{9mGp~# =yPϧ'r ~`_/ԪQoG=u ) A8ZZ%KED4.N%jD."x!hfs)Zc!y2 z҆ AnՏd){9ٿR@k% drId>^0A"%5 l~&U%ߐXV 7|ZGwǴ_֨"ORصEER,Д5oY,Z?JQQ=>1w B>ZwReq!k9> Fݒ`Q )\[炔ͥۙ}sطDyg>nz5? Ώf2VE܊-@_.9iȸ.ũ.qAtP XUۂe;8/jHťz5߿qOH. gtT?vt +`0jC-(T"jre:Vkُ6+j b7wէ+gGUBSF{\s'O~@m ySÕ;CY?:ڴD]t.U,N +vug +d3cWwex&O)ݟOdw0gǦ/bYѽdw0e7kbf"lwxo7^/vaƋ}EJ"|UIENDB` \ No newline at end of file --- b/Tests/images/test_draw_pbm_target.png 1969-12-31 19:00:00.000000000 -0500 +++ a/Tests/images/test_draw_pbm_target.png 2017-12-25 11:47:00.592291325 -0500 @@ -0,0 +1,3 @@ +PNG + + IHDR̙IDATx ˽0M@<(Fe5' A\U=;o,Јpy\w+ :26JvrL ]NaTg>rO~ LDN7Rc׫%'|8&  SVqFW &Z8n6FX{:I9ÞrIENDB` \ No newline at end of file diff --git a/Tests/test_font_pcf.py b/Tests/test_font_pcf.py index 90e204303..87a3ea067 100644 --- a/Tests/test_font_pcf.py +++ b/Tests/test_font_pcf.py @@ -5,7 +5,7 @@ codecs = dir(Image.core) -fontname = "Tests/fonts/helvO18.pcf" +fontname = "Tests/fonts/10x20-ISO8859-1.pcf" message = "hello, world" @@ -20,7 +20,8 @@ def save_font(self): with open(fontname, "rb") as test_file: font = PcfFontFile.PcfFontFile(test_file) self.assertIsInstance(font, FontFile.FontFile) - self.assertEqual(len([_f for _f in font.glyph if _f]), 192) + #check the number of characters in the font + self.assertEqual(len([_f for _f in font.glyph if _f]), 223) tempname = self.tempfile("temp.pil") self.addCleanup(self.delete_tempfile, tempname[:-4]+'.pbm') @@ -34,25 +35,26 @@ def test_invalid_file(self): with open("Tests/images/flower.jpg", "rb") as fp: self.assertRaises(SyntaxError, PcfFontFile.PcfFontFile, fp) - def xtest_draw(self): - + def test_draw(self): tempname = self.save_font() font = ImageFont.load(tempname) - image = Image.new("L", font.getsize(message), "white") - draw = ImageDraw.Draw(image) - draw.text((0, 0), message, font=font) - # assert_signature(image, "7216c60f988dea43a46bb68321e3c1b03ec62aee") + im = Image.new("L", (130,30), "white") + draw = ImageDraw.Draw(im) + draw.text((0, 0), message, 'black', font=font) + with Image.open('Tests/images/test_draw_pbm_target.png') as target: + self.assert_image_similar(im, target, 0) + def _test_high_characters(self, message): tempname = self.save_font() font = ImageFont.load(tempname) - image = Image.new("L", font.getsize(message), "white") - draw = ImageDraw.Draw(image) - draw.text((0, 0), message, font=font) + im = Image.new("L", (750,30) , "white") + draw = ImageDraw.Draw(im) + draw.text((0, 0), message, "black", font=font) + with Image.open('Tests/images/high_ascii_chars.png') as target: + self.assert_image_similar(im, target, 0) - compare = Image.open('Tests/images/high_ascii_chars.png') - self.assert_image_equal(image, compare) def test_high_characters(self): message = "".join(chr(i+1) for i in range(140, 232))