From bb3b41498e80f1a4c86829b60096745e016fec02 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Thu, 13 Aug 2009 21:44:29 +0200 Subject: [PATCH] added test for "--flatten l/i chars disappearing" problem --- spec/edit_spec.py | 3 +-- spec/smalltext.pdf | Bin 0 -> 2746 bytes spec/smalltext.py | 26 ++++++++++++++++++++++++++ spec/smalltext.spec.rb | 15 +++++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 spec/smalltext.pdf create mode 100644 spec/smalltext.py create mode 100644 spec/smalltext.spec.rb diff --git a/spec/edit_spec.py b/spec/edit_spec.py index ba6448d..2ab4453 100755 --- a/spec/edit_spec.py +++ b/spec/edit_spec.py @@ -482,8 +482,7 @@ if __name__ == "__main__": parser.add_option("-t", "--test", dest="test", help="Test checks against swf", action="store_true") (options, args) = parser.parse_args() - if options.test: - TESTMODE = True + TESTMODE = options.test app = wx.PySimpleApp() model = Model.load(args[0]) diff --git a/spec/smalltext.pdf b/spec/smalltext.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d7c7eeb57233d84016bf0499e45de3687449f710 GIT binary patch literal 2746 zcmcguPm3c(6c-PJ)JZ&gss-cD;7+>!bai)R7)a6^HaKdSEV`1JLr+qZv}C$Ncg>pd zxQO5<5Y%tr*)QOA1$8f;mleTp;d|A8(vuMv95JM*s$acV@AqE4epRheIN0ZHkFpHi)uZ6>$lh2ul(>m{T4}-JC=0NIMVWYMbO_6 z9A)WrtPMpUkztw`pgmyJvjEV8f4NbxQR@R`lV)@`zlfIL)Y`OHS9`>$3iLMd>qfrBA*C9ptoq`7P@G+)|X0Ar99h$phG>+r@X_dl(J}m zslc^d5i9MIO6O&L#S{0aoAL-}Tv=mi&=sr1X(zyVg6Qi8bXpW7*t1Z3@A zKKKth=nu|q^NIuu!1t=bnb`BQ=Z0tAXq=S+Y=Su63KFT3#wH6GZ1$LGRT9;5a47Yj zK%hGC?H<1ZdvIkys`YLA75=w91O^lD#u^5#NRm_H+)ton$H|;>Ru#vxGFqTnk1Elk z2vsvECP_ER<7!TvFg`!mnNFrUpD?GLq-Lhi$;|;5K@D>GPm;CREeG5c^$y%s_4t1n zaJ6xEV=iAsQ%$%poyFB^p%Zf2xDT+7H{*|Ge^ch6>@TBvPNg7DH=pXnP@e~ITScn} zI-W1eDJtOFzF>ZFQ}lZ2db01qC$TSuqJoJ44qy6^3~1ql=t4Iym!XN4@wA)Fml`jU zvC$VF(EtoRD$OV%8>HnH=@C3E;A)H@9}E@6&C~}oFwH4GD&T@X)_HoFLAp@9!~u9; z&*BJaVorJ-3Ls<6$lyNB$e@uNTu(2-2waly#j|`uk;?Ju=BkHp;ksHs0^ia((gXdH z-9~<$LE19P1%Yx<{-~#vRP>zI7+fKCjV2W)gaU&2YhYY~_3Id89#GuE1cPV57Uptz zrEFnBK=8IPA5!Kz#ye0tw=osm@@_BWhcB0~=bM`-GdAu*Dwnic_dgtvzW^3r Bre6R6 literal 0 HcmV?d00001 diff --git a/spec/smalltext.py b/spec/smalltext.py new file mode 100644 index 0000000..a0ac9df --- /dev/null +++ b/spec/smalltext.py @@ -0,0 +1,26 @@ +from sys import * +from pdflib_py import * +p = PDF_new() +PDF_open_file(p, "smalltext.pdf") + +PDF_set_parameter(p, "usercoordinates", "true") + +PDF_set_info(p, "Creator", "smalltext.py") +PDF_begin_page(p, 612, 200) +font = PDF_load_font(p, "Helvetica", "host", "") + +PDF_setfont(p, font, 6.0) +PDF_set_text_pos(p, 40, 100);PDF_show(p, "|") +PDF_set_text_pos(p, 80, 100);PDF_show(p, "i") +PDF_set_text_pos(p, 120, 100);PDF_show(p, "l") +PDF_set_text_pos(p, 160, 100);PDF_show(p, "-") + +PDF_setfont(p, font, 9.0) +PDF_set_text_pos(p, 40, 50);PDF_show(p, "|") +PDF_set_text_pos(p, 80, 50);PDF_show(p, "i") +PDF_set_text_pos(p, 120, 50);PDF_show(p, "l") +PDF_set_text_pos(p, 160, 50);PDF_show(p, "-") + +PDF_end_page(p) +PDF_close(p) +PDF_delete(p); diff --git a/spec/smalltext.spec.rb b/spec/smalltext.spec.rb new file mode 100644 index 0000000..eb65646 --- /dev/null +++ b/spec/smalltext.spec.rb @@ -0,0 +1,15 @@ +require File.dirname(__FILE__) + '/spec_helper' + +describe "pdf conversion" do + convert_file "smalltext.pdf" do + area_at(37,93,44,103).should_not_be_plain_colored + area_at(77,94,86,104).should_not_be_plain_colored + area_at(117,94,123,104).should_not_be_plain_colored + area_at(157,94,165,103).should_not_be_plain_colored + area_at(37,139,45,155).should_not_be_plain_colored + area_at(76,139,85,154).should_not_be_plain_colored + area_at(116,142,125,152).should_not_be_plain_colored + area_at(155,145,167,151).should_not_be_plain_colored + area_at(27,110,180,115).should_be_plain_colored + end +end -- 1.7.10.4