rbpdf 1.19.6 → 1.19.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb07b943fb93bd28c583e7d1725cb594fd38e37e
4
- data.tar.gz: bc4e241e6d61bf6ff850080c598fe468a0c524a7
3
+ metadata.gz: f909de66d7d9b1db4d2be634eff73c5e6bf7210a
4
+ data.tar.gz: c68858c453b6aef789a7cefc01e60a779e965119
5
5
  SHA512:
6
- metadata.gz: 01bf0690ab57b3248123090f7832826d60247d6361e276187a9efa98855a95733a869a48edd3d85f3b938f78c4ca424f7a830c6c203146830a350e2ee4bf8b9d
7
- data.tar.gz: 65cc6adaff4ee5271c0f9d006e4dc600d93766c0d807fb90fd6120399ed73316258aee785bff8f963bee85a920705cb4414ef21fbe964785ea6543399e78995f
6
+ metadata.gz: 38270382e703093ec80ec61e255c109573e3b0f2b26a4bd4ef2e85840c73eaa979ff9bfe0497815a616c6e95038da48625482524f4675a30bbef57a354fc278c
7
+ data.tar.gz: 803a2ec4067e3ec8c2572f30c2cea8614be52cea9b760693ee545ca2da99d911318c2cce69e852f00a4aa965f8da2b121a4396d2d56c159ac1e7271acf5d4d7c
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 1.19.7 2019-01-20
2
+ - Ruby 2.6 supported.
3
+ - utf8Bidi() X6,X7 bug fixed.
4
+
1
5
  1.19.6 2018-10-06
2
6
  - The problem of the line feed position of Ln() function has been fixed.
3
7
  - Fixed a problem of line feed position occurring in the following <pre> tag of HTML in the following cases.
data/Gemfile CHANGED
@@ -7,4 +7,5 @@ source 'https://rubygems.org'
7
7
  # Specify your gem's dependencies in rbpdf.gemspec
8
8
  gemspec
9
9
 
10
- gem "actionpack", "~> 5.2.0"
10
+ gem "actionpack"
11
+
@@ -9639,10 +9639,10 @@ public
9639
9639
 
9640
9640
  # X1. Begin by setting the current embedding level to the paragraph embedding level. Set the directional override status to neutral. Process each character iteratively, applying rules X2 through X9. Only embedding levels from 0 to 61 are valid in this phase.
9641
9641
  # In the resolution of levels in rules I1 and I2, the maximum embedding level of 62 can be reached.
9642
- reg_KRP = /^(@@k_rle|@@k_lre|@@k_rlo|@@k_lro|@@k_pdf)$/
9643
- reg_KR = /^(@@k_rle|@@k_lre|@@k_rlo|@@k_lro)$/
9644
9642
  numchars.times do |i|
9645
- if ta[i] !~ reg_KRP
9643
+ case ta[i]
9644
+ when @@k_rle, @@k_lre, @@k_rlo, @@k_lro, @@k_pdf
9645
+ else
9646
9646
  # X6. For all types besides RLE, LRE, RLO, LRO, and PDF:
9647
9647
  # a. Set the level of the current character to the current embedding level.
9648
9648
  # b. Whenever the directional override status is not neutral, reset the current character type to the directional override status.
@@ -9710,7 +9710,8 @@ public
9710
9710
  # X7. With each PDF, determine the matching embedding or override code. If there was a valid matching code, restore (pop) the last remembered (pushed) embedding level and directional override.
9711
9711
  if remember.length
9712
9712
  last = remember.length - 1
9713
- if remember[last][:num] =~ reg_KR
9713
+ case remember[last][:num]
9714
+ when @@k_rle, @@k_lre, @@k_rlo, @@k_lro
9714
9715
  match = remember.pop
9715
9716
  cel = match[:cel]
9716
9717
  dos = match[:dos]
@@ -1,7 +1,7 @@
1
- # Copyright (c) 2011-2018 NAITOH Jun
1
+ # Copyright (c) 2011-2019 NAITOH Jun
2
2
  # Released under the MIT license
3
3
  # http://www.opensource.org/licenses/MIT
4
4
 
5
5
  module Rbpdf
6
- VERSION = "1.19.6"
6
+ VERSION = "1.19.7"
7
7
  end
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
39
39
  spec.add_runtime_dependency "rbpdf-font", "~> 1.19.0"
40
40
  spec.required_ruby_version = '>= 1.8.7'
41
41
 
42
- spec.add_development_dependency "bundler", "~> 1.6"
42
+ spec.add_development_dependency "bundler"
43
43
  if RUBY_VERSION <'1.9.3' # Ruby 1.8.7 or 1.9.2
44
44
  spec.add_development_dependency "rake", "<= 10.5"
45
45
  else
@@ -7,6 +7,9 @@
7
7
  require 'test_helper'
8
8
 
9
9
  class RbpdfTest < Test::Unit::TestCase
10
+ require 'unicode_data.rb'
11
+ include Unicode_data
12
+
10
13
  class MYPDF < RBPDF
11
14
  def UTF8StringToArray(str)
12
15
  super
@@ -98,6 +101,7 @@ class RbpdfTest < Test::Unit::TestCase
98
101
 
99
102
  ary_ucs4 = pdf.utf8Bidi(pdf.UTF8StringToArray(ascii_str))
100
103
  assert_equal [0x61, 0x62, 0x63], ary_ucs4
104
+
101
105
  ary_ucs4 = pdf.utf8Bidi(pdf.UTF8StringToArray(ascii_str), ascii_str, 'R')
102
106
  assert_equal [0x61, 0x62, 0x63], ary_ucs4
103
107
 
@@ -131,11 +135,17 @@ class RbpdfTest < Test::Unit::TestCase
131
135
  current_font = pdf.get_current_font
132
136
  assert_equal 256 + 5, current_font['subsetchars'].compact.length
133
137
 
134
- ary_str = pdf.utf8Bidi(pdf.UTF8StringToArray(ascii_str + utf8_str_2), ascii_str + utf8_str_2, 'R')
138
+ ary_str = pdf.utf8Bidi(pdf.UTF8StringToArray(ascii_str + utf8_str_2), ascii_str + utf8_str_2, 'R') # LTR -> RTL
135
139
  assert_equal [0x5ea, 0x5d9, 0x5e8, 0x5d1, 0x5e2, 0x61, 0x62, 0x63], ary_str
136
140
  current_font = pdf.get_current_font
137
141
  assert_equal 256 + 5, current_font['subsetchars'].compact.length
138
142
 
143
+ # Left-to-right embedding (LRE) : 202A
144
+ ary_str = pdf.utf8Bidi([@@k_lre] + pdf.UTF8StringToArray(ascii_str + utf8_str_2), ascii_str + utf8_str_2, 'R') # LTR -> RTL -> LTR
145
+ assert_equal [0x61, 0x62, 0x63, 0x5ea, 0x5d9, 0x5e8, 0x5d1, 0x5e2], ary_str
146
+ current_font = pdf.get_current_font
147
+ assert_equal 256 + 5, current_font['subsetchars'].compact.length
148
+
139
149
  ary_str = pdf.utf8Bidi(pdf.UTF8StringToArray(utf8_str_2 + ascii_str), utf8_str_2 + ascii_str, 'L')
140
150
  assert_equal [0x5ea, 0x5d9, 0x5e8, 0x5d1, 0x5e2, 0x61, 0x62, 0x63], ary_str
141
151
  ary_str = pdf.utf8Bidi(pdf.UTF8StringToArray(utf8_str_2 + ascii_str)) # RTL
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.6
4
+ version: 1.19.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - NAITOH Jun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-05 00:00:00.000000000 Z
11
+ date: 2019-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.6'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.6'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  version: '0'
170
170
  requirements: []
171
171
  rubyforge_project:
172
- rubygems_version: 2.6.10
172
+ rubygems_version: 2.2.2
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: RBPDF via TCPDF.
@@ -213,3 +213,4 @@ test_files:
213
213
  - test/rbpdf_viewerpreferences_test.rb
214
214
  - test/rbpdf_write_test.rb
215
215
  - test/test_helper.rb
216
+ has_rdoc: