ruby-zint 1.5.0-x86_64-linux-gnu

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 (135) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +9 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +146 -0
  5. data/ext/ruby-zint/extconf.rb +113 -0
  6. data/lib/3.4/libzint.so +0 -0
  7. data/lib/ruby-zint.rb +1 -0
  8. data/lib/zint/aus_post.rb +8 -0
  9. data/lib/zint/aus_redirect.rb +8 -0
  10. data/lib/zint/aus_reply.rb +8 -0
  11. data/lib/zint/aus_route.rb +8 -0
  12. data/lib/zint/azrune.rb +8 -0
  13. data/lib/zint/aztec.rb +8 -0
  14. data/lib/zint/barcode.rb +550 -0
  15. data/lib/zint/bc_412.rb +8 -0
  16. data/lib/zint/bitmap.rb +4 -0
  17. data/lib/zint/bitmap_pixel.rb +4 -0
  18. data/lib/zint/c25iata.rb +8 -0
  19. data/lib/zint/c25ind.rb +8 -0
  20. data/lib/zint/c25inter.rb +8 -0
  21. data/lib/zint/c25logic.rb +8 -0
  22. data/lib/zint/c25matrix.rb +8 -0
  23. data/lib/zint/c25standard.rb +8 -0
  24. data/lib/zint/cep_net.rb +8 -0
  25. data/lib/zint/channel.rb +8 -0
  26. data/lib/zint/codabar.rb +8 -0
  27. data/lib/zint/codablock_f.rb +8 -0
  28. data/lib/zint/code11.rb +8 -0
  29. data/lib/zint/code128.rb +8 -0
  30. data/lib/zint/code128ab.rb +8 -0
  31. data/lib/zint/code128b.rb +5 -0
  32. data/lib/zint/code16k.rb +8 -0
  33. data/lib/zint/code32.rb +8 -0
  34. data/lib/zint/code39.rb +8 -0
  35. data/lib/zint/code49.rb +8 -0
  36. data/lib/zint/code93.rb +8 -0
  37. data/lib/zint/code_one.rb +8 -0
  38. data/lib/zint/constants/capability_flags.rb +21 -0
  39. data/lib/zint/constants/debug_flags.rb +9 -0
  40. data/lib/zint/constants/errors.rb +20 -0
  41. data/lib/zint/constants/input_data_types.rb +16 -0
  42. data/lib/zint/constants/output_options.rb +24 -0
  43. data/lib/zint/constants/specific_options.rb +13 -0
  44. data/lib/zint/constants/symbologies.rb +138 -0
  45. data/lib/zint/constants/warn_levels.rb +9 -0
  46. data/lib/zint/constants/warnings.rb +12 -0
  47. data/lib/zint/daft.rb +8 -0
  48. data/lib/zint/data_matrix.rb +19 -0
  49. data/lib/zint/dbarexp.rb +8 -0
  50. data/lib/zint/dbarexpstk.rb +8 -0
  51. data/lib/zint/dbarltd.rb +8 -0
  52. data/lib/zint/dbaromn.rb +8 -0
  53. data/lib/zint/dbaromnstk.rb +8 -0
  54. data/lib/zint/dbarstk.rb +8 -0
  55. data/lib/zint/dependencies.rb +15 -0
  56. data/lib/zint/dot_code.rb +8 -0
  57. data/lib/zint/dpd.rb +8 -0
  58. data/lib/zint/dpident.rb +8 -0
  59. data/lib/zint/dpleit.rb +8 -0
  60. data/lib/zint/dxfilmedge.rb +8 -0
  61. data/lib/zint/ean128.rb +8 -0
  62. data/lib/zint/ean14.rb +8 -0
  63. data/lib/zint/eanx.rb +8 -0
  64. data/lib/zint/eanxchk.rb +8 -0
  65. data/lib/zint/excode39.rb +8 -0
  66. data/lib/zint/fim.rb +8 -0
  67. data/lib/zint/flat.rb +8 -0
  68. data/lib/zint/grid_matrix.rb +8 -0
  69. data/lib/zint/gs1_128.rb +10 -0
  70. data/lib/zint/hanxin.rb +8 -0
  71. data/lib/zint/hibc128.rb +8 -0
  72. data/lib/zint/hibc39.rb +8 -0
  73. data/lib/zint/hibcaztec.rb +8 -0
  74. data/lib/zint/hibcblockf.rb +8 -0
  75. data/lib/zint/hibcdm.rb +8 -0
  76. data/lib/zint/hibcmicpdf.rb +8 -0
  77. data/lib/zint/hibcpdf.rb +8 -0
  78. data/lib/zint/hibcqr.rb +8 -0
  79. data/lib/zint/isbnx.rb +8 -0
  80. data/lib/zint/itf14.rb +8 -0
  81. data/lib/zint/japan_post.rb +8 -0
  82. data/lib/zint/kix.rb +8 -0
  83. data/lib/zint/korea_post.rb +8 -0
  84. data/lib/zint/logmars.rb +8 -0
  85. data/lib/zint/mailmark.rb +8 -0
  86. data/lib/zint/mailmark_2d.rb +8 -0
  87. data/lib/zint/mailmark_4s.rb +8 -0
  88. data/lib/zint/maxi_code.rb +8 -0
  89. data/lib/zint/micro_pdf417.rb +8 -0
  90. data/lib/zint/micro_qr.rb +8 -0
  91. data/lib/zint/msiplessey.rb +8 -0
  92. data/lib/zint/native.rb +106 -0
  93. data/lib/zint/nve18.rb +8 -0
  94. data/lib/zint/one_code.rb +8 -0
  95. data/lib/zint/pdf417.rb +8 -0
  96. data/lib/zint/pdf417comp.rb +8 -0
  97. data/lib/zint/pdf417trunc.rb +8 -0
  98. data/lib/zint/pharma.rb +8 -0
  99. data/lib/zint/pharmatwo.rb +8 -0
  100. data/lib/zint/planet.rb +8 -0
  101. data/lib/zint/plessey.rb +8 -0
  102. data/lib/zint/postnet.rb +8 -0
  103. data/lib/zint/pzn.rb +8 -0
  104. data/lib/zint/qr.rb +18 -0
  105. data/lib/zint/rmqr.rb +8 -0
  106. data/lib/zint/rss14.rb +8 -0
  107. data/lib/zint/rss14stack.rb +8 -0
  108. data/lib/zint/rss14stackomni.rb +8 -0
  109. data/lib/zint/rssexp.rb +8 -0
  110. data/lib/zint/rssexpstack.rb +8 -0
  111. data/lib/zint/rssltd.rb +8 -0
  112. data/lib/zint/structs/seg.rb +26 -0
  113. data/lib/zint/structs/structapp.rb +25 -0
  114. data/lib/zint/structs/symbol.rb +57 -0
  115. data/lib/zint/structs/vector.rb +54 -0
  116. data/lib/zint/structs/vector_circle.rb +32 -0
  117. data/lib/zint/structs/vector_hexagon.rb +31 -0
  118. data/lib/zint/structs/vector_rect.rb +37 -0
  119. data/lib/zint/structs/vector_string.rb +50 -0
  120. data/lib/zint/telepen.rb +8 -0
  121. data/lib/zint/telepennum.rb +8 -0
  122. data/lib/zint/ultra.rb +8 -0
  123. data/lib/zint/upc_a.rb +8 -0
  124. data/lib/zint/upc_a_chk.rb +8 -0
  125. data/lib/zint/upc_e.rb +8 -0
  126. data/lib/zint/upc_e_chk.rb +8 -0
  127. data/lib/zint/upnqr.rb +8 -0
  128. data/lib/zint/upu_s10.rb +8 -0
  129. data/lib/zint/uspsimail.rb +8 -0
  130. data/lib/zint/version.rb +3 -0
  131. data/lib/zint/vin.rb +8 -0
  132. data/lib/zint/zint_recipe.rb +31 -0
  133. data/lib/zint.rb +170 -0
  134. data/ruby-zint.gemspec +43 -0
  135. metadata +305 -0
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Code 16k
3
+ class Code16k < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_CODE16K, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Code 32
3
+ class Code32 < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_CODE32, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Code 39
3
+ class Code39 < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_CODE39, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Code 49
3
+ class Code49 < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_CODE49, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Code 93
3
+ class Code93 < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_CODE93, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Code One
3
+ class CodeOne < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_CODEONE, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,21 @@
1
+ module Zint
2
+ module Constants
3
+ # Capability flags (ZBarcode_Cap() `cap_flag`)
4
+ module CapabilityFlags
5
+ ZINT_CAP_HRT = 0x0001 # Prints Human Readable Text? */
6
+ ZINT_CAP_STACKABLE = 0x0002 # Is stackable? */
7
+ ZINT_CAP_EXTENDABLE = 0x0004 # Is extendable with add-on data? (Is EAN/UPC?) */
8
+ ZINT_CAP_COMPOSITE = 0x0008 # Can have composite data? */
9
+ ZINT_CAP_ECI = 0x0010 # Supports Extended Channel Interpretations? */
10
+ ZINT_CAP_GS1 = 0x0020 # Supports GS1 data? */
11
+ ZINT_CAP_DOTTY = 0x0040 # Can be output as dots? */
12
+ ZINT_CAP_QUIET_ZONES = 0x0080 # Has default quiet zones? */
13
+ ZINT_CAP_FIXED_RATIO = 0x0100 # Has fixed width-to-height (aspect) ratio? */
14
+ ZINT_CAP_READER_INIT = 0x0200 # Supports Reader Initialisation? */
15
+ ZINT_CAP_FULL_MULTIBYTE = 0x0400 # Supports full-multibyte option? */
16
+ ZINT_CAP_MASK = 0x0800 # Is mask selectable? */
17
+ ZINT_CAP_STRUCTAPP = 0x1000 # Supports Structured Append? */
18
+ ZINT_CAP_COMPLIANT_HEIGHT = 0x2000 # Has compliant height? */
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,9 @@
1
+ module Zint
2
+ module Constants
3
+ # Debug flags (debug)
4
+ module DebugFlags
5
+ ZINT_DEBUG_PRINT = 1 # Print debug info (if any) to stdout
6
+ ZINT_DEBUG_TEST = 2 # For internal test use only
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,20 @@
1
+ module Zint
2
+ module Constants
3
+ # Errors (API return values)
4
+ module Errors
5
+ ERRORS = {
6
+ error_too_long: 5,
7
+ error_invalid_data: 6,
8
+ error_invalid_check: 7,
9
+ error_invalid_option: 8,
10
+ error_encoding_problem: 9,
11
+ error_file_access: 10,
12
+ error_memory: 11,
13
+ error_file_write: 12,
14
+ error_uses_eci: 13,
15
+ error_noncompliant: 14,
16
+ error_hrt_truncated: 15 # Error counterpart of warning if WARN_FAIL_ALL set */
17
+ }
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,16 @@
1
+ module Zint
2
+ module Constants
3
+ # Input data types (`symbol->input_mode`)
4
+ module InputDataTypes
5
+ DATA_MODE = 0 # Binary
6
+ UNICODE_MODE = 1 # UTF-8
7
+ GS1_MODE = 2 # GS1
8
+ ESCAPE_MODE = 0x0008 # Process escape sequences
9
+ GS1PARENS_MODE = 0x0010 # Process parentheses as GS1 AI delimiters (instead of square brackets)
10
+ GS1NOCHECK_MODE = 0x0020 # Do not check validity of GS1 data (except that printable ASCII only)
11
+ HEIGHTPERROW_MODE = 0x0040 # Interpret `height` as per-row rather than as overall height
12
+ FAST_MODE = 0x0080 # Use faster if less optimal encodation or other shortcuts if available (affects DATAMATRIX, MICROPDF417, PDF417, QRCODE & UPNQR only)
13
+ EXTRA_ESCAPE_MODE = 0x0100 # Process special symbology-specific escape sequences as well as others. Note: currently Code 128 only.
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,24 @@
1
+ module Zint
2
+ module Constants
3
+ # Output options (`symbol->output_options`)
4
+ module OutputOptions
5
+ BARCODE_BIND_TOP = 0x0001 # Boundary bar above the symbol only (not below), does not affect stacking */
6
+ BARCODE_BIND = 0x0002 # Boundary bars above & below the symbol and between stacked symbols */
7
+ BARCODE_BOX = 0x0004 # Box around symbol */
8
+ BARCODE_STDOUT = 0x0008 # Output to stdout */
9
+ READER_INIT = 0x0010 # Reader Initialisation (Programming) */
10
+ SMALL_TEXT = 0x0020 # Use smaller font */
11
+ BOLD_TEXT = 0x0040 # Use bold font */
12
+ CMYK_COLOUR = 0x0080 # CMYK colour space (Encapsulated PostScript and TIF) */
13
+ BARCODE_DOTTY_MODE = 0x0100 # Plot a matrix symbol using dots rather than squares */
14
+ GS1_GS_SEPARATOR = 0x0200 # Use GS instead of FNC1 as GS1 separator (Data Matrix) */
15
+ OUT_BUFFER_INTERMEDIATE = 0x0400 # Return ASCII values in bitmap buffer (OUT_BUFFER only) */
16
+ BARCODE_QUIET_ZONES = 0x0800 # Add compliant quiet zones (additional to any specified whitespace); Note: CODE16K, CODE49, CODABLOCKF, ITF14, EAN/UPC have default quiet zones */
17
+ BARCODE_NO_QUIET_ZONES = 0x1000 # Disable quiet zones, notably those with defaults as listed above */
18
+ COMPLIANT_HEIGHT = 0x2000 # Warn if height not compliant and use standard height (if any) as default */
19
+ EANUPC_GUARD_WHITESPACE = 0x04000 # Add quiet zone indicators ("<"/">") to HRT whitespace (EAN/UPC) */
20
+ EMBED_VECTOR_FONT = 0x08000 # Embed font in vector output - currently only for SVG output */
21
+ BARCODE_MEMORY_FILE = 0x10000 # Write output to in-memory buffer `memfile` instead of to `outfile` */
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,13 @@
1
+ module Zint
2
+ module Constants
3
+ # Specific options (`symbol->option_3`)
4
+ module SpecificOptions
5
+ DM_SQUARE = 100 # Only consider square versions on automatic symbol size selection
6
+ DM_DMRE = 101 # Consider DMRE versions on automatic symbol size selection
7
+ DM_ISO_144 = 128 # Use ISO instead of "de facto" format for 144x144 (i.e. don't skew ECC)
8
+
9
+ ZINT_FULL_MULTIBYTE = 200 # Enable Kanji/Hanzi compression for Latin-1 & binary data
10
+ ULTRA_COMPRESSION = 128 # Enable Ultracode compression (experimental)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,138 @@
1
+ module Zint
2
+ module Constants
3
+ # Symbologies (`symbol->symbology`)
4
+ module Symbologies
5
+ # Tbarcode 7 codes
6
+ BARCODE_CODE11 = 1 # Code 11
7
+ BARCODE_C25STANDARD = 2 # 2 of 5 Standard (Matrix)
8
+ BARCODE_C25MATRIX = 2 # Legacy
9
+ BARCODE_C25INTER = 3 # 2 of 5 Interleaved
10
+ BARCODE_C25IATA = 4 # 2 of 5 IATA
11
+ BARCODE_C25LOGIC = 6 # 2 of 5 Data Logic
12
+ BARCODE_C25IND = 7 # 2 of 5 Industrial
13
+ BARCODE_CODE39 = 8 # Code 39
14
+ BARCODE_EXCODE39 = 9 # Extended Code 39
15
+ BARCODE_EANX = 13 # EAN (European Article Number)
16
+ BARCODE_EANX_CHK = 14 # EAN + Check Digit
17
+ BARCODE_GS1_128 = 16 # GS1-128
18
+ BARCODE_EAN128 = 16 # Legacy
19
+ BARCODE_CODABAR = 18 # Codabar
20
+ BARCODE_CODE128 = 20 # Code 128
21
+ BARCODE_DPLEIT = 21 # Deutsche Post Leitcode
22
+ BARCODE_DPIDENT = 22 # Deutsche Post Identcode
23
+ BARCODE_CODE16K = 23 # Code 16k
24
+ BARCODE_CODE49 = 24 # Code 49
25
+ BARCODE_CODE93 = 25 # Code 93
26
+ BARCODE_FLAT = 28 # Flattermarken
27
+ BARCODE_DBAR_OMN = 29 # GS1 DataBar Omnidirectional
28
+ BARCODE_RSS14 = 29 # Legacy
29
+ BARCODE_DBAR_LTD = 30 # GS1 DataBar Limited
30
+ BARCODE_RSS_LTD = 30 # Legacy
31
+ BARCODE_DBAR_EXP = 31 # GS1 DataBar Expanded
32
+ BARCODE_RSS_EXP = 31 # Legacy
33
+ BARCODE_TELEPEN = 32 # Telepen Alpha
34
+ BARCODE_UPCA = 34 # UPC-A
35
+ BARCODE_UPCA_CHK = 35 # UPC-A + Check Digit
36
+ BARCODE_UPCE = 37 # UPC-E
37
+ BARCODE_UPCE_CHK = 38 # UPC-E + Check Digit
38
+ BARCODE_POSTNET = 40 # USPS (U.S. Postal Service) POSTNET
39
+ BARCODE_MSI_PLESSEY = 47 # MSI Plessey
40
+ BARCODE_FIM = 49 # Facing Identification Mark
41
+ BARCODE_LOGMARS = 50 # LOGMARS
42
+ BARCODE_PHARMA = 51 # Pharmacode One-Track
43
+ BARCODE_PZN = 52 # Pharmazentralnummer
44
+ BARCODE_PHARMA_TWO = 53 # Pharmacode Two-Track
45
+ BARCODE_CEPNET = 54 # Brazilian CEPNet Postal Code
46
+ BARCODE_PDF417 = 55 # PDF417
47
+ BARCODE_PDF417COMP = 56 # Compact PDF417 (Truncated PDF417)
48
+ BARCODE_PDF417TRUNC = 56 # Legacy
49
+ BARCODE_MAXICODE = 57 # MaxiCode
50
+ BARCODE_QRCODE = 58 # QR Code
51
+ BARCODE_CODE128AB = 60 # Code 128 (Suppress subset C)
52
+ BARCODE_CODE128B = 60 # Legacy
53
+ BARCODE_AUSPOST = 63 # Australia Post Standard Customer
54
+ BARCODE_AUSREPLY = 66 # Australia Post Reply Paid
55
+ BARCODE_AUSROUTE = 67 # Australia Post Routing
56
+ BARCODE_AUSREDIRECT = 68 # Australia Post Redirection
57
+ BARCODE_ISBNX = 69 # ISBN
58
+ BARCODE_RM4SCC = 70 # Royal Mail 4-State Customer Code
59
+ BARCODE_DATAMATRIX = 71 # Data Matrix (ECC200)
60
+ BARCODE_EAN14 = 72 # EAN-14
61
+ BARCODE_VIN = 73 # Vehicle Identification Number
62
+ BARCODE_CODABLOCKF = 74 # Codablock-F
63
+ BARCODE_NVE18 = 75 # NVE-18 (SSCC-18)
64
+ BARCODE_JAPANPOST = 76 # Japanese Postal Code
65
+ BARCODE_KOREAPOST = 77 # Korea Post
66
+ BARCODE_DBAR_STK = 79 # GS1 DataBar Stacked
67
+ BARCODE_RSS14STACK = 79 # Legacy
68
+ BARCODE_DBAR_OMNSTK = 80 # GS1 DataBar Stacked Omnidirectional
69
+ BARCODE_RSS14STACK_OMNI = 80 # Legacy
70
+ BARCODE_DBAR_EXPSTK = 81 # GS1 DataBar Expanded Stacked
71
+ BARCODE_RSS_EXPSTACK = 81 # Legacy
72
+ BARCODE_PLANET = 82 # USPS PLANET
73
+ BARCODE_MICROPDF417 = 84 # MicroPDF417
74
+ BARCODE_USPS_IMAIL = 85 # USPS Intelligent Mail (OneCode)
75
+ BARCODE_ONECODE = 85 # Legacy
76
+ BARCODE_PLESSEY = 86 # UK Plessey
77
+
78
+ # Tbarcode 8 codes
79
+ BARCODE_TELEPEN_NUM = 87 # Telepen Numeric
80
+ BARCODE_ITF14 = 89 # ITF-14
81
+ BARCODE_KIX = 90 # Dutch Post KIX Code
82
+ BARCODE_AZTEC = 92 # Aztec Code
83
+ BARCODE_DAFT = 93 # DAFT Code
84
+ BARCODE_DPD = 96 # DPD Code
85
+ BARCODE_MICROQR = 97 # Micro QR Code
86
+
87
+ # Tbarcode 9 codes
88
+ BARCODE_HIBC_128 = 98 # HIBC (Health Industry Barcode) Code 128
89
+ BARCODE_HIBC_39 = 99 # HIBC Code 39
90
+ BARCODE_HIBC_DM = 102 # HIBC Data Matrix
91
+ BARCODE_HIBC_QR = 104 # HIBC QR Code
92
+ BARCODE_HIBC_PDF = 106 # HIBC PDF417
93
+ BARCODE_HIBC_MICPDF = 108 # HIBC MicroPDF417
94
+ BARCODE_HIBC_BLOCKF = 110 # HIBC Codablock-F
95
+ BARCODE_HIBC_AZTEC = 112 # HIBC Aztec Code
96
+
97
+ # Tbarcode 10 codes
98
+ BARCODE_DOTCODE = 115 # DotCode
99
+ BARCODE_HANXIN = 116 # Han Xin (Chinese Sensible) Code
100
+
101
+ # Tbarcode 11 codes
102
+ BARCODE_MAILMARK_2D = 119 # Royal Mail 2D Mailmark (CMDM) (Data Matrix)
103
+ BARCODE_UPU_S10 = 120 # Universal Postal Union S10
104
+ BARCODE_MAILMARK_4S = 121 # Royal Mail 4-State Mailmark
105
+ BARCODE_MAILMARK = 121 # Legacy
106
+
107
+ # Zint specific
108
+ BARCODE_AZRUNE = 128 # Aztec Runes
109
+ BARCODE_CODE32 = 129 # Code 32
110
+ BARCODE_EANX_CC = 130 # EAN Composite
111
+ BARCODE_GS1_128_CC = 131 # GS1-128 Composite
112
+ BARCODE_EAN128_CC = 131 # Legacy
113
+ BARCODE_DBAR_OMN_CC = 132 # GS1 DataBar Omnidirectional Composite
114
+ BARCODE_RSS14_CC = 132 # Legacy
115
+ BARCODE_DBAR_LTD_CC = 133 # GS1 DataBar Limited Composite
116
+ BARCODE_RSS_LTD_CC = 133 # Legacy
117
+ BARCODE_DBAR_EXP_CC = 134 # GS1 DataBar Expanded Composite
118
+ BARCODE_RSS_EXP_CC = 134 # Legacy
119
+ BARCODE_UPCA_CC = 135 # UPC-A Composite
120
+ BARCODE_UPCE_CC = 136 # UPC-E Composite
121
+ BARCODE_DBAR_STK_CC = 137 # GS1 DataBar Stacked Composite
122
+ BARCODE_RSS14STACK_CC = 137 # Legacy
123
+ BARCODE_DBAR_OMNSTK_CC = 138 # GS1 DataBar Stacked Omnidirectional Composite
124
+ BARCODE_RSS14_OMNI_CC = 138 # Legacy
125
+ BARCODE_DBAR_EXPSTK_CC = 139 # GS1 DataBar Expanded Stacked Composite
126
+ BARCODE_RSS_EXPSTACK_CC = 139 # Legacy
127
+ BARCODE_CHANNEL = 140 # Channel Code
128
+ BARCODE_CODEONE = 141 # Code One
129
+ BARCODE_GRIDMATRIX = 142 # Grid Matrix
130
+ BARCODE_UPNQR = 143 # UPNQR (Univerzalnega Plačilnega Naloga QR)
131
+ BARCODE_ULTRA = 144 # Ultracode
132
+ BARCODE_RMQR = 145 # Rectangular Micro QR Code (rMQR)
133
+ BARCODE_BC412 = 146 # IBM BC412 (SEMI T1-95)
134
+ BARCODE_DXFILMEDGE = 147 # DX Film Edge Barcode on 35mm and APS films
135
+ BARCODE_LAST = 147 # Max barcode number marker, not barcode
136
+ end
137
+ end
138
+ end
@@ -0,0 +1,9 @@
1
+ module Zint
2
+ module Constants
3
+ # Warning level (`symbol->warn_level`)
4
+ module WarnLevels
5
+ WARN_DEFAULT = 0 # Default behaviour
6
+ WARN_FAIL_ALL = 2 # Treat warning as error
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ module Zint
2
+ module Constants
3
+ # Warnings (API return values)
4
+ module Warnings
5
+ WARNINGS = {
6
+ warn_invalid_option: 2,
7
+ warn_uses_eci: 3,
8
+ warn_noncompliant: 4
9
+ }
10
+ end
11
+ end
12
+ end
data/lib/zint/daft.rb ADDED
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # DAFT Code
3
+ class Daft < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_DAFT, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,19 @@
1
+ module Zint
2
+ # Data Matrix (ECC200)
3
+ class DataMatrix < Barcode
4
+ # Options
5
+ DM_NULL = 0
6
+ DM_ASCII = 1
7
+ DM_C40 = 2
8
+ DM_TEXT = 3
9
+ DM_X12 = 4
10
+ DM_EDIFACT = 5
11
+ DM_BASE256 = 6
12
+
13
+ def initialize(value: nil, input_file: nil, type: Zint::BARCODE_DATAMATRIX, symbology: type, **kwargs)
14
+ raise ArgumentError, "Invalid symbology for DataMatrix code" unless [Zint::BARCODE_DATAMATRIX, Zint::BARCODE_HIBC_DM].include?(symbology)
15
+
16
+ super(value: value, input_file: input_file, symbology: symbology, option_3: Zint::DM_SQUARE, **kwargs)
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # GS1 DataBar Expanded
3
+ class DbarExp < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_DBAR_EXP, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # GS1 DataBar Expanded Stacked
3
+ class DbarExpstk < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_DBAR_EXPSTK, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # GS1 DataBar Limited
3
+ class DbarLtd < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_DBAR_LTD, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # GS1 DataBar Omnidirectional
3
+ class DbarOmn < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_DBAR_OMN, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # GS1 DataBar Stacked Omnidirectional
3
+ class DbarOmnstk < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_DBAR_OMNSTK, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # GS1 DataBar Stacked
3
+ class DbarStk < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_DBAR_STK, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,15 @@
1
+ module Zint
2
+ LIBZ_VERSION = ENV["LIBZ_VERSION"] || "1.3.1"
3
+ LIBZ_SOURCE_URI = "http://zlib.net/fossils/zlib-#{LIBZ_VERSION}.tar.gz"
4
+ LIBZ_SOURCE_SHA1 = "f535367b1a11e2f9ac3bec723fb007fbc0d189e5"
5
+
6
+ ZINT_VERSION = ENV["ZINT_VERSION"] || "2.15.0"
7
+ ZINT_SOURCE_URI = "https://downloads.sourceforge.net/zint/zint-#{ZINT_VERSION}-src.tar.gz"
8
+ ZINT_SOURCE_SHA1 = "e18966972d77feaa62a33d73d2f06ffec3356f66"
9
+
10
+ LIBPNG_VERSION = ENV["LIBPNG_VERSION"] || "1.6.50"
11
+ LIBPNG_SOURCE_URI = "https://netcologne.dl.sourceforge.net/project/libpng/libpng16/#{LIBPNG_VERSION}/libpng-#{LIBPNG_VERSION}.tar.xz"
12
+ LIBPNG_SOURCE_SHA1 = "ecd92ba84628a8ace430706c85fd2fb26ba0882c"
13
+
14
+ MINI_PORTILE_VERSION = "~> 2.1"
15
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # DotCode
3
+ class DotCode < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_DOTCODE, **kwargs)
6
+ end
7
+ end
8
+ end
data/lib/zint/dpd.rb ADDED
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # DPD Code
3
+ class Dpd < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_DPD, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Deutsche Post Identcode
3
+ class Dpident < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_DPIDENT, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Deutsche Post Leitcode
3
+ class Dpleit < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_DPLEIT, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # DX Film Edge Barcode on 35mm and APS films
3
+ class Dxfilmedge < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_DXFILMEDGE, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Legacy
3
+ class Ean128 < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_EAN128, **kwargs)
6
+ end
7
+ end
8
+ end
data/lib/zint/ean14.rb ADDED
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # EAN-14
3
+ class Ean14 < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_EAN14, **kwargs)
6
+ end
7
+ end
8
+ end
data/lib/zint/eanx.rb ADDED
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # EAN (European Article Number)
3
+ class Eanx < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_EANX, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # EAN + Check Digit
3
+ class EanxChk < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_EANX_CHK, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Extended Code 39
3
+ class Excode39 < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_EXCODE39, **kwargs)
6
+ end
7
+ end
8
+ end
data/lib/zint/fim.rb ADDED
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Facing Identification Mark
3
+ class Fim < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_FIM, **kwargs)
6
+ end
7
+ end
8
+ end
data/lib/zint/flat.rb ADDED
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Flattermarken
3
+ class Flat < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_FLAT, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Grid Matrix
3
+ class GridMatrix < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_GRIDMATRIX, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,10 @@
1
+ module Zint
2
+ # standard:disable Naming/ClassAndModuleCamelCase
3
+ # GS1-128
4
+ class Gs1_128 < Barcode
5
+ # standard:enable Naming/ClassAndModuleCamelCase
6
+ def initialize(value: nil, input_file: nil, **kwargs)
7
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_GS1_128, **kwargs)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # Han Xin (Chinese Sensible) Code
3
+ class Hanxin < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_HANXIN, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # HIBC (Health Industry Barcode) Code 128
3
+ class Hibc128 < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_HIBC_128, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # HIBC Code 39
3
+ class Hibc39 < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_HIBC_39, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # HIBC Aztec Code
3
+ class HibcAztec < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_HIBC_AZTEC, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # HIBC Codablock-F
3
+ class HibcBlockf < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_HIBC_BLOCKF, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # HIBC Data Matrix
3
+ class HibcDm < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_HIBC_DM, **kwargs)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zint
2
+ # HIBC MicroPDF417
3
+ class HibcMicpdf < Barcode
4
+ def initialize(value: nil, input_file: nil, **kwargs)
5
+ super(value: value, input_file: input_file, symbology: Zint::BARCODE_HIBC_MICPDF, **kwargs)
6
+ end
7
+ end
8
+ end