rbpdf 1.19.7 → 1.19.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f909de66d7d9b1db4d2be634eff73c5e6bf7210a
4
- data.tar.gz: c68858c453b6aef789a7cefc01e60a779e965119
3
+ metadata.gz: 66699792092231cda5c7ad0b1cfdd9f446425ae4
4
+ data.tar.gz: e53cb1abb783881253c801aab591dcf84ad74442
5
5
  SHA512:
6
- metadata.gz: 38270382e703093ec80ec61e255c109573e3b0f2b26a4bd4ef2e85840c73eaa979ff9bfe0497815a616c6e95038da48625482524f4675a30bbef57a354fc278c
7
- data.tar.gz: 803a2ec4067e3ec8c2572f30c2cea8614be52cea9b760693ee545ca2da99d911318c2cce69e852f00a4aa965f8da2b121a4396d2d56c159ac1e7271acf5d4d7c
6
+ metadata.gz: 7a90e8b5bb735b8bff2f390537965013ba33b57c7a086749ed00383b1715437c6ee78b9833a783ee56c3f9f9d58c347a8193ea8f6f403eed6b847e8e2fc395c0
7
+ data.tar.gz: 46eb59da195f4f177b6ec7f3a33158543ae92d1e1f7e1d99e17d7c668e705ae8a93acaf174d4c3fb42b858267dfde6961dd30c7bd21afc25b2ae8866ef087dce
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ 1.19.8 2019-01-30
2
+ - Fixed a bug that escaping parentheses when <div style = "text-align: justify;"> is specified in write_html method.
3
+
1
4
  1.19.7 2019-01-20
2
5
  - Ruby 2.6 supported.
3
6
  - utf8Bidi() X6,X7 bug fixed.
@@ -12351,7 +12351,7 @@ public
12351
12351
  no = 0 # spaces without trim
12352
12352
  ns = 0 # spaces with trim
12353
12353
 
12354
- pmidtemp = pmid
12354
+ pmidtemp = pmid.dup
12355
12355
  # escape special characters
12356
12356
  pmidtemp.gsub!(/[\\][\(]/x, '\\#!#OP#!#')
12357
12357
  pmidtemp.gsub!(/[\\][\)]/x, '\\#!#CP#!#')
@@ -12527,7 +12527,7 @@ public
12527
12527
  if (@current_font['type'] == 'TrueTypeUnicode') or (@current_font['type'] == 'cidfont0')
12528
12528
  # multibyte characters
12529
12529
  spacew = spacewidthu
12530
- pmidtemp = pmid
12530
+ pmidtemp = pmid.dup
12531
12531
  # escape special characters
12532
12532
  pmidtemp.gsub!(/[\\][\(]/x, '\\#!#OP#!#')
12533
12533
  pmidtemp.gsub!(/[\\][\)]/x, '\\#!#CP#!#')
@@ -3,5 +3,5 @@
3
3
  # http://www.opensource.org/licenses/MIT
4
4
 
5
5
  module Rbpdf
6
- VERSION = "1.19.7"
6
+ VERSION = "1.19.8"
7
7
  end
@@ -403,6 +403,31 @@ class RbpdfHtmlTest < Test::Unit::TestCase
403
403
  assert_equal 1, count_text
404
404
  end
405
405
 
406
+ test "write_html Justify text test" do
407
+ pdf = MYPDF.new
408
+ pdf.set_font('times', 'BI', 20)
409
+ pdf.add_page()
410
+
411
+ text = 'hello Ruby (inside hello world) hello Ruby (inside hello world) hello Ruby (inside hello world)'
412
+ justify_text = 'hello Ruby \(inside hello world\) hello Ruby \(inside hello world\)'
413
+ htmlcontent = '<div style="text-align:justify;">' + text + '</div>'
414
+
415
+ pdf.write_html(htmlcontent, true, 0, true, 0)
416
+
417
+ page = pdf.get_page
418
+ assert_equal 1, page
419
+
420
+ content = []
421
+ contents = pdf.getPageBuffer(1)
422
+ contents.each_line {|line| content.push line.chomp if line.include? ' TJ ET' } # Text Line set
423
+
424
+ count_text = 0
425
+ content.each do |line|
426
+ count_text += 1 unless line.scan(justify_text).empty?
427
+ end
428
+ assert_equal 1, count_text, "'#{justify_text}' is not include in '#{content.inspect}'"
429
+ end
430
+
406
431
  test "write_html Non ASCII text test" do
407
432
  pdf = MYPDF.new
408
433
  pdf.add_page()
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbpdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.7
4
+ version: 1.19.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - NAITOH Jun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-20 00:00:00.000000000 Z
11
+ date: 2019-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities