udrs 0.1.4 → 0.1.5

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: 2208a37caa9a03f24e0267951dec69de7a3d76ed
4
- data.tar.gz: e551ad03d1ec54006215c008d81bb75e54ad12f7
3
+ metadata.gz: dfb80ccd266e332027ba564d3d77e12e2f516240
4
+ data.tar.gz: eb97860256eea803d8fad23e1bfcadc07e871165
5
5
  SHA512:
6
- metadata.gz: b00c97b6fbd1e135ac26090fc1617168bd7241d55c06bf666d7273801bf46d80d98ec62a1eba9ed1bc9314798ef6061978fd3d8e6f8af456f668f45d092f17f3
7
- data.tar.gz: f0ab7a675e488536985b2982601a9824267257c3a712c97124496752301887278643944e54629f1c716f2d64f42d413c00b799250ed68301f0ce6c8b554ffca4
6
+ metadata.gz: 2af7832aa53f8f464e8032912bf1f69aa1196f98fa917e43a07526c8233b942efec4e475b0fdcd0fd426c705217283c5d79cc61f747ae412cc91156eb15b026e
7
+ data.tar.gz: 968de9f95db11f4d96f5ab3eb00ad5c65d9fed1ccc42895337dbf9294e543fb5bc0374d4c6ef24af1051eb480b14d80be8cf5b2bd2b30813fcedc0c07b61924d
@@ -22,14 +22,75 @@ module UDRS
22
22
  GS = 29.chr
23
23
 
24
24
  CHARACTER_MAP = {
25
- '' => "\xD5",
25
+ 'Ç' => "\x80",
26
+ 'ü' => "\x81",
27
+ 'é' => "\x82",
28
+ 'â' => "\x83",
29
+ 'ä' => "\x84",
30
+ 'à' => "\x85",
31
+ 'å' => "\x86",
32
+ 'ç' => "\x87",
33
+ 'ê' => "\x88",
34
+ 'ë' => "\x89",
35
+ 'è' => "\x8A",
36
+ 'ï' => "\x8B",
37
+ 'î' => "\x8C",
38
+ 'ì' => "\x8D",
39
+ 'Ä' => "\x8E",
40
+ 'Å' => "\x8F",
41
+ 'É' => "\x90",
42
+ 'æ' => "\x91",
43
+ 'Æ' => "\x92",
44
+ 'ô' => "\x93",
45
+ 'ö' => "\x94",
46
+ 'ò' => "\x95",
47
+ 'û' => "\x96",
48
+ 'ù' => "\x97",
49
+ 'ÿ' => "\x98",
50
+ 'Ö' => "\x99",
51
+ 'Ü' => "\x9A",
52
+ 'ø' => "\x9B",
26
53
  '£' => "\x9C",
27
- '¢' => "\xBD",
54
+ 'Ø' => "\x9D",
55
+ 'á' => "\xA0",
56
+ 'í' => "\xA1",
57
+ 'ó' => "\xA2",
58
+ 'ú' => "\xA3",
59
+ 'ñ' => "\xA4",
60
+ 'Ñ' => "\xA5",
61
+ 'ª' => "\xA6",
62
+ 'º' => "\xA7",
63
+ '¿' => "\xA8",
64
+ '®' => "\xA9",
28
65
  '«' => "\xAE",
29
66
  '»' => "\xAF",
30
67
  '→' => "\xAF",
68
+ 'Á' => "\xB5",
69
+ 'Â' => "\xB6",
70
+ 'À' => "\xB7",
31
71
  '©' => "\xB8",
32
- '®' => "\xA9",
72
+ '¢' => "\xBD",
73
+ 'ã' => "\xC6",
74
+ 'Ã' => "\xC7",
75
+ 'Ê' => "\xD2",
76
+ 'Ë' => "\xD3",
77
+ 'È' => "\xD4",
78
+ '€' => "\xD5",
79
+ 'Í' => "\xD6",
80
+ 'Î' => "\xD7",
81
+ 'Ï' => "\xD8",
82
+ 'Ì' => "\xDE",
83
+ 'Ó' => "\xE0",
84
+ 'ß' => "\xE1",
85
+ 'Ô' => "\xE2",
86
+ 'Ò' => "\xE3",
87
+ 'õ' => "\xE4",
88
+ 'Õ' => "\xE5",
89
+ 'Ú' => "\xE9",
90
+ 'Û' => "\xEA",
91
+ 'Ù' => "\xEB",
92
+ 'ý' => "\xEC",
93
+ 'Ý' => "\xED",
33
94
  }
34
95
 
35
96
  CODE_NUM = 48 # The code num for PDF417
@@ -89,6 +150,7 @@ module UDRS
89
150
  when 2
90
151
  add_spacer
91
152
  add_line(header.text, size: :large, bold: true)
153
+ add_spacer
92
154
 
93
155
  when 3
94
156
  add_line(header.text, size: :medium, bold: true)
@@ -24,17 +24,27 @@ module UDRS
24
24
  # Make all the blocks have the same amount of lines
25
25
  max_length = parts.map(&:size).max
26
26
  column_widths.zip(parts).each do |width, lines|
27
+ next if width == 0
27
28
  lines << (' ' * width) while lines.size < max_length
28
29
  end
29
30
 
30
31
  # Add lines
31
32
  parts.transpose.each do |line_parts|
33
+ missing = @line_width
34
+
32
35
  cells.zip(line_parts).each_with_index do |(cell, part), i|
33
- @buffer << ' ' if i > 0
36
+ if i > 0
37
+ @buffer << ' '
38
+ missing -= 1
39
+ end
40
+
34
41
  font(text_to_options(cell)) do
35
42
  @buffer << part
43
+ missing -= part.size
36
44
  end
37
45
  end
46
+
47
+ @buffer << ' ' * missing
38
48
  end
39
49
  end
40
50
 
@@ -33,10 +33,10 @@ module UDRS
33
33
  SIZE_MAP = {
34
34
  tiny: 9,
35
35
  small: 11,
36
- normal: 12,
37
- medium: 14,
38
- large: 16,
39
- huge: 18,
36
+ normal: 11,
37
+ medium: 13,
38
+ large: 15,
39
+ huge: 17,
40
40
  }
41
41
 
42
42
  def render_page_end(page_end)
@@ -1,3 +1,3 @@
1
1
  module Udrs
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: udrs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michon van Dooren
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-23 00:00:00.000000000 Z
11
+ date: 2016-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attribute_predicates