ruby-zint 1.1.0 → 1.2.0

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.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/ext/ruby-zint/extconf.rb +2 -2
  4. data/lib/zint/aus_post.rb +1 -0
  5. data/lib/zint/aus_redirect.rb +1 -0
  6. data/lib/zint/aus_reply.rb +1 -0
  7. data/lib/zint/aus_route.rb +1 -0
  8. data/lib/zint/azrune.rb +1 -0
  9. data/lib/zint/aztec.rb +1 -0
  10. data/lib/zint/barcode.rb +85 -39
  11. data/lib/zint/{bind.rb → bc_412.rb} +3 -2
  12. data/lib/zint/c25iata.rb +1 -0
  13. data/lib/zint/c25ind.rb +1 -0
  14. data/lib/zint/c25inter.rb +1 -0
  15. data/lib/zint/c25logic.rb +1 -0
  16. data/lib/zint/c25matrix.rb +1 -0
  17. data/lib/zint/c25standard.rb +1 -0
  18. data/lib/zint/{dotty_mode.rb → cep_net.rb} +3 -2
  19. data/lib/zint/channel.rb +1 -0
  20. data/lib/zint/codabar.rb +1 -0
  21. data/lib/zint/codablock_f.rb +1 -0
  22. data/lib/zint/code11.rb +1 -0
  23. data/lib/zint/code128.rb +1 -0
  24. data/lib/zint/{noascii.rb → code128ab.rb} +3 -2
  25. data/lib/zint/code128b.rb +2 -4
  26. data/lib/zint/code16k.rb +1 -0
  27. data/lib/zint/code32.rb +1 -0
  28. data/lib/zint/code39.rb +1 -0
  29. data/lib/zint/code49.rb +1 -0
  30. data/lib/zint/code93.rb +1 -0
  31. data/lib/zint/code_one.rb +1 -0
  32. data/lib/zint/constants/capability_flags.rb +14 -11
  33. data/lib/zint/constants/input_data_types.rb +8 -7
  34. data/lib/zint/constants/output_options.rb +14 -11
  35. data/lib/zint/constants/symbologies.rb +13 -6
  36. data/lib/zint/constants/warn_levels.rb +1 -1
  37. data/lib/zint/daft.rb +1 -0
  38. data/lib/zint/data_matrix.rb +1 -0
  39. data/lib/zint/dbarexp.rb +1 -0
  40. data/lib/zint/dbarexpstk.rb +1 -0
  41. data/lib/zint/dbarltd.rb +1 -0
  42. data/lib/zint/dbaromn.rb +1 -0
  43. data/lib/zint/dbaromnstk.rb +1 -0
  44. data/lib/zint/dbarstk.rb +1 -0
  45. data/lib/zint/dependencies.rb +2 -2
  46. data/lib/zint/dot_code.rb +1 -0
  47. data/lib/zint/dpd.rb +1 -0
  48. data/lib/zint/dpident.rb +1 -0
  49. data/lib/zint/dpleit.rb +1 -0
  50. data/lib/zint/ean128.rb +1 -0
  51. data/lib/zint/ean14.rb +1 -0
  52. data/lib/zint/eanx.rb +1 -0
  53. data/lib/zint/eanxchk.rb +1 -0
  54. data/lib/zint/excode39.rb +1 -0
  55. data/lib/zint/fim.rb +1 -0
  56. data/lib/zint/flat.rb +1 -0
  57. data/lib/zint/grid_matrix.rb +1 -0
  58. data/lib/zint/gs1_128.rb +1 -0
  59. data/lib/zint/hanxin.rb +1 -0
  60. data/lib/zint/hibc128.rb +1 -0
  61. data/lib/zint/hibc39.rb +1 -0
  62. data/lib/zint/hibcaztec.rb +1 -0
  63. data/lib/zint/hibcblockf.rb +1 -0
  64. data/lib/zint/hibcdm.rb +1 -0
  65. data/lib/zint/hibcmicpdf.rb +1 -0
  66. data/lib/zint/hibcpdf.rb +1 -0
  67. data/lib/zint/hibcqr.rb +1 -0
  68. data/lib/zint/isbnx.rb +1 -0
  69. data/lib/zint/itf14.rb +1 -0
  70. data/lib/zint/japan_post.rb +1 -0
  71. data/lib/zint/kix.rb +1 -0
  72. data/lib/zint/korea_post.rb +1 -0
  73. data/lib/zint/logmars.rb +1 -0
  74. data/lib/zint/mailmark.rb +1 -0
  75. data/lib/zint/mailmark_2d.rb +8 -0
  76. data/lib/zint/mailmark_4s.rb +8 -0
  77. data/lib/zint/maxi_code.rb +1 -0
  78. data/lib/zint/micro_pdf417.rb +1 -0
  79. data/lib/zint/micro_qr.rb +1 -0
  80. data/lib/zint/msiplessey.rb +1 -0
  81. data/lib/zint/native.rb +1 -1
  82. data/lib/zint/nve18.rb +1 -0
  83. data/lib/zint/one_code.rb +1 -0
  84. data/lib/zint/pdf417.rb +1 -0
  85. data/lib/zint/pdf417comp.rb +1 -0
  86. data/lib/zint/pdf417trunc.rb +1 -0
  87. data/lib/zint/pharma.rb +1 -0
  88. data/lib/zint/pharmatwo.rb +1 -0
  89. data/lib/zint/planet.rb +1 -0
  90. data/lib/zint/plessey.rb +1 -0
  91. data/lib/zint/postnet.rb +1 -0
  92. data/lib/zint/pzn.rb +1 -0
  93. data/lib/zint/qr.rb +1 -0
  94. data/lib/zint/rmqr.rb +1 -0
  95. data/lib/zint/rss14.rb +1 -0
  96. data/lib/zint/rss14stack.rb +1 -0
  97. data/lib/zint/rss14stackomni.rb +1 -0
  98. data/lib/zint/rssexp.rb +1 -0
  99. data/lib/zint/rssexpstack.rb +1 -0
  100. data/lib/zint/rssltd.rb +1 -0
  101. data/lib/zint/structs/structapp.rb +25 -0
  102. data/lib/zint/structs/symbol.rb +38 -35
  103. data/lib/zint/structs/vector_circle.rb +3 -2
  104. data/lib/zint/telepen.rb +1 -0
  105. data/lib/zint/telepennum.rb +1 -0
  106. data/lib/zint/ultra.rb +1 -0
  107. data/lib/zint/upc_a.rb +1 -0
  108. data/lib/zint/upc_a_chk.rb +1 -0
  109. data/lib/zint/upc_e.rb +1 -0
  110. data/lib/zint/upc_e_chk.rb +1 -0
  111. data/lib/zint/upnqr.rb +1 -0
  112. data/lib/zint/{box.rb → upu_s10.rb} +3 -2
  113. data/lib/zint/uspsimail.rb +1 -0
  114. data/lib/zint/version.rb +1 -1
  115. data/lib/zint/vin.rb +1 -0
  116. data/lib/zint.rb +8 -1
  117. data/ports/archives/zint-2.12.0-src.tar.gz +0 -0
  118. metadata +9 -7
  119. data/lib/zint/stdout.rb +0 -7
  120. data/ports/archives/zint-2.10.0-src.tar.gz +0 -0
@@ -1,41 +1,44 @@
1
1
  module Zint
2
2
  module Structs
3
3
  class Symbol < FFI::ManagedStruct
4
- layout :symbology, :int,
5
- :height, :float,
6
- :whitespace_width, :int,
7
- :whitespace_height, :int,
8
- :border_width, :int,
9
- :output_options, :int,
10
- :fgcolour, [:char, 10],
11
- :bgcolour, [:char, 10],
12
- :fgcolor, :pointer,
13
- :bgcolor, :pointer,
14
- :outfile, [:char, 256],
15
- :scale, :float,
16
- :option_1, :int,
17
- :option_2, :int,
18
- :option_3, :int,
19
- :show_hrt, :int,
20
- :fontsize, :int,
21
- :input_mode, :int,
22
- :eci, :int,
23
- :text, [:uchar, 128],
24
- :rows, :int,
25
- :width, :int,
26
- :primary, [:char, 128],
27
- :encoded_data, [:uchar, 200 * 143],
28
- :row_height, [:float, 200],
29
- :errtxt, [:char, 100],
30
- :bitmap, :pointer,
31
- :bitmap_width, :int,
32
- :bitmap_height, :int,
33
- :alphamap, :pointer,
34
- :bitmap_byte_length, :uchar,
35
- :dot_size, :float,
36
- :vector, Vector.by_ref,
37
- :debug, :int,
38
- :warn_level, :int
4
+ layout :symbology, :int, # Symbol to use (see BARCODE_XXX below)
5
+ :height, :float, # Barcode height in X-dimensions (ignored for fixed-width barcodes)
6
+ :scale, :float, # Scale factor when printing barcode, i.e. adjusts X-dimension. Default 1
7
+ :whitespace_width, :int, # Width in X-dimensions of whitespace to left & right of barcode
8
+ :whitespace_height, :int, # Height in X-dimensions of whitespace above & below the barcode
9
+ :border_width, :int, # Size of border in X-dimensions
10
+ :output_options, :int, # Various output parameters (bind, box etc, see below)
11
+ :fgcolour, [:char, 10], # Foreground as RGB/RGBA hexadecimal string, 6 or 8 characters, NUL-terminated
12
+ :bgcolour, [:char, 10], # Background as RGB/RGBA hexadecimal string, 6 or 8 characters, NUL-terminated
13
+ :fgcolor, :pointer, # Pointer to fgcolour (alternate spelling)
14
+ :bgcolor, :pointer, # Pointer to bgcolour (alternate spelling)
15
+ :outfile, [:char, 256], # Name of file to output to, NUL-terminated. Default "out.png" ("out.gif" if NO_PNG)
16
+ :primary, [:char, 128], # Primary message data (MaxiCode, Composite), NUL-terminated
17
+ :option_1, :int, # Symbol-specific options (see "../docs/manual.txt")
18
+ :option_2, :int, # Symbol-specific options
19
+ :option_3, :int, # Symbol-specific options
20
+ :show_hrt, :int, # Show (1) or hide (0) Human Readable Text (HRT). Default 1
21
+ :fontsize, :int, # Unused
22
+ :input_mode, :int, # Encoding of input data (see DATA_MODE etc below). Default DATA_MODE
23
+ :eci, :int, # Extended Channel Interpretation. Default 0 (none)
24
+ :dpmm, :float, # Resolution of output in dots per mm (BMP/EMF/PCX/PNG/TIF only). Default 0 (none)
25
+ :dot_size, :float, # Size of dots used in BARCODE_DOTTY_MODE. Default 0.8
26
+ :guard_descent, :float, # Height in X-dimensions that EAN/UPC guard bars descend. Default 5
27
+ :structapp, Structapp, # Structured Append info. Default structapp.count 0 (none)
28
+ :warn_level, :int, # Affects error/warning value returned by Zint API (see WARN_XXX below)
29
+ :debug, :int, # Debugging flags
30
+ :text, [:uchar, 128], # Human Readable Text (if any), UTF-8, NUL-terminated (output only)
31
+ :rows, :int, # Number of rows used by the symbol (output only)
32
+ :width, :int, # Width of the generated symbol (output only)
33
+ :encoded_data, [:uchar, 200 * 144], # Encoded data (output only). Allows for rows of 1152 modules
34
+ :row_height, [:float, 200], # Heights of rows (output only). Allows for 200 row DotCode
35
+ :errtxt, [:char, 100], # Error message if an error or warning occurs, NUL-terminated (output only)
36
+ :bitmap, :pointer, # Stored bitmap image (raster output only)
37
+ :bitmap_width, :int, # Width of bitmap image (raster output only)
38
+ :bitmap_height, :int, # Height of bitmap image (raster output only)
39
+ :alphamap, :pointer, # Array of alpha values used (raster output only)
40
+ :bitmap_byte_length, :uchar, # Size of BMP bitmap data (raster output only)
41
+ :vector, Vector.by_ref # Pointer to vector header (vector output only)
39
42
 
40
43
  # @private
41
44
  def self.release(ptr)
@@ -3,8 +3,9 @@ module Zint
3
3
  class VectorCircle < FFI::Struct
4
4
  layout :x, :float,
5
5
  :y, :float,
6
- :diameter, :float,
7
- :colour, :int, # Non-zero for draw with background colour
6
+ :diameter, :float, # Circle diameter. Does not include width (if any)
7
+ :width, :float, # Width of circle perimeter (circumference). 0 for fill (disc)
8
+ :colour, :int, # Non-zero for draw with background colour (else draw with foreground colour)
8
9
  :next, VectorCircle.by_ref # Pointer to next circle
9
10
 
10
11
  # x position
data/lib/zint/telepen.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  module Zint
2
+ # Telepen Alpha
2
3
  class Telepen < Barcode
3
4
  def initialize(value: nil, input_file: nil, options: {})
4
5
  super(value: value, input_file: input_file, type: Zint::BARCODE_TELEPEN, options: options)
@@ -1,4 +1,5 @@
1
1
  module Zint
2
+ # Telepen Numeric
2
3
  class TelepenNum < Barcode
3
4
  def initialize(value: nil, input_file: nil, options: {})
4
5
  super(value: value, input_file: input_file, type: Zint::BARCODE_TELEPEN_NUM, options: options)
data/lib/zint/ultra.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  module Zint
2
+ # Ultracode
2
3
  class Ultra < Barcode
3
4
  def initialize(value: nil, input_file: nil, options: {})
4
5
  super(value: value, input_file: input_file, type: Zint::BARCODE_ULTRA, options: options)
data/lib/zint/upc_a.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  module Zint
2
+ # UPC-A
2
3
  class UpcA < Barcode
3
4
  def initialize(value: nil, input_file: nil, options: {})
4
5
  super(value: value, input_file: input_file, type: Zint::BARCODE_UPCA, options: options)
@@ -1,4 +1,5 @@
1
1
  module Zint
2
+ # UPC-A + Check Digit
2
3
  class UpcAChk < Barcode
3
4
  def initialize(value: nil, input_file: nil, options: {})
4
5
  super(value: value, input_file: input_file, type: Zint::BARCODE_UPCA_CHK, options: options)
data/lib/zint/upc_e.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  module Zint
2
+ # UPC-E
2
3
  class UpcE < Barcode
3
4
  def initialize(value: nil, input_file: nil, options: {})
4
5
  super(value: value, input_file: input_file, type: Zint::BARCODE_UPCE, options: options)
@@ -1,4 +1,5 @@
1
1
  module Zint
2
+ # UPC-E + Check Digit
2
3
  class UpcEChk < Barcode
3
4
  def initialize(value: nil, input_file: nil, options: {})
4
5
  super(value: value, input_file: input_file, type: Zint::BARCODE_UPCE_CHK, options: options)
data/lib/zint/upnqr.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  module Zint
2
+ # UPNQR (Univerzalnega Plačilnega Naloga QR)
2
3
  class Upnqr < Barcode
3
4
  def initialize(value: nil, input_file: nil, options: {})
4
5
  super(value: value, input_file: input_file, type: Zint::BARCODE_UPNQR, options: options)
@@ -1,7 +1,8 @@
1
1
  module Zint
2
- class Box < Barcode
2
+ # Universal Postal Union S10
3
+ class UpuS10 < Barcode
3
4
  def initialize(value: nil, input_file: nil, options: {})
4
- super(value: value, input_file: input_file, type: Zint::BARCODE_BOX, options: options)
5
+ super(value: value, input_file: input_file, type: Zint::BARCODE_UPU_S10, options: options)
5
6
  end
6
7
  end
7
8
  end
@@ -1,4 +1,5 @@
1
1
  module Zint
2
+ # USPS Intelligent Mail (OneCode)
2
3
  class UspsImail < Barcode
3
4
  def initialize(value: nil, input_file: nil, options: {})
4
5
  super(value: value, input_file: input_file, type: Zint::BARCODE_USPS_IMAIL, options: options)
data/lib/zint/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Zint
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
data/lib/zint/vin.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  module Zint
2
+ # Vehicle Identification Number
2
3
  class Vin < Barcode
3
4
  def initialize(value: nil, input_file: nil, options: {})
4
5
  super(value: value, input_file: input_file, type: Zint::BARCODE_VIN, options: options)
data/lib/zint.rb CHANGED
@@ -20,6 +20,7 @@ require "zint/structs/vector_hexagon"
20
20
  require "zint/structs/vector_rect"
21
21
  require "zint/structs/vector_string"
22
22
  require "zint/structs/vector"
23
+ require "zint/structs/structapp"
23
24
  require "zint/structs/symbol"
24
25
  require "zint/native"
25
26
 
@@ -36,6 +37,7 @@ module Zint
36
37
  include Constants::Warnings
37
38
 
38
39
  # Barcode
40
+ autoload :Bc412, "zint/bc_412"
39
41
  autoload :Bitmap, "zint/bitmap"
40
42
  autoload :BitmapPixel, "zint/bitmap_pixel"
41
43
  autoload :Barcode, "zint/barcode"
@@ -53,12 +55,14 @@ module Zint
53
55
  autoload :C25logic, "zint/c25logic"
54
56
  autoload :C25matrix, "zint/c25matrix"
55
57
  autoload :C25standard, "zint/c25standard"
58
+ autoload :CepNet, "zint/cep_net"
56
59
  autoload :Channel, "zint/channel"
57
60
  autoload :Codabar, "zint/codabar"
58
61
  autoload :CodablockF, "zint/codablock_f"
59
62
  autoload :Code11, "zint/code11"
60
63
  autoload :Code128, "zint/code128"
61
- autoload :Code128b, "zint/code128b"
64
+ autoload :Code128AB, "zint/code128ab"
65
+ autoload :Code128B, "zint/code128b"
62
66
  autoload :Code16k, "zint/code16k"
63
67
  autoload :Code32, "zint/code32"
64
68
  autoload :Code39, "zint/code39"
@@ -103,6 +107,8 @@ module Zint
103
107
  autoload :KoreaPost, "zint/korea_post"
104
108
  autoload :Logmars, "zint/logmars"
105
109
  autoload :Mailmark, "zint/mailmark"
110
+ autoload :Mailmark2D, "zint/mailmark_2d"
111
+ autoload :Mailmark4S, "zint/mailmark_4s"
106
112
  autoload :MaxiCode, "zint/maxi_code"
107
113
  autoload :MicroPdf417, "zint/micro_pdf417"
108
114
  autoload :MicroQr, "zint/micro_qr"
@@ -136,6 +142,7 @@ module Zint
136
142
  autoload :UpcE, "zint/upc_e"
137
143
  autoload :UpcEChk, "zint/upc_e_chk"
138
144
  autoload :Upnqr, "zint/upnqr"
145
+ autoload :UpuS10, "zint/upu_s10"
139
146
  autoload :UspsImail, "zint/uspsimail"
140
147
  autoload :Vin, "zint/vin"
141
148
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-zint
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elias Fröhner
@@ -62,21 +62,22 @@ files:
62
62
  - lib/zint/azrune.rb
63
63
  - lib/zint/aztec.rb
64
64
  - lib/zint/barcode.rb
65
- - lib/zint/bind.rb
65
+ - lib/zint/bc_412.rb
66
66
  - lib/zint/bitmap.rb
67
67
  - lib/zint/bitmap_pixel.rb
68
- - lib/zint/box.rb
69
68
  - lib/zint/c25iata.rb
70
69
  - lib/zint/c25ind.rb
71
70
  - lib/zint/c25inter.rb
72
71
  - lib/zint/c25logic.rb
73
72
  - lib/zint/c25matrix.rb
74
73
  - lib/zint/c25standard.rb
74
+ - lib/zint/cep_net.rb
75
75
  - lib/zint/channel.rb
76
76
  - lib/zint/codabar.rb
77
77
  - lib/zint/codablock_f.rb
78
78
  - lib/zint/code11.rb
79
79
  - lib/zint/code128.rb
80
+ - lib/zint/code128ab.rb
80
81
  - lib/zint/code128b.rb
81
82
  - lib/zint/code16k.rb
82
83
  - lib/zint/code32.rb
@@ -103,7 +104,6 @@ files:
103
104
  - lib/zint/dbarstk.rb
104
105
  - lib/zint/dependencies.rb
105
106
  - lib/zint/dot_code.rb
106
- - lib/zint/dotty_mode.rb
107
107
  - lib/zint/dpd.rb
108
108
  - lib/zint/dpident.rb
109
109
  - lib/zint/dpleit.rb
@@ -132,12 +132,13 @@ files:
132
132
  - lib/zint/korea_post.rb
133
133
  - lib/zint/logmars.rb
134
134
  - lib/zint/mailmark.rb
135
+ - lib/zint/mailmark_2d.rb
136
+ - lib/zint/mailmark_4s.rb
135
137
  - lib/zint/maxi_code.rb
136
138
  - lib/zint/micro_pdf417.rb
137
139
  - lib/zint/micro_qr.rb
138
140
  - lib/zint/msiplessey.rb
139
141
  - lib/zint/native.rb
140
- - lib/zint/noascii.rb
141
142
  - lib/zint/nve18.rb
142
143
  - lib/zint/one_code.rb
143
144
  - lib/zint/pdf417.rb
@@ -157,7 +158,7 @@ files:
157
158
  - lib/zint/rssexp.rb
158
159
  - lib/zint/rssexpstack.rb
159
160
  - lib/zint/rssltd.rb
160
- - lib/zint/stdout.rb
161
+ - lib/zint/structs/structapp.rb
161
162
  - lib/zint/structs/symbol.rb
162
163
  - lib/zint/structs/vector.rb
163
164
  - lib/zint/structs/vector_circle.rb
@@ -172,11 +173,12 @@ files:
172
173
  - lib/zint/upc_e.rb
173
174
  - lib/zint/upc_e_chk.rb
174
175
  - lib/zint/upnqr.rb
176
+ - lib/zint/upu_s10.rb
175
177
  - lib/zint/uspsimail.rb
176
178
  - lib/zint/version.rb
177
179
  - lib/zint/vin.rb
178
180
  - lib/zint/zint_recipe.rb
179
- - ports/archives/zint-2.10.0-src.tar.gz
181
+ - ports/archives/zint-2.12.0-src.tar.gz
180
182
  homepage: https://github.com/api-walker/ruby-zint
181
183
  licenses:
182
184
  - MIT
data/lib/zint/stdout.rb DELETED
@@ -1,7 +0,0 @@
1
- module Zint
2
- class Stdout < Barcode
3
- def initialize(value: nil, input_file: nil, options: {})
4
- super(value: value, input_file: input_file, type: Zint::BARCODE_STDOUT, options: options)
5
- end
6
- end
7
- end
Binary file