diff --git a/pdfminer/layout.py b/pdfminer/layout.py index e0f2feb..b70073a 100644 --- a/pdfminer/layout.py +++ b/pdfminer/layout.py @@ -255,7 +255,7 @@ class LTChar(LTItem, LTText): return max(self.width, self.height) def is_vertical(self): - return self.font.is_vertical + return self.font.is_vertical() def is_upright(self): return self.upright diff --git a/samples/Makefile b/samples/Makefile index c8e657d..e2c98fa 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -10,6 +10,7 @@ HTMLS=$(HTMLS_FREE) $(HTMLS_NONFREE) HTMLS_FREE= \ simple1.html \ simple2.html \ + simple3.html \ jo.html HTMLS_NONFREE= \ nonfree/dmca.html \ @@ -23,6 +24,7 @@ TEXTS=$(TEXTS_FREE) $(TEXTS_NONFREE) TEXTS_FREE= \ simple1.txt \ simple2.txt \ + simple3.txt \ jo.txt TEXTS_NONFREE= \ nonfree/dmca.txt \ @@ -36,6 +38,7 @@ XMLS=$(XMLS_FREE) $(XMLS_NONFREE) XMLS_FREE= \ simple1.xml \ simple2.xml \ + simple3.xml \ jo.xml XMLS_NONFREE= \ nonfree/dmca.xml \ diff --git a/samples/jo.xml.ref b/samples/jo.xml.ref index b999d50..4be6531 100644 --- a/samples/jo.xml.ref +++ b/samples/jo.xml.ref @@ -1,1187 +1,1187 @@ - - -  -  - + + +  +  + - - -  + + +  - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - -  -  + +  +  - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - -  - - - - - - - - - - - - - + +  + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - -  -  + +  +  - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - -  - - - - - - - - - - - - - - - - - - - - + +  + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - -  -  -  - - - - - - - - - - - - + +  +  +  + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - -  -  + +  +  - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - -  -  + +  +  - - - - - - - - - -廿 - -  -  - - - - + + + + + + + + + +廿 + +  +  + + + + - - - - - + + + + + - + - - - + + + diff --git a/samples/nonfree/f1040nr.xml.ref b/samples/nonfree/f1040nr.xml.ref index f319714..f90a83a 100644 --- a/samples/nonfree/f1040nr.xml.ref +++ b/samples/nonfree/f1040nr.xml.ref @@ -611,9 +611,9 @@ 2 0 -0 -7 - +0 +7 + @@ -1756,24 +1756,24 @@ - -C -a -u -t -i -o -n -: - -D -o - + +C +a +u +t +i +o +n +: + +D +o + -n -o -t - +n +o +t + c h e @@ -1866,15 +1866,15 @@ - -D -o - + +D +o + -n -o -t - +n +o +t + c h e @@ -5547,28 +5547,28 @@ -P -l -e -a -s -e - -p -r -i -n -t - -o -r - -t -y -p -e -. - +P +l +e +a +s +e + +p +r +i +n +t + +o +r + +t +y +p +e +. + @@ -5599,76 +5599,76 @@ -A -t -t -a -c -h - -F -o -r -m -s - -W -- -2 - -h -e -r -e -. -A -l -s -o - -a -t -t -a -c -h - -F -o -r -m -( -s -) - -1 -0 -9 -9 -- -R - -i -f - -t -a -x - -w -a -s - -w -i -t -h -h -e -l -d -. - +A +t +t +a +c +h + +F +o +r +m +s + +W +- +2 + +h +e +r +e +. +A +l +s +o + +a +t +t +a +c +h + +F +o +r +m +( +s +) + +1 +0 +9 +9 +- +R + +i +f + +t +a +x + +w +a +s + +w +i +t +h +h +e +l +d +. + @@ -5711,60 +5711,60 @@ -I -n -c -o -m -e - -E -f -f -e -c -t -i -v -e -l -y - -C -o -n -n -e -c -t -e -d - -W -i -t -h - -U -. -S -. - -T -r -a -d -e -/ -B -u -s -i -n -e -s -s - +I +n +c +o +m +e + +E +f +f +e +c +t +i +v +e +l +y + +C +o +n +n +e +c +t +e +d + +W +i +t +h + +U +. +S +. + +T +r +a +d +e +/ +B +u +s +i +n +e +s +s + @@ -5775,70 +5775,70 @@ -E -n -c -l -o -s -e -, - -b -u -t - -d -o - -n -o -t - -a -t -t -a -c -h -, - -a -n -y - -p -a -y -m -e -n -t -. - +E +n +c +l +o +s +e +, + +b +u +t + +d +o + +n +o +t + +a +t +t +a +c +h +, + +a +n +y + +p +a +y +m +e +n +t +. + -A -d -j -u -s -t -e -d - -G -r -o -s -s - -I -n -c -o -m -e - +A +d +j +u +s +t +e +d + +G +r +o +s +s + +I +n +c +o +m +e + @@ -5971,19 +5971,21 @@ + + + - - - + + @@ -5991,8 +5993,6 @@ - - diff --git a/samples/nonfree/i1040nr.xml.ref b/samples/nonfree/i1040nr.xml.ref index 74982b1..6369191 100644 --- a/samples/nonfree/i1040nr.xml.ref +++ b/samples/nonfree/i1040nr.xml.ref @@ -1607,37 +1607,37 @@ -D -i -s -t -r -i -c -t - -o -f - -C -o -l -u -m -b -i -a - -f -i -r -s -t -- -t -i -m -e +D +i +s +t +r +i +c +t + +o +f + +C +o +l +u +m +b +i +a + +f +i +r +s +t +- +t +i +m +e @@ -2101,7 +2101,7 @@ - + a r e @@ -2136,11 +2136,11 @@ y 1 -/ +/ 2 - -o -f + +o +f diff --git a/samples/nonfree/kampo.xml.ref b/samples/nonfree/kampo.xml.ref index 20a097f..2fdeeba 100644 --- a/samples/nonfree/kampo.xml.ref +++ b/samples/nonfree/kampo.xml.ref @@ -123,7 +123,7 @@ - + @@ -158,11 +158,11 @@ - + - + @@ -178,7 +178,7 @@ - + @@ -190,7 +190,7 @@ - + @@ -200,20 +200,20 @@ - + - + - + @@ -226,7 +226,7 @@ - + @@ -238,14 +238,14 @@ - + - + @@ -255,10 +255,10 @@ - + - + @@ -267,7 +267,7 @@ - + @@ -275,7 +275,7 @@ - + @@ -304,7 +304,7 @@ - + @@ -317,9 +317,9 @@ - - - + + + @@ -330,7 +330,7 @@ - + @@ -344,7 +344,7 @@ - + @@ -354,7 +354,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -374,7 +374,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -403,10 +403,10 @@ - + - + @@ -437,7 +437,7 @@ - + @@ -447,11 +447,11 @@ - + - + @@ -460,7 +460,7 @@ - + @@ -475,7 +475,7 @@ - + @@ -489,11 +489,11 @@ - + - + @@ -506,27 +506,27 @@ - + - + - + - + - + - + - + @@ -536,12 +536,12 @@ - + - + @@ -551,9 +551,9 @@ - + - + @@ -567,16 +567,16 @@ - + - + - + @@ -597,17 +597,17 @@ - + - - - + + + - + - + @@ -621,23 +621,23 @@ - + - - + + - - + + - + @@ -650,13 +650,13 @@ - + - - + + @@ -668,14 +668,14 @@ - - + + - + - + @@ -683,13 +683,13 @@ - - + + - + @@ -703,15 +703,15 @@ - + - + - + @@ -719,7 +719,7 @@ - + @@ -739,8 +739,8 @@ - - + + @@ -753,19 +753,19 @@ - + - + - + @@ -773,7 +773,7 @@ - + @@ -785,8 +785,8 @@ - - + + @@ -796,7 +796,7 @@ - + @@ -814,11 +814,11 @@ - + - + @@ -833,16 +833,16 @@ - + - - + + - + @@ -856,18 +856,18 @@ - + - + - + @@ -879,13 +879,13 @@ - + - + - + @@ -902,21 +902,21 @@ - + - - + + - + - + - + @@ -933,18 +933,18 @@ - + - - + + - + @@ -959,27 +959,27 @@ - + - - - + + + - - + + - + @@ -992,11 +992,11 @@ - + - + @@ -1004,7 +1004,7 @@ - + @@ -1020,7 +1020,7 @@ - + @@ -1028,10 +1028,10 @@ - - + + - + @@ -1045,22 +1045,22 @@ - - - + + + - - + + - + @@ -1074,11 +1074,11 @@ - + - + @@ -1086,7 +1086,7 @@ - + @@ -1126,15 +1126,15 @@ - - + + - + @@ -1176,12 +1176,12 @@ - - + + - + @@ -1202,13 +1202,13 @@ - - - + + + - + @@ -1222,10 +1222,10 @@ - + - + @@ -1245,7 +1245,7 @@ - + @@ -1257,7 +1257,7 @@ - + @@ -1267,26 +1267,26 @@ - - + + - + - + - + - + - + @@ -1296,57 +1296,57 @@ - + - + - + - + - - + + - + - + - + - - + + - + - - + + - + - + @@ -1357,7 +1357,7 @@ - + @@ -1377,7 +1377,7 @@ - + @@ -1385,13 +1385,13 @@ - + - + @@ -1405,7 +1405,7 @@ - + @@ -1432,7 +1432,7 @@ - + @@ -1455,7 +1455,7 @@ - + @@ -1479,7 +1479,7 @@ - + @@ -1501,7 +1501,7 @@ - + @@ -1518,13 +1518,13 @@ - + - - + + @@ -1534,7 +1534,7 @@ - + @@ -1566,7 +1566,7 @@ - + @@ -1645,7 +1645,7 @@ - + @@ -1657,7 +1657,7 @@ - + @@ -1668,11 +1668,11 @@ - + - + @@ -1688,7 +1688,7 @@ - + @@ -1698,9 +1698,9 @@ - + - + @@ -1710,16 +1710,16 @@ - + - + - + @@ -1727,7 +1727,7 @@ - + @@ -1737,9 +1737,9 @@ - + - + @@ -1750,22 +1750,22 @@ - + - + - + - + @@ -1776,9 +1776,9 @@ - + - + @@ -1789,27 +1789,27 @@ - + - - - + + + - + - + - + @@ -1840,31 +1840,31 @@ - + - + - + - + - + - + - + @@ -1880,12 +1880,12 @@ - + - - + + @@ -1899,11 +1899,11 @@ - + - + @@ -1932,7 +1932,7 @@ - + @@ -1944,7 +1944,7 @@ - + @@ -1977,7 +1977,7 @@ - + @@ -1989,7 +1989,7 @@ - + @@ -2010,8 +2010,8 @@ - - + + @@ -2026,16 +2026,16 @@ - + - + - + @@ -2047,8 +2047,8 @@ - - + + @@ -2058,7 +2058,7 @@ - + @@ -2070,7 +2070,7 @@ - + @@ -2096,8 +2096,8 @@ - - + + @@ -2118,7 +2118,7 @@ - + @@ -2130,7 +2130,7 @@ - + @@ -2156,8 +2156,8 @@ - - + + @@ -2173,7 +2173,7 @@ - + @@ -2185,7 +2185,7 @@ - + @@ -2206,8 +2206,8 @@ - - + + @@ -2233,7 +2233,7 @@ - + @@ -2246,7 +2246,7 @@ - + @@ -2272,8 +2272,8 @@ - - + + @@ -2295,7 +2295,7 @@ - + @@ -2308,7 +2308,7 @@ - + @@ -2329,8 +2329,8 @@ - - + + @@ -2352,7 +2352,7 @@ - + @@ -2365,7 +2365,7 @@ - + @@ -2391,8 +2391,8 @@ - - + + @@ -2408,7 +2408,7 @@ - + @@ -2421,7 +2421,7 @@ - + @@ -2442,8 +2442,8 @@ - - + + @@ -2455,7 +2455,7 @@ - + @@ -2468,7 +2468,7 @@ - + @@ -2489,8 +2489,8 @@ - - + + @@ -2531,7 +2531,7 @@ - + @@ -2541,7 +2541,7 @@ - + @@ -2557,7 +2557,7 @@ - + @@ -2579,7 +2579,7 @@ - + @@ -2588,11 +2588,11 @@ - + - + @@ -2602,19 +2602,19 @@ - + - + - + - + @@ -2622,16 +2622,16 @@ - + - + - + @@ -2640,15 +2640,15 @@ - + - + - + @@ -2656,16 +2656,16 @@ - + - + - + @@ -2681,7 +2681,7 @@ - + @@ -2699,12 +2699,12 @@ - + - - + + @@ -2727,11 +2727,11 @@ - + - + @@ -2761,7 +2761,7 @@ - + @@ -2773,7 +2773,7 @@ - + @@ -2865,7 +2865,7 @@ - + @@ -2882,54 +2882,54 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -2939,19 +2939,19 @@ - + - + - + - + - + @@ -2962,30 +2962,30 @@ - + - + - + - + - + - + - + @@ -2996,30 +2996,30 @@ - + - + - + - - + + - + - + @@ -3030,26 +3030,26 @@ - + - + - + - + - + - + @@ -3060,30 +3060,30 @@ - + - + - + - + - + - + - + @@ -3094,30 +3094,30 @@ - + - + - + - - + + - + - + @@ -3128,26 +3128,26 @@ - + - + - + - + - + - + @@ -3158,11 +3158,11 @@ - + - + @@ -3180,7 +3180,7 @@ - + @@ -3191,7 +3191,7 @@ - + @@ -3208,57 +3208,57 @@ - - - - - - + + + + + + - - - + + + - - - - - + + + + + - - - - + + + + - + - - - - - - - + + + + + + + - - - - - + + + + + - + - + - + diff --git a/samples/simple3.html.ref b/samples/simple3.html.ref new file mode 100644 index 0000000..9e72577 --- /dev/null +++ b/samples/simple3.html.ref @@ -0,0 +1,38 @@ + + + + + + +H +e +l +l +o +H +e +l +l +o + + + + + + + + + + +W +o +r +l +d +W +o +r +l +d +
Page: 1
+ diff --git a/samples/simple3.pdf b/samples/simple3.pdf new file mode 100644 index 0000000..8c4f648 --- /dev/null +++ b/samples/simple3.pdf @@ -0,0 +1,87 @@ +%PDF-1.4 +1 0 obj +<< + /Type /Catalog + /Outlines 2 0 R + /Pages 3 0 R +>> +endobj +2 0 obj +<< + /Type /Outlines + /Count 0 +>> +endobj +3 0 obj +<< + /Type /Pages + /Kids [ 4 0 R ] + /Count 1 +>> +endobj +4 0 obj +<< + /Type /Page + /Parent 3 0 R + /MediaBox [ 0 0 612 792 ] + /Contents 5 0 R + /Resources << + /ProcSet 6 0 R + /Font << /F1 7 0 R /F2 8 0 R >> + >> +>> +endobj +5 0 obj +<< /Length 86 >> +stream +BT +/F1 48 Tf +0 700 Td 0 Tw 0 Tc +%1 0 1 1 -500 0 cm +(Hello) Tj 24 Ts (Hello) Tj 0 Ts +/F2 48 Tf +($"$$$&$\($*) Tj 24 Ts +($"$$$&$\($*) Tj 0 Ts +/F1 24 Tf +(World) Tj 24 Ts (World) Tj 0 Ts +ET +endstream +endobj +6 0 obj +[ /PDF /Text ] +endobj +7 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /MacRomanEncoding +>> +endobj +8 0 obj +<< + /Type /Font + /Subtype /Type0 + /Name /F2 + /BaseFont /Ryumin-Light-V + /Encoding /V + /DescendantFonts [ + << /Type /Font + /Subtype /CIDFontType0 + /CIDSystemInfo << + /Registry (Adobe) + /Ordering (Japan1) + /Supplement 1 + >> + >> + ] +>> +endobj + +trailer +<< + /Size 8 + /Root 1 0 R +>> +%%EOF diff --git a/samples/simple3.txt.ref b/samples/simple3.txt.ref new file mode 100644 index 0000000..970e27c --- /dev/null +++ b/samples/simple3.txt.ref @@ -0,0 +1,15 @@ +HelloHello +あ +い +う +え +お +あ +い +う +え +お +World +World + + \ No newline at end of file diff --git a/samples/simple3.xml.ref b/samples/simple3.xml.ref new file mode 100644 index 0000000..2ea488d --- /dev/null +++ b/samples/simple3.xml.ref @@ -0,0 +1,92 @@ + + + + + +H +e +l +l +o +H +e +l +l +o + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +W +o +r +l +d + + + + +W +o +r +l +d + + + + + + + + +