mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Remove spaces before EOL
This commit is contained in:
parent
45441a6da7
commit
31cc0ae78a
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -356,3 +356,4 @@ int dpident(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,8 +26,8 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define GDSET "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz #"
|
#define GDSET "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz #"
|
||||||
@ -254,3 +254,4 @@ int australia_post(struct zint_symbol *symbol, unsigned char source[], int lengt
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
163
backend/aztec.c
163
backend/aztec.c
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -34,7 +34,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "aztec.h"
|
#include "aztec.h"
|
||||||
@ -46,7 +46,7 @@ static int count_doubles(const unsigned char source[], const int posn, const siz
|
|||||||
int c = 0;
|
int c = 0;
|
||||||
int i = posn;
|
int i = posn;
|
||||||
int cond = 1;
|
int cond = 1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (((source[i] == '.') || (source[i] == ',')) && (source[i + 1] == ' ')) {
|
if (((source[i] == '.') || (source[i] == ',')) && (source[i + 1] == ' ')) {
|
||||||
c++;
|
c++;
|
||||||
@ -63,7 +63,7 @@ static int count_cr(unsigned char source[], int posn, int length) {
|
|||||||
int c = 0;
|
int c = 0;
|
||||||
int i = posn;
|
int i = posn;
|
||||||
int cond = 1;
|
int cond = 1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (source[i] == 13) {
|
if (source[i] == 13) {
|
||||||
c++;
|
c++;
|
||||||
@ -72,7 +72,7 @@ static int count_cr(unsigned char source[], int posn, int length) {
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
} while ((i < length) && cond);
|
} while ((i < length) && cond);
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ static int count_dotcomma(unsigned char source[], int posn, int length) {
|
|||||||
int c = 0;
|
int c = 0;
|
||||||
int i = posn;
|
int i = posn;
|
||||||
int cond = 1;
|
int cond = 1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if ((source[i] == '.') || (source[i] == ',')) {
|
if ((source[i] == '.') || (source[i] == ',')) {
|
||||||
c++;
|
c++;
|
||||||
@ -89,7 +89,7 @@ static int count_dotcomma(unsigned char source[], int posn, int length) {
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
} while ((i < length) && cond);
|
} while ((i < length) && cond);
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ static int count_spaces(unsigned char source[], int posn, int length) {
|
|||||||
int c = 0;
|
int c = 0;
|
||||||
int i = posn;
|
int i = posn;
|
||||||
int cond = 1;
|
int cond = 1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (source[i] == ' ') {
|
if (source[i] == ' ') {
|
||||||
c++;
|
c++;
|
||||||
@ -106,13 +106,13 @@ static int count_spaces(unsigned char source[], int posn, int length) {
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
} while ((i < length) && cond);
|
} while ((i < length) && cond);
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char get_next_mode(char encode_mode[], const size_t src_len, const int posn) {
|
static char get_next_mode(char encode_mode[], const size_t src_len, const int posn) {
|
||||||
int i = posn;
|
int i = posn;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
i++;
|
i++;
|
||||||
} while ((i < src_len) && (encode_mode[i] == encode_mode[posn]));
|
} while ((i < src_len) && (encode_mode[i] == encode_mode[posn]));
|
||||||
@ -124,7 +124,7 @@ static char get_next_mode(char encode_mode[], const size_t src_len, const int po
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int aztec_text_process(const unsigned char source[], const size_t src_len, char binary_string[], const int gs1, const int eci, const int debug) {
|
static int aztec_text_process(const unsigned char source[], const size_t src_len, char binary_string[], const int gs1, const int eci, const int debug) {
|
||||||
|
|
||||||
char *encode_mode;
|
char *encode_mode;
|
||||||
int i, j;
|
int i, j;
|
||||||
char current_mode;
|
char current_mode;
|
||||||
@ -155,7 +155,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
encode_mode[i] = AztecModes[(int) source[i]];
|
encode_mode[i] = AztecModes[(int) source[i]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deal first with letter combinations which can be combined to one codeword
|
// Deal first with letter combinations which can be combined to one codeword
|
||||||
// Combinations are (CR LF) (. SP) (, SP) (: SP) in Punct mode
|
// Combinations are (CR LF) (. SP) (, SP) (: SP) in Punct mode
|
||||||
current_mode = 'U';
|
current_mode = 'U';
|
||||||
@ -165,17 +165,17 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
encode_mode[i] = 'P';
|
encode_mode[i] = 'P';
|
||||||
encode_mode[i + 1] = 'P';
|
encode_mode[i + 1] = 'P';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combination (: SP) should always be in Punct mode
|
// Combination (: SP) should always be in Punct mode
|
||||||
if ((source[i] == ':') && (source[i + 1] == ' ')) {
|
if ((source[i] == ':') && (source[i + 1] == ' ')) {
|
||||||
encode_mode[i + 1] = 'P';
|
encode_mode[i + 1] = 'P';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combinations (. SP) and (, SP) sometimes use fewer bits in Digit mode
|
// Combinations (. SP) and (, SP) sometimes use fewer bits in Digit mode
|
||||||
if (((source[i] == '.') || (source[i] == ',')) && (source[i + 1] == ' ') && (encode_mode[i] == 'X')) {
|
if (((source[i] == '.') || (source[i] == ',')) && (source[i + 1] == ' ') && (encode_mode[i] == 'X')) {
|
||||||
count = count_doubles(source, i, src_len);
|
count = count_doubles(source, i, src_len);
|
||||||
next_mode = get_next_mode(encode_mode, src_len, i);
|
next_mode = get_next_mode(encode_mode, src_len, i);
|
||||||
|
|
||||||
if (current_mode == 'U') {
|
if (current_mode == 'U') {
|
||||||
if ((next_mode == 'D') && (count <= 5)) {
|
if ((next_mode == 'D') && (count <= 5)) {
|
||||||
for (j = 0; j < (2 * count); j++) {
|
for (j = 0; j < (2 * count); j++) {
|
||||||
@ -183,7 +183,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mode == 'L') {
|
if (current_mode == 'L') {
|
||||||
if ((next_mode == 'U') && (count == 1)) {
|
if ((next_mode == 'U') && (count == 1)) {
|
||||||
encode_mode[i] = 'D';
|
encode_mode[i] = 'D';
|
||||||
@ -195,14 +195,14 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mode == 'M') {
|
if (current_mode == 'M') {
|
||||||
if ((next_mode == 'D') && (count == 1)) {
|
if ((next_mode == 'D') && (count == 1)) {
|
||||||
encode_mode[i] = 'D';
|
encode_mode[i] = 'D';
|
||||||
encode_mode[i + 1] = 'D';
|
encode_mode[i + 1] = 'D';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mode == 'D') {
|
if (current_mode == 'D') {
|
||||||
if ((next_mode != 'D') && (count <= 4)) {
|
if ((next_mode != 'D') && (count <= 4)) {
|
||||||
for (j = 0; j < (2 * count); j++) {
|
for (j = 0; j < (2 * count); j++) {
|
||||||
@ -215,19 +215,19 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default is Punct mode
|
// Default is Punct mode
|
||||||
if (encode_mode[i] == 'X') {
|
if (encode_mode[i] == 'X') {
|
||||||
encode_mode[i] = 'P';
|
encode_mode[i] = 'P';
|
||||||
encode_mode[i + 1] = 'P';
|
encode_mode[i + 1] = 'P';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((encode_mode[i] != 'X') && (encode_mode[i] != 'B')) {
|
if ((encode_mode[i] != 'X') && (encode_mode[i] != 'B')) {
|
||||||
current_mode = encode_mode[i];
|
current_mode = encode_mode[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
printf("First Pass:\n");
|
printf("First Pass:\n");
|
||||||
for (i = 0; i < src_len; i++) {
|
for (i = 0; i < src_len; i++) {
|
||||||
@ -235,7 +235,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reduce two letter combinations to one codeword marked as [abcd] in Punct mode
|
// Reduce two letter combinations to one codeword marked as [abcd] in Punct mode
|
||||||
i = 0;
|
i = 0;
|
||||||
j = 0;
|
j = 0;
|
||||||
@ -263,28 +263,28 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
}
|
}
|
||||||
j++;
|
j++;
|
||||||
} while (i < src_len);
|
} while (i < src_len);
|
||||||
|
|
||||||
reduced_length = j;
|
reduced_length = j;
|
||||||
|
|
||||||
current_mode = 'U';
|
current_mode = 'U';
|
||||||
for(i = 0; i < reduced_length; i++) {
|
for(i = 0; i < reduced_length; i++) {
|
||||||
// Resolve Carriage Return (CR) which can be Punct or Mixed mode
|
// Resolve Carriage Return (CR) which can be Punct or Mixed mode
|
||||||
if (reduced_source[i] == 13) {
|
if (reduced_source[i] == 13) {
|
||||||
count = count_cr(reduced_source, i, reduced_length);
|
count = count_cr(reduced_source, i, reduced_length);
|
||||||
next_mode = get_next_mode(reduced_encode_mode, reduced_length, i);
|
next_mode = get_next_mode(reduced_encode_mode, reduced_length, i);
|
||||||
|
|
||||||
if ((current_mode == 'U') && ((next_mode == 'U') || (next_mode == 'B')) && (count == 1)) {
|
if ((current_mode == 'U') && ((next_mode == 'U') || (next_mode == 'B')) && (count == 1)) {
|
||||||
reduced_encode_mode[i] = 'P';
|
reduced_encode_mode[i] = 'P';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((current_mode == 'L') && ((next_mode == 'L') || (next_mode == 'B')) && (count == 1)) {
|
if ((current_mode == 'L') && ((next_mode == 'L') || (next_mode == 'B')) && (count == 1)) {
|
||||||
reduced_encode_mode[i] = 'P';
|
reduced_encode_mode[i] = 'P';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((current_mode == 'P') || (next_mode == 'P')) {
|
if ((current_mode == 'P') || (next_mode == 'P')) {
|
||||||
reduced_encode_mode[i] = 'P';
|
reduced_encode_mode[i] = 'P';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mode == 'D') {
|
if (current_mode == 'D') {
|
||||||
if (((next_mode == 'E') || (next_mode == 'U') || (next_mode == 'D') || (next_mode == 'B')) && (count <= 2)) {
|
if (((next_mode == 'E') || (next_mode == 'U') || (next_mode == 'D') || (next_mode == 'B')) && (count <= 2)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
@ -295,24 +295,24 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
reduced_encode_mode[i] = 'P';
|
reduced_encode_mode[i] = 'P';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default is Mixed mode
|
// Default is Mixed mode
|
||||||
if (reduced_encode_mode[i] == 'X') {
|
if (reduced_encode_mode[i] == 'X') {
|
||||||
reduced_encode_mode[i] = 'M';
|
reduced_encode_mode[i] = 'M';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resolve full stop and comma which can be in Punct or Digit mode
|
// Resolve full stop and comma which can be in Punct or Digit mode
|
||||||
if ((reduced_source[i] == '.') || (reduced_source[i] == ',')) {
|
if ((reduced_source[i] == '.') || (reduced_source[i] == ',')) {
|
||||||
count = count_dotcomma(reduced_source, i, reduced_length);
|
count = count_dotcomma(reduced_source, i, reduced_length);
|
||||||
next_mode = get_next_mode(reduced_encode_mode, reduced_length, i);
|
next_mode = get_next_mode(reduced_encode_mode, reduced_length, i);
|
||||||
|
|
||||||
if (current_mode == 'U') {
|
if (current_mode == 'U') {
|
||||||
if (((next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M') || (next_mode == 'B')) && (count == 1)) {
|
if (((next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M') || (next_mode == 'B')) && (count == 1)) {
|
||||||
reduced_encode_mode[i] = 'P';
|
reduced_encode_mode[i] = 'P';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mode == 'L') {
|
if (current_mode == 'L') {
|
||||||
if ((next_mode == 'L') && (count <= 2)) {
|
if ((next_mode == 'L') && (count <= 2)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
@ -323,7 +323,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
reduced_encode_mode[i] = 'P';
|
reduced_encode_mode[i] = 'P';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mode == 'M') {
|
if (current_mode == 'M') {
|
||||||
if (((next_mode == 'E') || (next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M')) && (count <= 4)) {
|
if (((next_mode == 'E') || (next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M')) && (count <= 4)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
@ -336,24 +336,24 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((current_mode == 'P') && (next_mode != 'D') && (count <= 9)) {
|
if ((current_mode == 'P') && (next_mode != 'D') && (count <= 9)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
reduced_encode_mode[i + j] = 'P';
|
reduced_encode_mode[i + j] = 'P';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default is Digit mode
|
// Default is Digit mode
|
||||||
if (reduced_encode_mode[i] == 'X') {
|
if (reduced_encode_mode[i] == 'X') {
|
||||||
reduced_encode_mode[i] = 'D';
|
reduced_encode_mode[i] = 'D';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resolve Space (SP) which can be any mode except Punct
|
// Resolve Space (SP) which can be any mode except Punct
|
||||||
if (reduced_source[i] == ' ') {
|
if (reduced_source[i] == ' ') {
|
||||||
count = count_spaces(reduced_source, i, reduced_length);
|
count = count_spaces(reduced_source, i, reduced_length);
|
||||||
next_mode = get_next_mode(reduced_encode_mode, reduced_length, i);
|
next_mode = get_next_mode(reduced_encode_mode, reduced_length, i);
|
||||||
|
|
||||||
if (current_mode == 'U') {
|
if (current_mode == 'U') {
|
||||||
if ((next_mode == 'E') && (count <= 5)) {
|
if ((next_mode == 'E') && (count <= 5)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
@ -366,7 +366,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mode == 'L') {
|
if (current_mode == 'L') {
|
||||||
if ((next_mode == 'E') && (count <= 5)) {
|
if ((next_mode == 'E') && (count <= 5)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
@ -387,116 +387,116 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mode == 'M') {
|
if (current_mode == 'M') {
|
||||||
if (((next_mode == 'E') || (next_mode == 'U')) && (count <= 9)) {
|
if (((next_mode == 'E') || (next_mode == 'U')) && (count <= 9)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
reduced_encode_mode[i + j] = 'M';
|
reduced_encode_mode[i + j] = 'M';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((next_mode == 'L') || (next_mode == 'B')) && (count <= 14)) {
|
if (((next_mode == 'L') || (next_mode == 'B')) && (count <= 14)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
reduced_encode_mode[i + j] = 'M';
|
reduced_encode_mode[i + j] = 'M';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((next_mode == 'M') || (next_mode == 'P')) && (count <= 19)) {
|
if (((next_mode == 'M') || (next_mode == 'P')) && (count <= 19)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
reduced_encode_mode[i + j] = 'M';
|
reduced_encode_mode[i + j] = 'M';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mode == 'P') {
|
if (current_mode == 'P') {
|
||||||
if ((next_mode == 'E') && (count <= 5)) {
|
if ((next_mode == 'E') && (count <= 5)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
reduced_encode_mode[i + j] = 'U';
|
reduced_encode_mode[i + j] = 'U';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M') || (next_mode == 'P') || (next_mode == 'B')) && (count <= 9)) {
|
if (((next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M') || (next_mode == 'P') || (next_mode == 'B')) && (count <= 9)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
reduced_encode_mode[i + j] = 'U';
|
reduced_encode_mode[i + j] = 'U';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default is Digit mode
|
// Default is Digit mode
|
||||||
if (reduced_encode_mode[i] == 'X') {
|
if (reduced_encode_mode[i] == 'X') {
|
||||||
reduced_encode_mode[i] = 'D';
|
reduced_encode_mode[i] = 'D';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reduced_encode_mode[i] != 'B') {
|
if (reduced_encode_mode[i] != 'B') {
|
||||||
current_mode = reduced_encode_mode[i];
|
current_mode = reduced_encode_mode[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decide when to use P/S instead of P/L and U/S instead of U/L
|
// Decide when to use P/S instead of P/L and U/S instead of U/L
|
||||||
current_mode = 'U';
|
current_mode = 'U';
|
||||||
for(i = 0; i < reduced_length; i++) {
|
for(i = 0; i < reduced_length; i++) {
|
||||||
|
|
||||||
if (reduced_encode_mode[i] != current_mode) {
|
if (reduced_encode_mode[i] != current_mode) {
|
||||||
|
|
||||||
for (count = 0; ((i + count) <= reduced_length) && (reduced_encode_mode[i + count] == reduced_encode_mode[i]); count++);
|
for (count = 0; ((i + count) <= reduced_length) && (reduced_encode_mode[i + count] == reduced_encode_mode[i]); count++);
|
||||||
next_mode = get_next_mode(reduced_encode_mode, reduced_length, i);
|
next_mode = get_next_mode(reduced_encode_mode, reduced_length, i);
|
||||||
|
|
||||||
if (reduced_encode_mode[i] == 'P') {
|
if (reduced_encode_mode[i] == 'P') {
|
||||||
if ((current_mode == 'U') && (count <= 2)) {
|
if ((current_mode == 'U') && (count <= 2)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
reduced_encode_mode[i + j] = 'p';
|
reduced_encode_mode[i + j] = 'p';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((current_mode == 'L') && (next_mode != 'U') && (count <= 2)) {
|
if ((current_mode == 'L') && (next_mode != 'U') && (count <= 2)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
reduced_encode_mode[i + j] = 'p';
|
reduced_encode_mode[i + j] = 'p';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((current_mode == 'L') && (next_mode == 'U') && (count == 1)) {
|
if ((current_mode == 'L') && (next_mode == 'U') && (count == 1)) {
|
||||||
reduced_encode_mode[i] = 'p';
|
reduced_encode_mode[i] = 'p';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((current_mode == 'M') && (next_mode != 'M') && (count == 1)) {
|
if ((current_mode == 'M') && (next_mode != 'M') && (count == 1)) {
|
||||||
reduced_encode_mode[i] = 'p';
|
reduced_encode_mode[i] = 'p';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((current_mode == 'M') && (next_mode == 'M') && (count <= 2)) {
|
if ((current_mode == 'M') && (next_mode == 'M') && (count <= 2)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
reduced_encode_mode[i + j] = 'p';
|
reduced_encode_mode[i + j] = 'p';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((current_mode == 'D') && (next_mode != 'D') && (count <= 3)) {
|
if ((current_mode == 'D') && (next_mode != 'D') && (count <= 3)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
reduced_encode_mode[i + j] = 'p';
|
reduced_encode_mode[i + j] = 'p';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((current_mode == 'D') && (next_mode == 'D') && (count <= 6)) {
|
if ((current_mode == 'D') && (next_mode == 'D') && (count <= 6)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
reduced_encode_mode[i + j] = 'p';
|
reduced_encode_mode[i + j] = 'p';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reduced_encode_mode[i] == 'U') {
|
if (reduced_encode_mode[i] == 'U') {
|
||||||
if ((current_mode == 'L') && ((next_mode == 'L') || (next_mode == 'M')) && (count <= 2)) {
|
if ((current_mode == 'L') && ((next_mode == 'L') || (next_mode == 'M')) && (count <= 2)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
reduced_encode_mode[i + j] = 'u';
|
reduced_encode_mode[i + j] = 'u';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((current_mode == 'L') && ((next_mode == 'E') || (next_mode == 'D') || (next_mode == 'B') || (next_mode == 'P')) && (count == 1)) {
|
if ((current_mode == 'L') && ((next_mode == 'E') || (next_mode == 'D') || (next_mode == 'B') || (next_mode == 'P')) && (count == 1)) {
|
||||||
reduced_encode_mode[i] = 'u';
|
reduced_encode_mode[i] = 'u';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((current_mode == 'D') && (next_mode == 'D') && (count == 1)) {
|
if ((current_mode == 'D') && (next_mode == 'D') && (count == 1)) {
|
||||||
reduced_encode_mode[i] = 'u';
|
reduced_encode_mode[i] = 'u';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((current_mode == 'D') && (next_mode == 'P') && (count <= 2)) {
|
if ((current_mode == 'D') && (next_mode == 'P') && (count <= 2)) {
|
||||||
for (j = 0; j < count; j++) {
|
for (j = 0; j < count; j++) {
|
||||||
reduced_encode_mode[i + j] = 'u';
|
reduced_encode_mode[i + j] = 'u';
|
||||||
@ -504,7 +504,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((reduced_encode_mode[i] != 'p') && (reduced_encode_mode[i] != 'u') && (reduced_encode_mode[i] != 'B')) {
|
if ((reduced_encode_mode[i] != 'p') && (reduced_encode_mode[i] != 'u') && (reduced_encode_mode[i] != 'B')) {
|
||||||
current_mode = reduced_encode_mode[i];
|
current_mode = reduced_encode_mode[i];
|
||||||
}
|
}
|
||||||
@ -520,9 +520,9 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(binary_string, "");
|
strcpy(binary_string, "");
|
||||||
|
|
||||||
if (gs1) {
|
if (gs1) {
|
||||||
bin_append(0, 5, binary_string); // P/S
|
bin_append(0, 5, binary_string); // P/S
|
||||||
bin_append(0, 5, binary_string); // FLG(n)
|
bin_append(0, 5, binary_string); // FLG(n)
|
||||||
@ -575,11 +575,11 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
|
|
||||||
current_mode = 'U';
|
current_mode = 'U';
|
||||||
for(i = 0; i < reduced_length; i++) {
|
for(i = 0; i < reduced_length; i++) {
|
||||||
|
|
||||||
if (reduced_encode_mode[i] != 'B') {
|
if (reduced_encode_mode[i] != 'B') {
|
||||||
byte_mode = 0;
|
byte_mode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((reduced_encode_mode[i] != current_mode) && (!byte_mode)) {
|
if ((reduced_encode_mode[i] != current_mode) && (!byte_mode)) {
|
||||||
// Change mode
|
// Change mode
|
||||||
if (current_mode == 'U') {
|
if (current_mode == 'U') {
|
||||||
@ -605,7 +605,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mode == 'L') {
|
if (current_mode == 'L') {
|
||||||
switch (reduced_encode_mode[i]) {
|
switch (reduced_encode_mode[i]) {
|
||||||
case 'U':
|
case 'U':
|
||||||
@ -633,7 +633,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mode == 'M') {
|
if (current_mode == 'M') {
|
||||||
switch (reduced_encode_mode[i]) {
|
switch (reduced_encode_mode[i]) {
|
||||||
case 'U':
|
case 'U':
|
||||||
@ -657,7 +657,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mode == 'P') {
|
if (current_mode == 'P') {
|
||||||
switch (reduced_encode_mode[i]) {
|
switch (reduced_encode_mode[i]) {
|
||||||
case 'U':
|
case 'U':
|
||||||
@ -682,7 +682,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mode == 'D') {
|
if (current_mode == 'D') {
|
||||||
switch (reduced_encode_mode[i]) {
|
switch (reduced_encode_mode[i]) {
|
||||||
case 'U':
|
case 'U':
|
||||||
@ -714,7 +714,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Byte mode length descriptor
|
// Byte mode length descriptor
|
||||||
if ((reduced_encode_mode[i] == 'B') && (!byte_mode)) {
|
if ((reduced_encode_mode[i] == 'B') && (!byte_mode)) {
|
||||||
for (count = 0; ((i + count) < reduced_length) && (reduced_encode_mode[i + count] == 'B'); count++);
|
for (count = 0; ((i + count) < reduced_length) && (reduced_encode_mode[i + count] == 'B'); count++);
|
||||||
@ -746,7 +746,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
bin_append(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string);
|
bin_append(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reduced_encode_mode[i] == 'L') {
|
if (reduced_encode_mode[i] == 'L') {
|
||||||
if (reduced_source[i] == ' ') {
|
if (reduced_source[i] == ' ') {
|
||||||
bin_append(1, 5, binary_string); // SP
|
bin_append(1, 5, binary_string); // SP
|
||||||
@ -754,7 +754,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
bin_append(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string);
|
bin_append(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reduced_encode_mode[i] == 'M') {
|
if (reduced_encode_mode[i] == 'M') {
|
||||||
if (reduced_source[i] == ' ') {
|
if (reduced_source[i] == ' ') {
|
||||||
bin_append(1, 5, binary_string); // SP
|
bin_append(1, 5, binary_string); // SP
|
||||||
@ -764,7 +764,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
bin_append(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string);
|
bin_append(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((reduced_encode_mode[i] == 'P') || (reduced_encode_mode[i] == 'p')) {
|
if ((reduced_encode_mode[i] == 'P') || (reduced_encode_mode[i] == 'p')) {
|
||||||
if (gs1 && (reduced_source[i] == '[')) {
|
if (gs1 && (reduced_source[i] == '[')) {
|
||||||
bin_append(0, 5, binary_string); // FLG(0) = FNC1
|
bin_append(0, 5, binary_string); // FLG(0) = FNC1
|
||||||
@ -786,7 +786,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
bin_append(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string);
|
bin_append(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reduced_encode_mode[i] == 'D') {
|
if (reduced_encode_mode[i] == 'D') {
|
||||||
if (reduced_source[i] == ' ') {
|
if (reduced_source[i] == ' ') {
|
||||||
bin_append(1, 4, binary_string); // SP
|
bin_append(1, 4, binary_string); // SP
|
||||||
@ -798,12 +798,12 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
bin_append(AztecSymbolChar[(int) reduced_source[i]], 4, binary_string);
|
bin_append(AztecSymbolChar[(int) reduced_source[i]], 4, binary_string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reduced_encode_mode[i] == 'B') {
|
if (reduced_encode_mode[i] == 'B') {
|
||||||
bin_append(reduced_source[i], 8, binary_string);
|
bin_append(reduced_source[i], 8, binary_string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
printf("Binary String:\n");
|
printf("Binary String:\n");
|
||||||
printf("%s\n", binary_string);
|
printf("%s\n", binary_string);
|
||||||
@ -812,7 +812,7 @@ static int aztec_text_process(const unsigned char source[], const size_t src_len
|
|||||||
free(encode_mode);
|
free(encode_mode);
|
||||||
free(reduced_source);
|
free(reduced_source);
|
||||||
free(reduced_encode_mode);
|
free(reduced_encode_mode);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1358,7 +1358,7 @@ int aztec(struct zint_symbol *symbol, unsigned char source[], const size_t lengt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (codeword_size) {
|
switch (codeword_size) {
|
||||||
case 6:
|
case 6:
|
||||||
rs_init_gf(0x43);
|
rs_init_gf(0x43);
|
||||||
@ -1380,7 +1380,7 @@ int aztec(struct zint_symbol *symbol, unsigned char source[], const size_t lengt
|
|||||||
bin_append(ecc_part[i], codeword_size, adjusted_string);
|
bin_append(ecc_part[i], codeword_size, adjusted_string);
|
||||||
}
|
}
|
||||||
rs_free();
|
rs_free();
|
||||||
|
|
||||||
/* Invert the data so that actual data is on the outside and reed-solomon on the inside */
|
/* Invert the data so that actual data is on the outside and reed-solomon on the inside */
|
||||||
memset(bit_pattern, '0', 20045);
|
memset(bit_pattern, '0', 20045);
|
||||||
|
|
||||||
@ -1691,3 +1691,4 @@ int aztec_runes(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -143,3 +143,4 @@ static const char AztecOffset[32] = {
|
|||||||
static const char AztecCompactOffset[4] = {
|
static const char AztecCompactOffset[4] = {
|
||||||
6, 4, 2, 0
|
6, 4, 2, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -145,3 +145,4 @@ int bmp_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
free(bitmap);
|
free(bitmap);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,7 +25,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#pragma pack (1)
|
#pragma pack (1)
|
||||||
|
|
||||||
typedef struct bitmap_file_header {
|
typedef struct bitmap_file_header {
|
||||||
uint16_t header_field;
|
uint16_t header_field;
|
||||||
uint32_t file_size;
|
uint32_t file_size;
|
||||||
@ -65,12 +65,13 @@ extern "C" {
|
|||||||
uint32_t colours;
|
uint32_t colours;
|
||||||
uint32_t important_colours;
|
uint32_t important_colours;
|
||||||
} bitmap_info_header_t;
|
} bitmap_info_header_t;
|
||||||
|
|
||||||
#pragma pack ()
|
#pragma pack ()
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* BMP_H */
|
#endif /* BMP_H */
|
||||||
|
|
||||||
|
|
||||||
|
@ -994,14 +994,15 @@ int codablock(struct zint_symbol *symbol,const unsigned char source[], const siz
|
|||||||
expand(symbol, dest);
|
expand(symbol, dest);
|
||||||
symbol->row_height[r] = 10;
|
symbol->row_height[r] = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(symbol->output_options & BARCODE_BIND)) {
|
if (!(symbol->output_options & BARCODE_BIND)) {
|
||||||
symbol->output_options += BARCODE_BIND;
|
symbol->output_options += BARCODE_BIND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->border_width < 2) {
|
if (symbol->border_width < 2) {
|
||||||
symbol->border_width = 2;
|
symbol->border_width = 2;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -590,3 +590,4 @@ int channel_code(struct zint_symbol *symbol, unsigned char source[], int length)
|
|||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -904,7 +904,7 @@ int c1_encode(struct zint_symbol *symbol, unsigned char source[], unsigned int t
|
|||||||
/* Binary buffer is full - transfer to target */
|
/* Binary buffer is full - transfer to target */
|
||||||
if (target_count >= 1) {
|
if (target_count >= 1) {
|
||||||
sub_target = 0;
|
sub_target = 0;
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
if (decimal_binary[i] == '1') {
|
if (decimal_binary[i] == '1') {
|
||||||
sub_target += 128 >> i;
|
sub_target += 128 >> i;
|
||||||
@ -915,7 +915,7 @@ int c1_encode(struct zint_symbol *symbol, unsigned char source[], unsigned int t
|
|||||||
}
|
}
|
||||||
if (target_count >= 2) {
|
if (target_count >= 2) {
|
||||||
sub_target = 0;
|
sub_target = 0;
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
if (decimal_binary[i + 8] == '1') {
|
if (decimal_binary[i + 8] == '1') {
|
||||||
sub_target += 128 >> i;
|
sub_target += 128 >> i;
|
||||||
@ -926,7 +926,7 @@ int c1_encode(struct zint_symbol *symbol, unsigned char source[], unsigned int t
|
|||||||
}
|
}
|
||||||
if (target_count == 3) {
|
if (target_count == 3) {
|
||||||
sub_target = 0;
|
sub_target = 0;
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
if (decimal_binary[i + 16] == '1') {
|
if (decimal_binary[i + 16] == '1') {
|
||||||
sub_target += 128 >> i;
|
sub_target += 128 >> i;
|
||||||
@ -1104,7 +1104,7 @@ int c1_encode(struct zint_symbol *symbol, unsigned char source[], unsigned int t
|
|||||||
/* Binary buffer is full - transfer to target */
|
/* Binary buffer is full - transfer to target */
|
||||||
if (target_count >= 1) {
|
if (target_count >= 1) {
|
||||||
sub_target = 0;
|
sub_target = 0;
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
if (decimal_binary[i] == '1') {
|
if (decimal_binary[i] == '1') {
|
||||||
sub_target += 128 >> i;
|
sub_target += 128 >> i;
|
||||||
@ -1115,7 +1115,7 @@ int c1_encode(struct zint_symbol *symbol, unsigned char source[], unsigned int t
|
|||||||
}
|
}
|
||||||
if (target_count >= 2) {
|
if (target_count >= 2) {
|
||||||
sub_target = 0;
|
sub_target = 0;
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
if (decimal_binary[i + 8] == '1') {
|
if (decimal_binary[i + 8] == '1') {
|
||||||
sub_target += 128 >> i;
|
sub_target += 128 >> i;
|
||||||
@ -1126,7 +1126,7 @@ int c1_encode(struct zint_symbol *symbol, unsigned char source[], unsigned int t
|
|||||||
}
|
}
|
||||||
if (target_count == 3) {
|
if (target_count == 3) {
|
||||||
sub_target = 0;
|
sub_target = 0;
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
if (decimal_binary[i + 16] == '1') {
|
if (decimal_binary[i + 16] == '1') {
|
||||||
sub_target += 128 >> i;
|
sub_target += 128 >> i;
|
||||||
@ -1161,7 +1161,7 @@ int c1_encode(struct zint_symbol *symbol, unsigned char source[], unsigned int t
|
|||||||
strcpy(symbol->errtxt, "512: Input data too long");
|
strcpy(symbol->errtxt, "512: Input data too long");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
printf("targets:\n");
|
printf("targets:\n");
|
||||||
for(i = 0; i < tp; i++) {
|
for(i = 0; i < tp; i++) {
|
||||||
printf("[%d]", target[i]);
|
printf("[%d]", target[i]);
|
||||||
@ -1426,7 +1426,7 @@ int code_one(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
if (symbol->option_2 > size) {
|
if (symbol->option_2 > size) {
|
||||||
size = symbol->option_2;
|
size = symbol->option_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((symbol-> option_2 != 0) && (symbol->option_2 < size)) {
|
if ((symbol-> option_2 != 0) && (symbol->option_2 < size)) {
|
||||||
strcpy(symbol->errtxt, "518: Input too long for selected symbol size");
|
strcpy(symbol->errtxt, "518: Input too long for selected symbol size");
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
@ -1770,3 +1770,4 @@ int code_one(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -99,4 +99,4 @@ static const unsigned short int c1_grid_height[] = {
|
|||||||
#define C1_DECIMAL 3
|
#define C1_DECIMAL 3
|
||||||
#define C1_TEXT 4
|
#define C1_TEXT 4
|
||||||
#define C1_EDI 5
|
#define C1_EDI 5
|
||||||
#define C1_BYTE 6
|
#define C1_BYTE 6
|
||||||
|
@ -9,14 +9,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -27,7 +27,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -35,7 +35,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "gs1.h"
|
#include "gs1.h"
|
||||||
@ -291,7 +291,7 @@ void c128_set_c(unsigned char source_a, unsigned char source_b, char dest[], int
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Handle Code 128 and NVE-18 */
|
/* Handle Code 128 and NVE-18 */
|
||||||
int code_128(struct zint_symbol *symbol, unsigned char source[], const size_t length) {
|
int code_128(struct zint_symbol *symbol, unsigned char source[], const size_t length) {
|
||||||
int i, j, k, values[170] = {0}, bar_characters, read, total_sum;
|
int i, j, k, values[170] = {0}, bar_characters, read, total_sum;
|
||||||
int error_number, indexchaine, indexliste, f_state;
|
int error_number, indexchaine, indexliste, f_state;
|
||||||
size_t sourcelen;
|
size_t sourcelen;
|
||||||
@ -1087,3 +1087,4 @@ int ean_14(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ int code_49(struct zint_symbol *symbol, unsigned char source[], const int length
|
|||||||
|
|
||||||
/* Expand into symbol */
|
/* Expand into symbol */
|
||||||
symbol->row_height[i] = 10;
|
symbol->row_height[i] = 10;
|
||||||
|
|
||||||
for (j = 0; j < strlen(pattern); j++) {
|
for (j = 0; j < strlen(pattern); j++) {
|
||||||
if (pattern[j] == '1') {
|
if (pattern[j] == '1') {
|
||||||
set_module(symbol, i, j);
|
set_module(symbol, i, j);
|
||||||
@ -343,3 +343,4 @@ int code_49(struct zint_symbol *symbol, unsigned char source[], const int length
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,9 +56,9 @@ void bin_append(const int arg, const int length, char *binary) {
|
|||||||
int i;
|
int i;
|
||||||
int start;
|
int start;
|
||||||
size_t posn = strlen(binary);
|
size_t posn = strlen(binary);
|
||||||
|
|
||||||
start = 0x01 << (length - 1);
|
start = 0x01 << (length - 1);
|
||||||
|
|
||||||
for (i = 0; i < length; i++) {
|
for (i = 0; i < length; i++) {
|
||||||
binary[posn + i] = '0';
|
binary[posn + i] = '0';
|
||||||
if (arg & (start >> i)) {
|
if (arg & (start >> i)) {
|
||||||
@ -66,7 +66,7 @@ void bin_append(const int arg, const int length, char *binary) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
binary[posn + length] = '\0';
|
binary[posn + length] = '\0';
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ int is_stackable(const int symbology) {
|
|||||||
if (symbology < BARCODE_PDF417) {
|
if (symbology < BARCODE_PDF417) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (symbology) {
|
switch (symbology) {
|
||||||
case BARCODE_CODE128B:
|
case BARCODE_CODE128B:
|
||||||
case BARCODE_ISBNX:
|
case BARCODE_ISBNX:
|
||||||
@ -300,15 +300,15 @@ void set_minimum_height(struct zint_symbol *symbol, const int min_height) {
|
|||||||
int fixed_height = 0;
|
int fixed_height = 0;
|
||||||
int zero_count = 0;
|
int zero_count = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < symbol->rows; i++) {
|
for (i = 0; i < symbol->rows; i++) {
|
||||||
fixed_height += symbol->row_height[i];
|
fixed_height += symbol->row_height[i];
|
||||||
|
|
||||||
if (symbol->row_height[i] == 0) {
|
if (symbol->row_height[i] == 0) {
|
||||||
zero_count++;
|
zero_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zero_count > 0) {
|
if (zero_count > 0) {
|
||||||
if (((symbol->height - fixed_height) / zero_count) < min_height) {
|
if (((symbol->height - fixed_height) / zero_count) < min_height) {
|
||||||
for (i = 0; i < symbol->rows; i++) {
|
for (i = 0; i < symbol->rows; i++) {
|
||||||
@ -319,3 +319,4 @@ void set_minimum_height(struct zint_symbol *symbol, const int min_height) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ static int encode928(UINT bitString[], UINT codeWords[], int bitLng) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* CC-A 2D component */
|
/* CC-A 2D component */
|
||||||
static int cc_a(struct zint_symbol *symbol, char source[], int cc_width) {
|
static int cc_a(struct zint_symbol *symbol, char source[], int cc_width) {
|
||||||
int i, segment, bitlen, cwCnt, variant, rows;
|
int i, segment, bitlen, cwCnt, variant, rows;
|
||||||
int k, offset, j, total, rsCodeWords[8];
|
int k, offset, j, total, rsCodeWords[8];
|
||||||
int LeftRAPStart, RightRAPStart, CentreRAPStart, StartCluster;
|
int LeftRAPStart, RightRAPStart, CentreRAPStart, StartCluster;
|
||||||
@ -335,7 +335,7 @@ static int cc_a(struct zint_symbol *symbol, char source[], int cc_width) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* CC-B 2D component */
|
/* CC-B 2D component */
|
||||||
static int cc_b(struct zint_symbol *symbol, char source[], int cc_width) {
|
static int cc_b(struct zint_symbol *symbol, char source[], int cc_width) {
|
||||||
int length, i;
|
int length, i;
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
unsigned char data_string[(strlen(source) / 8) + 3];
|
unsigned char data_string[(strlen(source) / 8) + 3];
|
||||||
@ -588,7 +588,7 @@ static int cc_b(struct zint_symbol *symbol, char source[], int cc_width) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* CC-C 2D component - byte compressed PDF417 */
|
/* CC-C 2D component - byte compressed PDF417 */
|
||||||
static int cc_c(struct zint_symbol *symbol, char source[], int cc_width, int ecc_level) {
|
static int cc_c(struct zint_symbol *symbol, char source[], int cc_width, int ecc_level) {
|
||||||
int length, i, p;
|
int length, i, p;
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
unsigned char data_string[(strlen(source) / 8) + 4];
|
unsigned char data_string[(strlen(source) / 8) + 4];
|
||||||
@ -730,7 +730,7 @@ static int cc_c(struct zint_symbol *symbol, char source[], int cc_width, int ecc
|
|||||||
|
|
||||||
static int calc_padding_cca(int binary_length, int cc_width) {
|
static int calc_padding_cca(int binary_length, int cc_width) {
|
||||||
int target_bitsize = 0;
|
int target_bitsize = 0;
|
||||||
|
|
||||||
switch (cc_width) {
|
switch (cc_width) {
|
||||||
case 2:
|
case 2:
|
||||||
if (binary_length <= 167) {
|
if (binary_length <= 167) {
|
||||||
@ -790,13 +790,13 @@ static int calc_padding_cca(int binary_length, int cc_width) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return target_bitsize;
|
return target_bitsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
int calc_padding_ccb(int binary_length, int cc_width) {
|
int calc_padding_ccb(int binary_length, int cc_width) {
|
||||||
int target_bitsize = 0;
|
int target_bitsize = 0;
|
||||||
|
|
||||||
switch (cc_width) {
|
switch (cc_width) {
|
||||||
case 2:
|
case 2:
|
||||||
if (binary_length <= 336) {
|
if (binary_length <= 336) {
|
||||||
@ -889,7 +889,7 @@ int calc_padding_ccb(int binary_length, int cc_width) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return target_bitsize;
|
return target_bitsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -944,7 +944,7 @@ int calc_padding_ccc(int binary_length, int *cc_width, int lin_width, int *ecc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
codewords_total = *(cc_width) * rows;
|
codewords_total = *(cc_width) * rows;
|
||||||
|
|
||||||
if (codewords_total > 928) { // PDF_MAX
|
if (codewords_total > 928) { // PDF_MAX
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -956,7 +956,7 @@ int calc_padding_ccc(int binary_length, int *cc_width, int lin_width, int *ecc)
|
|||||||
target_bytesize += target_codewords % 5;
|
target_bytesize += target_codewords % 5;
|
||||||
|
|
||||||
target_bitsize = 8 * target_bytesize;
|
target_bitsize = 8 * target_bytesize;
|
||||||
|
|
||||||
return target_bitsize;
|
return target_bitsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1194,7 +1194,7 @@ static int cc_binary_string(struct zint_symbol *symbol, const char source[], cha
|
|||||||
/* Encoding can be done according to 5.2.2 c) 2) */
|
/* Encoding can be done according to 5.2.2 c) 2) */
|
||||||
/* five bit binary string representing value before letter */
|
/* five bit binary string representing value before letter */
|
||||||
bin_append(numeric_value, 5, binary_string);
|
bin_append(numeric_value, 5, binary_string);
|
||||||
|
|
||||||
/* followed by four bit representation of letter from Table 3 */
|
/* followed by four bit representation of letter from Table 3 */
|
||||||
bin_append(table3_letter, 4, binary_string);
|
bin_append(table3_letter, 4, binary_string);
|
||||||
} else {
|
} else {
|
||||||
@ -1254,7 +1254,7 @@ static int cc_binary_string(struct zint_symbol *symbol, const char source[], cha
|
|||||||
case '*':
|
case '*':
|
||||||
bin_append(58, 6, binary_string);
|
bin_append(58, 6, binary_string);
|
||||||
break;
|
break;
|
||||||
case ',':
|
case ',':
|
||||||
bin_append(59, 6, binary_string);
|
bin_append(59, 6, binary_string);
|
||||||
break;
|
break;
|
||||||
case '-':
|
case '-':
|
||||||
@ -1437,7 +1437,7 @@ static int cc_binary_string(struct zint_symbol *symbol, const char source[], cha
|
|||||||
case '*':
|
case '*':
|
||||||
bin_append(58, 6, binary_string);
|
bin_append(58, 6, binary_string);
|
||||||
break;
|
break;
|
||||||
case ',':
|
case ',':
|
||||||
bin_append(59, 6, binary_string);
|
bin_append(59, 6, binary_string);
|
||||||
break;
|
break;
|
||||||
case '-':
|
case '-':
|
||||||
@ -1505,7 +1505,7 @@ static int cc_binary_string(struct zint_symbol *symbol, const char source[], cha
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (i + latch < (int) strlen(general_field));
|
} while (i + latch < (int) strlen(general_field));
|
||||||
|
|
||||||
binary_length = (int)strlen(binary_string);
|
binary_length = (int)strlen(binary_string);
|
||||||
switch (cc_mode) {
|
switch (cc_mode) {
|
||||||
case 1:
|
case 1:
|
||||||
@ -1518,7 +1518,7 @@ static int cc_binary_string(struct zint_symbol *symbol, const char source[], cha
|
|||||||
target_bitsize = calc_padding_ccc(binary_length, cc_width, lin_width, ecc);
|
target_bitsize = calc_padding_ccc(binary_length, cc_width, lin_width, ecc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target_bitsize == 0) {
|
if (target_bitsize == 0) {
|
||||||
strcpy(symbol->errtxt, "442: Input too long for selected 2d component");
|
strcpy(symbol->errtxt, "442: Input too long for selected 2d component");
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
@ -1556,7 +1556,7 @@ static int cc_binary_string(struct zint_symbol *symbol, const char source[], cha
|
|||||||
target_bitsize = calc_padding_ccc(binary_length, cc_width, lin_width, ecc);
|
target_bitsize = calc_padding_ccc(binary_length, cc_width, lin_width, ecc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target_bitsize == 0) {
|
if (target_bitsize == 0) {
|
||||||
strcpy(symbol->errtxt, "444: Input too long for selected 2d component");
|
strcpy(symbol->errtxt, "444: Input too long for selected 2d component");
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
@ -1590,14 +1590,14 @@ int linear_dummy_run(unsigned char *source, int length) {
|
|||||||
struct zint_symbol *dummy;
|
struct zint_symbol *dummy;
|
||||||
int error_number;
|
int error_number;
|
||||||
int linear_width;
|
int linear_width;
|
||||||
|
|
||||||
dummy = ZBarcode_Create();
|
dummy = ZBarcode_Create();
|
||||||
dummy->symbology = BARCODE_EAN128_CC;
|
dummy->symbology = BARCODE_EAN128_CC;
|
||||||
dummy->option_1 = 3;
|
dummy->option_1 = 3;
|
||||||
error_number = ean_128(dummy, source, length);
|
error_number = ean_128(dummy, source, length);
|
||||||
linear_width = dummy->width;
|
linear_width = dummy->width;
|
||||||
ZBarcode_Delete(dummy);
|
ZBarcode_Delete(dummy);
|
||||||
|
|
||||||
if (error_number == 0) {
|
if (error_number == 0) {
|
||||||
return linear_width;
|
return linear_width;
|
||||||
} else {
|
} else {
|
||||||
@ -1621,7 +1621,7 @@ int composite(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
struct zint_symbol *linear;
|
struct zint_symbol *linear;
|
||||||
int top_shift, bottom_shift;
|
int top_shift, bottom_shift;
|
||||||
int linear_width = 0;
|
int linear_width = 0;
|
||||||
|
|
||||||
/* Perform sanity checks on input options first */
|
/* Perform sanity checks on input options first */
|
||||||
error_number = 0;
|
error_number = 0;
|
||||||
pri_len = (int)strlen(symbol->primary);
|
pri_len = (int)strlen(symbol->primary);
|
||||||
@ -1634,7 +1634,7 @@ int composite(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
strcpy(symbol->errtxt, "446: 2D component input data too long");
|
strcpy(symbol->errtxt, "446: 2D component input data too long");
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
|
|
||||||
cc_mode = symbol->option_1;
|
cc_mode = symbol->option_1;
|
||||||
if ((cc_mode == 3) && (symbol->symbology != BARCODE_EAN128_CC)) {
|
if ((cc_mode == 3) && (symbol->symbology != BARCODE_EAN128_CC)) {
|
||||||
/* CC-C can only be used with a GS1-128 linear part */
|
/* CC-C can only be used with a GS1-128 linear part */
|
||||||
@ -1646,7 +1646,7 @@ int composite(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
if (error_number != 0) {
|
if (error_number != 0) {
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->symbology == BARCODE_EAN128_CC) {
|
if (symbol->symbology == BARCODE_EAN128_CC) {
|
||||||
/* Do a test run of encoding the linear component to establish its width */
|
/* Do a test run of encoding the linear component to establish its width */
|
||||||
linear_width = linear_dummy_run((unsigned char *) symbol->primary, pri_len);
|
linear_width = linear_dummy_run((unsigned char *) symbol->primary, pri_len);
|
||||||
@ -1691,7 +1691,7 @@ int composite(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
case BARCODE_RSS_EXPSTACK_CC: cc_width = 4;
|
case BARCODE_RSS_EXPSTACK_CC: cc_width = 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(binary_string, 0, bs);
|
memset(binary_string, 0, bs);
|
||||||
|
|
||||||
if (cc_mode < 1 || cc_mode > 3) {
|
if (cc_mode < 1 || cc_mode > 3) {
|
||||||
@ -1738,10 +1738,10 @@ int composite(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
if (error_number != 0) {
|
if (error_number != 0) {
|
||||||
return ZINT_ERROR_ENCODING_PROBLEM;
|
return ZINT_ERROR_ENCODING_PROBLEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 2D component done, now calculate linear component */
|
/* 2D component done, now calculate linear component */
|
||||||
linear = ZBarcode_Create(); /* Symbol contains the 2D component and Linear contains the rest */
|
linear = ZBarcode_Create(); /* Symbol contains the 2D component and Linear contains the rest */
|
||||||
|
|
||||||
linear->symbology = symbol->symbology;
|
linear->symbology = symbol->symbology;
|
||||||
|
|
||||||
if (linear->symbology != BARCODE_EAN128_CC) {
|
if (linear->symbology != BARCODE_EAN128_CC) {
|
||||||
@ -1874,3 +1874,4 @@ int composite(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ static void ecc200(unsigned char *binary, const int bytes, const int datablock,
|
|||||||
|
|
||||||
/* Return true (1) if a character is valid in X12 set */
|
/* Return true (1) if a character is valid in X12 set */
|
||||||
static int isX12(const int source) {
|
static int isX12(const int source) {
|
||||||
|
|
||||||
switch(source) {
|
switch(source) {
|
||||||
case 13: // CR
|
case 13: // CR
|
||||||
case 42: // *
|
case 42: // *
|
||||||
@ -517,7 +517,7 @@ static int look_ahead_test(const unsigned char inputData[], const size_t sourcel
|
|||||||
best_scheme = DM_ASCII;
|
best_scheme = DM_ASCII;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sp++;
|
sp++;
|
||||||
} while (best_scheme == DM_NULL); // step (s)
|
} while (best_scheme == DM_NULL); // step (s)
|
||||||
|
|
||||||
@ -897,11 +897,11 @@ static int dm200encode(struct zint_symbol *symbol, const unsigned char source[],
|
|||||||
next_mode = DM_ASCII;
|
next_mode = DM_ASCII;
|
||||||
} else {
|
} else {
|
||||||
int value = source[sp];
|
int value = source[sp];
|
||||||
|
|
||||||
if (source[sp] >= 64) { // '@'
|
if (source[sp] >= 64) { // '@'
|
||||||
value -= 64;
|
value -= 64;
|
||||||
}
|
}
|
||||||
|
|
||||||
process_buffer[*process_p] = value;
|
process_buffer[*process_p] = value;
|
||||||
(*process_p)++;
|
(*process_p)++;
|
||||||
sp++;
|
sp++;
|
||||||
@ -998,7 +998,7 @@ static int dm200encode(struct zint_symbol *symbol, const unsigned char source[],
|
|||||||
|
|
||||||
static int dm200encode_remainder(unsigned char target[], int target_length, const unsigned char source[], const size_t inputlen, const int last_mode, const int process_buffer[], const int process_p, const int symbols_left) {
|
static int dm200encode_remainder(unsigned char target[], int target_length, const unsigned char source[], const size_t inputlen, const int last_mode, const int process_buffer[], const int process_p, const int symbols_left) {
|
||||||
int debug = 0;
|
int debug = 0;
|
||||||
|
|
||||||
switch (last_mode) {
|
switch (last_mode) {
|
||||||
case DM_C40:
|
case DM_C40:
|
||||||
case DM_TEXT:
|
case DM_TEXT:
|
||||||
@ -1038,7 +1038,7 @@ static int dm200encode_remainder(unsigned char target[], int target_length, cons
|
|||||||
} else {
|
} else {
|
||||||
target[target_length] = (254);
|
target[target_length] = (254);
|
||||||
target_length++; // Unlatch.
|
target_length++; // Unlatch.
|
||||||
|
|
||||||
if (process_p == 1) {
|
if (process_p == 1) {
|
||||||
target[target_length] = source[inputlen - 1] + 1;
|
target[target_length] = source[inputlen - 1] + 1;
|
||||||
target_length++;
|
target_length++;
|
||||||
@ -1053,7 +1053,7 @@ static int dm200encode_remainder(unsigned char target[], int target_length, cons
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DM_EDIFACT:
|
case DM_EDIFACT:
|
||||||
if (symbols_left <= 2) // Unlatch not required!
|
if (symbols_left <= 2) // Unlatch not required!
|
||||||
{
|
{
|
||||||
if (process_p == 1) {
|
if (process_p == 1) {
|
||||||
@ -1199,7 +1199,7 @@ int data_matrix_200(struct zint_symbol *symbol,const unsigned char source[], con
|
|||||||
// Now we know the symbol size we can handle the remaining data in the process buffer.
|
// Now we know the symbol size we can handle the remaining data in the process buffer.
|
||||||
symbols_left = matrixbytes[symbolsize] - binlen;
|
symbols_left = matrixbytes[symbolsize] - binlen;
|
||||||
binlen = dm200encode_remainder(binary, binlen, source, inputlen, last_mode, process_buffer, process_p, symbols_left);
|
binlen = dm200encode_remainder(binary, binlen, source, inputlen, last_mode, process_buffer, process_p, symbols_left);
|
||||||
|
|
||||||
if (binlen > matrixbytes[symbolsize]) {
|
if (binlen > matrixbytes[symbolsize]) {
|
||||||
strcpy(symbol->errtxt, "523: Data too long to fit in symbol");
|
strcpy(symbol->errtxt, "523: Data too long to fit in symbol");
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
@ -1316,3 +1316,4 @@ int dmatrix(struct zint_symbol *symbol, const unsigned char source[], const size
|
|||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -235,3 +235,4 @@ static const unsigned short int matrixrsblock[] = {
|
|||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,11 +26,11 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Attempts to encode DotCode according to AIMD013 Rev 1.34a, dated Feb 19, 2009
|
* Attempts to encode DotCode according to AIMD013 Rev 1.34a, dated Feb 19, 2009
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ static int clr_col(char *Dots, const int Hgt, const int Wid, const int x) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ static int clr_row(char *Dots, const int Hgt, const int Wid, const int y) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ const int score_array(char Dots[], int Hgt, int Wid) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sum = 0;
|
sum = 0;
|
||||||
first = -1;
|
first = -1;
|
||||||
last = -1;
|
last = -1;
|
||||||
@ -480,7 +480,7 @@ int dotcode_encode_message(struct zint_symbol *symbol, const unsigned char sourc
|
|||||||
a = (symbol->eci - 40) % 12769;
|
a = (symbol->eci - 40) % 12769;
|
||||||
b = ((symbol->eci - 40) - (12769 * a)) % 113;
|
b = ((symbol->eci - 40) - (12769 * a)) % 113;
|
||||||
c = (symbol->eci - 40) - (12769 * a) - (113 * b);
|
c = (symbol->eci - 40) - (12769 * a) - (113 * b);
|
||||||
|
|
||||||
codeword_array[array_length] = a + 40;
|
codeword_array[array_length] = a + 40;
|
||||||
array_length++;
|
array_length++;
|
||||||
codeword_array[array_length] = b;
|
codeword_array[array_length] = b;
|
||||||
@ -498,7 +498,7 @@ int dotcode_encode_message(struct zint_symbol *symbol, const unsigned char sourc
|
|||||||
array_length++;
|
array_length++;
|
||||||
encoding_mode = 'A';
|
encoding_mode = 'A';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source[input_position] == 28) {
|
if (source[input_position] == 28) {
|
||||||
codeword_array[array_length] = 101; // Latch A
|
codeword_array[array_length] = 101; // Latch A
|
||||||
array_length++;
|
array_length++;
|
||||||
@ -506,7 +506,7 @@ int dotcode_encode_message(struct zint_symbol *symbol, const unsigned char sourc
|
|||||||
array_length++;
|
array_length++;
|
||||||
encoding_mode = 'A';
|
encoding_mode = 'A';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source[input_position] == 29) {
|
if (source[input_position] == 29) {
|
||||||
codeword_array[array_length] = 101; // Latch A
|
codeword_array[array_length] = 101; // Latch A
|
||||||
array_length++;
|
array_length++;
|
||||||
@ -514,7 +514,7 @@ int dotcode_encode_message(struct zint_symbol *symbol, const unsigned char sourc
|
|||||||
array_length++;
|
array_length++;
|
||||||
encoding_mode = 'A';
|
encoding_mode = 'A';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source[input_position] == 30) {
|
if (source[input_position] == 30) {
|
||||||
codeword_array[array_length] = 101; // Latch A
|
codeword_array[array_length] = 101; // Latch A
|
||||||
array_length++;
|
array_length++;
|
||||||
@ -522,7 +522,7 @@ int dotcode_encode_message(struct zint_symbol *symbol, const unsigned char sourc
|
|||||||
array_length++;
|
array_length++;
|
||||||
encoding_mode = 'A';
|
encoding_mode = 'A';
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
int done = 0;
|
int done = 0;
|
||||||
/* Step A */
|
/* Step A */
|
||||||
@ -743,17 +743,17 @@ int dotcode_encode_message(struct zint_symbol *symbol, const unsigned char sourc
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (datum_b(source, input_position, length)) {
|
if (datum_b(source, input_position, length)) {
|
||||||
|
|
||||||
if ((source[input_position] >= 32) && (source[input_position] <= 127)) {
|
if ((source[input_position] >= 32) && (source[input_position] <= 127)) {
|
||||||
codeword_array[array_length] = source[input_position] - 32;
|
codeword_array[array_length] = source[input_position] - 32;
|
||||||
done = 1;
|
done = 1;
|
||||||
|
|
||||||
} else if (source[input_position] == 13) {
|
} else if (source[input_position] == 13) {
|
||||||
/* CR/LF */
|
/* CR/LF */
|
||||||
codeword_array[array_length] = 96;
|
codeword_array[array_length] = 96;
|
||||||
input_position++;
|
input_position++;
|
||||||
done = 1;
|
done = 1;
|
||||||
|
|
||||||
} else if (input_position != 0) {
|
} else if (input_position != 0) {
|
||||||
/* HT, FS, GS and RS in the first data position would be interpreted as a macro (see table 2) */
|
/* HT, FS, GS and RS in the first data position would be interpreted as a macro (see table 2) */
|
||||||
switch(source[input_position]) {
|
switch(source[input_position]) {
|
||||||
@ -772,7 +772,7 @@ int dotcode_encode_message(struct zint_symbol *symbol, const unsigned char sourc
|
|||||||
}
|
}
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (done == 1) {
|
if (done == 1) {
|
||||||
array_length++;
|
array_length++;
|
||||||
input_position++;
|
input_position++;
|
||||||
@ -1080,8 +1080,8 @@ static size_t make_dotstream(unsigned char masked_array[], int array_length, cha
|
|||||||
return strlen(dot_stream);
|
return strlen(dot_stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Determines if a given dot is a reserved corner dot
|
/* Determines if a given dot is a reserved corner dot
|
||||||
* to be used by one of the last six bits
|
* to be used by one of the last six bits
|
||||||
*/
|
*/
|
||||||
int is_corner(int column, int row, int width, int height) {
|
int is_corner(int column, int row, int width, int height) {
|
||||||
int corner = 0;
|
int corner = 0;
|
||||||
@ -1214,7 +1214,7 @@ int dotcode(struct zint_symbol *symbol, const unsigned char source[], int length
|
|||||||
char* dot_array;
|
char* dot_array;
|
||||||
unsigned char* codeword_array = (unsigned char *) _alloca(length * 3 * sizeof (unsigned char));
|
unsigned char* codeword_array = (unsigned char *) _alloca(length * 3 * sizeof (unsigned char));
|
||||||
#endif /* _MSC_VER */
|
#endif /* _MSC_VER */
|
||||||
|
|
||||||
if (symbol->eci > 811799) {
|
if (symbol->eci > 811799) {
|
||||||
strcpy(symbol->errtxt, "525: Invalid ECI");
|
strcpy(symbol->errtxt, "525: Invalid ECI");
|
||||||
return ZINT_ERROR_INVALID_OPTION;
|
return ZINT_ERROR_INVALID_OPTION;
|
||||||
@ -1285,7 +1285,7 @@ int dotcode(struct zint_symbol *symbol, const unsigned char source[], int length
|
|||||||
strcpy(symbol->errtxt, "526: Specified symbol size is too large");
|
strcpy(symbol->errtxt, "526: Specified symbol size is too large");
|
||||||
return ZINT_ERROR_INVALID_OPTION;
|
return ZINT_ERROR_INVALID_OPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((height < 5) || (width < 5)) {
|
if ((height < 5) || (width < 5)) {
|
||||||
strcpy(symbol->errtxt, "527: Specified symbol size has a dimension which is too small");
|
strcpy(symbol->errtxt, "527: Specified symbol size has a dimension which is too small");
|
||||||
return ZINT_ERROR_INVALID_OPTION;
|
return ZINT_ERROR_INVALID_OPTION;
|
||||||
@ -1466,3 +1466,4 @@ int dotcode(struct zint_symbol *symbol, const unsigned char source[], int length
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,7 +25,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -305,3 +305,4 @@ int get_best_eci(unsigned char source[], size_t length) {
|
|||||||
return 26; // If all of these fail, use Unicode!
|
return 26; // If all of these fail, use Unicode!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,7 +25,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -250,3 +250,4 @@ static const unsigned short int windows_1256[] = {
|
|||||||
|
|
||||||
#endif /* ECI_H */
|
#endif /* ECI_H */
|
||||||
|
|
||||||
|
|
||||||
|
133
backend/emf.c
133
backend/emf.c
@ -7,14 +7,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,7 +25,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -45,8 +45,8 @@
|
|||||||
|
|
||||||
int count_rectangles(struct zint_symbol *symbol) {
|
int count_rectangles(struct zint_symbol *symbol) {
|
||||||
int rectangles = 0;
|
int rectangles = 0;
|
||||||
|
|
||||||
if ((symbol->symbology != BARCODE_MAXICODE) &&
|
if ((symbol->symbology != BARCODE_MAXICODE) &&
|
||||||
((symbol->output_options & BARCODE_DOTTY_MODE) == 0)) {
|
((symbol->output_options & BARCODE_DOTTY_MODE) == 0)) {
|
||||||
int this_row;
|
int this_row;
|
||||||
for(this_row = 0; this_row < symbol->rows; this_row++) {
|
for(this_row = 0; this_row < symbol->rows; this_row++) {
|
||||||
@ -63,13 +63,13 @@ int count_rectangles(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rectangles;
|
return rectangles;
|
||||||
}
|
}
|
||||||
|
|
||||||
int count_circles(struct zint_symbol *symbol) {
|
int count_circles(struct zint_symbol *symbol) {
|
||||||
int circles = 0;
|
int circles = 0;
|
||||||
|
|
||||||
if ((symbol->symbology != BARCODE_MAXICODE) &&
|
if ((symbol->symbology != BARCODE_MAXICODE) &&
|
||||||
((symbol->output_options & BARCODE_DOTTY_MODE) != 0)) {
|
((symbol->output_options & BARCODE_DOTTY_MODE) != 0)) {
|
||||||
int this_row;
|
int this_row;
|
||||||
@ -82,13 +82,13 @@ int count_circles(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return circles;
|
return circles;
|
||||||
}
|
}
|
||||||
|
|
||||||
int count_hexagons(struct zint_symbol *symbol) {
|
int count_hexagons(struct zint_symbol *symbol) {
|
||||||
int hexagons = 0;
|
int hexagons = 0;
|
||||||
|
|
||||||
if (symbol->symbology == BARCODE_MAXICODE) {
|
if (symbol->symbology == BARCODE_MAXICODE) {
|
||||||
int this_row;
|
int this_row;
|
||||||
for(this_row = 0; this_row < symbol->rows; this_row++) {
|
for(this_row = 0; this_row < symbol->rows; this_row++) {
|
||||||
@ -100,14 +100,14 @@ int count_hexagons(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return hexagons;
|
return hexagons;
|
||||||
}
|
}
|
||||||
|
|
||||||
void utfle_copy(unsigned char *output, unsigned char *input, int length) {
|
void utfle_copy(unsigned char *output, unsigned char *input, int length) {
|
||||||
int i;
|
int i;
|
||||||
int o;
|
int o;
|
||||||
|
|
||||||
/* Convert UTF-8 to UTF-16LE - only needs to handle characters <= U+00FF */
|
/* Convert UTF-8 to UTF-16LE - only needs to handle characters <= U+00FF */
|
||||||
i = 0;
|
i = 0;
|
||||||
o = 0;
|
o = 0;
|
||||||
@ -156,7 +156,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
unsigned char regz[7];
|
unsigned char regz[7];
|
||||||
unsigned char output_buffer[12];
|
unsigned char output_buffer[12];
|
||||||
uint32_t dx;
|
uint32_t dx;
|
||||||
|
|
||||||
emr_header_t emr_header;
|
emr_header_t emr_header;
|
||||||
emr_eof_t emr_eof;
|
emr_eof_t emr_eof;
|
||||||
emr_createbrushindirect_t emr_createbrushindirect_fg;
|
emr_createbrushindirect_t emr_createbrushindirect_fg;
|
||||||
@ -174,7 +174,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
emr_selectobject_t emr_selectobject_font_big;
|
emr_selectobject_t emr_selectobject_font_big;
|
||||||
|
|
||||||
box_t box;
|
box_t box;
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
unsigned char local_text[bump_up(ustrlen(symbol->text) + 1)];
|
unsigned char local_text[bump_up(ustrlen(symbol->text) + 1)];
|
||||||
unsigned char string_buffer[2 * bump_up(ustrlen(symbol->text) + 1)];
|
unsigned char string_buffer[2 * bump_up(ustrlen(symbol->text) + 1)];
|
||||||
@ -187,7 +187,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
local_text = (unsigned char*) _alloca(bump_up(ustrlen(symbol->text) + 1) * sizeof (unsigned char));
|
local_text = (unsigned char*) _alloca(bump_up(ustrlen(symbol->text) + 1) * sizeof (unsigned char));
|
||||||
string_buffer = (unsigned char*) _alloca(2 * bump_up(ustrlen(symbol->text) + 1) * sizeof (unsigned char));
|
string_buffer = (unsigned char*) _alloca(2 * bump_up(ustrlen(symbol->text) + 1) * sizeof (unsigned char));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
row_height = 0;
|
row_height = 0;
|
||||||
textdone = 0;
|
textdone = 0;
|
||||||
comp_offset = 0;
|
comp_offset = 0;
|
||||||
@ -203,7 +203,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
regy[i] = '\0';
|
regy[i] = '\0';
|
||||||
regz[i] = '\0';
|
regz[i] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->show_hrt != 0) {
|
if (symbol->show_hrt != 0) {
|
||||||
/* Copy text from symbol */
|
/* Copy text from symbol */
|
||||||
ustrcpy(local_text, symbol->text);
|
ustrcpy(local_text, symbol->text);
|
||||||
@ -234,7 +234,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sort out colour options */
|
/* sort out colour options */
|
||||||
to_upper((unsigned char*) symbol->fgcolour);
|
to_upper((unsigned char*) symbol->fgcolour);
|
||||||
to_upper((unsigned char*) symbol->bgcolour);
|
to_upper((unsigned char*) symbol->bgcolour);
|
||||||
@ -243,19 +243,19 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
strcpy(symbol->errtxt, "641: Malformed foreground colour target");
|
strcpy(symbol->errtxt, "641: Malformed foreground colour target");
|
||||||
return ZINT_ERROR_INVALID_OPTION;
|
return ZINT_ERROR_INVALID_OPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen(symbol->bgcolour) != 6) {
|
if (strlen(symbol->bgcolour) != 6) {
|
||||||
strcpy(symbol->errtxt, "642: Malformed background colour target");
|
strcpy(symbol->errtxt, "642: Malformed background colour target");
|
||||||
return ZINT_ERROR_INVALID_OPTION;
|
return ZINT_ERROR_INVALID_OPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
fgred = (16 * ctoi(symbol->fgcolour[0])) + ctoi(symbol->fgcolour[1]);
|
fgred = (16 * ctoi(symbol->fgcolour[0])) + ctoi(symbol->fgcolour[1]);
|
||||||
fggrn = (16 * ctoi(symbol->fgcolour[2])) + ctoi(symbol->fgcolour[3]);
|
fggrn = (16 * ctoi(symbol->fgcolour[2])) + ctoi(symbol->fgcolour[3]);
|
||||||
fgblu = (16 * ctoi(symbol->fgcolour[4])) + ctoi(symbol->fgcolour[5]);
|
fgblu = (16 * ctoi(symbol->fgcolour[4])) + ctoi(symbol->fgcolour[5]);
|
||||||
bgred = (16 * ctoi(symbol->bgcolour[0])) + ctoi(symbol->bgcolour[1]);
|
bgred = (16 * ctoi(symbol->bgcolour[0])) + ctoi(symbol->bgcolour[1]);
|
||||||
bggrn = (16 * ctoi(symbol->bgcolour[2])) + ctoi(symbol->bgcolour[3]);
|
bggrn = (16 * ctoi(symbol->bgcolour[2])) + ctoi(symbol->bgcolour[3]);
|
||||||
bgblu = (16 * ctoi(symbol->bgcolour[4])) + ctoi(symbol->bgcolour[5]);
|
bgblu = (16 * ctoi(symbol->bgcolour[4])) + ctoi(symbol->bgcolour[5]);
|
||||||
|
|
||||||
if (symbol->height == 0) {
|
if (symbol->height == 0) {
|
||||||
symbol->height = 50;
|
symbol->height = 50;
|
||||||
}
|
}
|
||||||
@ -306,7 +306,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
upcean = 1;
|
upcean = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ustrlen(local_text) != 0) {
|
if (ustrlen(local_text) != 0) {
|
||||||
textoffset = 9;
|
textoffset = 9;
|
||||||
} else {
|
} else {
|
||||||
@ -314,7 +314,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
xoffset = symbol->border_width + symbol->whitespace_width;
|
xoffset = symbol->border_width + symbol->whitespace_width;
|
||||||
yoffset = symbol->border_width;
|
yoffset = symbol->border_width;
|
||||||
|
|
||||||
rectangle_count = count_rectangles(symbol);
|
rectangle_count = count_rectangles(symbol);
|
||||||
circle_count = count_circles(symbol);
|
circle_count = count_circles(symbol);
|
||||||
hexagon_count = count_hexagons(symbol);
|
hexagon_count = count_hexagons(symbol);
|
||||||
@ -330,7 +330,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
circle = (emr_ellipse_t*) _alloca(circle_count*sizeof(emr_ellipse_t));
|
circle = (emr_ellipse_t*) _alloca(circle_count*sizeof(emr_ellipse_t));
|
||||||
hexagon = (emr_polygon_t*) _alloca(hexagon_count*sizeof(emr_polygon_t));
|
hexagon = (emr_polygon_t*) _alloca(hexagon_count*sizeof(emr_polygon_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Header */
|
/* Header */
|
||||||
emr_header.type = 0x00000001; // EMR_HEADER
|
emr_header.type = 0x00000001; // EMR_HEADER
|
||||||
emr_header.size = 88; // Assuming no additional data in header
|
emr_header.size = 88; // Assuming no additional data in header
|
||||||
@ -373,7 +373,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
emr_createbrushindirect_fg.log_brush.brush_hatch = 0; // ignored
|
emr_createbrushindirect_fg.log_brush.brush_hatch = 0; // ignored
|
||||||
bytecount += 24;
|
bytecount += 24;
|
||||||
recordcount++;
|
recordcount++;
|
||||||
|
|
||||||
emr_createbrushindirect_bg.type = 0x00000027; // EMR_CREATEBRUSHINDIRECT
|
emr_createbrushindirect_bg.type = 0x00000027; // EMR_CREATEBRUSHINDIRECT
|
||||||
emr_createbrushindirect_bg.size = 24;
|
emr_createbrushindirect_bg.size = 24;
|
||||||
emr_createbrushindirect_bg.ih_brush = 2;
|
emr_createbrushindirect_bg.ih_brush = 2;
|
||||||
@ -385,13 +385,13 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
emr_createbrushindirect_bg.log_brush.brush_hatch = 0; // ignored
|
emr_createbrushindirect_bg.log_brush.brush_hatch = 0; // ignored
|
||||||
bytecount += 24;
|
bytecount += 24;
|
||||||
recordcount++;
|
recordcount++;
|
||||||
|
|
||||||
emr_selectobject_fgbrush.type = 0x00000025; // EMR_SELECTOBJECT
|
emr_selectobject_fgbrush.type = 0x00000025; // EMR_SELECTOBJECT
|
||||||
emr_selectobject_fgbrush.size = 12;
|
emr_selectobject_fgbrush.size = 12;
|
||||||
emr_selectobject_fgbrush.ih_object = 1;
|
emr_selectobject_fgbrush.ih_object = 1;
|
||||||
bytecount += 12;
|
bytecount += 12;
|
||||||
recordcount++;
|
recordcount++;
|
||||||
|
|
||||||
emr_selectobject_bgbrush.type = 0x00000025; // EMR_SELECTOBJECT
|
emr_selectobject_bgbrush.type = 0x00000025; // EMR_SELECTOBJECT
|
||||||
emr_selectobject_bgbrush.size = 12;
|
emr_selectobject_bgbrush.size = 12;
|
||||||
emr_selectobject_bgbrush.ih_object = 2;
|
emr_selectobject_bgbrush.ih_object = 2;
|
||||||
@ -411,13 +411,13 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
emr_createpen.log_pen.color_ref.reserved = 0;
|
emr_createpen.log_pen.color_ref.reserved = 0;
|
||||||
bytecount += 28;
|
bytecount += 28;
|
||||||
recordcount++;
|
recordcount++;
|
||||||
|
|
||||||
emr_selectobject_pen.type = 0x00000025; // EMR_SELECTOBJECT
|
emr_selectobject_pen.type = 0x00000025; // EMR_SELECTOBJECT
|
||||||
emr_selectobject_pen.size = 12;
|
emr_selectobject_pen.size = 12;
|
||||||
emr_selectobject_pen.ih_object = 3;
|
emr_selectobject_pen.ih_object = 3;
|
||||||
bytecount += 12;
|
bytecount += 12;
|
||||||
recordcount++;
|
recordcount++;
|
||||||
|
|
||||||
/* Create font records */
|
/* Create font records */
|
||||||
if ((symbol->show_hrt != 0) && (ustrlen(local_text) != 0)) {
|
if ((symbol->show_hrt != 0) && (ustrlen(local_text) != 0)) {
|
||||||
emr_extcreatefontindirectw.type = 0x00000052; // EMR_EXTCREATEFONTINDIRECTW
|
emr_extcreatefontindirectw.type = 0x00000052; // EMR_EXTCREATEFONTINDIRECTW
|
||||||
@ -443,8 +443,8 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
|
|
||||||
emr_selectobject_font.type = 0x00000025; // EMR_SELECTOBJECT
|
emr_selectobject_font.type = 0x00000025; // EMR_SELECTOBJECT
|
||||||
emr_selectobject_font.size = 12;
|
emr_selectobject_font.size = 12;
|
||||||
emr_selectobject_font.ih_object = 4;
|
emr_selectobject_font.ih_object = 4;
|
||||||
|
|
||||||
if (!((symbol->symbology == BARCODE_EANX) || (symbol->symbology == BARCODE_EANX_CC) || (symbol->symbology == BARCODE_ISBNX))) {
|
if (!((symbol->symbology == BARCODE_EANX) || (symbol->symbology == BARCODE_EANX_CC) || (symbol->symbology == BARCODE_ISBNX))) {
|
||||||
bytecount += 104;
|
bytecount += 104;
|
||||||
recordcount++;
|
recordcount++;
|
||||||
@ -482,7 +482,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
|
|
||||||
emr_selectobject_font_big.type = 0x00000025; // EMR_SELECTOBJECT
|
emr_selectobject_font_big.type = 0x00000025; // EMR_SELECTOBJECT
|
||||||
emr_selectobject_font_big.size = 12;
|
emr_selectobject_font_big.size = 12;
|
||||||
emr_selectobject_font_big.ih_object = 5;
|
emr_selectobject_font_big.ih_object = 5;
|
||||||
bytecount += 12;
|
bytecount += 12;
|
||||||
recordcount++;
|
recordcount++;
|
||||||
}
|
}
|
||||||
@ -521,7 +521,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
for (i = (latch + 1); i <= ustrlen(local_text); i++) {
|
for (i = (latch + 1); i <= ustrlen(local_text); i++) {
|
||||||
regz[i - (latch + 1)] = local_text[i];
|
regz[i - (latch + 1)] = local_text[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
local_text[4] = '\0';
|
local_text[4] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -600,12 +600,12 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
utfle_copy(string_buffer, local_text, ustrlen(local_text));
|
utfle_copy(string_buffer, local_text, ustrlen(local_text));
|
||||||
bytecount += 76 + (6 * bump_up(ustrlen(local_text) + 1));
|
bytecount += 76 + (6 * bump_up(ustrlen(local_text) + 1));
|
||||||
recordcount++;
|
recordcount++;
|
||||||
|
|
||||||
emr_exttextoutw[1].w_emr_text.chars = ustrlen(regw);
|
emr_exttextoutw[1].w_emr_text.chars = ustrlen(regw);
|
||||||
emr_exttextoutw[2].w_emr_text.chars = ustrlen(regx);
|
emr_exttextoutw[2].w_emr_text.chars = ustrlen(regx);
|
||||||
emr_exttextoutw[3].w_emr_text.chars = ustrlen(regy);
|
emr_exttextoutw[3].w_emr_text.chars = ustrlen(regy);
|
||||||
emr_exttextoutw[4].w_emr_text.chars = ustrlen(regz);
|
emr_exttextoutw[4].w_emr_text.chars = ustrlen(regz);
|
||||||
|
|
||||||
if ((symbol->symbology == BARCODE_EANX) || (symbol->symbology == BARCODE_EANX_CC) || (symbol->symbology == BARCODE_ISBNX)) {
|
if ((symbol->symbology == BARCODE_EANX) || (symbol->symbology == BARCODE_EANX_CC) || (symbol->symbology == BARCODE_ISBNX)) {
|
||||||
if (latch > 8) {
|
if (latch > 8) {
|
||||||
/* EAN-13 */
|
/* EAN-13 */
|
||||||
@ -670,7 +670,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
bytecount += (3 * 112) + 12;
|
bytecount += (3 * 112) + 12;
|
||||||
recordcount += 4;
|
recordcount += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((symbol->symbology == BARCODE_UPCE) || (symbol->symbology == BARCODE_UPCE_CC)) {
|
if ((symbol->symbology == BARCODE_UPCE) || (symbol->symbology == BARCODE_UPCE_CC)) {
|
||||||
emr_exttextoutw[0].w_emr_text.reference.x = (xoffset - 7) * scaler;
|
emr_exttextoutw[0].w_emr_text.reference.x = (xoffset - 7) * scaler;
|
||||||
emr_exttextoutw[0].w_emr_text.reference.y = emr_header.emf_header.bounds.bottom - (9 * scaler);;
|
emr_exttextoutw[0].w_emr_text.reference.y = emr_header.emf_header.bounds.bottom - (9 * scaler);;
|
||||||
@ -702,7 +702,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
background.box.bottom = emr_header.emf_header.bounds.bottom;
|
background.box.bottom = emr_header.emf_header.bounds.bottom;
|
||||||
bytecount += 24;
|
bytecount += 24;
|
||||||
recordcount++;
|
recordcount++;
|
||||||
|
|
||||||
/* Make bind and box rectangles if needed */
|
/* Make bind and box rectangles if needed */
|
||||||
if ((symbol->output_options & BARCODE_BIND) || (symbol->output_options & BARCODE_BOX)) {
|
if ((symbol->output_options & BARCODE_BIND) || (symbol->output_options & BARCODE_BOX)) {
|
||||||
box.top.type = 0x0000002b; // EMR_RECTANGLE;
|
box.top.type = 0x0000002b; // EMR_RECTANGLE;
|
||||||
@ -713,7 +713,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
box.top.box.right = emr_header.emf_header.bounds.right - (symbol->border_width * scaler);
|
box.top.box.right = emr_header.emf_header.bounds.right - (symbol->border_width * scaler);
|
||||||
bytecount += 24;
|
bytecount += 24;
|
||||||
recordcount++;
|
recordcount++;
|
||||||
|
|
||||||
box.bottom.type = 0x0000002b; // EMR_RECTANGLE;
|
box.bottom.type = 0x0000002b; // EMR_RECTANGLE;
|
||||||
box.bottom.size = 24;
|
box.bottom.size = 24;
|
||||||
box.bottom.box.top = emr_header.emf_header.bounds.bottom - ((symbol->border_width + textoffset) * scaler);
|
box.bottom.box.top = emr_header.emf_header.bounds.bottom - ((symbol->border_width + textoffset) * scaler);
|
||||||
@ -722,7 +722,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
box.bottom.box.right = emr_header.emf_header.bounds.right - (symbol->border_width * scaler);
|
box.bottom.box.right = emr_header.emf_header.bounds.right - (symbol->border_width * scaler);
|
||||||
bytecount += 24;
|
bytecount += 24;
|
||||||
recordcount++;
|
recordcount++;
|
||||||
|
|
||||||
if (symbol->output_options & BARCODE_BOX) {
|
if (symbol->output_options & BARCODE_BOX) {
|
||||||
box.left.type = 0x0000002b; // EMR_RECTANGLE;
|
box.left.type = 0x0000002b; // EMR_RECTANGLE;
|
||||||
box.left.size = 24;
|
box.left.size = 24;
|
||||||
@ -732,7 +732,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
box.left.box.right = symbol->border_width * scaler;
|
box.left.box.right = symbol->border_width * scaler;
|
||||||
bytecount += 24;
|
bytecount += 24;
|
||||||
recordcount++;
|
recordcount++;
|
||||||
|
|
||||||
box.right.type = 0x0000002b; // EMR_RECTANGLE;
|
box.right.type = 0x0000002b; // EMR_RECTANGLE;
|
||||||
box.right.size = 24;
|
box.right.size = 24;
|
||||||
box.right.box.top = 0;
|
box.right.box.top = 0;
|
||||||
@ -787,13 +787,13 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
} else {
|
} else {
|
||||||
latch = 0;
|
latch = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
block_width = 0;
|
block_width = 0;
|
||||||
do {
|
do {
|
||||||
block_width++;
|
block_width++;
|
||||||
} while (module_is_set(symbol, this_row, i + block_width) == module_is_set(symbol, this_row, i));
|
} while (module_is_set(symbol, this_row, i + block_width) == module_is_set(symbol, this_row, i));
|
||||||
|
|
||||||
if (latch == 1) {
|
if (latch == 1) {
|
||||||
/* a bar */
|
/* a bar */
|
||||||
rectangle[this_rectangle].type = 0x0000002b; // EMR_RECTANGLE;
|
rectangle[this_rectangle].type = 0x0000002b; // EMR_RECTANGLE;
|
||||||
@ -860,7 +860,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
rectangle[this_rectangle].box.bottom += (5 * scaler);
|
rectangle[this_rectangle].box.bottom += (5 * scaler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((symbol->symbology == BARCODE_UPCE) && (symbol->rows == 1)) || (symbol->symbology == BARCODE_UPCE_CC)) {
|
if (((symbol->symbology == BARCODE_UPCE) && (symbol->rows == 1)) || (symbol->symbology == BARCODE_UPCE_CC)) {
|
||||||
/* guard bar extensions for UPCE */
|
/* guard bar extensions for UPCE */
|
||||||
switch (i) {
|
switch (i) {
|
||||||
@ -879,7 +879,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this_rectangle++;
|
this_rectangle++;
|
||||||
latch = 0;
|
latch = 0;
|
||||||
} else {
|
} else {
|
||||||
@ -887,14 +887,14 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
latch = 1;
|
latch = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
i += block_width;
|
i += block_width;
|
||||||
} while (i < symbol->width);
|
} while (i < symbol->width);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
float ax, ay, bx, by, cx, cy, dx, dy, ex, ey, fx, fy, mx, my;
|
float ax, ay, bx, by, cx, cy, dx, dy, ex, ey, fx, fy, mx, my;
|
||||||
/* Maxicode, use hexagons */
|
/* Maxicode, use hexagons */
|
||||||
|
|
||||||
/* Calculate bullseye */
|
/* Calculate bullseye */
|
||||||
for(i = 0; i < 6; i++) {
|
for(i = 0; i < 6; i++) {
|
||||||
bullseye[i].type = 0x0000002a; // EMR_ELLIPSE
|
bullseye[i].type = 0x0000002a; // EMR_ELLIPSE
|
||||||
@ -924,14 +924,14 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
bullseye[5].box.bottom = (35.60 + 1.43) * scaler;
|
bullseye[5].box.bottom = (35.60 + 1.43) * scaler;
|
||||||
bullseye[5].box.left = (35.76 - 1.43) * scaler;
|
bullseye[5].box.left = (35.76 - 1.43) * scaler;
|
||||||
bullseye[5].box.right = (35.76 + 1.43) * scaler;
|
bullseye[5].box.right = (35.76 + 1.43) * scaler;
|
||||||
|
|
||||||
/* Plot hexagons */
|
/* Plot hexagons */
|
||||||
for(i = 0; i < symbol->width; i++) {
|
for(i = 0; i < symbol->width; i++) {
|
||||||
if(module_is_set(symbol, this_row, i)) {
|
if(module_is_set(symbol, this_row, i)) {
|
||||||
hexagon[this_hexagon].type = 0x00000003; // EMR_POLYGON
|
hexagon[this_hexagon].type = 0x00000003; // EMR_POLYGON
|
||||||
hexagon[this_hexagon].size = 76;
|
hexagon[this_hexagon].size = 76;
|
||||||
hexagon[this_hexagon].count = 6;
|
hexagon[this_hexagon].count = 6;
|
||||||
|
|
||||||
my = this_row * 2.135 + 1.43;
|
my = this_row * 2.135 + 1.43;
|
||||||
ay = my + 1.0 + yoffset;
|
ay = my + 1.0 + yoffset;
|
||||||
by = my + 0.5 + yoffset;
|
by = my + 0.5 + yoffset;
|
||||||
@ -950,7 +950,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
dx = mx + xoffset;
|
dx = mx + xoffset;
|
||||||
ex = mx - 0.86 + xoffset;
|
ex = mx - 0.86 + xoffset;
|
||||||
fx = mx - 0.86 + xoffset;
|
fx = mx - 0.86 + xoffset;
|
||||||
|
|
||||||
hexagon[this_hexagon].a_points_a.x = ax * scaler;
|
hexagon[this_hexagon].a_points_a.x = ax * scaler;
|
||||||
hexagon[this_hexagon].a_points_a.y = ay * scaler;
|
hexagon[this_hexagon].a_points_a.y = ay * scaler;
|
||||||
hexagon[this_hexagon].a_points_b.x = bx * scaler;
|
hexagon[this_hexagon].a_points_b.x = bx * scaler;
|
||||||
@ -963,7 +963,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
hexagon[this_hexagon].a_points_e.y = ey * scaler;
|
hexagon[this_hexagon].a_points_e.y = ey * scaler;
|
||||||
hexagon[this_hexagon].a_points_f.x = fx * scaler;
|
hexagon[this_hexagon].a_points_f.x = fx * scaler;
|
||||||
hexagon[this_hexagon].a_points_f.y = fy * scaler;
|
hexagon[this_hexagon].a_points_f.y = fy * scaler;
|
||||||
|
|
||||||
hexagon[this_hexagon].bounds.top = hexagon[this_hexagon].a_points_d.y;
|
hexagon[this_hexagon].bounds.top = hexagon[this_hexagon].a_points_d.y;
|
||||||
hexagon[this_hexagon].bounds.bottom = hexagon[this_hexagon].a_points_a.y;
|
hexagon[this_hexagon].bounds.bottom = hexagon[this_hexagon].a_points_a.y;
|
||||||
hexagon[this_hexagon].bounds.left = hexagon[this_hexagon].a_points_e.x;
|
hexagon[this_hexagon].bounds.left = hexagon[this_hexagon].a_points_e.x;
|
||||||
@ -975,7 +975,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->output_options & BARCODE_BIND) {
|
if (symbol->output_options & BARCODE_BIND) {
|
||||||
if ((symbol->rows > 1) && (is_stackable(symbol->symbology) == 1)) {
|
if ((symbol->rows > 1) && (is_stackable(symbol->symbology) == 1)) {
|
||||||
/* row binding */
|
/* row binding */
|
||||||
@ -984,7 +984,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
row_binding[i - 1].size = 24;
|
row_binding[i - 1].size = 24;
|
||||||
row_binding[i - 1].box.top = ((i * row_height) + yoffset - 1) * scaler;
|
row_binding[i - 1].box.top = ((i * row_height) + yoffset - 1) * scaler;
|
||||||
row_binding[i - 1].box.bottom = row_binding[i - 1].box.top + (2 * scaler);
|
row_binding[i - 1].box.bottom = row_binding[i - 1].box.top + (2 * scaler);
|
||||||
|
|
||||||
if (symbol->symbology != BARCODE_CODABLOCKF) {
|
if (symbol->symbology != BARCODE_CODABLOCKF) {
|
||||||
row_binding[i - 1].box.left = xoffset * scaler;
|
row_binding[i - 1].box.left = xoffset * scaler;
|
||||||
row_binding[i - 1].box.right = emr_header.emf_header.bounds.right - (xoffset * scaler);
|
row_binding[i - 1].box.right = emr_header.emf_header.bounds.right - (xoffset * scaler);
|
||||||
@ -1006,11 +1006,11 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
emr_eof.size_last = emr_eof.size;
|
emr_eof.size_last = emr_eof.size;
|
||||||
bytecount += 18;
|
bytecount += 18;
|
||||||
recordcount++;
|
recordcount++;
|
||||||
|
|
||||||
/* Put final counts in header */
|
/* Put final counts in header */
|
||||||
emr_header.emf_header.bytes = bytecount;
|
emr_header.emf_header.bytes = bytecount;
|
||||||
emr_header.emf_header.records = recordcount;
|
emr_header.emf_header.records = recordcount;
|
||||||
|
|
||||||
/* Send EMF data to file */
|
/* Send EMF data to file */
|
||||||
if (symbol->output_options & BARCODE_STDOUT) {
|
if (symbol->output_options & BARCODE_STDOUT) {
|
||||||
emf_file = stdout;
|
emf_file = stdout;
|
||||||
@ -1021,21 +1021,21 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
strcpy(symbol->errtxt, "640: Could not open output file");
|
strcpy(symbol->errtxt, "640: Could not open output file");
|
||||||
return ZINT_ERROR_FILE_ACCESS;
|
return ZINT_ERROR_FILE_ACCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite(&emr_header, sizeof(emr_header_t), 1, emf_file);
|
fwrite(&emr_header, sizeof(emr_header_t), 1, emf_file);
|
||||||
|
|
||||||
fwrite(&emr_createbrushindirect_fg, sizeof(emr_createbrushindirect_t), 1, emf_file);
|
fwrite(&emr_createbrushindirect_fg, sizeof(emr_createbrushindirect_t), 1, emf_file);
|
||||||
fwrite(&emr_createbrushindirect_bg, sizeof(emr_createbrushindirect_t), 1, emf_file);
|
fwrite(&emr_createbrushindirect_bg, sizeof(emr_createbrushindirect_t), 1, emf_file);
|
||||||
fwrite(&emr_createpen, sizeof(emr_createpen_t), 1, emf_file);
|
fwrite(&emr_createpen, sizeof(emr_createpen_t), 1, emf_file);
|
||||||
|
|
||||||
if ((symbol->show_hrt != 0) && (ustrlen(local_text) != 0)) {
|
if ((symbol->show_hrt != 0) && (ustrlen(local_text) != 0)) {
|
||||||
fwrite(&emr_extcreatefontindirectw, sizeof(emr_extcreatefontindirectw_t), 1, emf_file);
|
fwrite(&emr_extcreatefontindirectw, sizeof(emr_extcreatefontindirectw_t), 1, emf_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite(&emr_selectobject_bgbrush, sizeof(emr_selectobject_t), 1, emf_file);
|
fwrite(&emr_selectobject_bgbrush, sizeof(emr_selectobject_t), 1, emf_file);
|
||||||
fwrite(&emr_selectobject_pen, sizeof(emr_selectobject_t), 1, emf_file);
|
fwrite(&emr_selectobject_pen, sizeof(emr_selectobject_t), 1, emf_file);
|
||||||
fwrite(&background, sizeof(emr_rectangle_t), 1, emf_file);
|
fwrite(&background, sizeof(emr_rectangle_t), 1, emf_file);
|
||||||
|
|
||||||
fwrite(&emr_selectobject_fgbrush, sizeof(emr_selectobject_t), 1, emf_file);
|
fwrite(&emr_selectobject_fgbrush, sizeof(emr_selectobject_t), 1, emf_file);
|
||||||
|
|
||||||
for (i = 0; i < rectangle_count; i++) {
|
for (i = 0; i < rectangle_count; i++) {
|
||||||
@ -1055,8 +1055,8 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
fwrite(&box.left, sizeof(emr_rectangle_t), 1, emf_file);
|
fwrite(&box.left, sizeof(emr_rectangle_t), 1, emf_file);
|
||||||
fwrite(&box.right, sizeof(emr_rectangle_t), 1, emf_file);
|
fwrite(&box.right, sizeof(emr_rectangle_t), 1, emf_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->output_options & BARCODE_BIND) {
|
if (symbol->output_options & BARCODE_BIND) {
|
||||||
if ((symbol->rows > 1) && (is_stackable(symbol->symbology) == 1)) {
|
if ((symbol->rows > 1) && (is_stackable(symbol->symbology) == 1)) {
|
||||||
for(i = 0; i < symbol->rows - 1; i++) {
|
for(i = 0; i < symbol->rows - 1; i++) {
|
||||||
@ -1064,7 +1064,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(symbol->symbology == BARCODE_MAXICODE) {
|
if(symbol->symbology == BARCODE_MAXICODE) {
|
||||||
fwrite(&bullseye[0], sizeof(emr_ellipse_t), 1, emf_file);
|
fwrite(&bullseye[0], sizeof(emr_ellipse_t), 1, emf_file);
|
||||||
fwrite(&emr_selectobject_bgbrush, sizeof(emr_selectobject_t), 1, emf_file);
|
fwrite(&emr_selectobject_bgbrush, sizeof(emr_selectobject_t), 1, emf_file);
|
||||||
@ -1078,7 +1078,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
fwrite(&emr_selectobject_bgbrush, sizeof(emr_selectobject_t), 1, emf_file);
|
fwrite(&emr_selectobject_bgbrush, sizeof(emr_selectobject_t), 1, emf_file);
|
||||||
fwrite(&bullseye[5], sizeof(emr_ellipse_t), 1, emf_file);
|
fwrite(&bullseye[5], sizeof(emr_ellipse_t), 1, emf_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((symbol->show_hrt != 0) && (ustrlen(local_text) != 0)) {
|
if ((symbol->show_hrt != 0) && (ustrlen(local_text) != 0)) {
|
||||||
if ((symbol->symbology == BARCODE_EANX) || (symbol->symbology == BARCODE_EANX_CC) || (symbol->symbology == BARCODE_ISBNX)) {
|
if ((symbol->symbology == BARCODE_EANX) || (symbol->symbology == BARCODE_EANX_CC) || (symbol->symbology == BARCODE_ISBNX)) {
|
||||||
if (ustrlen(regx) != 0) {
|
if (ustrlen(regx) != 0) {
|
||||||
@ -1171,7 +1171,7 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
textdone = 1;
|
textdone = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((symbol->symbology == BARCODE_UPCE) && (symbol->rows == 1)) || (symbol->symbology == BARCODE_UPCE_CC)) {
|
if (((symbol->symbology == BARCODE_UPCE) && (symbol->rows == 1)) || (symbol->symbology == BARCODE_UPCE_CC)) {
|
||||||
fwrite(&emr_selectobject_font, sizeof(emr_selectobject_t), 1, emf_file);
|
fwrite(&emr_selectobject_font, sizeof(emr_selectobject_t), 1, emf_file);
|
||||||
fwrite(&emr_exttextoutw[0], sizeof(emr_exttextoutw_t), 1, emf_file);
|
fwrite(&emr_exttextoutw[0], sizeof(emr_exttextoutw_t), 1, emf_file);
|
||||||
@ -1212,9 +1212,9 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite(&emr_eof, sizeof(emr_eof_t), 1, emf_file);
|
fwrite(&emr_eof, sizeof(emr_eof_t), 1, emf_file);
|
||||||
|
|
||||||
if (symbol->output_options & BARCODE_STDOUT) {
|
if (symbol->output_options & BARCODE_STDOUT) {
|
||||||
fflush(emf_file);
|
fflush(emf_file);
|
||||||
} else {
|
} else {
|
||||||
@ -1223,3 +1223,4 @@ int emf_plot(struct zint_symbol *symbol) {
|
|||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,7 +25,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -42,45 +42,45 @@ extern "C" {
|
|||||||
#else
|
#else
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
typedef struct rect_l {
|
typedef struct rect_l {
|
||||||
int32_t left;
|
int32_t left;
|
||||||
int32_t top;
|
int32_t top;
|
||||||
int32_t right;
|
int32_t right;
|
||||||
int32_t bottom;
|
int32_t bottom;
|
||||||
} rect_l_t;
|
} rect_l_t;
|
||||||
|
|
||||||
typedef struct size_l {
|
typedef struct size_l {
|
||||||
uint32_t cx;
|
uint32_t cx;
|
||||||
uint32_t cy;
|
uint32_t cy;
|
||||||
} size_l_t;
|
} size_l_t;
|
||||||
|
|
||||||
typedef struct point_l {
|
typedef struct point_l {
|
||||||
int32_t x;
|
int32_t x;
|
||||||
int32_t y;
|
int32_t y;
|
||||||
} point_l_t;
|
} point_l_t;
|
||||||
|
|
||||||
typedef struct color_ref {
|
typedef struct color_ref {
|
||||||
uint8_t red;
|
uint8_t red;
|
||||||
uint8_t green;
|
uint8_t green;
|
||||||
uint8_t blue;
|
uint8_t blue;
|
||||||
uint8_t reserved;
|
uint8_t reserved;
|
||||||
} color_ref_t;
|
} color_ref_t;
|
||||||
|
|
||||||
typedef struct log_brush_ex {
|
typedef struct log_brush_ex {
|
||||||
uint32_t brush_style;
|
uint32_t brush_style;
|
||||||
color_ref_t color;
|
color_ref_t color;
|
||||||
uint32_t brush_hatch;
|
uint32_t brush_hatch;
|
||||||
} log_brush_ex_t;
|
} log_brush_ex_t;
|
||||||
|
|
||||||
typedef struct log_pen {
|
typedef struct log_pen {
|
||||||
uint32_t pen_style;
|
uint32_t pen_style;
|
||||||
point_l_t width;
|
point_l_t width;
|
||||||
color_ref_t color_ref;
|
color_ref_t color_ref;
|
||||||
} log_pen_t;
|
} log_pen_t;
|
||||||
|
|
||||||
typedef struct log_font {
|
typedef struct log_font {
|
||||||
int32_t height;
|
int32_t height;
|
||||||
int32_t width;
|
int32_t width;
|
||||||
@ -97,7 +97,7 @@ extern "C" {
|
|||||||
uint8_t pitch_and_family;
|
uint8_t pitch_and_family;
|
||||||
unsigned char facename[64];
|
unsigned char facename[64];
|
||||||
} log_font_t;
|
} log_font_t;
|
||||||
|
|
||||||
typedef struct emr_text {
|
typedef struct emr_text {
|
||||||
point_l_t reference;
|
point_l_t reference;
|
||||||
uint32_t chars;
|
uint32_t chars;
|
||||||
@ -106,7 +106,7 @@ extern "C" {
|
|||||||
rect_l_t rectangle;
|
rect_l_t rectangle;
|
||||||
uint32_t off_dx;
|
uint32_t off_dx;
|
||||||
} emr_text_t;
|
} emr_text_t;
|
||||||
|
|
||||||
typedef struct emf_header {
|
typedef struct emf_header {
|
||||||
rect_l_t bounds;
|
rect_l_t bounds;
|
||||||
rect_l_t frame;
|
rect_l_t frame;
|
||||||
@ -122,45 +122,45 @@ extern "C" {
|
|||||||
size_l_t device;
|
size_l_t device;
|
||||||
size_l_t millimeters;
|
size_l_t millimeters;
|
||||||
} emf_header_t;
|
} emf_header_t;
|
||||||
|
|
||||||
typedef struct emr_header {
|
typedef struct emr_header {
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
emf_header_t emf_header;
|
emf_header_t emf_header;
|
||||||
} emr_header_t;
|
} emr_header_t;
|
||||||
|
|
||||||
typedef struct emr_createbrushindirect {
|
typedef struct emr_createbrushindirect {
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
uint32_t ih_brush;
|
uint32_t ih_brush;
|
||||||
log_brush_ex_t log_brush;
|
log_brush_ex_t log_brush;
|
||||||
} emr_createbrushindirect_t;
|
} emr_createbrushindirect_t;
|
||||||
|
|
||||||
typedef struct emr_createpen {
|
typedef struct emr_createpen {
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
uint32_t ih_pen;
|
uint32_t ih_pen;
|
||||||
log_pen_t log_pen;
|
log_pen_t log_pen;
|
||||||
} emr_createpen_t;
|
} emr_createpen_t;
|
||||||
|
|
||||||
typedef struct emr_selectobject {
|
typedef struct emr_selectobject {
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
uint32_t ih_object;
|
uint32_t ih_object;
|
||||||
} emr_selectobject_t;
|
} emr_selectobject_t;
|
||||||
|
|
||||||
typedef struct emr_rectangle {
|
typedef struct emr_rectangle {
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
rect_l_t box;
|
rect_l_t box;
|
||||||
} emr_rectangle_t;
|
} emr_rectangle_t;
|
||||||
|
|
||||||
typedef struct emr_ellipse {
|
typedef struct emr_ellipse {
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
rect_l_t box;
|
rect_l_t box;
|
||||||
} emr_ellipse_t;
|
} emr_ellipse_t;
|
||||||
|
|
||||||
typedef struct emr_polygon {
|
typedef struct emr_polygon {
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
@ -173,14 +173,14 @@ extern "C" {
|
|||||||
point_l_t a_points_e;
|
point_l_t a_points_e;
|
||||||
point_l_t a_points_f;
|
point_l_t a_points_f;
|
||||||
} emr_polygon_t;
|
} emr_polygon_t;
|
||||||
|
|
||||||
typedef struct emr_extcreatefontindirectw {
|
typedef struct emr_extcreatefontindirectw {
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
uint32_t ih_fonts;
|
uint32_t ih_fonts;
|
||||||
log_font_t elw;
|
log_font_t elw;
|
||||||
} emr_extcreatefontindirectw_t;
|
} emr_extcreatefontindirectw_t;
|
||||||
|
|
||||||
typedef struct emr_exttextoutw {
|
typedef struct emr_exttextoutw {
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
@ -190,7 +190,7 @@ extern "C" {
|
|||||||
float ey_scale;
|
float ey_scale;
|
||||||
emr_text_t w_emr_text;
|
emr_text_t w_emr_text;
|
||||||
} emr_exttextoutw_t;
|
} emr_exttextoutw_t;
|
||||||
|
|
||||||
typedef struct emr_eof {
|
typedef struct emr_eof {
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
@ -198,14 +198,14 @@ extern "C" {
|
|||||||
uint32_t off_pal_entries;
|
uint32_t off_pal_entries;
|
||||||
uint32_t size_last;
|
uint32_t size_last;
|
||||||
} emr_eof_t;
|
} emr_eof_t;
|
||||||
|
|
||||||
typedef struct box {
|
typedef struct box {
|
||||||
emr_rectangle_t top;
|
emr_rectangle_t top;
|
||||||
emr_rectangle_t bottom;
|
emr_rectangle_t bottom;
|
||||||
emr_rectangle_t left;
|
emr_rectangle_t left;
|
||||||
emr_rectangle_t right;
|
emr_rectangle_t right;
|
||||||
} box_t;
|
} box_t;
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@ -214,3 +214,4 @@ extern "C" {
|
|||||||
|
|
||||||
#endif /* EMF_H */
|
#endif /* EMF_H */
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,7 +25,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -23321,4 +23321,4 @@ static const unsigned short int gb18030_fourbyte_lookup[] = {
|
|||||||
0xFFDD, 0x8431, 0xA231,
|
0xFFDD, 0x8431, 0xA231,
|
||||||
0xFFDE, 0x8431, 0xA232,
|
0xFFDE, 0x8431, 0xA232,
|
||||||
0xFFDF, 0x8431, 0xA233
|
0xFFDF, 0x8431, 0xA233
|
||||||
};
|
};
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,7 +25,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -7476,3 +7476,4 @@ static const unsigned short int gb2312_lookup[] = {
|
|||||||
0xFFE3, 0xA3FE,
|
0xFFE3, 0xA3FE,
|
||||||
0xFFE5, 0xA3A4
|
0xFFE5, 0xA3A4
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -399,4 +399,4 @@ int gif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
fclose(gif_file);
|
fclose(gif_file);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -315,7 +315,7 @@ static int seek_forward(int gbdata[], const size_t length, const size_t position
|
|||||||
/* Add the length indicator for byte encoded blocks */
|
/* Add the length indicator for byte encoded blocks */
|
||||||
static void add_byte_count(char binary[], const size_t byte_count_posn, const int byte_count) {
|
static void add_byte_count(char binary[], const size_t byte_count_posn, const int byte_count) {
|
||||||
int p;
|
int p;
|
||||||
|
|
||||||
for (p = 0; p < 8; p++) {
|
for (p = 0; p < 8; p++) {
|
||||||
if (byte_count & (0x100 >> p)) {
|
if (byte_count & (0x100 >> p)) {
|
||||||
binary[byte_count_posn + p] = '0';
|
binary[byte_count_posn + p] = '0';
|
||||||
@ -365,7 +365,7 @@ static int gm_encode(int gbdata[], const size_t length, char binary[],const int
|
|||||||
if (reader) {
|
if (reader) {
|
||||||
bin_append(10, 4, binary); /* FNC3 - Reader Initialisation */
|
bin_append(10, 4, binary); /* FNC3 - Reader Initialisation */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eci != 3) {
|
if (eci != 3) {
|
||||||
/* ECI assignment according to Table 8 */
|
/* ECI assignment according to Table 8 */
|
||||||
bin_append(12, 4, binary); /* ECI */
|
bin_append(12, 4, binary); /* ECI */
|
||||||
@ -732,7 +732,7 @@ static int gm_encode(int gbdata[], const size_t length, char binary[],const int
|
|||||||
if (debug) {
|
if (debug) {
|
||||||
printf("[%d] ", glyph);
|
printf("[%d] ", glyph);
|
||||||
}
|
}
|
||||||
|
|
||||||
bin_append(glyph, 5, binary);
|
bin_append(glyph, 5, binary);
|
||||||
} else {
|
} else {
|
||||||
/* Shift Mode character */
|
/* Shift Mode character */
|
||||||
@ -1054,7 +1054,7 @@ int grid_matrix(struct zint_symbol *symbol, const unsigned char source[], size_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->output_options & READER_INIT) reader = 1;
|
if (symbol->output_options & READER_INIT) reader = 1;
|
||||||
|
|
||||||
if (symbol->eci > 811799) {
|
if (symbol->eci > 811799) {
|
||||||
strcpy(symbol->errtxt, "533: Invalid ECI");
|
strcpy(symbol->errtxt, "533: Invalid ECI");
|
||||||
return ZINT_ERROR_INVALID_OPTION;
|
return ZINT_ERROR_INVALID_OPTION;
|
||||||
@ -1208,3 +1208,4 @@ int grid_matrix(struct zint_symbol *symbol, const unsigned char source[], size_t
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,7 +25,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -182,3 +182,4 @@ static const unsigned short int gm_macro_matrix[] = {
|
|||||||
703, 600, 599, 598, 597, 596, 595, 594, 593, 592, 591, 590, 589, 588, 587, 586, 585, 584, 583, 582, 581, 580, 579, 578, 577, 576, 675,
|
703, 600, 599, 598, 597, 596, 595, 594, 593, 592, 591, 590, 589, 588, 587, 586, 585, 584, 583, 582, 581, 580, 579, 578, 577, 576, 675,
|
||||||
702, 701, 700, 699, 698, 697, 696, 695, 694, 693, 692, 691, 690, 689, 688, 687, 686, 685, 684, 683, 682, 681, 680, 679, 678, 677, 676,
|
702, 701, 700, 699, 698, 697, 696, 695, 694, 693, 692, 691, 690, 689, 688, 687, 686, 685, 684, 683, 682, 681, 680, 679, 678, 677, 676,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -34,7 +34,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "gs1.h"
|
#include "gs1.h"
|
||||||
@ -356,3 +356,4 @@ int ugs1_verify(struct zint_symbol *symbol, const unsigned char source[], const
|
|||||||
strcpy(symbol->errtxt, "261: ugs1_verify overflow");
|
strcpy(symbol->errtxt, "261: ugs1_verify overflow");
|
||||||
return ZINT_ERROR_INVALID_DATA;
|
return ZINT_ERROR_INVALID_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,19 +47,19 @@
|
|||||||
/* Find which submode to use for a text character */
|
/* Find which submode to use for a text character */
|
||||||
int getsubmode(char input) {
|
int getsubmode(char input) {
|
||||||
int submode = 2;
|
int submode = 2;
|
||||||
|
|
||||||
if ((input >= '0') && (input <= '9')) {
|
if ((input >= '0') && (input <= '9')) {
|
||||||
submode = 1;
|
submode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((input >= 'A') && (input <= 'Z')) {
|
if ((input >= 'A') && (input <= 'Z')) {
|
||||||
submode = 1;
|
submode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((input >= 'a') && (input <= 'z')) {
|
if ((input >= 'a') && (input <= 'z')) {
|
||||||
submode = 1;
|
submode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return submode;
|
return submode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,11 +69,11 @@ static int calculate_binlength(char mode[], int source[], const size_t length, i
|
|||||||
char lastmode = 't';
|
char lastmode = 't';
|
||||||
int est_binlen = 0;
|
int est_binlen = 0;
|
||||||
int submode = 1;
|
int submode = 1;
|
||||||
|
|
||||||
if (eci != 3) {
|
if (eci != 3) {
|
||||||
est_binlen += 12;
|
est_binlen += 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
do {
|
do {
|
||||||
switch (mode[i]) {
|
switch (mode[i]) {
|
||||||
@ -220,7 +220,7 @@ int isFourByte(int glyph, int glyph2) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return valid;
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,25 +232,25 @@ static void hx_define_mode(char mode[], int source[], const size_t length) {
|
|||||||
i = 0;
|
i = 0;
|
||||||
do {
|
do {
|
||||||
int done = 0;
|
int done = 0;
|
||||||
|
|
||||||
if (isRegion1(source[i])) {
|
if (isRegion1(source[i])) {
|
||||||
mode[i] = '1';
|
mode[i] = '1';
|
||||||
done = 1;
|
done = 1;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((done == 0) && (isRegion2(source[i]))) {
|
if ((done == 0) && (isRegion2(source[i]))) {
|
||||||
mode[i] = '2';
|
mode[i] = '2';
|
||||||
done = 1;
|
done = 1;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((done == 0) && (isDoubleByte(source[i]))) {
|
if ((done == 0) && (isDoubleByte(source[i]))) {
|
||||||
mode[i] = 'd';
|
mode[i] = 'd';
|
||||||
done = 1;
|
done = 1;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((done == 0) && (i < length - 1)) {
|
if ((done == 0) && (i < length - 1)) {
|
||||||
if (isFourByte(source[i], source[i + 1])) {
|
if (isFourByte(source[i], source[i + 1])) {
|
||||||
mode[i] = 'f';
|
mode[i] = 'f';
|
||||||
@ -288,42 +288,42 @@ static void hx_define_mode(char mode[], int source[], const size_t length) {
|
|||||||
/* Convert Text 1 sub-mode character to encoding value, as given in table 3 */
|
/* Convert Text 1 sub-mode character to encoding value, as given in table 3 */
|
||||||
int lookup_text1(char input) {
|
int lookup_text1(char input) {
|
||||||
int encoding_value = 0;
|
int encoding_value = 0;
|
||||||
|
|
||||||
if ((input >= '0') && (input <= '9')) {
|
if ((input >= '0') && (input <= '9')) {
|
||||||
encoding_value = input - '0';
|
encoding_value = input - '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((input >= 'A') && (input <= 'Z')) {
|
if ((input >= 'A') && (input <= 'Z')) {
|
||||||
encoding_value = input - 'A' + 10;
|
encoding_value = input - 'A' + 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((input >= 'a') && (input <= 'z')) {
|
if ((input >= 'a') && (input <= 'z')) {
|
||||||
encoding_value = input - 'a' + 36;
|
encoding_value = input - 'a' + 36;
|
||||||
}
|
}
|
||||||
|
|
||||||
return encoding_value;
|
return encoding_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert Text 2 sub-mode character to encoding value, as given in table 4 */
|
/* Convert Text 2 sub-mode character to encoding value, as given in table 4 */
|
||||||
int lookup_text2(char input) {
|
int lookup_text2(char input) {
|
||||||
int encoding_value = 0;
|
int encoding_value = 0;
|
||||||
|
|
||||||
if ((input >= 0) && (input <= 27)) {
|
if ((input >= 0) && (input <= 27)) {
|
||||||
encoding_value = input;
|
encoding_value = input;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((input >= ' ') && (input <= '/')) {
|
if ((input >= ' ') && (input <= '/')) {
|
||||||
encoding_value = input - ' ' + 28;
|
encoding_value = input - ' ' + 28;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((input >= '[') && (input <= 96)) {
|
if ((input >= '[') && (input <= 96)) {
|
||||||
encoding_value = input - '[' + 51;
|
encoding_value = input - '[' + 51;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((input >= '{') && (input <= 127)) {
|
if ((input >= '{') && (input <= 127)) {
|
||||||
encoding_value = input - '{' + 57;
|
encoding_value = input - '{' + 57;
|
||||||
}
|
}
|
||||||
|
|
||||||
return encoding_value;
|
return encoding_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -657,7 +657,7 @@ void hx_place_finder_top_left(unsigned char* grid, int size) {
|
|||||||
int xp, yp;
|
int xp, yp;
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
char finder[] = {0x7F, 0x40, 0x5F, 0x50, 0x57, 0x57, 0x57};
|
char finder[] = {0x7F, 0x40, 0x5F, 0x50, 0x57, 0x57, 0x57};
|
||||||
|
|
||||||
for (xp = 0; xp < 7; xp++) {
|
for (xp = 0; xp < 7; xp++) {
|
||||||
for (yp = 0; yp < 7; yp++) {
|
for (yp = 0; yp < 7; yp++) {
|
||||||
if (finder[yp] & 0x40 >> xp) {
|
if (finder[yp] & 0x40 >> xp) {
|
||||||
@ -942,7 +942,7 @@ void hx_add_ecc(unsigned char fullstream[], unsigned char datastream[], int vers
|
|||||||
void make_picket_fence(unsigned char fullstream[], unsigned char picket_fence[], int streamsize) {
|
void make_picket_fence(unsigned char fullstream[], unsigned char picket_fence[], int streamsize) {
|
||||||
int i, start;
|
int i, start;
|
||||||
int output_position = 0;
|
int output_position = 0;
|
||||||
|
|
||||||
for (start = 0; start < 13; start++) {
|
for (start = 0; start < 13; start++) {
|
||||||
for (i = start; i < streamsize; i += 13) {
|
for (i = start; i < streamsize; i += 13) {
|
||||||
if (i < streamsize) {
|
if (i < streamsize) {
|
||||||
@ -1217,7 +1217,7 @@ int hx_apply_bitmask(unsigned char *grid, int size) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return best_pattern;
|
return best_pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1265,14 +1265,14 @@ int han_xin(struct zint_symbol *symbol, const unsigned char source[], size_t len
|
|||||||
for (i = 0; i < length; i++) {
|
for (i = 0; i < length; i++) {
|
||||||
int done = 0;
|
int done = 0;
|
||||||
gbdata[posn] = 0;
|
gbdata[posn] = 0;
|
||||||
|
|
||||||
/* Single byte characters in range U+0000 -> U+007F */
|
/* Single byte characters in range U+0000 -> U+007F */
|
||||||
if (utfdata[i] <= 0x7f) {
|
if (utfdata[i] <= 0x7f) {
|
||||||
gbdata[posn] = utfdata[i];
|
gbdata[posn] = utfdata[i];
|
||||||
posn++;
|
posn++;
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Two bytes characters in GB-2312 */
|
/* Two bytes characters in GB-2312 */
|
||||||
if (done == 0) {
|
if (done == 0) {
|
||||||
j = 0;
|
j = 0;
|
||||||
@ -1285,7 +1285,7 @@ int han_xin(struct zint_symbol *symbol, const unsigned char source[], size_t len
|
|||||||
j++;
|
j++;
|
||||||
} while ((j < 7445) && (done == 0));
|
} while ((j < 7445) && (done == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Two byte characters in GB-18030 */
|
/* Two byte characters in GB-18030 */
|
||||||
if (done == 0) {
|
if (done == 0) {
|
||||||
j = 0;
|
j = 0;
|
||||||
@ -1312,13 +1312,13 @@ int han_xin(struct zint_symbol *symbol, const unsigned char source[], size_t len
|
|||||||
j++;
|
j++;
|
||||||
} while ((j < 6793) && (done == 0));
|
} while ((j < 6793) && (done == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Supplementary planes U+10000 -> U+1FFFF */
|
/* Supplementary planes U+10000 -> U+1FFFF */
|
||||||
if (done == 0) {
|
if (done == 0) {
|
||||||
if (utfdata[i] >= 0x10000 && utfdata[i] < 0x110000) {
|
if (utfdata[i] >= 0x10000 && utfdata[i] < 0x110000) {
|
||||||
/* algorithm from libiconv-1.15\lib\gb18030.h */
|
/* algorithm from libiconv-1.15\lib\gb18030.h */
|
||||||
int j, r3, r2, r1, r0;
|
int j, r3, r2, r1, r0;
|
||||||
|
|
||||||
j = utfdata[i] - 0x10000;
|
j = utfdata[i] - 0x10000;
|
||||||
r3 = (j % 10) + 0x30; j = j / 10;
|
r3 = (j % 10) + 0x30; j = j / 10;
|
||||||
r2 = (j % 126) + 0x81; j = j / 126;
|
r2 = (j % 126) + 0x81; j = j / 126;
|
||||||
@ -1330,7 +1330,7 @@ int han_xin(struct zint_symbol *symbol, const unsigned char source[], size_t len
|
|||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Character not found */
|
/* Character not found */
|
||||||
if (done == 0) {
|
if (done == 0) {
|
||||||
strcpy(symbol->errtxt, "540: Unknown character in input data");
|
strcpy(symbol->errtxt, "540: Unknown character in input data");
|
||||||
@ -1407,7 +1407,7 @@ int han_xin(struct zint_symbol *symbol, const unsigned char source[], size_t len
|
|||||||
if (symbol->option_2 > version) {
|
if (symbol->option_2 > version) {
|
||||||
version = symbol->option_2;
|
version = symbol->option_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((symbol->option_2 != 0) && (symbol->option_2 < version)) {
|
if ((symbol->option_2 != 0) && (symbol->option_2 < version)) {
|
||||||
strcpy(symbol->errtxt, "542: Input too long for selected symbol size");
|
strcpy(symbol->errtxt, "542: Input too long for selected symbol size");
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
@ -1571,3 +1571,4 @@ int han_xin(struct zint_symbol *symbol, const unsigned char source[], size_t len
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -457,4 +457,4 @@ static const unsigned short int hx_table_d1[] = {
|
|||||||
3, 45, 22, 55, 47, 20, 0, 0, 0,
|
3, 45, 22, 55, 47, 20, 0, 0, 0,
|
||||||
2, 26, 26, 62, 33, 28, 0, 0, 0,
|
2, 26, 26, 62, 33, 28, 0, 0, 0,
|
||||||
79, 18, 28, 4, 33, 30, 0, 0, 0
|
79, 18, 28, 4, 33, 30, 0, 0, 0
|
||||||
};
|
};
|
||||||
|
@ -327,7 +327,7 @@ int imail(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
for (i = 0; i < 112; i++) {
|
for (i = 0; i < 112; i++) {
|
||||||
x_reg[i] = 0;
|
x_reg[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
if (ctoi(zip[read]) & (0x01 << i)) x_reg[i] = 1;
|
if (ctoi(zip[read]) & (0x01 << i)) x_reg[i] = 1;
|
||||||
}
|
}
|
||||||
@ -368,11 +368,11 @@ int imail(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
for (i = 0; i < 9; i++) {
|
for (i = 0; i < 9; i++) {
|
||||||
binary_add(accum, y_reg);
|
binary_add(accum, y_reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 112; i++) {
|
for (i = 0; i < 112; i++) {
|
||||||
y_reg[i] = 0;
|
y_reg[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
if (ctoi(zip_adder[read]) & (0x01 << i)) y_reg[i] = 1;
|
if (ctoi(zip_adder[read]) & (0x01 << i)) y_reg[i] = 1;
|
||||||
}
|
}
|
||||||
@ -392,11 +392,11 @@ int imail(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
for (i = 0; i < 9; i++) {
|
for (i = 0; i < 9; i++) {
|
||||||
binary_add(accum, y_reg);
|
binary_add(accum, y_reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 112; i++) {
|
for (i = 0; i < 112; i++) {
|
||||||
y_reg[i] = 0;
|
y_reg[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add first digit of tracker */
|
/* add first digit of tracker */
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
if (ctoi(tracker[0]) & (0x01 << i)) y_reg[i] = 1;
|
if (ctoi(tracker[0]) & (0x01 << i)) y_reg[i] = 1;
|
||||||
@ -412,7 +412,7 @@ int imail(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
binary_add(accum, y_reg);
|
binary_add(accum, y_reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 112; i++) {
|
for (i = 0; i < 112; i++) {
|
||||||
y_reg[i] = 0;
|
y_reg[i] = 0;
|
||||||
}
|
}
|
||||||
@ -435,15 +435,15 @@ int imail(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
for (i = 0; i < 9; i++) {
|
for (i = 0; i < 9; i++) {
|
||||||
binary_add(accum, y_reg);
|
binary_add(accum, y_reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 112; i++) {
|
for (i = 0; i < 112; i++) {
|
||||||
y_reg[i] = 0;
|
y_reg[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
if (ctoi(tracker[read]) & (0x01 << i)) y_reg[i] = 1;
|
if (ctoi(tracker[read]) & (0x01 << i)) y_reg[i] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
binary_add(accum, y_reg);
|
binary_add(accum, y_reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -552,7 +552,7 @@ int imail(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
characters[i] = AppxD_II[codeword[i] - 1287];
|
characters[i] = AppxD_II[codeword[i] - 1287];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 10; i++) {
|
||||||
if (usps_crc & (1 << i)) {
|
if (usps_crc & (1 << i)) {
|
||||||
characters[i] = 0x1FFF - characters[i];
|
characters[i] = 0x1FFF - characters[i];
|
||||||
@ -603,3 +603,4 @@ int imail(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
symbol->width = read - 1;
|
symbol->width = read - 1;
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -41,49 +41,49 @@ void binary_add(short int accumulator[], short int input_buffer[]) { /* Binary a
|
|||||||
|
|
||||||
for (i = 0; i < 112; i++) {
|
for (i = 0; i < 112; i++) {
|
||||||
int done = 0;
|
int done = 0;
|
||||||
if (((input_buffer[i] == 0) && (accumulator[i] == 0))
|
if (((input_buffer[i] == 0) && (accumulator[i] == 0))
|
||||||
&& ((carry == 0) && (done == 0))) {
|
&& ((carry == 0) && (done == 0))) {
|
||||||
accumulator[i] = 0;
|
accumulator[i] = 0;
|
||||||
carry = 0;
|
carry = 0;
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
if (((input_buffer[i] == 0) && (accumulator[i] == 0))
|
if (((input_buffer[i] == 0) && (accumulator[i] == 0))
|
||||||
&& ((carry == 1) && (done == 0))) {
|
&& ((carry == 1) && (done == 0))) {
|
||||||
accumulator[i] = 1;
|
accumulator[i] = 1;
|
||||||
carry = 0;
|
carry = 0;
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
if (((input_buffer[i] == 0) && (accumulator[i] == 1))
|
if (((input_buffer[i] == 0) && (accumulator[i] == 1))
|
||||||
&& ((carry == 0) && (done == 0))) {
|
&& ((carry == 0) && (done == 0))) {
|
||||||
accumulator[i] = 1;
|
accumulator[i] = 1;
|
||||||
carry = 0;
|
carry = 0;
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
if (((input_buffer[i] == 0) && (accumulator[i] == 1))
|
if (((input_buffer[i] == 0) && (accumulator[i] == 1))
|
||||||
&& ((carry == 1) && (done == 0))) {
|
&& ((carry == 1) && (done == 0))) {
|
||||||
accumulator[i] = 0;
|
accumulator[i] = 0;
|
||||||
carry = 1;
|
carry = 1;
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
if (((input_buffer[i] == 1) && (accumulator[i] == 0))
|
if (((input_buffer[i] == 1) && (accumulator[i] == 0))
|
||||||
&& ((carry == 0) && (done == 0))) {
|
&& ((carry == 0) && (done == 0))) {
|
||||||
accumulator[i] = 1;
|
accumulator[i] = 1;
|
||||||
carry = 0;
|
carry = 0;
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
if (((input_buffer[i] == 1) && (accumulator[i] == 0))
|
if (((input_buffer[i] == 1) && (accumulator[i] == 0))
|
||||||
&& ((carry == 1) && (done == 0))) {
|
&& ((carry == 1) && (done == 0))) {
|
||||||
accumulator[i] = 0;
|
accumulator[i] = 0;
|
||||||
carry = 1;
|
carry = 1;
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
if (((input_buffer[i] == 1) && (accumulator[i] == 1))
|
if (((input_buffer[i] == 1) && (accumulator[i] == 1))
|
||||||
&& ((carry == 0) && (done == 0))) {
|
&& ((carry == 0) && (done == 0))) {
|
||||||
accumulator[i] = 0;
|
accumulator[i] = 0;
|
||||||
carry = 1;
|
carry = 1;
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
if (((input_buffer[i] == 1) && (accumulator[i] == 1))
|
if (((input_buffer[i] == 1) && (accumulator[i] == 1))
|
||||||
&& ((carry == 1) && (done == 0))) {
|
&& ((carry == 1) && (done == 0))) {
|
||||||
accumulator[i] = 1;
|
accumulator[i] = 1;
|
||||||
carry = 1;
|
carry = 1;
|
||||||
@ -92,7 +92,7 @@ void binary_add(short int accumulator[], short int input_buffer[]) { /* Binary a
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void binary_subtract(short int accumulator[], short int input_buffer[]) {
|
void binary_subtract(short int accumulator[], short int input_buffer[]) {
|
||||||
/* 2's compliment subtraction */
|
/* 2's compliment subtraction */
|
||||||
/* take input_buffer from accumulator and put answer in accumulator */
|
/* take input_buffer from accumulator and put answer in accumulator */
|
||||||
int i;
|
int i;
|
||||||
@ -180,7 +180,7 @@ void binary_load(short int reg[], char data[], const size_t src_len) {
|
|||||||
for (i = 0; i < 112; i++) {
|
for (i = 0; i < 112; i++) {
|
||||||
temp[i] = 0;
|
temp[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
if (ctoi(data[read]) & (0x01 << i)) temp[i] = 1;
|
if (ctoi(data[read]) & (0x01 << i)) temp[i] = 1;
|
||||||
}
|
}
|
||||||
@ -189,3 +189,4 @@ void binary_load(short int reg[], char data[], const size_t src_len) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifndef __LARGE_H
|
#ifndef __LARGE_H
|
||||||
@ -48,3 +48,4 @@ extern short int islarger(short int accum[], short int reg[]);
|
|||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#endif /* __LARGE_H */
|
#endif /* __LARGE_H */
|
||||||
|
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,7 +25,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -34,7 +34,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "gs1.h"
|
#include "gs1.h"
|
||||||
@ -351,20 +351,20 @@ static void check_row_heights(struct zint_symbol *symbol) {
|
|||||||
int i;
|
int i;
|
||||||
int preset_height = 0;
|
int preset_height = 0;
|
||||||
int large_bar_height = 0;
|
int large_bar_height = 0;
|
||||||
|
|
||||||
for (i = 0; i < symbol->rows; i++) {
|
for (i = 0; i < symbol->rows; i++) {
|
||||||
preset_height += symbol->row_height[i];
|
preset_height += symbol->row_height[i];
|
||||||
if (symbol->row_height[i] == 0) {
|
if (symbol->row_height[i] == 0) {
|
||||||
large_bar_count++;
|
large_bar_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (large_bar_count == 0) {
|
if (large_bar_count == 0) {
|
||||||
symbol->height = preset_height;
|
symbol->height = preset_height;
|
||||||
} else {
|
} else {
|
||||||
large_bar_height = (symbol->height - preset_height) / large_bar_count;
|
large_bar_height = (symbol->height - preset_height) / large_bar_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (large_bar_height < 5) {
|
if (large_bar_height < 5) {
|
||||||
for (i = 0; i < symbol->rows; i++) {
|
for (i = 0; i < symbol->rows; i++) {
|
||||||
if (symbol->row_height[i] == 0) {
|
if (symbol->row_height[i] == 0) {
|
||||||
@ -637,11 +637,11 @@ static int reduced_charset(struct zint_symbol *symbol, const unsigned char *sour
|
|||||||
break;
|
break;
|
||||||
case BARCODE_DPIDENT: error_number = dpident(symbol, preprocessed, in_length);
|
case BARCODE_DPIDENT: error_number = dpident(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
case BARCODE_UPCA:
|
case BARCODE_UPCA:
|
||||||
case BARCODE_UPCA_CHK:
|
case BARCODE_UPCA_CHK:
|
||||||
case BARCODE_UPCE:
|
case BARCODE_UPCE:
|
||||||
case BARCODE_UPCE_CHK:
|
case BARCODE_UPCE_CHK:
|
||||||
case BARCODE_EANX:
|
case BARCODE_EANX:
|
||||||
case BARCODE_EANX_CHK:
|
case BARCODE_EANX_CHK:
|
||||||
error_number = eanx(symbol, preprocessed, in_length);
|
error_number = eanx(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
@ -660,7 +660,7 @@ static int reduced_charset(struct zint_symbol *symbol, const unsigned char *sour
|
|||||||
case BARCODE_LOGMARS: error_number = c39(symbol, preprocessed, in_length);
|
case BARCODE_LOGMARS: error_number = c39(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
case BARCODE_CODE128:
|
case BARCODE_CODE128:
|
||||||
case BARCODE_CODE128B:
|
case BARCODE_CODE128B:
|
||||||
error_number = code_128(symbol, preprocessed, in_length);
|
error_number = code_128(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
case BARCODE_NVE18: error_number = nve_18(symbol, preprocessed, in_length);
|
case BARCODE_NVE18: error_number = nve_18(symbol, preprocessed, in_length);
|
||||||
@ -690,7 +690,7 @@ static int reduced_charset(struct zint_symbol *symbol, const unsigned char *sour
|
|||||||
case BARCODE_RM4SCC: error_number = royal_plot(symbol, preprocessed, in_length);
|
case BARCODE_RM4SCC: error_number = royal_plot(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
case BARCODE_AUSPOST:
|
case BARCODE_AUSPOST:
|
||||||
case BARCODE_AUSREPLY:
|
case BARCODE_AUSREPLY:
|
||||||
case BARCODE_AUSROUTE:
|
case BARCODE_AUSROUTE:
|
||||||
case BARCODE_AUSREDIRECT:
|
case BARCODE_AUSREDIRECT:
|
||||||
error_number = australia_post(symbol, preprocessed, in_length);
|
error_number = australia_post(symbol, preprocessed, in_length);
|
||||||
@ -704,26 +704,26 @@ static int reduced_charset(struct zint_symbol *symbol, const unsigned char *sour
|
|||||||
case BARCODE_ISBNX: error_number = eanx(symbol, preprocessed, in_length);
|
case BARCODE_ISBNX: error_number = eanx(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
case BARCODE_RSS14:
|
case BARCODE_RSS14:
|
||||||
case BARCODE_RSS14STACK:
|
case BARCODE_RSS14STACK:
|
||||||
case BARCODE_RSS14STACK_OMNI:
|
case BARCODE_RSS14STACK_OMNI:
|
||||||
error_number = rss14(symbol, preprocessed, in_length);
|
error_number = rss14(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
case BARCODE_RSS_LTD: error_number = rsslimited(symbol, preprocessed, in_length);
|
case BARCODE_RSS_LTD: error_number = rsslimited(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
case BARCODE_RSS_EXP:
|
case BARCODE_RSS_EXP:
|
||||||
case BARCODE_RSS_EXPSTACK:
|
case BARCODE_RSS_EXPSTACK:
|
||||||
error_number = rssexpanded(symbol, preprocessed, in_length);
|
error_number = rssexpanded(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
case BARCODE_EANX_CC:
|
case BARCODE_EANX_CC:
|
||||||
case BARCODE_EAN128_CC:
|
case BARCODE_EAN128_CC:
|
||||||
case BARCODE_RSS14_CC:
|
case BARCODE_RSS14_CC:
|
||||||
case BARCODE_RSS_LTD_CC:
|
case BARCODE_RSS_LTD_CC:
|
||||||
case BARCODE_RSS_EXP_CC:
|
case BARCODE_RSS_EXP_CC:
|
||||||
case BARCODE_UPCA_CC:
|
case BARCODE_UPCA_CC:
|
||||||
case BARCODE_UPCE_CC:
|
case BARCODE_UPCE_CC:
|
||||||
case BARCODE_RSS14STACK_CC:
|
case BARCODE_RSS14STACK_CC:
|
||||||
case BARCODE_RSS14_OMNI_CC:
|
case BARCODE_RSS14_OMNI_CC:
|
||||||
case BARCODE_RSS_EXPSTACK_CC:
|
case BARCODE_RSS_EXPSTACK_CC:
|
||||||
error_number = composite(symbol, preprocessed, in_length);
|
error_number = composite(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
case BARCODE_KIX: error_number = kix_code(symbol, preprocessed, in_length);
|
case BARCODE_KIX: error_number = kix_code(symbol, preprocessed, in_length);
|
||||||
@ -739,14 +739,14 @@ static int reduced_charset(struct zint_symbol *symbol, const unsigned char *sour
|
|||||||
break;
|
break;
|
||||||
case BARCODE_KOREAPOST: error_number = korea_post(symbol, preprocessed, in_length);
|
case BARCODE_KOREAPOST: error_number = korea_post(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
case BARCODE_HIBC_128:
|
case BARCODE_HIBC_128:
|
||||||
case BARCODE_HIBC_39:
|
case BARCODE_HIBC_39:
|
||||||
case BARCODE_HIBC_DM:
|
case BARCODE_HIBC_DM:
|
||||||
case BARCODE_HIBC_QR:
|
case BARCODE_HIBC_QR:
|
||||||
case BARCODE_HIBC_PDF:
|
case BARCODE_HIBC_PDF:
|
||||||
case BARCODE_HIBC_MICPDF:
|
case BARCODE_HIBC_MICPDF:
|
||||||
case BARCODE_HIBC_AZTEC:
|
case BARCODE_HIBC_AZTEC:
|
||||||
case BARCODE_HIBC_BLOCKF:
|
case BARCODE_HIBC_BLOCKF:
|
||||||
error_number = hibc(symbol, preprocessed, in_length);
|
error_number = hibc(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
case BARCODE_JAPANPOST: error_number = japan_post(symbol, preprocessed, in_length);
|
case BARCODE_JAPANPOST: error_number = japan_post(symbol, preprocessed, in_length);
|
||||||
@ -759,8 +759,8 @@ static int reduced_charset(struct zint_symbol *symbol, const unsigned char *sour
|
|||||||
break;
|
break;
|
||||||
case BARCODE_DATAMATRIX: error_number = dmatrix(symbol, preprocessed, in_length);
|
case BARCODE_DATAMATRIX: error_number = dmatrix(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
case BARCODE_PDF417:
|
case BARCODE_PDF417:
|
||||||
case BARCODE_PDF417TRUNC:
|
case BARCODE_PDF417TRUNC:
|
||||||
error_number = pdf417enc(symbol, preprocessed, in_length);
|
error_number = pdf417enc(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
case BARCODE_MICROPDF417: error_number = micro_pdf417(symbol, preprocessed, in_length);
|
case BARCODE_MICROPDF417: error_number = micro_pdf417(symbol, preprocessed, in_length);
|
||||||
@ -774,13 +774,13 @@ static int reduced_charset(struct zint_symbol *symbol, const unsigned char *sour
|
|||||||
case BARCODE_CODABLOCKF: error_number = codablock(symbol, preprocessed, in_length);
|
case BARCODE_CODABLOCKF: error_number = codablock(symbol, preprocessed, in_length);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
void strip_bom(unsigned char *source, int *input_length) {
|
void strip_bom(unsigned char *source, int *input_length) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (*input_length > 3) {
|
if (*input_length > 3) {
|
||||||
if((source[0] == 0xef) && (source[1] == 0xbb) && (source[2] == 0xbf)) {
|
if((source[0] == 0xef) && (source[1] == 0xbb) && (source[2] == 0xbf)) {
|
||||||
/* BOM at start of input data, strip in accordance with RFC 3629 */
|
/* BOM at start of input data, strip in accordance with RFC 3629 */
|
||||||
@ -875,7 +875,7 @@ int escape_char_process(struct zint_symbol *symbol, unsigned char *input_string,
|
|||||||
|
|
||||||
memcpy(input_string, escaped_string, out_posn);
|
memcpy(input_string, escaped_string, out_posn);
|
||||||
*length = out_posn;
|
*length = out_posn;
|
||||||
|
|
||||||
error_number = 0;
|
error_number = 0;
|
||||||
|
|
||||||
return error_number;
|
return error_number;
|
||||||
@ -887,7 +887,7 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int
|
|||||||
unsigned char* local_source;
|
unsigned char* local_source;
|
||||||
#endif
|
#endif
|
||||||
error_number = 0;
|
error_number = 0;
|
||||||
|
|
||||||
if (in_length == 0) {
|
if (in_length == 0) {
|
||||||
in_length = (int)ustrlen(source);
|
in_length = (int)ustrlen(source);
|
||||||
}
|
}
|
||||||
@ -900,7 +900,7 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int
|
|||||||
if (strcmp(symbol->outfile, "") == 0) {
|
if (strcmp(symbol->outfile, "") == 0) {
|
||||||
#ifdef NO_PNG
|
#ifdef NO_PNG
|
||||||
strcpy(symbol->outfile, "out.gif");
|
strcpy(symbol->outfile, "out.gif");
|
||||||
#else
|
#else
|
||||||
strcpy(symbol->outfile, "out.png");
|
strcpy(symbol->outfile, "out.png");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1078,7 +1078,7 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int
|
|||||||
memcpy(local_source, source, in_length);
|
memcpy(local_source, source, in_length);
|
||||||
local_source[in_length] = '\0';
|
local_source[in_length] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->input_mode &= ESCAPE_MODE) {
|
if (symbol->input_mode &= ESCAPE_MODE) {
|
||||||
error_number = escape_char_process(symbol, local_source, &in_length);
|
error_number = escape_char_process(symbol, local_source, &in_length);
|
||||||
if (error_number != 0) {
|
if (error_number != 0) {
|
||||||
@ -1086,19 +1086,19 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int
|
|||||||
}
|
}
|
||||||
symbol->input_mode -= ESCAPE_MODE;
|
symbol->input_mode -= ESCAPE_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((symbol->input_mode < 0) || (symbol->input_mode > 2)) {
|
if ((symbol->input_mode < 0) || (symbol->input_mode > 2)) {
|
||||||
symbol->input_mode = DATA_MODE;
|
symbol->input_mode = DATA_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((symbol->eci != 3) && (symbol->eci != 26)) {
|
if ((symbol->eci != 3) && (symbol->eci != 26)) {
|
||||||
symbol->input_mode = DATA_MODE;
|
symbol->input_mode = DATA_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->input_mode == UNICODE_MODE) {
|
if (symbol->input_mode == UNICODE_MODE) {
|
||||||
strip_bom(local_source, &in_length);
|
strip_bom(local_source, &in_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((symbol->dot_size < 0.01) || (symbol->dot_size > 20.0)) {
|
if ((symbol->dot_size < 0.01) || (symbol->dot_size > 20.0)) {
|
||||||
strcpy(symbol->errtxt, "221: Invalid dot size");
|
strcpy(symbol->errtxt, "221: Invalid dot size");
|
||||||
return ZINT_ERROR_INVALID_OPTION;
|
return ZINT_ERROR_INVALID_OPTION;
|
||||||
@ -1116,12 +1116,12 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int
|
|||||||
error_number = reduced_charset(symbol, local_source, in_length);
|
error_number = reduced_charset(symbol, local_source, in_length);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((error_number == ZINT_ERROR_INVALID_DATA) && (supports_eci(symbol->symbology)
|
if ((error_number == ZINT_ERROR_INVALID_DATA) && (supports_eci(symbol->symbology)
|
||||||
&& (symbol->input_mode == UNICODE_MODE))) {
|
&& (symbol->input_mode == UNICODE_MODE))) {
|
||||||
/* Try another ECI mode */
|
/* Try another ECI mode */
|
||||||
symbol->eci = get_best_eci(local_source, in_length);
|
symbol->eci = get_best_eci(local_source, in_length);
|
||||||
|
|
||||||
error_number = ZINT_WARN_USES_ECI;
|
error_number = ZINT_WARN_USES_ECI;
|
||||||
strcpy(symbol->errtxt, "222: Encoded data includes ECI codes");
|
strcpy(symbol->errtxt, "222: Encoded data includes ECI codes");
|
||||||
//printf("Data will encode with ECI %d\n", symbol->eci);
|
//printf("Data will encode with ECI %d\n", symbol->eci);
|
||||||
@ -1138,7 +1138,7 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int
|
|||||||
error_number = reduced_charset(symbol, local_source, in_length);
|
error_number = reduced_charset(symbol, local_source, in_length);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error_number == 0) {
|
if (error_number == 0) {
|
||||||
@ -1154,11 +1154,11 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int
|
|||||||
error_number = error_buffer;
|
error_number = error_buffer;
|
||||||
}
|
}
|
||||||
error_tag(symbol->errtxt, error_number);
|
error_tag(symbol->errtxt, error_number);
|
||||||
|
|
||||||
if (error_number <= 5) {
|
if (error_number <= 5) {
|
||||||
check_row_heights(symbol);
|
check_row_heights(symbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1391,3 +1391,4 @@ int ZBarcode_Render(struct zint_symbol *symbol, const float width, const float h
|
|||||||
int ZBarcode_Version() {
|
int ZBarcode_Version() {
|
||||||
return (ZINT_VERSION_MAJOR * 10000) + (ZINT_VERSION_MINOR * 100) + ZINT_VERSION_RELEASE;
|
return (ZINT_VERSION_MAJOR * 10000) + (ZINT_VERSION_MINOR * 100) + ZINT_VERSION_RELEASE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -489,7 +489,7 @@ int maxi_text_process(int mode, unsigned char source[], int length, int eci) {
|
|||||||
length += 5;
|
length += 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((mode == 2) || (mode == 3)) && (length > 84)) {
|
if (((mode == 2) || (mode == 3)) && (length > 84)) {
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
@ -734,3 +734,4 @@ int maxicode(struct zint_symbol *symbol, unsigned char local_source[], const int
|
|||||||
return internal_error;
|
return internal_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -306,3 +306,4 @@ int code32(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
||||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006-2008 Alexander Chemeris
|
// Copyright (c) 2006-2008 Alexander Chemeris
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are met:
|
// modification, are permitted provided that the following conditions are met:
|
||||||
//
|
//
|
||||||
// 1. Redistributions of source code must retain the above copyright notice,
|
// 1. Redistributions of source code must retain the above copyright notice,
|
||||||
// this list of conditions and the following disclaimer.
|
// this list of conditions and the following disclaimer.
|
||||||
//
|
//
|
||||||
// 2. Redistributions in binary form must reproduce the above copyright
|
// 2. Redistributions in binary form must reproduce the above copyright
|
||||||
// notice, this list of conditions and the following disclaimer in the
|
// notice, this list of conditions and the following disclaimer in the
|
||||||
// documentation and/or other materials provided with the distribution.
|
// documentation and/or other materials provided with the distribution.
|
||||||
//
|
//
|
||||||
// 3. The name of the author may be used to endorse or promote products
|
// 3. The name of the author may be used to endorse or promote products
|
||||||
// derived from this software without specific prior written permission.
|
// derived from this software without specific prior written permission.
|
||||||
//
|
//
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/* @(#) $Id: ms_stdint.h,v 1.1 2009/09/19 08:16:21 hooper114 Exp $ */
|
/* @(#) $Id: ms_stdint.h,v 1.1 2009/09/19 08:16:21 hooper114 Exp $ */
|
||||||
@ -49,7 +49,7 @@
|
|||||||
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
|
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
|
||||||
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
||||||
extern "C++" {
|
extern "C++" {
|
||||||
#endif
|
#endif
|
||||||
# include <wchar.h>
|
# include <wchar.h>
|
||||||
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
||||||
}
|
}
|
||||||
@ -232,3 +232,4 @@ typedef uint64_t uintmax_t;
|
|||||||
|
|
||||||
|
|
||||||
#endif // _MSC_STDINT_H_ ]
|
#endif // _MSC_STDINT_H_ ]
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -170,3 +170,4 @@ int pcx_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,7 +25,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#pragma pack (1)
|
#pragma pack (1)
|
||||||
|
|
||||||
typedef struct pcx_header {
|
typedef struct pcx_header {
|
||||||
uint8_t manufacturer;
|
uint8_t manufacturer;
|
||||||
uint8_t version;
|
uint8_t version;
|
||||||
@ -67,10 +67,11 @@ extern "C" {
|
|||||||
} pcx_header_t;
|
} pcx_header_t;
|
||||||
|
|
||||||
#pragma pack ()
|
#pragma pack ()
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* PCX_H */
|
#endif /* PCX_H */
|
||||||
|
|
||||||
|
|
||||||
|
@ -601,12 +601,12 @@ static int pdf417(struct zint_symbol *symbol, unsigned char chaine[], const size
|
|||||||
/* 541 - now compress the data */
|
/* 541 - now compress the data */
|
||||||
indexchaine = 0;
|
indexchaine = 0;
|
||||||
mclength = 0;
|
mclength = 0;
|
||||||
|
|
||||||
if (symbol->output_options & READER_INIT) {
|
if (symbol->output_options & READER_INIT) {
|
||||||
chainemc[mclength] = 921; /* Reader Initialisation */
|
chainemc[mclength] = 921; /* Reader Initialisation */
|
||||||
mclength++;
|
mclength++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->eci != 3) {
|
if (symbol->eci != 3) {
|
||||||
/* Encoding ECI assignment number, according to Table 8 */
|
/* Encoding ECI assignment number, according to Table 8 */
|
||||||
if (symbol->eci <= 899) {
|
if (symbol->eci <= 899) {
|
||||||
@ -630,12 +630,12 @@ static int pdf417(struct zint_symbol *symbol, unsigned char chaine[], const size
|
|||||||
mclength++;
|
mclength++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->eci > 811799) {
|
if (symbol->eci > 811799) {
|
||||||
strcpy(symbol->errtxt, "472: Invalid ECI");
|
strcpy(symbol->errtxt, "472: Invalid ECI");
|
||||||
return ZINT_ERROR_INVALID_OPTION;
|
return ZINT_ERROR_INVALID_OPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < indexliste; i++) {
|
for (i = 0; i < indexliste; i++) {
|
||||||
switch (liste[1][i]) {
|
switch (liste[1][i]) {
|
||||||
case TEX: /* 547 - text mode */
|
case TEX: /* 547 - text mode */
|
||||||
@ -798,21 +798,21 @@ static int pdf417(struct zint_symbol *symbol, unsigned char chaine[], const size
|
|||||||
bin_append(pdf_bitpattern[offset + dummy[j]], 16, pattern);
|
bin_append(pdf_bitpattern[offset + dummy[j]], 16, pattern);
|
||||||
strcat(pattern, "0");
|
strcat(pattern, "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->symbology != BARCODE_PDF417TRUNC) {
|
if (symbol->symbology != BARCODE_PDF417TRUNC) {
|
||||||
bin_append(pdf_bitpattern[offset + dummy[j]], 16, pattern);
|
bin_append(pdf_bitpattern[offset + dummy[j]], 16, pattern);
|
||||||
strcat(pattern, "0");
|
strcat(pattern, "0");
|
||||||
bin_append(0x3FA29, 18, pattern); /* Row Stop */
|
bin_append(0x3FA29, 18, pattern); /* Row Stop */
|
||||||
}
|
}
|
||||||
|
|
||||||
for (loop = 0; loop < strlen(pattern); loop++) {
|
for (loop = 0; loop < strlen(pattern); loop++) {
|
||||||
if (pattern[loop] == '1') {
|
if (pattern[loop] == '1') {
|
||||||
set_module(symbol, i, loop);
|
set_module(symbol, i, loop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
symbol->row_height[i] = 3;
|
symbol->row_height[i] = 3;
|
||||||
|
|
||||||
}
|
}
|
||||||
symbol->rows = (mclength / symbol->option_2);
|
symbol->rows = (mclength / symbol->option_2);
|
||||||
symbol->width =(int)strlen(pattern);
|
symbol->width =(int)strlen(pattern);
|
||||||
@ -930,17 +930,17 @@ int micro_pdf417(struct zint_symbol *symbol, unsigned char chaine[], const size_
|
|||||||
/* 541 - now compress the data */
|
/* 541 - now compress the data */
|
||||||
indexchaine = 0;
|
indexchaine = 0;
|
||||||
mclength = 0;
|
mclength = 0;
|
||||||
|
|
||||||
if (symbol->output_options & READER_INIT) {
|
if (symbol->output_options & READER_INIT) {
|
||||||
chainemc[mclength] = 921; /* Reader Initialisation */
|
chainemc[mclength] = 921; /* Reader Initialisation */
|
||||||
mclength++;
|
mclength++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->eci > 811799) {
|
if (symbol->eci > 811799) {
|
||||||
strcpy(symbol->errtxt, "473: Invalid ECI");
|
strcpy(symbol->errtxt, "473: Invalid ECI");
|
||||||
return ZINT_ERROR_INVALID_OPTION;
|
return ZINT_ERROR_INVALID_OPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->eci != 3) {
|
if (symbol->eci != 3) {
|
||||||
/* Encoding ECI assignment number, according to Table 8 */
|
/* Encoding ECI assignment number, according to Table 8 */
|
||||||
if (symbol->eci <= 899) {
|
if (symbol->eci <= 899) {
|
||||||
@ -964,7 +964,7 @@ int micro_pdf417(struct zint_symbol *symbol, unsigned char chaine[], const size_
|
|||||||
mclength++;
|
mclength++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < indexliste; i++) {
|
for (i = 0; i < indexliste; i++) {
|
||||||
switch (liste[1][i]) {
|
switch (liste[1][i]) {
|
||||||
case TEX: /* 547 - text mode */
|
case TEX: /* 547 - text mode */
|
||||||
@ -1289,3 +1289,4 @@ int micro_pdf417(struct zint_symbol *symbol, unsigned char chaine[], const size_
|
|||||||
return codeerr;
|
return codeerr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ static const char *MSITable[10] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Not MSI/Plessey but the older Plessey standard */
|
/* Not MSI/Plessey but the older Plessey standard */
|
||||||
int plessey(struct zint_symbol *symbol, unsigned char source[], const size_t length) {
|
int plessey(struct zint_symbol *symbol, unsigned char source[], const size_t length) {
|
||||||
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned char *checkptr;
|
unsigned char *checkptr;
|
||||||
@ -111,7 +111,7 @@ int plessey(struct zint_symbol *symbol, unsigned char source[], const size_t len
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Plain MSI Plessey - does not calculate any check character */
|
/* Plain MSI Plessey - does not calculate any check character */
|
||||||
int msi_plessey(struct zint_symbol *symbol, unsigned char source[], const size_t length) {
|
int msi_plessey(struct zint_symbol *symbol, unsigned char source[], const size_t length) {
|
||||||
|
|
||||||
size_t i;
|
size_t i;
|
||||||
char dest[512]; /* 2 + 55 * 8 + 3 + 1 ~ 512 */
|
char dest[512]; /* 2 + 55 * 8 + 3 + 1 ~ 512 */
|
||||||
@ -307,7 +307,7 @@ int msi_plessey_mod1010(struct zint_symbol *symbol, unsigned char source[], cons
|
|||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate a Modulo 11 check digit using the system discussed on Wikipedia -
|
/* Calculate a Modulo 11 check digit using the system discussed on Wikipedia -
|
||||||
see http://en.wikipedia.org/wiki/Talk:MSI_Barcode */
|
see http://en.wikipedia.org/wiki/Talk:MSI_Barcode */
|
||||||
int msi_plessey_mod11(struct zint_symbol *symbol, unsigned char source[], const unsigned int src_len) {
|
int msi_plessey_mod11(struct zint_symbol *symbol, unsigned char source[], const unsigned int src_len) {
|
||||||
/* uses the IBM weight system */
|
/* uses the IBM weight system */
|
||||||
@ -491,3 +491,4 @@ int msi_handle(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
|
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ int png_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
graphic = &wpng_info;
|
graphic = &wpng_info;
|
||||||
|
|
||||||
graphic->width = symbol->bitmap_width;
|
graphic->width = symbol->bitmap_width;
|
||||||
graphic->height = symbol->bitmap_height;
|
graphic->height = symbol->bitmap_height;
|
||||||
|
|
||||||
@ -190,3 +190,4 @@ int png_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
}
|
}
|
||||||
#endif /* NO_PNG */
|
#endif /* NO_PNG */
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* postal.c - Handles PostNet, PLANET, FIM. RM4SCC and Flattermarken */
|
/* postal.c - Handles PostNet, PLANET, FIM. RM4SCC and Flattermarken */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
libzint - the open source barcode library
|
libzint - the open source barcode library
|
||||||
Copyright (C) 2008-2017 Robin Stuart <rstuart114@gmail.com>
|
Copyright (C) 2008-2017 Robin Stuart <rstuart114@gmail.com>
|
||||||
Including bug fixes by Bryan Hatton
|
Including bug fixes by Bryan Hatton
|
||||||
@ -9,14 +9,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -27,7 +27,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -35,7 +35,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
@ -351,7 +351,7 @@ int royal_plot(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
/*check = */rm4scc((char*) source, (unsigned char*) height_pattern, length);
|
/*check = */rm4scc((char*) source, (unsigned char*) height_pattern, length);
|
||||||
|
|
||||||
writer = 0;
|
writer = 0;
|
||||||
h = strlen(height_pattern);
|
h = strlen(height_pattern);
|
||||||
for (loopey = 0; loopey < h; loopey++) {
|
for (loopey = 0; loopey < h; loopey++) {
|
||||||
@ -398,7 +398,7 @@ int kix_code(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
strcpy(localstr, (char *) source);
|
strcpy(localstr, (char *) source);
|
||||||
|
|
||||||
/* Encode data */
|
/* Encode data */
|
||||||
for (i = 0; i < length; i++) {
|
for (i = 0; i < length; i++) {
|
||||||
lookup(KRSET, RoyalTable, localstr[i], height_pattern);
|
lookup(KRSET, RoyalTable, localstr[i], height_pattern);
|
||||||
@ -526,7 +526,7 @@ int japan_post(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
strcpy(symbol->errtxt, "496: Input too long");
|
strcpy(symbol->errtxt, "496: Input too long");
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
|
|
||||||
inter_posn = 0;
|
inter_posn = 0;
|
||||||
error_number = 0;
|
error_number = 0;
|
||||||
|
|
||||||
@ -619,3 +619,4 @@ int japan_post(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
|
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
unsigned char local_text[ustrlen(symbol->text) + 1];
|
unsigned char local_text[ustrlen(symbol->text) + 1];
|
||||||
#else
|
#else
|
||||||
unsigned char* local_text = (unsigned char*) malloc(ustrlen(symbol->text) + 1);
|
unsigned char* local_text = (unsigned char*) malloc(ustrlen(symbol->text) + 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
row_height = 0;
|
row_height = 0;
|
||||||
textdone = 0;
|
textdone = 0;
|
||||||
@ -974,3 +974,4 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
37
backend/qr.c
37
backend/qr.c
@ -164,7 +164,7 @@ static void qr_binary(int datastream[], const int version, const int target_binl
|
|||||||
if (gs1) {
|
if (gs1) {
|
||||||
strcat(binary, "0101"); /* FNC1 */
|
strcat(binary, "0101"); /* FNC1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eci != 3) {
|
if (eci != 3) {
|
||||||
strcat(binary, "0111"); /* ECI (Table 4) */
|
strcat(binary, "0111"); /* ECI (Table 4) */
|
||||||
if (eci <= 127) {
|
if (eci <= 127) {
|
||||||
@ -210,15 +210,15 @@ static void qr_binary(int datastream[], const int version, const int target_binl
|
|||||||
for (i = 0; i < short_data_block_length; i++) {
|
for (i = 0; i < short_data_block_length; i++) {
|
||||||
int jis = jisdata[position + i];
|
int jis = jisdata[position + i];
|
||||||
int prod;
|
int prod;
|
||||||
|
|
||||||
if (jis >= 0x8140 && jis <= 0x9ffc)
|
if (jis >= 0x8140 && jis <= 0x9ffc)
|
||||||
jis -= 0x8140;
|
jis -= 0x8140;
|
||||||
|
|
||||||
else if (jis >= 0xe040 && jis <= 0xebbf)
|
else if (jis >= 0xe040 && jis <= 0xebbf)
|
||||||
jis -= 0xc140;
|
jis -= 0xc140;
|
||||||
|
|
||||||
prod = ((jis >> 8) * 0xc0) + (jis & 0xff);
|
prod = ((jis >> 8) * 0xc0) + (jis & 0xff);
|
||||||
|
|
||||||
bin_append(prod, 13, binary);
|
bin_append(prod, 13, binary);
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
@ -547,7 +547,7 @@ static void add_ecc(int fullstream[],const int datastream[],const int version,co
|
|||||||
static void place_finder(unsigned char grid[],const int size,const int x,const int y) {
|
static void place_finder(unsigned char grid[],const int size,const int x,const int y) {
|
||||||
int xp, yp;
|
int xp, yp;
|
||||||
char finder[] = {0x7F, 0x41, 0x5D, 0x5D, 0x5D, 0x41, 0x7F};
|
char finder[] = {0x7F, 0x41, 0x5D, 0x5D, 0x5D, 0x41, 0x7F};
|
||||||
|
|
||||||
for (xp = 0; xp < 7; xp++) {
|
for (xp = 0; xp < 7; xp++) {
|
||||||
for (yp = 0; yp < 7; yp++) {
|
for (yp = 0; yp < 7; yp++) {
|
||||||
if (finder[yp] & 0x40 >> xp) {
|
if (finder[yp] & 0x40 >> xp) {
|
||||||
@ -1327,7 +1327,7 @@ static int getBinaryLength(const int version,char inputMode[],const int inputDat
|
|||||||
if (gs1 == 1) {
|
if (gs1 == 1) {
|
||||||
count += 4;
|
count += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eci != 3) {
|
if (eci != 3) {
|
||||||
count += 12;
|
count += 12;
|
||||||
}
|
}
|
||||||
@ -1545,7 +1545,7 @@ int qr_code(struct zint_symbol *symbol, const unsigned char source[], size_t len
|
|||||||
version = symbol->option_2;
|
version = symbol->option_2;
|
||||||
est_binlen = getBinaryLength(symbol->option_2, mode, jisdata, length, gs1, symbol->eci);
|
est_binlen = getBinaryLength(symbol->option_2, mode, jisdata, length, gs1, symbol->eci);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->option_2 < version) {
|
if (symbol->option_2 < version) {
|
||||||
strcpy(symbol->errtxt, "569: Input too long for selected symbol size");
|
strcpy(symbol->errtxt, "569: Input too long for selected symbol size");
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
@ -1679,13 +1679,13 @@ static int micro_qr_intermediate(char binary[], const int jisdata[], const char
|
|||||||
for (i = 0; i < short_data_block_length; i++) {
|
for (i = 0; i < short_data_block_length; i++) {
|
||||||
int jis = jisdata[position + i];
|
int jis = jisdata[position + i];
|
||||||
int prod;
|
int prod;
|
||||||
|
|
||||||
if (jis >= 0x8140 && jis <= 0x9ffc)
|
if (jis >= 0x8140 && jis <= 0x9ffc)
|
||||||
jis -= 0x8140;
|
jis -= 0x8140;
|
||||||
|
|
||||||
else if (jis >= 0xe040 && jis <= 0xebbf)
|
else if (jis >= 0xe040 && jis <= 0xebbf)
|
||||||
jis -= 0xc140;
|
jis -= 0xc140;
|
||||||
|
|
||||||
prod = ((jis >> 8) * 0xc0) + (jis & 0xff);
|
prod = ((jis >> 8) * 0xc0) + (jis & 0xff);
|
||||||
|
|
||||||
bin_append(prod, 13, binary);
|
bin_append(prod, 13, binary);
|
||||||
@ -2123,7 +2123,7 @@ static void micro_qr_m2(char binary_data[],const int ecc_mode) {
|
|||||||
/* Copy data into codewords */
|
/* Copy data into codewords */
|
||||||
for (i = 0; i < data_codewords; i++) {
|
for (i = 0; i < data_codewords; i++) {
|
||||||
data_blocks[i] = 0;
|
data_blocks[i] = 0;
|
||||||
|
|
||||||
for (j = 0; j < 8; j++) {
|
for (j = 0; j < 8; j++) {
|
||||||
if (binary_data[(i * 8) + j] == '1') {
|
if (binary_data[(i * 8) + j] == '1') {
|
||||||
data_blocks[i] += 0x80 >> j;
|
data_blocks[i] += 0x80 >> j;
|
||||||
@ -2217,7 +2217,7 @@ static void micro_qr_m3(char binary_data[],const int ecc_mode) {
|
|||||||
/* Copy data into codewords */
|
/* Copy data into codewords */
|
||||||
for (i = 0; i < (data_codewords - 1); i++) {
|
for (i = 0; i < (data_codewords - 1); i++) {
|
||||||
data_blocks[i] = 0;
|
data_blocks[i] = 0;
|
||||||
|
|
||||||
for (j = 0; j < 8; j++) {
|
for (j = 0; j < 8; j++) {
|
||||||
if (binary_data[(i * 8) + j] == '1') {
|
if (binary_data[(i * 8) + j] == '1') {
|
||||||
data_blocks[i] += 0x80 >> j;
|
data_blocks[i] += 0x80 >> j;
|
||||||
@ -2322,7 +2322,7 @@ static void micro_qr_m4(char binary_data[],const int ecc_mode) {
|
|||||||
/* Copy data into codewords */
|
/* Copy data into codewords */
|
||||||
for (i = 0; i < data_codewords; i++) {
|
for (i = 0; i < data_codewords; i++) {
|
||||||
data_blocks[i] = 0;
|
data_blocks[i] = 0;
|
||||||
|
|
||||||
for (j = 0; j < 8; j++) {
|
for (j = 0; j < 8; j++) {
|
||||||
if (binary_data[(i * 8) + j] == '1') {
|
if (binary_data[(i * 8) + j] == '1') {
|
||||||
data_blocks[i] += 0x80 >> j;
|
data_blocks[i] += 0x80 >> j;
|
||||||
@ -2886,7 +2886,7 @@ int upnqr(struct zint_symbol *symbol, const unsigned char source[], size_t lengt
|
|||||||
int* jisdata = (int *) _alloca((length + 1) * sizeof (int));
|
int* jisdata = (int *) _alloca((length + 1) * sizeof (int));
|
||||||
char* mode = (char *) _alloca(length + 1);
|
char* mode = (char *) _alloca(length + 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
unsigned char preprocessed[length + 1];
|
unsigned char preprocessed[length + 1];
|
||||||
#else
|
#else
|
||||||
@ -2920,7 +2920,7 @@ int upnqr(struct zint_symbol *symbol, const unsigned char source[], size_t lengt
|
|||||||
|
|
||||||
symbol->eci = 4;
|
symbol->eci = 4;
|
||||||
est_binlen = getBinaryLength(15, mode, jisdata, length, 0, symbol->eci);
|
est_binlen = getBinaryLength(15, mode, jisdata, length, 0, symbol->eci);
|
||||||
|
|
||||||
ecc_level = LEVEL_M;
|
ecc_level = LEVEL_M;
|
||||||
|
|
||||||
if (est_binlen > 3320) {
|
if (est_binlen > 3320) {
|
||||||
@ -2959,13 +2959,13 @@ int upnqr(struct zint_symbol *symbol, const unsigned char source[], size_t lengt
|
|||||||
|
|
||||||
setup_grid(grid, size, version);
|
setup_grid(grid, size, version);
|
||||||
populate_grid(grid, size, fullstream, qr_total_codewords[version - 1]);
|
populate_grid(grid, size, fullstream, qr_total_codewords[version - 1]);
|
||||||
|
|
||||||
add_version_info(grid, size, version);
|
add_version_info(grid, size, version);
|
||||||
|
|
||||||
bitmask = apply_bitmask(grid, size, ecc_level);
|
bitmask = apply_bitmask(grid, size, ecc_level);
|
||||||
|
|
||||||
add_format_info(grid, size, ecc_level, bitmask);
|
add_format_info(grid, size, ecc_level, bitmask);
|
||||||
|
|
||||||
symbol->width = size;
|
symbol->width = size;
|
||||||
symbol->rows = size;
|
symbol->rows = size;
|
||||||
|
|
||||||
@ -2981,3 +2981,4 @@ int upnqr(struct zint_symbol *symbol, const unsigned char source[], size_t lengt
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -40,7 +40,7 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif /* _MSC_VER */
|
#endif /* _MSC_VER */
|
||||||
|
|
||||||
#include "font.h" /* Font for human readable text */
|
#include "font.h" /* Font for human readable text */
|
||||||
@ -59,16 +59,16 @@ void buffer_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
/* Place pixelbuffer into symbol */
|
/* Place pixelbuffer into symbol */
|
||||||
int fgred, fggrn, fgblu, bgred, bggrn, bgblu;
|
int fgred, fggrn, fgblu, bgred, bggrn, bgblu;
|
||||||
int row, column, i;
|
int row, column, i;
|
||||||
|
|
||||||
symbol->bitmap = (char *) malloc(symbol->bitmap_width * symbol->bitmap_height * 3);
|
symbol->bitmap = (char *) malloc(symbol->bitmap_width * symbol->bitmap_height * 3);
|
||||||
|
|
||||||
fgred = (16 * ctoi(symbol->fgcolour[0])) + ctoi(symbol->fgcolour[1]);
|
fgred = (16 * ctoi(symbol->fgcolour[0])) + ctoi(symbol->fgcolour[1]);
|
||||||
fggrn = (16 * ctoi(symbol->fgcolour[2])) + ctoi(symbol->fgcolour[3]);
|
fggrn = (16 * ctoi(symbol->fgcolour[2])) + ctoi(symbol->fgcolour[3]);
|
||||||
fgblu = (16 * ctoi(symbol->fgcolour[4])) + ctoi(symbol->fgcolour[5]);
|
fgblu = (16 * ctoi(symbol->fgcolour[4])) + ctoi(symbol->fgcolour[5]);
|
||||||
bgred = (16 * ctoi(symbol->bgcolour[0])) + ctoi(symbol->bgcolour[1]);
|
bgred = (16 * ctoi(symbol->bgcolour[0])) + ctoi(symbol->bgcolour[1]);
|
||||||
bggrn = (16 * ctoi(symbol->bgcolour[2])) + ctoi(symbol->bgcolour[3]);
|
bggrn = (16 * ctoi(symbol->bgcolour[2])) + ctoi(symbol->bgcolour[3]);
|
||||||
bgblu = (16 * ctoi(symbol->bgcolour[4])) + ctoi(symbol->bgcolour[5]);
|
bgblu = (16 * ctoi(symbol->bgcolour[4])) + ctoi(symbol->bgcolour[5]);
|
||||||
|
|
||||||
for (row = 0; row < symbol->bitmap_height; row++) {
|
for (row = 0; row < symbol->bitmap_height; row++) {
|
||||||
for (column = 0; column < symbol->bitmap_width; column++) {
|
for (column = 0; column < symbol->bitmap_width; column++) {
|
||||||
i = ((row * symbol->bitmap_width) + column) * 3;
|
i = ((row * symbol->bitmap_width) + column) * 3;
|
||||||
@ -92,9 +92,9 @@ void buffer_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
int save_raster_image_to_file(struct zint_symbol *symbol, int image_height, int image_width, char *pixelbuf, int rotate_angle, int image_type) {
|
int save_raster_image_to_file(struct zint_symbol *symbol, int image_height, int image_width, char *pixelbuf, int rotate_angle, int image_type) {
|
||||||
int error_number;
|
int error_number;
|
||||||
int row, column;
|
int row, column;
|
||||||
|
|
||||||
char *rotated_pixbuf;
|
char *rotated_pixbuf;
|
||||||
|
|
||||||
if (!(rotated_pixbuf = (char *) malloc(image_width * image_height))) {
|
if (!(rotated_pixbuf = (char *) malloc(image_width * image_height))) {
|
||||||
strcpy(symbol->errtxt, "650: Insufficient memory for pixel buffer");
|
strcpy(symbol->errtxt, "650: Insufficient memory for pixel buffer");
|
||||||
return ZINT_ERROR_ENCODING_PROBLEM;
|
return ZINT_ERROR_ENCODING_PROBLEM;
|
||||||
@ -112,7 +112,7 @@ int save_raster_image_to_file(struct zint_symbol *symbol, int image_height, int
|
|||||||
symbol->bitmap_height = image_width;
|
symbol->bitmap_height = image_width;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sort out colour options */
|
/* sort out colour options */
|
||||||
to_upper((unsigned char*) symbol->fgcolour);
|
to_upper((unsigned char*) symbol->fgcolour);
|
||||||
to_upper((unsigned char*) symbol->bgcolour);
|
to_upper((unsigned char*) symbol->bgcolour);
|
||||||
@ -139,7 +139,7 @@ int save_raster_image_to_file(struct zint_symbol *symbol, int image_height, int
|
|||||||
free(rotated_pixbuf);
|
free(rotated_pixbuf);
|
||||||
return ZINT_ERROR_INVALID_OPTION;
|
return ZINT_ERROR_INVALID_OPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Rotate image before plotting */
|
/* Rotate image before plotting */
|
||||||
switch (rotate_angle) {
|
switch (rotate_angle) {
|
||||||
case 0: /* Plot the right way up */
|
case 0: /* Plot the right way up */
|
||||||
@ -175,7 +175,7 @@ int save_raster_image_to_file(struct zint_symbol *symbol, int image_height, int
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (image_type) {
|
switch (image_type) {
|
||||||
case OUT_BUFFER:
|
case OUT_BUFFER:
|
||||||
buffer_plot(symbol, rotated_pixbuf);
|
buffer_plot(symbol, rotated_pixbuf);
|
||||||
@ -225,7 +225,7 @@ void draw_bar(char *pixelbuf, int xpos, int xlen, int ypos, int ylen, int image_
|
|||||||
void draw_circle(char *pixelbuf, int image_width, int image_height, int x0, int y0, float radius, char fill) {
|
void draw_circle(char *pixelbuf, int image_width, int image_height, int x0, int y0, float radius, char fill) {
|
||||||
int x, y;
|
int x, y;
|
||||||
int radius_i = (int) radius;
|
int radius_i = (int) radius;
|
||||||
|
|
||||||
for (y = -radius_i; y <= radius_i; y++) {
|
for (y = -radius_i; y <= radius_i; y++) {
|
||||||
for (x = -radius_i; x <= radius_i; x++) {
|
for (x = -radius_i; x <= radius_i; x++) {
|
||||||
if ((x * x) + (y * y) <= (radius_i * radius_i)) {
|
if ((x * x) + (y * y) <= (radius_i * radius_i)) {
|
||||||
@ -240,7 +240,7 @@ void draw_circle(char *pixelbuf, int image_width, int image_height, int x0, int
|
|||||||
|
|
||||||
void draw_bullseye(char *pixelbuf, int image_width, int image_height, int cx, int cy, int scaler) {
|
void draw_bullseye(char *pixelbuf, int image_width, int image_height, int cx, int cy, int scaler) {
|
||||||
/* Central bullseye in Maxicode symbols */
|
/* Central bullseye in Maxicode symbols */
|
||||||
|
|
||||||
draw_circle(pixelbuf, image_width, image_height, cx, cy, (int)(4.571 * scaler) + 1, '1');
|
draw_circle(pixelbuf, image_width, image_height, cx, cy, (int)(4.571 * scaler) + 1, '1');
|
||||||
draw_circle(pixelbuf, image_width, image_height, cx, cy, (int)(3.779 * scaler) + 1, '0');
|
draw_circle(pixelbuf, image_width, image_height, cx, cy, (int)(3.779 * scaler) + 1, '0');
|
||||||
draw_circle(pixelbuf, image_width, image_height, cx, cy, (int)(2.988 * scaler) + 1, '1');
|
draw_circle(pixelbuf, image_width, image_height, cx, cy, (int)(2.988 * scaler) + 1, '1');
|
||||||
@ -252,7 +252,7 @@ void draw_bullseye(char *pixelbuf, int image_width, int image_height, int cx, in
|
|||||||
void draw_hexagon(char *pixelbuf, int image_width, char *scaled_hexagon, int hexagon_size, int xposn, int yposn) {
|
void draw_hexagon(char *pixelbuf, int image_width, char *scaled_hexagon, int hexagon_size, int xposn, int yposn) {
|
||||||
/* Put a hexagon into the pixel buffer */
|
/* Put a hexagon into the pixel buffer */
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
for (i = 0; i < hexagon_size; i++) {
|
for (i = 0; i < hexagon_size; i++) {
|
||||||
for (j = 0; j < hexagon_size; j++) {
|
for (j = 0; j < hexagon_size; j++) {
|
||||||
if (scaled_hexagon[(i * hexagon_size) + j] == '1') {
|
if (scaled_hexagon[(i * hexagon_size) + j] == '1') {
|
||||||
@ -410,10 +410,10 @@ void plot_hexline(char *scaled_hexagon, int hexagon_size, float start_x, float s
|
|||||||
/* Draw a straight line from start to end */
|
/* Draw a straight line from start to end */
|
||||||
int i;
|
int i;
|
||||||
float inc_x, inc_y;
|
float inc_x, inc_y;
|
||||||
|
|
||||||
inc_x = (end_x - start_x) / hexagon_size;
|
inc_x = (end_x - start_x) / hexagon_size;
|
||||||
inc_y = (end_y - start_y) / hexagon_size;
|
inc_y = (end_y - start_y) / hexagon_size;
|
||||||
|
|
||||||
for (i = 0; i < hexagon_size; i++) {
|
for (i = 0; i < hexagon_size; i++) {
|
||||||
float this_x = start_x + ((float)i * inc_x);
|
float this_x = start_x + ((float)i * inc_x);
|
||||||
float this_y = start_y + ((float)i * inc_y);
|
float this_y = start_y + ((float)i * inc_y);
|
||||||
@ -426,26 +426,26 @@ void plot_hexline(char *scaled_hexagon, int hexagon_size, float start_x, float s
|
|||||||
void plot_hexagon(char *scaled_hexagon, int hexagon_size) {
|
void plot_hexagon(char *scaled_hexagon, int hexagon_size) {
|
||||||
/* Create a hexagon shape and fill it */
|
/* Create a hexagon shape and fill it */
|
||||||
int line, i;
|
int line, i;
|
||||||
|
|
||||||
float x_offset[6];
|
float x_offset[6];
|
||||||
float y_offset[6];
|
float y_offset[6];
|
||||||
float start_x, start_y;
|
float start_x, start_y;
|
||||||
float end_x, end_y;
|
float end_x, end_y;
|
||||||
|
|
||||||
x_offset[0] = 0.0;
|
x_offset[0] = 0.0;
|
||||||
x_offset[1] = 0.86;
|
x_offset[1] = 0.86;
|
||||||
x_offset[2] = 0.86;
|
x_offset[2] = 0.86;
|
||||||
x_offset[3] = 0.0;
|
x_offset[3] = 0.0;
|
||||||
x_offset[4] = -0.86;
|
x_offset[4] = -0.86;
|
||||||
x_offset[5] = -0.86;
|
x_offset[5] = -0.86;
|
||||||
|
|
||||||
y_offset[0] = 1.0;
|
y_offset[0] = 1.0;
|
||||||
y_offset[1] = 0.5;
|
y_offset[1] = 0.5;
|
||||||
y_offset[2] = -0.5;
|
y_offset[2] = -0.5;
|
||||||
y_offset[3] = -1.0;
|
y_offset[3] = -1.0;
|
||||||
y_offset[4] = -0.5;
|
y_offset[4] = -0.5;
|
||||||
y_offset[5] = 0.5;
|
y_offset[5] = 0.5;
|
||||||
|
|
||||||
/* Plot hexagon outline */
|
/* Plot hexagon outline */
|
||||||
for (line = 0; line < 5; line++) {
|
for (line = 0; line < 5; line++) {
|
||||||
start_x = ((float)hexagon_size / 2.0) + (((float)hexagon_size / 2.0) * x_offset[line]);
|
start_x = ((float)hexagon_size / 2.0) + (((float)hexagon_size / 2.0) * x_offset[line]);
|
||||||
@ -459,7 +459,7 @@ void plot_hexagon(char *scaled_hexagon, int hexagon_size) {
|
|||||||
end_x = ((float)hexagon_size / 2.0) + (((float)hexagon_size / 2.0) * x_offset[0]);
|
end_x = ((float)hexagon_size / 2.0) + (((float)hexagon_size / 2.0) * x_offset[0]);
|
||||||
end_y = ((float)hexagon_size / 2.0) + (((float)hexagon_size / 2.0) * y_offset[0]);
|
end_y = ((float)hexagon_size / 2.0) + (((float)hexagon_size / 2.0) * y_offset[0]);
|
||||||
plot_hexline(scaled_hexagon, hexagon_size, start_x, start_y, end_x, end_y);
|
plot_hexline(scaled_hexagon, hexagon_size, start_x, start_y, end_x, end_y);
|
||||||
|
|
||||||
/* Fill hexagon */
|
/* Fill hexagon */
|
||||||
for (line = 0; line < hexagon_size; line++) {
|
for (line = 0; line < hexagon_size; line++) {
|
||||||
char ink = '0';
|
char ink = '0';
|
||||||
@ -471,7 +471,7 @@ void plot_hexagon(char *scaled_hexagon, int hexagon_size) {
|
|||||||
ink = '0';
|
ink = '0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ink == '1') {
|
if (ink == '1') {
|
||||||
scaled_hexagon[(hexagon_size * line) + i] = ink;
|
scaled_hexagon[(hexagon_size * line) + i] = ink;
|
||||||
}
|
}
|
||||||
@ -489,7 +489,7 @@ int plot_raster_maxicode(struct zint_symbol *symbol, int rotate_angle, int data_
|
|||||||
float scaler = symbol->scale;
|
float scaler = symbol->scale;
|
||||||
char *scaled_hexagon;
|
char *scaled_hexagon;
|
||||||
int hexagon_size;
|
int hexagon_size;
|
||||||
|
|
||||||
xoffset = symbol->border_width + symbol->whitespace_width;
|
xoffset = symbol->border_width + symbol->whitespace_width;
|
||||||
yoffset = symbol->border_width;
|
yoffset = symbol->border_width;
|
||||||
image_width = (300 + (2 * xoffset * 2)) * scaler;
|
image_width = (300 + (2 * xoffset * 2)) * scaler;
|
||||||
@ -503,9 +503,9 @@ int plot_raster_maxicode(struct zint_symbol *symbol, int rotate_angle, int data_
|
|||||||
*(pixelbuf + i) = '0';
|
*(pixelbuf + i) = '0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hexagon_size = (int)scaler * 10;
|
hexagon_size = (int)scaler * 10;
|
||||||
|
|
||||||
if (!(scaled_hexagon = (char *) malloc(hexagon_size * hexagon_size))) {
|
if (!(scaled_hexagon = (char *) malloc(hexagon_size * hexagon_size))) {
|
||||||
strcpy(symbol->errtxt, "656: Insufficient memory for pixel buffer");
|
strcpy(symbol->errtxt, "656: Insufficient memory for pixel buffer");
|
||||||
free(scaled_hexagon);
|
free(scaled_hexagon);
|
||||||
@ -516,7 +516,7 @@ int plot_raster_maxicode(struct zint_symbol *symbol, int rotate_angle, int data_
|
|||||||
*(scaled_hexagon + i) = '0';
|
*(scaled_hexagon + i) = '0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plot_hexagon(scaled_hexagon, hexagon_size);
|
plot_hexagon(scaled_hexagon, hexagon_size);
|
||||||
|
|
||||||
for (row = 0; row < symbol->rows; row++) {
|
for (row = 0; row < symbol->rows; row++) {
|
||||||
@ -535,12 +535,12 @@ int plot_raster_maxicode(struct zint_symbol *symbol, int rotate_angle, int data_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_bullseye(pixelbuf, image_width, image_height, (int)(((14.5 * 10.0) + (2.0 * xoffset)) * scaler), (int)(((16.5 * 9.0) + (2.0 * yoffset)) * scaler), scaler * 10);
|
draw_bullseye(pixelbuf, image_width, image_height, (int)(((14.5 * 10.0) + (2.0 * xoffset)) * scaler), (int)(((16.5 * 9.0) + (2.0 * yoffset)) * scaler), scaler * 10);
|
||||||
|
|
||||||
// Virtual hexagon
|
// Virtual hexagon
|
||||||
//draw_hexagon(pixelbuf, image_width, scaled_hexagon, hexagon_size, ((14 * 10) + (2 * xoffset)) * scaler, ((16 * 9) + (2 * yoffset)) * scaler);
|
//draw_hexagon(pixelbuf, image_width, scaled_hexagon, hexagon_size, ((14 * 10) + (2 * xoffset)) * scaler, ((16 * 9) + (2 * yoffset)) * scaler);
|
||||||
|
|
||||||
if ((symbol->output_options & BARCODE_BOX) || (symbol->output_options & BARCODE_BIND)) {
|
if ((symbol->output_options & BARCODE_BOX) || (symbol->output_options & BARCODE_BIND)) {
|
||||||
/* boundary bars */
|
/* boundary bars */
|
||||||
draw_bar(pixelbuf, 0, image_width, 0, symbol->border_width * 2, image_width, image_height);
|
draw_bar(pixelbuf, 0, image_width, 0, symbol->border_width * 2, image_width, image_height);
|
||||||
@ -1128,7 +1128,7 @@ int plot_raster(struct zint_symbol *symbol, int rotate_angle, int file_type) {
|
|||||||
if (file_type == OUT_PNG_FILE) {
|
if (file_type == OUT_PNG_FILE) {
|
||||||
return ZINT_ERROR_INVALID_OPTION;
|
return ZINT_ERROR_INVALID_OPTION;
|
||||||
}
|
}
|
||||||
#endif /* NO_PNG */
|
#endif /* NO_PNG */
|
||||||
|
|
||||||
if (symbol->output_options & BARCODE_DOTTY_MODE) {
|
if (symbol->output_options & BARCODE_DOTTY_MODE) {
|
||||||
error = plot_raster_dotty(symbol, rotate_angle, file_type);
|
error = plot_raster_dotty(symbol, rotate_angle, file_type);
|
||||||
@ -1143,3 +1143,4 @@ int plot_raster(struct zint_symbol *symbol, int rotate_angle, int file_type) {
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/**
|
/**
|
||||||
|
|
||||||
This is a simple Reed-Solomon encoder
|
This is a simple Reed-Solomon encoder
|
||||||
(C) Cliff Hones 2004
|
(C) Cliff Hones 2004
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,8 +25,8 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// It is not written with high efficiency in mind, so is probably
|
// It is not written with high efficiency in mind, so is probably
|
||||||
@ -162,3 +162,4 @@ void rs_free(void) {
|
|||||||
free(rspoly);
|
free(rspoly);
|
||||||
rspoly = NULL;
|
rspoly = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
This is a simple Reed-Solomon encoder
|
This is a simple Reed-Solomon encoder
|
||||||
(C) Cliff Hones 2004
|
(C) Cliff Hones 2004
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,7 +25,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
@ -48,3 +48,4 @@ extern void rs_encode_long(const int len,const unsigned int *data, unsigned int
|
|||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#endif /* __REEDSOL_H */
|
#endif /* __REEDSOL_H */
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* render.c - Generic Rendered Format
|
* render.c - Generic Rendered Format
|
||||||
*
|
*
|
||||||
* Initiall written by Sam Lown for use in gLabels. Converts encoded
|
* Initiall written by Sam Lown for use in gLabels. Converts encoded
|
||||||
* data into a generic internal structure of lines and characters
|
* data into a generic internal structure of lines and characters
|
||||||
@ -14,14 +14,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -32,7 +32,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ int render_plot(struct zint_symbol *symbol, float width, float height) {
|
|||||||
addon_width_x = 0;
|
addon_width_x = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Determine if there will be any addon texts and text height
|
* Determine if there will be any addon texts and text height
|
||||||
*/
|
*/
|
||||||
latch = 0;
|
latch = 0;
|
||||||
r = 0;
|
r = 0;
|
||||||
@ -688,7 +688,7 @@ int render_plot(struct zint_symbol *symbol, float width, float height) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a new line with its memory allocated ready for adding to the
|
* Create a new line with its memory allocated ready for adding to the
|
||||||
* rendered structure.
|
* rendered structure.
|
||||||
*
|
*
|
||||||
* This is much quicker than writing out each line manually (in some cases!)
|
* This is much quicker than writing out each line manually (in some cases!)
|
||||||
@ -709,7 +709,7 @@ struct zint_render_line *render_plot_create_line(float x, float y, float width,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add the line to the current rendering and update the last line's
|
* Add the line to the current rendering and update the last line's
|
||||||
* next value.
|
* next value.
|
||||||
*/
|
*/
|
||||||
int render_plot_add_line(struct zint_symbol *symbol, struct zint_render_line *line, struct zint_render_line **last_line) {
|
int render_plot_add_line(struct zint_symbol *symbol, struct zint_render_line *line, struct zint_render_line **last_line) {
|
||||||
@ -848,3 +848,4 @@ void render_free(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,25 +26,25 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* The functions "combins" and "getRSSwidths" are copyright BSI and are
|
/* The functions "combins" and "getRSSwidths" are copyright BSI and are
|
||||||
released with permission under the following terms:
|
released with permission under the following terms:
|
||||||
|
|
||||||
"Copyright subsists in all BSI publications. BSI also holds the copyright, in the
|
"Copyright subsists in all BSI publications. BSI also holds the copyright, in the
|
||||||
UK, of the international standardisation bodies. Except as
|
UK, of the international standardisation bodies. Except as
|
||||||
permitted under the Copyright, Designs and Patents Act 1988 no extract may be
|
permitted under the Copyright, Designs and Patents Act 1988 no extract may be
|
||||||
reproduced, stored in a retrieval system or transmitted in any form or by any
|
reproduced, stored in a retrieval system or transmitted in any form or by any
|
||||||
means - electronic, photocopying, recording or otherwise - without prior written
|
means - electronic, photocopying, recording or otherwise - without prior written
|
||||||
permission from BSI.
|
permission from BSI.
|
||||||
|
|
||||||
"This does not preclude the free use, in the course of implementing the standard,
|
"This does not preclude the free use, in the course of implementing the standard,
|
||||||
of necessary details such as symbols, and size, type or grade designations. If these
|
of necessary details such as symbols, and size, type or grade designations. If these
|
||||||
details are to be used for any other purpose than implementation then the prior
|
details are to be used for any other purpose than implementation then the prior
|
||||||
written permission of BSI must be obtained."
|
written permission of BSI must be obtained."
|
||||||
|
|
||||||
The date of publication for these functions is 30 November 2006
|
The date of publication for these functions is 30 November 2006
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
/* Note: This code reflects the symbol names as used in ISO/IEC 24724:2006. These names
|
/* Note: This code reflects the symbol names as used in ISO/IEC 24724:2006. These names
|
||||||
* were updated in ISO/IEC 24724:2011 as follows:
|
* were updated in ISO/IEC 24724:2011 as follows:
|
||||||
*
|
*
|
||||||
* RSS-14 > GS1 DataBar Omnidirectional
|
* RSS-14 > GS1 DataBar Omnidirectional
|
||||||
* RSS-14 Truncated > GS1 DataBar Truncated
|
* RSS-14 Truncated > GS1 DataBar Truncated
|
||||||
* RSS-14 Stacked > GS1 DataBar Stacked
|
* RSS-14 Stacked > GS1 DataBar Stacked
|
||||||
@ -66,7 +66,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "large.h"
|
#include "large.h"
|
||||||
@ -517,7 +517,7 @@ int rss14(struct zint_symbol *symbol, unsigned char source[], int src_len) {
|
|||||||
hrt[13] = itoc(check_digit);
|
hrt[13] = itoc(check_digit);
|
||||||
|
|
||||||
strcat((char*) symbol->text, hrt);
|
strcat((char*) symbol->text, hrt);
|
||||||
|
|
||||||
set_minimum_height(symbol, 14); // Minimum height is 14X for truncated symbol
|
set_minimum_height(symbol, 14); // Minimum height is 14X for truncated symbol
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -721,7 +721,7 @@ int rss14(struct zint_symbol *symbol, unsigned char source[], int src_len) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
symbol->rows = symbol->rows + 1;
|
symbol->rows = symbol->rows + 1;
|
||||||
|
|
||||||
set_minimum_height(symbol, 33);
|
set_minimum_height(symbol, 33);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1049,7 +1049,7 @@ int rsslimited(struct zint_symbol *symbol, unsigned char source[], int src_len)
|
|||||||
hrt[14] = '\0';
|
hrt[14] = '\0';
|
||||||
|
|
||||||
strcat((char*) symbol->text, hrt);
|
strcat((char*) symbol->text, hrt);
|
||||||
|
|
||||||
set_minimum_height(symbol, 10);
|
set_minimum_height(symbol, 10);
|
||||||
|
|
||||||
return error_number;
|
return error_number;
|
||||||
@ -1422,12 +1422,12 @@ int rss_binary_string(struct zint_symbol *symbol, char source[], char binary_str
|
|||||||
bin_append(atoi(weight_str), 15, binary_string);
|
bin_append(atoi(weight_str), 15, binary_string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((encoding_method == 5) || (encoding_method == 6)) {
|
if ((encoding_method == 5) || (encoding_method == 6)) {
|
||||||
/* Encoding method "01100" - variable measure item and price */
|
/* Encoding method "01100" - variable measure item and price */
|
||||||
/* Encoding method "01101" - variable measure item and price with ISO 4217
|
/* Encoding method "01101" - variable measure item and price with ISO 4217
|
||||||
Currency Code */
|
Currency Code */
|
||||||
|
|
||||||
char group[4];
|
char group[4];
|
||||||
|
|
||||||
for (i = 1; i < 5; i++) {
|
for (i = 1; i < 5; i++) {
|
||||||
@ -1435,15 +1435,15 @@ int rss_binary_string(struct zint_symbol *symbol, char source[], char binary_str
|
|||||||
group[1] = source[(i * 3) + 1];
|
group[1] = source[(i * 3) + 1];
|
||||||
group[2] = source[(i * 3) + 2];
|
group[2] = source[(i * 3) + 2];
|
||||||
group[3] = '\0';
|
group[3] = '\0';
|
||||||
|
|
||||||
bin_append(atoi(group), 10, binary_string);
|
bin_append(atoi(group), 10, binary_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
bin_append(source[19] - '0', 2, binary_string);
|
bin_append(source[19] - '0', 2, binary_string);
|
||||||
|
|
||||||
if (encoding_method == 6) {
|
if (encoding_method == 6) {
|
||||||
char currency_str[5];
|
char currency_str[5];
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
currency_str[i] = source[20 + i];
|
currency_str[i] = source[20 + i];
|
||||||
}
|
}
|
||||||
@ -1465,7 +1465,7 @@ int rss_binary_string(struct zint_symbol *symbol, char source[], char binary_str
|
|||||||
group[1] = source[(i * 3) + 1];
|
group[1] = source[(i * 3) + 1];
|
||||||
group[2] = source[(i * 3) + 2];
|
group[2] = source[(i * 3) + 2];
|
||||||
group[3] = '\0';
|
group[3] = '\0';
|
||||||
|
|
||||||
bin_append(atoi(group), 10, binary_string);
|
bin_append(atoi(group), 10, binary_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1475,7 +1475,7 @@ int rss_binary_string(struct zint_symbol *symbol, char source[], char binary_str
|
|||||||
weight_str[i + 1] = source[21 + i];
|
weight_str[i + 1] = source[21 + i];
|
||||||
}
|
}
|
||||||
weight_str[6] = '\0';
|
weight_str[6] = '\0';
|
||||||
|
|
||||||
bin_append(atoi(weight_str), 20, binary_string);
|
bin_append(atoi(weight_str), 20, binary_string);
|
||||||
|
|
||||||
if (strlen(source) == 34) {
|
if (strlen(source) == 34) {
|
||||||
@ -1665,12 +1665,12 @@ int rss_binary_string(struct zint_symbol *symbol, char source[], char binary_str
|
|||||||
}
|
}
|
||||||
|
|
||||||
last_mode = ALPHA;
|
last_mode = ALPHA;
|
||||||
|
|
||||||
if (general_field[i] == '[') {
|
if (general_field[i] == '[') {
|
||||||
bin_append(15, 5, binary_string);
|
bin_append(15, 5, binary_string);
|
||||||
last_mode = NUMERIC;
|
last_mode = NUMERIC;
|
||||||
} /* FNC1/Numeric latch */
|
} /* FNC1/Numeric latch */
|
||||||
|
|
||||||
if (general_field[i] == '*') bin_append(58, 6, binary_string); /* asterisk */
|
if (general_field[i] == '*') bin_append(58, 6, binary_string); /* asterisk */
|
||||||
if (general_field[i] == ',') bin_append(59, 6, binary_string); /* comma */
|
if (general_field[i] == ',') bin_append(59, 6, binary_string); /* comma */
|
||||||
if (general_field[i] == '-') bin_append(60, 6, binary_string); /* minus or hyphen */
|
if (general_field[i] == '-') bin_append(60, 6, binary_string); /* minus or hyphen */
|
||||||
@ -1704,12 +1704,12 @@ int rss_binary_string(struct zint_symbol *symbol, char source[], char binary_str
|
|||||||
bin_append(general_field[i] - 7, 7, binary_string);
|
bin_append(general_field[i] - 7, 7, binary_string);
|
||||||
}
|
}
|
||||||
last_mode = ISOIEC;
|
last_mode = ISOIEC;
|
||||||
|
|
||||||
if (general_field[i] == '[') {
|
if (general_field[i] == '[') {
|
||||||
bin_append(15, 5, binary_string);
|
bin_append(15, 5, binary_string);
|
||||||
last_mode = NUMERIC;
|
last_mode = NUMERIC;
|
||||||
} /* FNC1/Numeric latch */
|
} /* FNC1/Numeric latch */
|
||||||
|
|
||||||
if (general_field[i] == '!') bin_append(232, 8, binary_string); /* exclamation mark */
|
if (general_field[i] == '!') bin_append(232, 8, binary_string); /* exclamation mark */
|
||||||
if (general_field[i] == 34) bin_append(233, 8, binary_string); /* quotation mark */
|
if (general_field[i] == 34) bin_append(233, 8, binary_string); /* quotation mark */
|
||||||
if (general_field[i] == 37) bin_append(234, 8, binary_string); /* percent sign */
|
if (general_field[i] == 37) bin_append(234, 8, binary_string); /* percent sign */
|
||||||
@ -1744,29 +1744,29 @@ int rss_binary_string(struct zint_symbol *symbol, char source[], char binary_str
|
|||||||
remainder = 0;
|
remainder = 0;
|
||||||
}
|
}
|
||||||
symbol_characters = ((strlen(binary_string) + remainder) / 12) + 1;
|
symbol_characters = ((strlen(binary_string) + remainder) / 12) + 1;
|
||||||
|
|
||||||
if ((symbol->symbology == BARCODE_RSS_EXPSTACK) || (symbol->symbology == BARCODE_RSS_EXPSTACK_CC)) {
|
if ((symbol->symbology == BARCODE_RSS_EXPSTACK) || (symbol->symbology == BARCODE_RSS_EXPSTACK_CC)) {
|
||||||
characters_per_row = symbol->option_2 * 2;
|
characters_per_row = symbol->option_2 * 2;
|
||||||
|
|
||||||
if ((characters_per_row < 2) || (characters_per_row > 20)) {
|
if ((characters_per_row < 2) || (characters_per_row > 20)) {
|
||||||
characters_per_row = 4;
|
characters_per_row = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((symbol_characters % characters_per_row) == 1) {
|
if ((symbol_characters % characters_per_row) == 1) {
|
||||||
symbol_characters++;
|
symbol_characters++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol_characters < 4) {
|
if (symbol_characters < 4) {
|
||||||
symbol_characters = 4;
|
symbol_characters = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol_characters < 3) {
|
if (symbol_characters < 3) {
|
||||||
symbol_characters = 3;
|
symbol_characters = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
remainder = (12 * (symbol_characters - 1)) - strlen(binary_string);
|
remainder = (12 * (symbol_characters - 1)) - strlen(binary_string);
|
||||||
|
|
||||||
if (latch == 1) {
|
if (latch == 1) {
|
||||||
/* There is still one more numeric digit to encode */
|
/* There is still one more numeric digit to encode */
|
||||||
if (debug) printf("Adding extra (odd) numeric digit\n");
|
if (debug) printf("Adding extra (odd) numeric digit\n");
|
||||||
@ -1811,7 +1811,7 @@ int rss_binary_string(struct zint_symbol *symbol, char source[], char binary_str
|
|||||||
}
|
}
|
||||||
|
|
||||||
remainder = (12 * (symbol_characters - 1)) - strlen(binary_string);
|
remainder = (12 * (symbol_characters - 1)) - strlen(binary_string);
|
||||||
|
|
||||||
if (debug) printf("Resultant binary = %s\n", binary_string);
|
if (debug) printf("Resultant binary = %s\n", binary_string);
|
||||||
if (debug) printf("\tLength: %d\n", (int) strlen(binary_string));
|
if (debug) printf("\tLength: %d\n", (int) strlen(binary_string));
|
||||||
}
|
}
|
||||||
@ -1835,7 +1835,7 @@ int rss_binary_string(struct zint_symbol *symbol, char source[], char binary_str
|
|||||||
|
|
||||||
padstring[remainder] = '\0';
|
padstring[remainder] = '\0';
|
||||||
strcat(binary_string, padstring);
|
strcat(binary_string, padstring);
|
||||||
|
|
||||||
/* Patch variable length symbol bit field */
|
/* Patch variable length symbol bit field */
|
||||||
d1 = symbol_characters & 1;
|
d1 = symbol_characters & 1;
|
||||||
|
|
||||||
@ -2035,13 +2035,13 @@ int rssexpanded(struct zint_symbol *symbol, unsigned char source[], int src_len)
|
|||||||
|
|
||||||
if ((symbol->symbology == BARCODE_RSS_EXP) || (symbol->symbology == BARCODE_RSS_EXP_CC)) {
|
if ((symbol->symbology == BARCODE_RSS_EXP) || (symbol->symbology == BARCODE_RSS_EXP_CC)) {
|
||||||
/* Copy elements into symbol */
|
/* Copy elements into symbol */
|
||||||
|
|
||||||
elements[0] = 1; // left guard
|
elements[0] = 1; // left guard
|
||||||
elements[1] = 1;
|
elements[1] = 1;
|
||||||
|
|
||||||
elements[pattern_width - 2] = 1; // right guard
|
elements[pattern_width - 2] = 1; // right guard
|
||||||
elements[pattern_width - 1] = 1;
|
elements[pattern_width - 1] = 1;
|
||||||
|
|
||||||
writer = 0;
|
writer = 0;
|
||||||
latch = '0';
|
latch = '0';
|
||||||
for (i = 0; i < pattern_width; i++) {
|
for (i = 0; i < pattern_width; i++) {
|
||||||
@ -2154,7 +2154,7 @@ int rssexpanded(struct zint_symbol *symbol, unsigned char source[], int src_len)
|
|||||||
}
|
}
|
||||||
elements_in_sub++;
|
elements_in_sub++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* right to left */
|
/* right to left */
|
||||||
left_to_right = 0;
|
left_to_right = 0;
|
||||||
i = 2 + (((current_row * symbol->option_2) - reader - 1) * 21);
|
i = 2 + (((current_row * symbol->option_2) - reader - 1) * 21);
|
||||||
@ -2303,7 +2303,7 @@ int rssexpanded(struct zint_symbol *symbol, unsigned char source[], int src_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < symbol->rows; i++) {
|
for (i = 0; i < symbol->rows; i++) {
|
||||||
if (symbol->row_height[i] == 0) {
|
if (symbol->row_height[i] == 0) {
|
||||||
symbol->row_height[i] = 34;
|
symbol->row_height[i] = 34;
|
||||||
@ -2313,3 +2313,4 @@ int rssexpanded(struct zint_symbol *symbol, unsigned char source[], int src_len)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -296,3 +296,4 @@ static const char weight_rows[210] = {
|
|||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 17, 18, 19, 20, 21, 22, 0, 0,
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 17, 18, 19, 20, 21, 22, 0, 0,
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 13, 14, 11, 12, 17, 18, 15, 16, 21, 22, 19, 20
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 13, 14, 11, 12, 17, 18, 15, 16, 21, 22, 19, 20
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,13 +25,13 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Derived from :
|
/* Derived from :
|
||||||
## Shift_JIS (JIS X 0208:1997 Appendix 1) vs Unicode mapping table
|
## Shift_JIS (JIS X 0208:1997 Appendix 1) vs Unicode mapping table
|
||||||
##
|
##
|
||||||
## Date: 06 Mar 2002 06:01:22 GMT
|
## Date: 06 Mar 2002 06:01:22 GMT
|
||||||
## License:
|
## License:
|
||||||
## Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved.
|
## Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved.
|
||||||
@ -207,7 +207,7 @@ static const unsigned short int sjis_lookup[] = {
|
|||||||
0x222C, 0x81E8, // DOUBLE INTEGRAL
|
0x222C, 0x81E8, // DOUBLE INTEGRAL
|
||||||
0x2234, 0x8188, // THEREFORE
|
0x2234, 0x8188, // THEREFORE
|
||||||
0x2235, 0x81E6, // BECAUSE
|
0x2235, 0x81E6, // BECAUSE
|
||||||
0x223D, 0x81E4, // REVERSED TILDE
|
0x223D, 0x81E4, // REVERSED TILDE
|
||||||
0x2252, 0x81E0, // APPROXIMATELY EQUAL TO OR THE IMAGE OF
|
0x2252, 0x81E0, // APPROXIMATELY EQUAL TO OR THE IMAGE OF
|
||||||
0x2260, 0x8182, // NOT EQUAL TO
|
0x2260, 0x8182, // NOT EQUAL TO
|
||||||
0x2261, 0x81DF, // IDENTICAL TO
|
0x2261, 0x81DF, // IDENTICAL TO
|
||||||
@ -6881,6 +6881,6 @@ static const unsigned short int sjis_lookup[] = {
|
|||||||
0xFF5B, 0x816F, // FULLWIDTH LEFT CURLY BRACKET
|
0xFF5B, 0x816F, // FULLWIDTH LEFT CURLY BRACKET
|
||||||
0xFF5C, 0x8162, // FULLWIDTH VERTICAL LINE
|
0xFF5C, 0x8162, // FULLWIDTH VERTICAL LINE
|
||||||
0xFF5D, 0x8170, // FULLWIDTH RIGHT CURLY BRACKET
|
0xFF5D, 0x8170, // FULLWIDTH RIGHT CURLY BRACKET
|
||||||
0xFFE3, 0x8150, // FULLWIDTH MACRON
|
0xFFE3, 0x8150, // FULLWIDTH MACRON
|
||||||
0xFFE5, 0x818F // FULLWIDTH YEN SIGN
|
0xFFE5, 0x818F // FULLWIDTH YEN SIGN
|
||||||
};
|
};
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,7 +25,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -51,3 +51,4 @@ typedef INT32 int32_t;
|
|||||||
|
|
||||||
#endif /* STDINT_MSVC_H */
|
#endif /* STDINT_MSVC_H */
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
local_text[i] = ' ';
|
local_text[i] = ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ustrlen(local_text) != 0) {
|
if (ustrlen(local_text) != 0) {
|
||||||
textoffset = 9;
|
textoffset = 9;
|
||||||
} else {
|
} else {
|
||||||
@ -677,3 +677,4 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
|
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -165,3 +165,4 @@ int telepen_num(struct zint_symbol *symbol, unsigned char source[], const size_t
|
|||||||
ustrcpy(symbol->text, temp);
|
ustrcpy(symbol->text, temp);
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -61,19 +61,19 @@ int tif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
uint32_t* strip_offset;
|
uint32_t* strip_offset;
|
||||||
uint32_t* strip_bytes;
|
uint32_t* strip_bytes;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tiff_header_t header;
|
tiff_header_t header;
|
||||||
tiff_ifd_t ifd;
|
tiff_ifd_t ifd;
|
||||||
uint16_t temp;
|
uint16_t temp;
|
||||||
uint32_t temp32;
|
uint32_t temp32;
|
||||||
|
|
||||||
fgred = (16 * ctoi(symbol->fgcolour[0])) + ctoi(symbol->fgcolour[1]);
|
fgred = (16 * ctoi(symbol->fgcolour[0])) + ctoi(symbol->fgcolour[1]);
|
||||||
fggrn = (16 * ctoi(symbol->fgcolour[2])) + ctoi(symbol->fgcolour[3]);
|
fggrn = (16 * ctoi(symbol->fgcolour[2])) + ctoi(symbol->fgcolour[3]);
|
||||||
fgblu = (16 * ctoi(symbol->fgcolour[4])) + ctoi(symbol->fgcolour[5]);
|
fgblu = (16 * ctoi(symbol->fgcolour[4])) + ctoi(symbol->fgcolour[5]);
|
||||||
bgred = (16 * ctoi(symbol->bgcolour[0])) + ctoi(symbol->bgcolour[1]);
|
bgred = (16 * ctoi(symbol->bgcolour[0])) + ctoi(symbol->bgcolour[1]);
|
||||||
bggrn = (16 * ctoi(symbol->bgcolour[2])) + ctoi(symbol->bgcolour[3]);
|
bggrn = (16 * ctoi(symbol->bgcolour[2])) + ctoi(symbol->bgcolour[3]);
|
||||||
bgblu = (16 * ctoi(symbol->bgcolour[4])) + ctoi(symbol->bgcolour[5]);
|
bgblu = (16 * ctoi(symbol->bgcolour[4])) + ctoi(symbol->bgcolour[5]);
|
||||||
|
|
||||||
rows_per_strip = 8192 / (symbol->bitmap_width * 3);
|
rows_per_strip = 8192 / (symbol->bitmap_width * 3);
|
||||||
if (rows_per_strip == 0) {
|
if (rows_per_strip == 0) {
|
||||||
rows_per_strip = 1;
|
rows_per_strip = 1;
|
||||||
@ -83,7 +83,7 @@ int tif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
if ((symbol->bitmap_height % rows_per_strip) != 0) {
|
if ((symbol->bitmap_height % rows_per_strip) != 0) {
|
||||||
strip_count++;
|
strip_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
uint32_t strip_offset[strip_count];
|
uint32_t strip_offset[strip_count];
|
||||||
uint32_t strip_bytes[strip_count];
|
uint32_t strip_bytes[strip_count];
|
||||||
@ -92,7 +92,7 @@ int tif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
strip_bytes = (uint32_t*) _alloca(strip_count * sizeof(uint32_t));
|
strip_bytes = (uint32_t*) _alloca(strip_count * sizeof(uint32_t));
|
||||||
#endif
|
#endif
|
||||||
free_memory = 8;
|
free_memory = 8;
|
||||||
|
|
||||||
for(i = 0; i < strip_count; i++) {
|
for(i = 0; i < strip_count; i++) {
|
||||||
strip_offset[i] = free_memory;
|
strip_offset[i] = free_memory;
|
||||||
if (i != (strip_count - 1)) {
|
if (i != (strip_count - 1)) {
|
||||||
@ -109,7 +109,7 @@ int tif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
free_memory++;
|
free_memory++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (free_memory > 0xffff0000) {
|
if (free_memory > 0xffff0000) {
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
free(strip_offset);
|
free(strip_offset);
|
||||||
@ -134,15 +134,15 @@ int tif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
return ZINT_ERROR_FILE_ACCESS;
|
return ZINT_ERROR_FILE_ACCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Header */
|
/* Header */
|
||||||
header.byte_order = 0x4949;
|
header.byte_order = 0x4949;
|
||||||
header.identity = 42;
|
header.identity = 42;
|
||||||
header.offset = free_memory;
|
header.offset = free_memory;
|
||||||
|
|
||||||
fwrite(&header, sizeof(tiff_header_t), 1, tif_file);
|
fwrite(&header, sizeof(tiff_header_t), 1, tif_file);
|
||||||
free_memory += sizeof(tiff_ifd_t);
|
free_memory += sizeof(tiff_ifd_t);
|
||||||
|
|
||||||
/* Pixel data */
|
/* Pixel data */
|
||||||
for (row = 0; row < symbol->bitmap_height; row++) {
|
for (row = 0; row < symbol->bitmap_height; row++) {
|
||||||
for (column = 0; column < symbol->bitmap_width; column++) {
|
for (column = 0; column < symbol->bitmap_width; column++) {
|
||||||
@ -164,126 +164,126 @@ int tif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Image File Directory */
|
/* Image File Directory */
|
||||||
ifd.entries = 14;
|
ifd.entries = 14;
|
||||||
ifd.offset = 0;
|
ifd.offset = 0;
|
||||||
|
|
||||||
ifd.new_subset.tag = 0xfe;
|
ifd.new_subset.tag = 0xfe;
|
||||||
ifd.new_subset.type = 4;
|
ifd.new_subset.type = 4;
|
||||||
ifd.new_subset.count = 1;
|
ifd.new_subset.count = 1;
|
||||||
ifd.new_subset.offset = 0;
|
ifd.new_subset.offset = 0;
|
||||||
|
|
||||||
ifd.image_width.tag = 0x0100;
|
ifd.image_width.tag = 0x0100;
|
||||||
ifd.image_width.type = 3; // SHORT
|
ifd.image_width.type = 3; // SHORT
|
||||||
ifd.image_width.count = 1;
|
ifd.image_width.count = 1;
|
||||||
ifd.image_width.offset = symbol->bitmap_width;
|
ifd.image_width.offset = symbol->bitmap_width;
|
||||||
|
|
||||||
ifd.image_length.tag = 0x0101;
|
ifd.image_length.tag = 0x0101;
|
||||||
ifd.image_length.type = 3; // SHORT
|
ifd.image_length.type = 3; // SHORT
|
||||||
ifd.image_length.count = 1;
|
ifd.image_length.count = 1;
|
||||||
ifd.image_length.offset = symbol->bitmap_height;
|
ifd.image_length.offset = symbol->bitmap_height;
|
||||||
|
|
||||||
ifd.bits_per_sample.tag = 0x0102;
|
ifd.bits_per_sample.tag = 0x0102;
|
||||||
ifd.bits_per_sample.type = 3; // SHORT
|
ifd.bits_per_sample.type = 3; // SHORT
|
||||||
ifd.bits_per_sample.count = 3;
|
ifd.bits_per_sample.count = 3;
|
||||||
ifd.bits_per_sample.offset = free_memory;
|
ifd.bits_per_sample.offset = free_memory;
|
||||||
free_memory += 6;
|
free_memory += 6;
|
||||||
|
|
||||||
ifd.compression.tag = 0x0103;
|
ifd.compression.tag = 0x0103;
|
||||||
ifd.compression.type = 3;
|
ifd.compression.type = 3;
|
||||||
ifd.compression.count = 1;
|
ifd.compression.count = 1;
|
||||||
ifd.compression.offset = 1; // Uncompressed
|
ifd.compression.offset = 1; // Uncompressed
|
||||||
|
|
||||||
ifd.photometric.tag = 0x0106;
|
ifd.photometric.tag = 0x0106;
|
||||||
ifd.photometric.type = 3; // SHORT
|
ifd.photometric.type = 3; // SHORT
|
||||||
ifd.photometric.count = 1;
|
ifd.photometric.count = 1;
|
||||||
ifd.photometric.offset = 2; // RGB Model
|
ifd.photometric.offset = 2; // RGB Model
|
||||||
|
|
||||||
ifd.strip_offsets.tag = 0x0111;
|
ifd.strip_offsets.tag = 0x0111;
|
||||||
ifd.strip_offsets.type = 4; // LONG
|
ifd.strip_offsets.type = 4; // LONG
|
||||||
ifd.strip_offsets.count = strip_count;
|
ifd.strip_offsets.count = strip_count;
|
||||||
ifd.strip_offsets.offset = free_memory;
|
ifd.strip_offsets.offset = free_memory;
|
||||||
free_memory += strip_count * 4;
|
free_memory += strip_count * 4;
|
||||||
|
|
||||||
ifd.samples_per_pixel.tag = 0x0115;
|
ifd.samples_per_pixel.tag = 0x0115;
|
||||||
ifd.samples_per_pixel.type = 3;
|
ifd.samples_per_pixel.type = 3;
|
||||||
ifd.samples_per_pixel.count = 1;
|
ifd.samples_per_pixel.count = 1;
|
||||||
ifd.samples_per_pixel.offset = 3;
|
ifd.samples_per_pixel.offset = 3;
|
||||||
|
|
||||||
ifd.rows_per_strip.tag = 0x0116;
|
ifd.rows_per_strip.tag = 0x0116;
|
||||||
ifd.rows_per_strip.type = 4;
|
ifd.rows_per_strip.type = 4;
|
||||||
ifd.rows_per_strip.count = 1;
|
ifd.rows_per_strip.count = 1;
|
||||||
ifd.rows_per_strip.offset = rows_per_strip;
|
ifd.rows_per_strip.offset = rows_per_strip;
|
||||||
|
|
||||||
ifd.strip_byte_counts.tag = 0x0117;
|
ifd.strip_byte_counts.tag = 0x0117;
|
||||||
ifd.strip_byte_counts.type = 4;
|
ifd.strip_byte_counts.type = 4;
|
||||||
ifd.strip_byte_counts.count = strip_count;
|
ifd.strip_byte_counts.count = strip_count;
|
||||||
ifd.strip_byte_counts.offset = free_memory;
|
ifd.strip_byte_counts.offset = free_memory;
|
||||||
free_memory += strip_count * 4;
|
free_memory += strip_count * 4;
|
||||||
|
|
||||||
ifd.x_resolution.tag = 0x011a;
|
ifd.x_resolution.tag = 0x011a;
|
||||||
ifd.x_resolution.type = 5;
|
ifd.x_resolution.type = 5;
|
||||||
ifd.x_resolution.count = 1;
|
ifd.x_resolution.count = 1;
|
||||||
ifd.x_resolution.offset = free_memory;
|
ifd.x_resolution.offset = free_memory;
|
||||||
free_memory += 8;
|
free_memory += 8;
|
||||||
|
|
||||||
ifd.y_resolution.tag = 0x011b;
|
ifd.y_resolution.tag = 0x011b;
|
||||||
ifd.y_resolution.type = 5;
|
ifd.y_resolution.type = 5;
|
||||||
ifd.y_resolution.count = 1;
|
ifd.y_resolution.count = 1;
|
||||||
ifd.y_resolution.offset = free_memory;
|
ifd.y_resolution.offset = free_memory;
|
||||||
// free_memory += 8;
|
// free_memory += 8;
|
||||||
|
|
||||||
ifd.planar_config.tag = 0x11c;
|
ifd.planar_config.tag = 0x11c;
|
||||||
ifd.planar_config.type = 3;
|
ifd.planar_config.type = 3;
|
||||||
ifd.planar_config.count = 1;
|
ifd.planar_config.count = 1;
|
||||||
ifd.planar_config.offset = 1;
|
ifd.planar_config.offset = 1;
|
||||||
|
|
||||||
ifd.resolution_unit.tag = 0x0128;
|
ifd.resolution_unit.tag = 0x0128;
|
||||||
ifd.resolution_unit.type = 3;
|
ifd.resolution_unit.type = 3;
|
||||||
ifd.resolution_unit.count = 1;
|
ifd.resolution_unit.count = 1;
|
||||||
ifd.resolution_unit.offset = 2; // Inches
|
ifd.resolution_unit.offset = 2; // Inches
|
||||||
|
|
||||||
fwrite(&ifd, sizeof(tiff_ifd_t), 1, tif_file);
|
fwrite(&ifd, sizeof(tiff_ifd_t), 1, tif_file);
|
||||||
|
|
||||||
/* Bits per sample */
|
/* Bits per sample */
|
||||||
temp = 8;
|
temp = 8;
|
||||||
fwrite(&temp, 2, 1, tif_file); // Red Bytes
|
fwrite(&temp, 2, 1, tif_file); // Red Bytes
|
||||||
fwrite(&temp, 2, 1, tif_file); // Green Bytes
|
fwrite(&temp, 2, 1, tif_file); // Green Bytes
|
||||||
fwrite(&temp, 2, 1, tif_file); // Blue Bytes
|
fwrite(&temp, 2, 1, tif_file); // Blue Bytes
|
||||||
|
|
||||||
/* Strip offsets */
|
/* Strip offsets */
|
||||||
for(i = 0; i < strip_count; i++) {
|
for(i = 0; i < strip_count; i++) {
|
||||||
fwrite(&strip_offset[i], 4, 1, tif_file);
|
fwrite(&strip_offset[i], 4, 1, tif_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Strip byte lengths */
|
/* Strip byte lengths */
|
||||||
for(i = 0; i < strip_count; i++) {
|
for(i = 0; i < strip_count; i++) {
|
||||||
fwrite(&strip_bytes[i], 4, 1, tif_file);
|
fwrite(&strip_bytes[i], 4, 1, tif_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* X Resolution */
|
/* X Resolution */
|
||||||
temp32 = 72;
|
temp32 = 72;
|
||||||
fwrite(&temp32, 4, 1, tif_file);
|
fwrite(&temp32, 4, 1, tif_file);
|
||||||
temp32 = 1;
|
temp32 = 1;
|
||||||
fwrite(&temp32, 4, 1, tif_file);
|
fwrite(&temp32, 4, 1, tif_file);
|
||||||
|
|
||||||
/* Y Resolution */
|
/* Y Resolution */
|
||||||
temp32 = 72;
|
temp32 = 72;
|
||||||
fwrite(&temp32, 4, 1, tif_file);
|
fwrite(&temp32, 4, 1, tif_file);
|
||||||
temp32 = 1;
|
temp32 = 1;
|
||||||
fwrite(&temp32, 4, 1, tif_file);
|
fwrite(&temp32, 4, 1, tif_file);
|
||||||
|
|
||||||
if (symbol->output_options & BARCODE_STDOUT) {
|
if (symbol->output_options & BARCODE_STDOUT) {
|
||||||
fflush(tif_file);
|
fflush(tif_file);
|
||||||
} else {
|
} else {
|
||||||
fclose(tif_file);
|
fclose(tif_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
free(strip_offset);
|
free(strip_offset);
|
||||||
free(strip_bytes);
|
free(strip_bytes);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -26,7 +26,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifndef TIF_H
|
#ifndef TIF_H
|
||||||
@ -35,7 +35,7 @@
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "stdint_msvc.h"
|
#include "stdint_msvc.h"
|
||||||
@ -44,20 +44,20 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
typedef struct tiff_header {
|
typedef struct tiff_header {
|
||||||
uint16_t byte_order;
|
uint16_t byte_order;
|
||||||
uint16_t identity;
|
uint16_t identity;
|
||||||
uint32_t offset;
|
uint32_t offset;
|
||||||
} tiff_header_t;
|
} tiff_header_t;
|
||||||
|
|
||||||
typedef struct tiff_tag {
|
typedef struct tiff_tag {
|
||||||
uint16_t tag;
|
uint16_t tag;
|
||||||
uint16_t type;
|
uint16_t type;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
uint32_t offset;
|
uint32_t offset;
|
||||||
} tiff_tag_t;
|
} tiff_tag_t;
|
||||||
|
|
||||||
typedef struct tiff_ifd {
|
typedef struct tiff_ifd {
|
||||||
uint16_t entries;
|
uint16_t entries;
|
||||||
tiff_tag_t new_subset;
|
tiff_tag_t new_subset;
|
||||||
@ -76,7 +76,7 @@ extern "C" {
|
|||||||
tiff_tag_t resolution_unit;
|
tiff_tag_t resolution_unit;
|
||||||
uint32_t offset;
|
uint32_t offset;
|
||||||
} tiff_ifd_t;
|
} tiff_ifd_t;
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@ -85,3 +85,4 @@ extern "C" {
|
|||||||
|
|
||||||
#endif /* TIF_H */
|
#endif /* TIF_H */
|
||||||
|
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ int upca(struct zint_symbol *symbol, unsigned char source[], char dest[]) {
|
|||||||
|
|
||||||
strcpy(gtin, (char*) source);
|
strcpy(gtin, (char*) source);
|
||||||
length = strlen(gtin);
|
length = strlen(gtin);
|
||||||
|
|
||||||
if (length == 11) {
|
if (length == 11) {
|
||||||
gtin[length] = upc_check(gtin);
|
gtin[length] = upc_check(gtin);
|
||||||
gtin[length + 1] = '\0';
|
gtin[length + 1] = '\0';
|
||||||
@ -393,7 +393,7 @@ int ean13(struct zint_symbol *symbol, unsigned char source[], char dest[]) {
|
|||||||
|
|
||||||
/* Add the appropriate check digit */
|
/* Add the appropriate check digit */
|
||||||
length = strlen(gtin);
|
length = strlen(gtin);
|
||||||
|
|
||||||
if (length == 12) {
|
if (length == 12) {
|
||||||
gtin[length] = ean_check(gtin);
|
gtin[length] = ean_check(gtin);
|
||||||
gtin[length + 1] = '\0';
|
gtin[length + 1] = '\0';
|
||||||
@ -444,7 +444,7 @@ int ean8(struct zint_symbol *symbol, unsigned char source[], char dest[]) {
|
|||||||
|
|
||||||
strcpy(gtin, (char*) source);
|
strcpy(gtin, (char*) source);
|
||||||
length = strlen(gtin);
|
length = strlen(gtin);
|
||||||
|
|
||||||
if (length == 7) {
|
if (length == 7) {
|
||||||
gtin[length] = upc_check(gtin);
|
gtin[length] = upc_check(gtin);
|
||||||
gtin[length + 1] = '\0';
|
gtin[length + 1] = '\0';
|
||||||
@ -458,7 +458,7 @@ int ean8(struct zint_symbol *symbol, unsigned char source[], char dest[]) {
|
|||||||
}
|
}
|
||||||
upca_draw(gtin, dest);
|
upca_draw(gtin, dest);
|
||||||
ustrcpy(symbol->text, (unsigned char*) gtin);
|
ustrcpy(symbol->text, (unsigned char*) gtin);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -796,7 +796,7 @@ int eanx(struct zint_symbol *symbol, unsigned char source[], int src_len) {
|
|||||||
case 7:
|
case 7:
|
||||||
case 8: error_number = ean8(symbol, first_part, (char*) dest);
|
case 8: error_number = ean8(symbol, first_part, (char*) dest);
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
case 13: error_number = ean13(symbol, first_part, (char*) dest);
|
case 13: error_number = ean13(symbol, first_part, (char*) dest);
|
||||||
break;
|
break;
|
||||||
default: strcpy(symbol->errtxt, "286: Invalid length input");
|
default: strcpy(symbol->errtxt, "286: Invalid length input");
|
||||||
@ -891,11 +891,11 @@ int eanx(struct zint_symbol *symbol, unsigned char source[], int src_len) {
|
|||||||
error_number = isbn(symbol, first_part, ustrlen(first_part), (char*) dest);
|
error_number = isbn(symbol, first_part, ustrlen(first_part), (char*) dest);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error_number > 4) {
|
if (error_number > 4) {
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (ustrlen(second_part)) {
|
switch (ustrlen(second_part)) {
|
||||||
case 0: break;
|
case 0: break;
|
||||||
case 2:
|
case 2:
|
||||||
@ -934,3 +934,4 @@ int eanx(struct zint_symbol *symbol, unsigned char source[], int src_len) {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the project nor the names of its contributors
|
3. Neither the name of the project nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -25,7 +25,7 @@
|
|||||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ extern "C" {
|
|||||||
#define ZINT_VERSION_MAJOR 2
|
#define ZINT_VERSION_MAJOR 2
|
||||||
#define ZINT_VERSION_MINOR 6
|
#define ZINT_VERSION_MINOR 6
|
||||||
#define ZINT_VERSION_RELEASE 2
|
#define ZINT_VERSION_RELEASE 2
|
||||||
|
|
||||||
/* Tbarcode 7 codes */
|
/* Tbarcode 7 codes */
|
||||||
#define BARCODE_CODE11 1
|
#define BARCODE_CODE11 1
|
||||||
#define BARCODE_C25MATRIX 2
|
#define BARCODE_C25MATRIX 2
|
||||||
@ -180,7 +180,7 @@ extern "C" {
|
|||||||
#define BARCODE_HIBC_MICPDF 108
|
#define BARCODE_HIBC_MICPDF 108
|
||||||
#define BARCODE_HIBC_BLOCKF 110
|
#define BARCODE_HIBC_BLOCKF 110
|
||||||
#define BARCODE_HIBC_AZTEC 112
|
#define BARCODE_HIBC_AZTEC 112
|
||||||
|
|
||||||
/* Tbarcode 10 codes */
|
/* Tbarcode 10 codes */
|
||||||
#define BARCODE_DOTCODE 115
|
#define BARCODE_DOTCODE 115
|
||||||
#define BARCODE_HANXIN 116
|
#define BARCODE_HANXIN 116
|
||||||
@ -236,7 +236,7 @@ extern "C" {
|
|||||||
#define ZINT_ERROR_ENCODING_PROBLEM 9
|
#define ZINT_ERROR_ENCODING_PROBLEM 9
|
||||||
#define ZINT_ERROR_FILE_ACCESS 10
|
#define ZINT_ERROR_FILE_ACCESS 10
|
||||||
#define ZINT_ERROR_MEMORY 11
|
#define ZINT_ERROR_MEMORY 11
|
||||||
|
|
||||||
// Raster file types
|
// Raster file types
|
||||||
#define OUT_BUFFER 0
|
#define OUT_BUFFER 0
|
||||||
#define OUT_PNG_FILE 100
|
#define OUT_PNG_FILE 100
|
||||||
@ -255,7 +255,7 @@ extern "C" {
|
|||||||
#define ZINT_EXTERN extern
|
#define ZINT_EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#define ZINT_EXTERN extern
|
#define ZINT_EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ZINT_EXTERN struct zint_symbol *ZBarcode_Create(void);
|
ZINT_EXTERN struct zint_symbol *ZBarcode_Create(void);
|
||||||
@ -282,3 +282,4 @@ extern "C" {
|
|||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#endif /* ZINT_H */
|
#endif /* ZINT_H */
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ namespace Zint {
|
|||||||
void QZint::setText(const QString & text) {
|
void QZint::setText(const QString & text) {
|
||||||
m_text = text;
|
m_text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZint::setTargetSize(int width, int height) {
|
void QZint::setTargetSize(int width, int height) {
|
||||||
target_size_horiz = width;
|
target_size_horiz = width;
|
||||||
target_size_vert = height;
|
target_size_vert = height;
|
||||||
@ -162,7 +162,7 @@ namespace Zint {
|
|||||||
void QZint::setScale(float scale) {
|
void QZint::setScale(float scale) {
|
||||||
m_scale = scale;
|
m_scale = scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZint::setDotSize(float dot_size) {
|
void QZint::setDotSize(float dot_size) {
|
||||||
m_dot_size = dot_size;
|
m_dot_size = dot_size;
|
||||||
}
|
}
|
||||||
@ -306,15 +306,15 @@ namespace Zint {
|
|||||||
int xoffset = m_whitespace;
|
int xoffset = m_whitespace;
|
||||||
int main_width = 0, addon_text_height = 0;
|
int main_width = 0, addon_text_height = 0;
|
||||||
int yoffset = 0;
|
int yoffset = 0;
|
||||||
|
|
||||||
encode();
|
encode();
|
||||||
|
|
||||||
QString caption = QString::fromUtf8((const char *) m_zintSymbol->text, -1);
|
QString caption = QString::fromUtf8((const char *) m_zintSymbol->text, -1);
|
||||||
QFont fontSmall(fontstyle);
|
QFont fontSmall(fontstyle);
|
||||||
fontSmall.setPixelSize(fontPixelSizeSmall);
|
fontSmall.setPixelSize(fontPixelSizeSmall);
|
||||||
QFont fontLarge(fontstyle);
|
QFont fontLarge(fontstyle);
|
||||||
fontLarge.setPixelSize(fontPixelSizeLarge);
|
fontLarge.setPixelSize(fontPixelSizeLarge);
|
||||||
|
|
||||||
if (m_lastError.length()) {
|
if (m_lastError.length()) {
|
||||||
fontLarge.setPointSize(14);
|
fontLarge.setPointSize(14);
|
||||||
painter.setFont(fontLarge);
|
painter.setFont(fontLarge);
|
||||||
@ -324,7 +324,7 @@ namespace Zint {
|
|||||||
|
|
||||||
painter.save();
|
painter.save();
|
||||||
painter.setClipRect(paintRect, Qt::IntersectClip);
|
painter.setClipRect(paintRect, Qt::IntersectClip);
|
||||||
|
|
||||||
qreal xtr = paintRect.x();
|
qreal xtr = paintRect.x();
|
||||||
qreal ytr = paintRect.y();
|
qreal ytr = paintRect.y();
|
||||||
|
|
||||||
@ -369,7 +369,7 @@ namespace Zint {
|
|||||||
textoffset = 0;
|
textoffset = 0;
|
||||||
}
|
}
|
||||||
gwidth += m_zintSymbol->whitespace_width * 2;
|
gwidth += m_zintSymbol->whitespace_width * 2;
|
||||||
|
|
||||||
if (paintRect.width() / gwidth < paintRect.height() / gheight) {
|
if (paintRect.width() / gwidth < paintRect.height() / gheight) {
|
||||||
ysf = xsf = (qreal) paintRect.width() / gwidth;
|
ysf = xsf = (qreal) paintRect.width() / gwidth;
|
||||||
ytr += (qreal) (paintRect.height() - gheight * ysf) / 2;
|
ytr += (qreal) (paintRect.height() - gheight * ysf) / 2;
|
||||||
@ -384,7 +384,7 @@ namespace Zint {
|
|||||||
painter.scale(xsf, ysf);
|
painter.scale(xsf, ysf);
|
||||||
|
|
||||||
QPen p;
|
QPen p;
|
||||||
|
|
||||||
p.setColor(m_fgColor);
|
p.setColor(m_fgColor);
|
||||||
p.setWidth(m_borderWidth);
|
p.setWidth(m_borderWidth);
|
||||||
painter.setPen(p);
|
painter.setPen(p);
|
||||||
@ -526,7 +526,7 @@ namespace Zint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Add row binding */
|
/* Add row binding */
|
||||||
if (((m_zintSymbol->symbology == BARCODE_CODE16K)
|
if (((m_zintSymbol->symbology == BARCODE_CODE16K)
|
||||||
|| (m_zintSymbol->symbology == BARCODE_CODE49)) && (row != 0)) {
|
|| (m_zintSymbol->symbology == BARCODE_CODE49)) && (row != 0)) {
|
||||||
painter.fillRect(0, y - 1, m_zintSymbol->width, 2, QBrush(m_fgColor));
|
painter.fillRect(0, y - 1, m_zintSymbol->width, 2, QBrush(m_fgColor));
|
||||||
}
|
}
|
||||||
@ -690,3 +690,4 @@ namespace Zint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ public:
|
|||||||
|
|
||||||
void setWidth(int width);
|
void setWidth(int width);
|
||||||
int width();
|
int width();
|
||||||
|
|
||||||
void setOption3(int option);
|
void setOption3(int option);
|
||||||
|
|
||||||
QColor fgColor() const;
|
QColor fgColor() const;
|
||||||
@ -73,7 +73,7 @@ public:
|
|||||||
|
|
||||||
float scale() const;
|
float scale() const;
|
||||||
void setScale(float scale);
|
void setScale(float scale);
|
||||||
|
|
||||||
void setDotSize(float dot_size);
|
void setDotSize(float dot_size);
|
||||||
|
|
||||||
int mode() const;
|
int mode() const;
|
||||||
@ -91,9 +91,9 @@ public:
|
|||||||
bool hasErrors();
|
bool hasErrors();
|
||||||
|
|
||||||
bool save_to_file(QString filename);
|
bool save_to_file(QString filename);
|
||||||
|
|
||||||
void setHideText(bool hide);
|
void setHideText(bool hide);
|
||||||
|
|
||||||
void setTargetSize(int width, int height);
|
void setTargetSize(int width, int height);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -126,3 +126,4 @@ private:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
- No changes here, take 2.6 framework files
|
- No changes here, take 2.6 framework files
|
||||||
2017-08-29 2.6.1 HaO
|
2017-08-29 2.6.1 HaO
|
||||||
- Framework 2.6.1 extensions
|
- Framework 2.6.1 extensions
|
||||||
- EAN/UPC Codes with included check digit
|
- EAN/UPC Codes with included check digit
|
||||||
- UPNQR Code
|
- UPNQR Code
|
||||||
- Misspelled symbology: AztecRunes
|
- Misspelled symbology: AztecRunes
|
||||||
2017-10-23 2.6.2 HaO
|
2017-10-23 2.6.2 HaO
|
||||||
@ -852,3 +852,4 @@ static int Encode(Tcl_Interp *interp, int objc,
|
|||||||
return TCL_OK;
|
return TCL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ int validator(char test_string[], char source[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Converts an integer value to its hexadecimal character */
|
/* Converts an integer value to its hexadecimal character */
|
||||||
static char itoc(int source) {
|
static char itoc(int source) {
|
||||||
if ((source >= 0) && (source <= 9)) {
|
if ((source >= 0) && (source <= 9)) {
|
||||||
return ('0' + source);
|
return ('0' + source);
|
||||||
} else {
|
} else {
|
||||||
@ -179,7 +179,7 @@ static char itoc(int source) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Concatinates dest[] with the contents of source[], copying /0 as well */
|
/* Concatinates dest[] with the contents of source[], copying /0 as well */
|
||||||
static void concat(char dest[], char source[]) {
|
static void concat(char dest[], char source[]) {
|
||||||
unsigned int i, j, n;
|
unsigned int i, j, n;
|
||||||
|
|
||||||
j = strlen(dest);
|
j = strlen(dest);
|
||||||
@ -200,7 +200,7 @@ int batch_process(struct zint_symbol *symbol, char *filename, int mirror_mode, c
|
|||||||
char format_string[127], reversed_string[127], format_char;
|
char format_string[127], reversed_string[127], format_char;
|
||||||
int format_len, i;
|
int format_len, i;
|
||||||
char adjusted[2];
|
char adjusted[2];
|
||||||
|
|
||||||
memset(buffer, 0, sizeof (unsigned char) * 7100);
|
memset(buffer, 0, sizeof (unsigned char) * 7100);
|
||||||
memset(format_string, 0, sizeof (unsigned char) * 127);
|
memset(format_string, 0, sizeof (unsigned char) * 127);
|
||||||
if (symbol->outfile[0] == '\0') {
|
if (symbol->outfile[0] == '\0') {
|
||||||
@ -239,7 +239,7 @@ int batch_process(struct zint_symbol *symbol, char *filename, int mirror_mode, c
|
|||||||
posn--;
|
posn--;
|
||||||
buffer[posn] = '\0';
|
buffer[posn] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mirror_mode == 0) {
|
if (mirror_mode == 0) {
|
||||||
inpos = 0;
|
inpos = 0;
|
||||||
local_line_count = line_count;
|
local_line_count = line_count;
|
||||||
@ -321,11 +321,11 @@ int batch_process(struct zint_symbol *symbol, char *filename, int mirror_mode, c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add file extension */
|
/* Add file extension */
|
||||||
output_file[i] = '.';
|
output_file[i] = '.';
|
||||||
output_file[i + 1] = '\0';
|
output_file[i + 1] = '\0';
|
||||||
|
|
||||||
strcat(output_file, filetype);
|
strcat(output_file, filetype);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -643,7 +643,7 @@ int main(int argc, char **argv) {
|
|||||||
case 't':
|
case 't':
|
||||||
types();
|
types();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'e':
|
case 'e':
|
||||||
show_eci();
|
show_eci();
|
||||||
break;
|
break;
|
||||||
@ -766,3 +766,4 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,10 +35,11 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
mutable Zint::QZint bc;
|
mutable Zint::QZint bc;
|
||||||
Zint::QZint::AspectRatioMode ar;
|
Zint::QZint::AspectRatioMode ar;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ DataWindow::DataWindow(const QString &input)
|
|||||||
setupUi(this);
|
setupUi(this);
|
||||||
txtDataInput->setPlainText(input);
|
txtDataInput->setPlainText(input);
|
||||||
txtDataInput->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor);
|
txtDataInput->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor);
|
||||||
|
|
||||||
connect(btnCancel, SIGNAL( clicked( bool )), SLOT(quit_now()));
|
connect(btnCancel, SIGNAL( clicked( bool )), SLOT(quit_now()));
|
||||||
connect(btnReset, SIGNAL( clicked( bool )), SLOT(clear_data()));
|
connect(btnReset, SIGNAL( clicked( bool )), SLOT(clear_data()));
|
||||||
connect(btnOK, SIGNAL( clicked( bool )), SLOT(okay()));
|
connect(btnOK, SIGNAL( clicked( bool )), SLOT(okay()));
|
||||||
@ -81,7 +81,7 @@ void DataWindow::from_file()
|
|||||||
|
|
||||||
open_dialog.setWindowTitle("Open File");
|
open_dialog.setWindowTitle("Open File");
|
||||||
open_dialog.setDirectory(settings.value("studio/default_dir", QDir::toNativeSeparators(QDir::homePath())).toString());
|
open_dialog.setDirectory(settings.value("studio/default_dir", QDir::toNativeSeparators(QDir::homePath())).toString());
|
||||||
|
|
||||||
if (open_dialog.exec()) {
|
if (open_dialog.exec()) {
|
||||||
filename = open_dialog.selectedFiles().at(0);
|
filename = open_dialog.selectedFiles().at(0);
|
||||||
} else {
|
} else {
|
||||||
@ -93,14 +93,14 @@ void DataWindow::from_file()
|
|||||||
QMessageBox::critical(this, tr("Open Error"), tr("Could not open selected file."));
|
QMessageBox::critical(this, tr("Open Error"), tr("Could not open selected file."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
outstream = file.readAll();
|
outstream = file.readAll();
|
||||||
|
|
||||||
/* Allow some non-printing (control) characters to be read from file
|
/* Allow some non-printing (control) characters to be read from file
|
||||||
by converting them to escape sequences */
|
by converting them to escape sequences */
|
||||||
escape_string.clear();
|
escape_string.clear();
|
||||||
escape_string.append(QString(outstream));
|
escape_string.append(QString(outstream));
|
||||||
|
|
||||||
escape_string.replace((QChar)'\\', (QString)"\\\\", Qt::CaseInsensitive);
|
escape_string.replace((QChar)'\\', (QString)"\\\\", Qt::CaseInsensitive);
|
||||||
escape_string.replace((QChar)0x04, (QString)"\\E", Qt::CaseInsensitive); /* End of Transmission */
|
escape_string.replace((QChar)0x04, (QString)"\\E", Qt::CaseInsensitive); /* End of Transmission */
|
||||||
escape_string.replace((QChar)'\a', (QString)"\\a", Qt::CaseInsensitive); /* Bell */
|
escape_string.replace((QChar)'\a', (QString)"\\a", Qt::CaseInsensitive); /* Bell */
|
||||||
@ -112,9 +112,9 @@ void DataWindow::from_file()
|
|||||||
escape_string.replace((QChar)0x1b, (QString)"\\e", Qt::CaseInsensitive); /* Escape */
|
escape_string.replace((QChar)0x1b, (QString)"\\e", Qt::CaseInsensitive); /* Escape */
|
||||||
escape_string.replace((QChar)0x1d, (QString)"\\G", Qt::CaseInsensitive); /* Group Separator */
|
escape_string.replace((QChar)0x1d, (QString)"\\G", Qt::CaseInsensitive); /* Group Separator */
|
||||||
escape_string.replace((QChar)0x1e, (QString)"\\R", Qt::CaseInsensitive); /* Record Separator */
|
escape_string.replace((QChar)0x1e, (QString)"\\R", Qt::CaseInsensitive); /* Record Separator */
|
||||||
|
|
||||||
txtDataInput->setPlainText(QString(escape_string));
|
txtDataInput->setPlainText(QString(escape_string));
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
settings.setValue("studio/default_dir", filename.mid(0, filename.lastIndexOf(QDir::separator())));
|
settings.setValue("studio/default_dir", filename.mid(0, filename.lastIndexOf(QDir::separator())));
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ ExportWindow::ExportWindow()
|
|||||||
linPrefix->setText(settings.value("studio/export/file_prefix", "bcs_").toString());
|
linPrefix->setText(settings.value("studio/export/file_prefix", "bcs_").toString());
|
||||||
cmbFileName->setCurrentIndex(settings.value("studio/export/name_format", 0).toInt());
|
cmbFileName->setCurrentIndex(settings.value("studio/export/name_format", 0).toInt());
|
||||||
cmbFileFormat->setCurrentIndex(settings.value("studio/export/filetype", 0).toInt());
|
cmbFileFormat->setCurrentIndex(settings.value("studio/export/filetype", 0).toInt());
|
||||||
|
|
||||||
connect(btnCancel, SIGNAL( clicked( bool )), SLOT(quit_now()));
|
connect(btnCancel, SIGNAL( clicked( bool )), SLOT(quit_now()));
|
||||||
connect(btnOK, SIGNAL( clicked( bool )), SLOT(process()));
|
connect(btnOK, SIGNAL( clicked( bool )), SLOT(process()));
|
||||||
connect(btnDestPath, SIGNAL( clicked( bool )), SLOT(get_directory()));
|
connect(btnDestPath, SIGNAL( clicked( bool )), SLOT(get_directory()));
|
||||||
@ -82,10 +82,10 @@ void ExportWindow::process()
|
|||||||
QString suffix;
|
QString suffix;
|
||||||
QString Feedback;
|
QString Feedback;
|
||||||
int lines, i, j, inputpos;
|
int lines, i, j, inputpos;
|
||||||
|
|
||||||
lines = output_data.count(QChar('\n'), Qt::CaseInsensitive);
|
lines = output_data.count(QChar('\n'), Qt::CaseInsensitive);
|
||||||
inputpos = 0;
|
inputpos = 0;
|
||||||
|
|
||||||
switch(cmbFileFormat->currentIndex()) {
|
switch(cmbFileFormat->currentIndex()) {
|
||||||
#ifdef NO_PNG
|
#ifdef NO_PNG
|
||||||
case 0: suffix = ".eps"; break;
|
case 0: suffix = ".eps"; break;
|
||||||
@ -108,7 +108,7 @@ void ExportWindow::process()
|
|||||||
}
|
}
|
||||||
txtFeedback->clear();
|
txtFeedback->clear();
|
||||||
Feedback = "";
|
Feedback = "";
|
||||||
|
|
||||||
for(i = 0; i < lines; i++) {
|
for(i = 0; i < lines; i++) {
|
||||||
int datalen = 0;
|
int datalen = 0;
|
||||||
for(j = inputpos; ((j < output_data.length()) && (output_data[j] != '\n') ); j++) {
|
for(j = inputpos; ((j < output_data.length()) && (output_data[j] != '\n') ); j++) {
|
||||||
@ -120,11 +120,11 @@ void ExportWindow::process()
|
|||||||
QString url_escaped;
|
QString url_escaped;
|
||||||
int m;
|
int m;
|
||||||
QChar name_qchar;
|
QChar name_qchar;
|
||||||
|
|
||||||
for(m = 0; m < dataString.length(); m++) {
|
for(m = 0; m < dataString.length(); m++) {
|
||||||
name_qchar = dataString[m];
|
name_qchar = dataString[m];
|
||||||
char name_char = name_qchar.toLatin1();
|
char name_char = name_qchar.toLatin1();
|
||||||
|
|
||||||
switch(name_char) {
|
switch(name_char) {
|
||||||
case '\\': url_escaped += "%5C"; break;
|
case '\\': url_escaped += "%5C"; break;
|
||||||
case '/': url_escaped += "%2F"; break;
|
case '/': url_escaped += "%2F"; break;
|
||||||
@ -145,18 +145,18 @@ void ExportWindow::process()
|
|||||||
case 1: { /* Formatted Serial Number */
|
case 1: { /* Formatted Serial Number */
|
||||||
QString biggest, this_val, outnumber;
|
QString biggest, this_val, outnumber;
|
||||||
int number_size, val_size, m;
|
int number_size, val_size, m;
|
||||||
|
|
||||||
biggest = QString::number(lines + 1);
|
biggest = QString::number(lines + 1);
|
||||||
number_size = biggest.length();
|
number_size = biggest.length();
|
||||||
this_val = QString::number(i + 1);
|
this_val = QString::number(i + 1);
|
||||||
val_size = this_val.length();
|
val_size = this_val.length();
|
||||||
|
|
||||||
for(m = 0; m < (number_size - val_size); m++) {
|
for(m = 0; m < (number_size - val_size); m++) {
|
||||||
outnumber += QChar('0');
|
outnumber += QChar('0');
|
||||||
}
|
}
|
||||||
|
|
||||||
outnumber += this_val;
|
outnumber += this_val;
|
||||||
|
|
||||||
fileName = linDestPath->text() + QDir::separator() + linPrefix->text() + outnumber + suffix;
|
fileName = linDestPath->text() + QDir::separator() + linPrefix->text() + outnumber + suffix;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -176,3 +176,4 @@ void ExportWindow::process()
|
|||||||
inputpos += datalen + 1;
|
inputpos += datalen + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,8 +21,9 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
Q_INIT_RESOURCE(resources);
|
Q_INIT_RESOURCE(resources);
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
w.show();
|
w.show();
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,11 +36,11 @@
|
|||||||
MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
|
MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
|
||||||
: QWidget(parent, fl),m_optionWidget(0)
|
: QWidget(parent, fl),m_optionWidget(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
QCoreApplication::setOrganizationName("zint");
|
QCoreApplication::setOrganizationName("zint");
|
||||||
QCoreApplication::setOrganizationDomain("zint.org.uk");
|
QCoreApplication::setOrganizationDomain("zint.org.uk");
|
||||||
QCoreApplication::setApplicationName("Barcode Studio");
|
QCoreApplication::setApplicationName("Barcode Studio");
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
char bstyle_text[][50] = {
|
char bstyle_text[][50] = {
|
||||||
@ -65,7 +65,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
|
|||||||
"Code 39 (ISO 16388)",
|
"Code 39 (ISO 16388)",
|
||||||
"Code 39 Extended",
|
"Code 39 Extended",
|
||||||
"Code 49",
|
"Code 49",
|
||||||
"Code 93",
|
"Code 93",
|
||||||
"Code One",
|
"Code One",
|
||||||
"Data Matrix (ISO 16022)",
|
"Data Matrix (ISO 16022)",
|
||||||
"Deutsche Post Identcode",
|
"Deutsche Post Identcode",
|
||||||
@ -80,9 +80,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
|
|||||||
"GS1 DataBar Expanded Omnidirectional",
|
"GS1 DataBar Expanded Omnidirectional",
|
||||||
"GS1 DataBar Expanded Stacked Omnidirectional",
|
"GS1 DataBar Expanded Stacked Omnidirectional",
|
||||||
"GS1 DataBar Limited",
|
"GS1 DataBar Limited",
|
||||||
"GS1 DataBar Omnidirectional",
|
"GS1 DataBar Omnidirectional",
|
||||||
"GS1 DataBar Stacked",
|
"GS1 DataBar Stacked",
|
||||||
"GS1 DataBar Stacked Omnidirectional",
|
"GS1 DataBar Stacked Omnidirectional",
|
||||||
"Han Xin (Chinese Sensible) Code",
|
"Han Xin (Chinese Sensible) Code",
|
||||||
"ITF-14",
|
"ITF-14",
|
||||||
"International Standard Book Number (ISBN)",
|
"International Standard Book Number (ISBN)",
|
||||||
@ -110,15 +110,15 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
|
|||||||
"Universal Product Code (UPC-E)",
|
"Universal Product Code (UPC-E)",
|
||||||
"USPS Intelligent Mail"
|
"USPS Intelligent Mail"
|
||||||
};
|
};
|
||||||
|
|
||||||
/* createActions();
|
/* createActions();
|
||||||
createMenus(); */
|
createMenus(); */
|
||||||
|
|
||||||
scene = new QGraphicsScene(this);
|
scene = new QGraphicsScene(this);
|
||||||
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
view->setScene(scene);
|
view->setScene(scene);
|
||||||
|
|
||||||
m_fgcolor=qRgb(settings.value("studio/ink/red", 0).toInt(),
|
m_fgcolor=qRgb(settings.value("studio/ink/red", 0).toInt(),
|
||||||
settings.value("studio/ink/green", 0).toInt(),
|
settings.value("studio/ink/green", 0).toInt(),
|
||||||
settings.value("studio/ink/blue", 0).toInt());
|
settings.value("studio/ink/blue", 0).toInt());
|
||||||
@ -166,7 +166,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
|
|||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
settings.setValue("studio/symbology", bstyle->currentIndex());
|
settings.setValue("studio/symbology", bstyle->currentIndex());
|
||||||
settings.setValue("studio/ink/red", m_fgcolor.red());
|
settings.setValue("studio/ink/red", m_fgcolor.red());
|
||||||
settings.setValue("studio/ink/green", m_fgcolor.green());
|
settings.setValue("studio/ink/green", m_fgcolor.green());
|
||||||
@ -206,7 +206,7 @@ bool MainWindow::save()
|
|||||||
save_dialog.setAcceptMode(QFileDialog::AcceptSave);
|
save_dialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||||
save_dialog.setWindowTitle("Save Barcode Image");
|
save_dialog.setWindowTitle("Save Barcode Image");
|
||||||
save_dialog.setDirectory(settings.value("studio/default_dir", QDir::toNativeSeparators(QDir::homePath())).toString());
|
save_dialog.setDirectory(settings.value("studio/default_dir", QDir::toNativeSeparators(QDir::homePath())).toString());
|
||||||
|
|
||||||
#ifdef NO_PNG
|
#ifdef NO_PNG
|
||||||
suffix = settings.value("studio/default_suffix", "gif").toString();
|
suffix = settings.value("studio/default_suffix", "gif").toString();
|
||||||
save_dialog.setNameFilter(tr("Encapsulated Post Script (*.eps);;Graphics Interchange Format (*.gif);;Scalable Vector Graphic (*.svg);;Windows Bitmap (*.bmp);;ZSoft PC Painter Image (*.pcx);;Extended Metafile (*.emf);;Tagged Image File Format (*.tif)"));
|
save_dialog.setNameFilter(tr("Encapsulated Post Script (*.eps);;Graphics Interchange Format (*.gif);;Scalable Vector Graphic (*.svg);;Windows Bitmap (*.bmp);;ZSoft PC Painter Image (*.pcx);;Extended Metafile (*.emf);;Tagged Image File Format (*.tif)"));
|
||||||
@ -214,7 +214,7 @@ bool MainWindow::save()
|
|||||||
suffix = settings.value("studio/default_suffix", "png").toString();
|
suffix = settings.value("studio/default_suffix", "png").toString();
|
||||||
save_dialog.setNameFilter(tr("Portable Network Graphic (*.png);;Encapsulated Post Script (*.eps);;Graphics Interchange Format (*.gif);;Scalable Vector Graphic (*.svg);;Windows Bitmap (*.bmp);;ZSoft PC Painter Image (*.pcx);;Extended Metafile (*.emf);;Tagged Image File Format (*.tif)"));
|
save_dialog.setNameFilter(tr("Portable Network Graphic (*.png);;Encapsulated Post Script (*.eps);;Graphics Interchange Format (*.gif);;Scalable Vector Graphic (*.svg);;Windows Bitmap (*.bmp);;ZSoft PC Painter Image (*.pcx);;Extended Metafile (*.emf);;Tagged Image File Format (*.tif)"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (QString::compare(suffix, "png", Qt::CaseInsensitive) == 0)
|
if (QString::compare(suffix, "png", Qt::CaseInsensitive) == 0)
|
||||||
save_dialog.selectNameFilter("Portable Network Graphic (*.png)");
|
save_dialog.selectNameFilter("Portable Network Graphic (*.png)");
|
||||||
if (QString::compare(suffix, "eps", Qt::CaseInsensitive) == 0)
|
if (QString::compare(suffix, "eps", Qt::CaseInsensitive) == 0)
|
||||||
@ -231,7 +231,7 @@ bool MainWindow::save()
|
|||||||
save_dialog.selectNameFilter("Extended Metafile (*.emf)");
|
save_dialog.selectNameFilter("Extended Metafile (*.emf)");
|
||||||
if (QString::compare(suffix, "tif", Qt::CaseInsensitive) == 0)
|
if (QString::compare(suffix, "tif", Qt::CaseInsensitive) == 0)
|
||||||
save_dialog.selectNameFilter("Tagged Image File Format (*.tif)");
|
save_dialog.selectNameFilter("Tagged Image File Format (*.tif)");
|
||||||
|
|
||||||
if (save_dialog.exec()) {
|
if (save_dialog.exec()) {
|
||||||
filename = save_dialog.selectedFiles().at(0);
|
filename = save_dialog.selectedFiles().at(0);
|
||||||
if ((filename.lastIndexOf(".") == -1) || (filename.lastIndexOf(".") < (filename.length() - 5))) {
|
if ((filename.lastIndexOf(".") == -1) || (filename.lastIndexOf(".") < (filename.length() - 5))) {
|
||||||
@ -250,7 +250,7 @@ bool MainWindow::save()
|
|||||||
QMessageBox::critical(this,tr("Save Error"),m_bc.bc.error_message());
|
QMessageBox::critical(this,tr("Save Error"),m_bc.bc.error_message());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.setValue("studio/default_dir", filename.mid(0, filename.lastIndexOf(QDir::separator())));
|
settings.setValue("studio/default_dir", filename.mid(0, filename.lastIndexOf(QDir::separator())));
|
||||||
settings.setValue("studio/default_suffix", suffix);
|
settings.setValue("studio/default_suffix", suffix);
|
||||||
return true;
|
return true;
|
||||||
@ -391,7 +391,7 @@ void MainWindow::change_options()
|
|||||||
connect(m_optionWidget->findChild<QObject*>("radC128CSup"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("radC128CSup"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
||||||
connect(m_optionWidget->findChild<QObject*>("radC128EAN"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("radC128EAN"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
||||||
connect(m_optionWidget->findChild<QObject*>("radC128HIBC"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("radC128HIBC"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
chkComposite->setText(tr("Add 2D Component"));
|
chkComposite->setText(tr("Add 2D Component"));
|
||||||
|
|
||||||
@ -479,16 +479,16 @@ void MainWindow::change_options()
|
|||||||
connect(m_optionWidget->findChild<QObject*>("radC39Stand"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("radC39Stand"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
||||||
connect(m_optionWidget->findChild<QObject*>("radC39Check"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("radC39Check"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
||||||
connect(m_optionWidget->findChild<QObject*>("radC39HIBC"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("radC39HIBC"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
||||||
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_EXCODE39)
|
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_EXCODE39)
|
||||||
{
|
{
|
||||||
if(m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->isChecked() == true)
|
if(m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->isChecked() == true)
|
||||||
{
|
{
|
||||||
m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setChecked(false);
|
m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setChecked(false);
|
||||||
m_optionWidget->findChild<QRadioButton*>("radC39Stand")->setChecked(true);
|
m_optionWidget->findChild<QRadioButton*>("radC39Stand")->setChecked(true);
|
||||||
}
|
}
|
||||||
m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setEnabled(false);
|
m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setEnabled(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setEnabled(true);
|
m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -502,7 +502,7 @@ void MainWindow::change_options()
|
|||||||
tabMain->insertTab(1,m_optionWidget,tr("Code 16K"));
|
tabMain->insertTab(1,m_optionWidget,tr("Code 16K"));
|
||||||
connect(m_optionWidget->findChild<QObject*>("radC16kStand"), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("radC16kStand"), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CODABLOCKF)
|
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CODABLOCKF)
|
||||||
{
|
{
|
||||||
QFile file (":/grpCodablockF.ui");
|
QFile file (":/grpCodablockF.ui");
|
||||||
@ -517,7 +517,7 @@ void MainWindow::change_options()
|
|||||||
connect(m_optionWidget->findChild<QObject*>("cmbCbfWidth"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("cmbCbfWidth"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||||
connect(m_optionWidget->findChild<QObject*>("cmbCbfHeight"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("cmbCbfHeight"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_DATAMATRIX)
|
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_DATAMATRIX)
|
||||||
{
|
{
|
||||||
QFile file(":/grpDM.ui");
|
QFile file(":/grpDM.ui");
|
||||||
@ -533,7 +533,7 @@ void MainWindow::change_options()
|
|||||||
connect(m_optionWidget->findChild<QObject*>("chkDMRectangle"), SIGNAL(stateChanged( int )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("chkDMRectangle"), SIGNAL(stateChanged( int )), SLOT(update_preview()));
|
||||||
connect(m_optionWidget->findChild<QObject*>("chkDMRE"), SIGNAL(stateChanged( int )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("chkDMRE"), SIGNAL(stateChanged( int )), SLOT(update_preview()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_QRCODE)
|
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_QRCODE)
|
||||||
{
|
{
|
||||||
QFile file(":/grpQR.ui");
|
QFile file(":/grpQR.ui");
|
||||||
@ -551,7 +551,7 @@ void MainWindow::change_options()
|
|||||||
connect(m_optionWidget->findChild<QObject*>("radQRGS1"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("radQRGS1"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
||||||
connect(m_optionWidget->findChild<QObject*>("radQRHIBC"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("radQRHIBC"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_HANXIN)
|
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_HANXIN)
|
||||||
{
|
{
|
||||||
QFile file (":/grpHX.ui");
|
QFile file (":/grpHX.ui");
|
||||||
@ -581,7 +581,7 @@ void MainWindow::change_options()
|
|||||||
connect(m_optionWidget->findChild<QObject*>("cmbMQRSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("cmbMQRSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||||
connect(m_optionWidget->findChild<QObject*>("cmbMQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("cmbMQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_GRIDMATRIX)
|
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_GRIDMATRIX)
|
||||||
{
|
{
|
||||||
QFile file(":/grpGrid.ui");
|
QFile file(":/grpGrid.ui");
|
||||||
@ -609,7 +609,7 @@ void MainWindow::change_options()
|
|||||||
connect(m_optionWidget->findChild<QObject*>("cmbMaxiMode"), SIGNAL(currentIndexChanged( int )), SLOT(maxi_primary()));
|
connect(m_optionWidget->findChild<QObject*>("cmbMaxiMode"), SIGNAL(currentIndexChanged( int )), SLOT(maxi_primary()));
|
||||||
connect(m_optionWidget->findChild<QObject*>("txtMaxiPrimary"), SIGNAL(textChanged( const QString& )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("txtMaxiPrimary"), SIGNAL(textChanged( const QString& )), SLOT(update_preview()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CHANNEL)
|
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CHANNEL)
|
||||||
{
|
{
|
||||||
QFile file(":/grpChannel.ui");
|
QFile file(":/grpChannel.ui");
|
||||||
@ -620,7 +620,7 @@ void MainWindow::change_options()
|
|||||||
tabMain->insertTab(1,m_optionWidget,tr("Channel Code"));
|
tabMain->insertTab(1,m_optionWidget,tr("Channel Code"));
|
||||||
connect(m_optionWidget->findChild<QObject*>("cmbChannel"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("cmbChannel"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CODEONE)
|
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CODEONE)
|
||||||
{
|
{
|
||||||
QFile file(":/grpCodeOne.ui");
|
QFile file(":/grpCodeOne.ui");
|
||||||
@ -643,7 +643,7 @@ void MainWindow::change_options()
|
|||||||
tabMain->insertTab(1,m_optionWidget,tr("Code 49"));
|
tabMain->insertTab(1,m_optionWidget,tr("Code 49"));
|
||||||
connect(m_optionWidget->findChild<QObject*>("radC49GS1"), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
connect(m_optionWidget->findChild<QObject*>("radC49GS1"), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_RSS_EXPSTACK)
|
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_RSS_EXPSTACK)
|
||||||
{
|
{
|
||||||
QFile file(":/grpDBExtend.ui");
|
QFile file(":/grpDBExtend.ui");
|
||||||
@ -679,7 +679,7 @@ void MainWindow::change_options()
|
|||||||
|
|
||||||
void MainWindow::composite_enable()
|
void MainWindow::composite_enable()
|
||||||
{
|
{
|
||||||
if(chkComposite->isChecked() == true)
|
if(chkComposite->isChecked() == true)
|
||||||
{
|
{
|
||||||
lblCompType->setEnabled(true);
|
lblCompType->setEnabled(true);
|
||||||
cmbCompType->setEnabled(true);
|
cmbCompType->setEnabled(true);
|
||||||
@ -722,7 +722,7 @@ void MainWindow::update_preview()
|
|||||||
{
|
{
|
||||||
int width = view->geometry().width();
|
int width = view->geometry().width();
|
||||||
int height = view->geometry().height();
|
int height = view->geometry().height();
|
||||||
|
|
||||||
//m_bc.ar=(Zint::QZint::AspectRatioMode)1;
|
//m_bc.ar=(Zint::QZint::AspectRatioMode)1;
|
||||||
if(chkComposite->isChecked() == true) {
|
if(chkComposite->isChecked() == true) {
|
||||||
m_bc.bc.setPrimaryMessage(txtData->text());
|
m_bc.bc.setPrimaryMessage(txtData->text());
|
||||||
@ -747,9 +747,9 @@ void MainWindow::update_preview()
|
|||||||
if(m_optionWidget->findChild<QRadioButton*>("radC128CSup")->isChecked())
|
if(m_optionWidget->findChild<QRadioButton*>("radC128CSup")->isChecked())
|
||||||
m_bc.bc.setSymbol(BARCODE_CODE128B);
|
m_bc.bc.setSymbol(BARCODE_CODE128B);
|
||||||
|
|
||||||
if(m_optionWidget->findChild<QRadioButton*>("radC128EAN")->isChecked())
|
if(m_optionWidget->findChild<QRadioButton*>("radC128EAN")->isChecked())
|
||||||
{
|
{
|
||||||
if(chkComposite->isChecked())
|
if(chkComposite->isChecked())
|
||||||
m_bc.bc.setSymbol(BARCODE_EAN128_CC);
|
m_bc.bc.setSymbol(BARCODE_EAN128_CC);
|
||||||
else
|
else
|
||||||
m_bc.bc.setSymbol(BARCODE_EAN128);
|
m_bc.bc.setSymbol(BARCODE_EAN128);
|
||||||
@ -820,7 +820,7 @@ void MainWindow::update_preview()
|
|||||||
m_bc.bc.setSymbol(BARCODE_RSS_EXPSTACK_CC);
|
m_bc.bc.setSymbol(BARCODE_RSS_EXPSTACK_CC);
|
||||||
else
|
else
|
||||||
m_bc.bc.setSymbol(BARCODE_RSS_EXPSTACK);
|
m_bc.bc.setSymbol(BARCODE_RSS_EXPSTACK);
|
||||||
|
|
||||||
if(m_optionWidget->findChild<QComboBox*>("cmbCols")->currentIndex() != 0)
|
if(m_optionWidget->findChild<QComboBox*>("cmbCols")->currentIndex() != 0)
|
||||||
m_bc.bc.setWidth(m_optionWidget->findChild<QComboBox*>("cmbCols")->currentIndex());
|
m_bc.bc.setWidth(m_optionWidget->findChild<QComboBox*>("cmbCols")->currentIndex());
|
||||||
break;
|
break;
|
||||||
@ -908,7 +908,7 @@ void MainWindow::update_preview()
|
|||||||
if(m_optionWidget->findChild<QRadioButton*>("radCbfSetHeight")->isChecked())
|
if(m_optionWidget->findChild<QRadioButton*>("radCbfSetHeight")->isChecked())
|
||||||
m_bc.bc.setSecurityLevel(m_optionWidget->findChild<QComboBox*>("cmbCbfHeight")->currentIndex() + 1);
|
m_bc.bc.setSecurityLevel(m_optionWidget->findChild<QComboBox*>("cmbCbfHeight")->currentIndex() + 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BARCODE_DATAMATRIX:
|
case BARCODE_DATAMATRIX:
|
||||||
m_bc.bc.setSecurityLevel(1);
|
m_bc.bc.setSecurityLevel(1);
|
||||||
if(m_optionWidget->findChild<QRadioButton*>("radDM200HIBC")->isChecked())
|
if(m_optionWidget->findChild<QRadioButton*>("radDM200HIBC")->isChecked())
|
||||||
@ -929,7 +929,7 @@ void MainWindow::update_preview()
|
|||||||
m_bc.bc.setOption3(0);
|
m_bc.bc.setOption3(0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BARCODE_QRCODE:
|
case BARCODE_QRCODE:
|
||||||
if(m_optionWidget->findChild<QRadioButton*>("radQRHIBC")->isChecked())
|
if(m_optionWidget->findChild<QRadioButton*>("radQRHIBC")->isChecked())
|
||||||
m_bc.bc.setSymbol(BARCODE_HIBC_QR);
|
m_bc.bc.setSymbol(BARCODE_HIBC_QR);
|
||||||
@ -938,7 +938,7 @@ void MainWindow::update_preview()
|
|||||||
|
|
||||||
if(m_optionWidget->findChild<QRadioButton*>("radQRGS1")->isChecked())
|
if(m_optionWidget->findChild<QRadioButton*>("radQRGS1")->isChecked())
|
||||||
m_bc.bc.setInputMode(GS1_MODE);
|
m_bc.bc.setInputMode(GS1_MODE);
|
||||||
|
|
||||||
if(m_optionWidget->findChild<QRadioButton*>("radQRSize")->isChecked())
|
if(m_optionWidget->findChild<QRadioButton*>("radQRSize")->isChecked())
|
||||||
m_bc.bc.setWidth(m_optionWidget->findChild<QComboBox*>("cmbQRSize")->currentIndex() + 1);
|
m_bc.bc.setWidth(m_optionWidget->findChild<QComboBox*>("cmbQRSize")->currentIndex() + 1);
|
||||||
|
|
||||||
@ -954,7 +954,7 @@ void MainWindow::update_preview()
|
|||||||
if(m_optionWidget->findChild<QRadioButton*>("radMQRECC")->isChecked())
|
if(m_optionWidget->findChild<QRadioButton*>("radMQRECC")->isChecked())
|
||||||
m_bc.bc.setSecurityLevel(m_optionWidget->findChild<QComboBox*>("cmbMQRECC")->currentIndex() + 1);
|
m_bc.bc.setSecurityLevel(m_optionWidget->findChild<QComboBox*>("cmbMQRECC")->currentIndex() + 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BARCODE_GRIDMATRIX:
|
case BARCODE_GRIDMATRIX:
|
||||||
m_bc.bc.setSymbol(BARCODE_GRIDMATRIX);
|
m_bc.bc.setSymbol(BARCODE_GRIDMATRIX);
|
||||||
if(m_optionWidget->findChild<QRadioButton*>("radGridSize")->isChecked())
|
if(m_optionWidget->findChild<QRadioButton*>("radGridSize")->isChecked())
|
||||||
@ -977,25 +977,25 @@ void MainWindow::update_preview()
|
|||||||
|
|
||||||
case BARCODE_CHANNEL:
|
case BARCODE_CHANNEL:
|
||||||
m_bc.bc.setSymbol(BARCODE_CHANNEL);
|
m_bc.bc.setSymbol(BARCODE_CHANNEL);
|
||||||
if(m_optionWidget->findChild<QComboBox*>("cmbChannel")->currentIndex() == 0)
|
if(m_optionWidget->findChild<QComboBox*>("cmbChannel")->currentIndex() == 0)
|
||||||
m_bc.bc.setWidth(0);
|
m_bc.bc.setWidth(0);
|
||||||
else
|
else
|
||||||
m_bc.bc.setWidth(m_optionWidget->findChild<QComboBox*>("cmbChannel")->currentIndex() + 2);
|
m_bc.bc.setWidth(m_optionWidget->findChild<QComboBox*>("cmbChannel")->currentIndex() + 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BARCODE_CODEONE:
|
case BARCODE_CODEONE:
|
||||||
m_bc.bc.setSymbol(BARCODE_CODEONE);
|
m_bc.bc.setSymbol(BARCODE_CODEONE);
|
||||||
if(m_optionWidget->findChild<QRadioButton*>("radC1GS1")->isChecked())
|
if(m_optionWidget->findChild<QRadioButton*>("radC1GS1")->isChecked())
|
||||||
m_bc.bc.setInputMode(GS1_MODE);
|
m_bc.bc.setInputMode(GS1_MODE);
|
||||||
m_bc.bc.setWidth(m_optionWidget->findChild<QComboBox*>("cmbC1Size")->currentIndex());
|
m_bc.bc.setWidth(m_optionWidget->findChild<QComboBox*>("cmbC1Size")->currentIndex());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BARCODE_CODE49:
|
case BARCODE_CODE49:
|
||||||
m_bc.bc.setSymbol(BARCODE_CODE49);
|
m_bc.bc.setSymbol(BARCODE_CODE49);
|
||||||
if(m_optionWidget->findChild<QRadioButton*>("radC49GS1")->isChecked())
|
if(m_optionWidget->findChild<QRadioButton*>("radC49GS1")->isChecked())
|
||||||
m_bc.bc.setInputMode(GS1_MODE);
|
m_bc.bc.setInputMode(GS1_MODE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BARCODE_HANXIN:
|
case BARCODE_HANXIN:
|
||||||
m_bc.bc.setSymbol(BARCODE_HANXIN);
|
m_bc.bc.setSymbol(BARCODE_HANXIN);
|
||||||
if(m_optionWidget->findChild<QRadioButton*>("radHXSize")->isChecked())
|
if(m_optionWidget->findChild<QRadioButton*>("radHXSize")->isChecked())
|
||||||
@ -1004,7 +1004,7 @@ void MainWindow::update_preview()
|
|||||||
if(m_optionWidget->findChild<QRadioButton*>("radHXECC")->isChecked())
|
if(m_optionWidget->findChild<QRadioButton*>("radHXECC")->isChecked())
|
||||||
m_bc.bc.setSecurityLevel(m_optionWidget->findChild<QComboBox*>("cmbHXECC")->currentIndex() + 1);
|
m_bc.bc.setSecurityLevel(m_optionWidget->findChild<QComboBox*>("cmbHXECC")->currentIndex() + 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
m_bc.bc.setSymbol(metaObject()->enumerator(0).value(bstyle->currentIndex()));
|
m_bc.bc.setSymbol(metaObject()->enumerator(0).value(bstyle->currentIndex()));
|
||||||
break;
|
break;
|
||||||
@ -1024,3 +1024,4 @@ void MainWindow::update_preview()
|
|||||||
scene->setSceneRect(0, 0, width - 10, height - 10);
|
scene->setSceneRect(0, 0, width - 10, height - 10);
|
||||||
scene->update();
|
scene->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ public:
|
|||||||
RSS_EXP =31,
|
RSS_EXP =31,
|
||||||
RSS_EXPSTACK =81,
|
RSS_EXPSTACK =81,
|
||||||
RSS_LTD =30,
|
RSS_LTD =30,
|
||||||
RSS14 =29,
|
RSS14 =29,
|
||||||
RSS14STACK =79,
|
RSS14STACK =79,
|
||||||
RSS14STACK_OMNI =80,
|
RSS14STACK_OMNI =80,
|
||||||
HANXIN =116,
|
HANXIN =116,
|
||||||
@ -123,7 +123,7 @@ public slots:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resizeEvent(QResizeEvent *event);
|
void resizeEvent(QResizeEvent *event);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
bool save();
|
bool save();
|
||||||
void about();
|
void about();
|
||||||
@ -140,7 +140,7 @@ private:
|
|||||||
|
|
||||||
QColor m_fgcolor,m_bgcolor;
|
QColor m_fgcolor,m_bgcolor;
|
||||||
BarcodeItem m_bc;
|
BarcodeItem m_bc;
|
||||||
QWidget *m_optionWidget;
|
QWidget *m_optionWidget;
|
||||||
QGraphicsScene *scene;
|
QGraphicsScene *scene;
|
||||||
/* QMenu *fileMenu;
|
/* QMenu *fileMenu;
|
||||||
QMenu *helpMenu;
|
QMenu *helpMenu;
|
||||||
@ -151,3 +151,4 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,12 +33,12 @@ SequenceWindow::SequenceWindow()
|
|||||||
setupUi(this);
|
setupUi(this);
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
QValidator *intvalid = new QIntValidator(this);
|
QValidator *intvalid = new QIntValidator(this);
|
||||||
|
|
||||||
linStartVal->setText(settings.value("studio/sequence/start_value", "1").toString());
|
linStartVal->setText(settings.value("studio/sequence/start_value", "1").toString());
|
||||||
linEndVal->setText(settings.value("studio/sequence/end_value", "10").toString());
|
linEndVal->setText(settings.value("studio/sequence/end_value", "10").toString());
|
||||||
linIncVal->setText(settings.value("studio/sequence/increment", "1").toString());
|
linIncVal->setText(settings.value("studio/sequence/increment", "1").toString());
|
||||||
linFormat->setText(settings.value("studio/sequence/format", "$$$$$$").toString());
|
linFormat->setText(settings.value("studio/sequence/format", "$$$$$$").toString());
|
||||||
|
|
||||||
linStartVal->setValidator(intvalid);
|
linStartVal->setValidator(intvalid);
|
||||||
linEndVal->setValidator(intvalid);
|
linEndVal->setValidator(intvalid);
|
||||||
linIncVal->setValidator(intvalid);
|
linIncVal->setValidator(intvalid);
|
||||||
@ -53,7 +53,7 @@ SequenceWindow::SequenceWindow()
|
|||||||
SequenceWindow::~SequenceWindow()
|
SequenceWindow::~SequenceWindow()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
settings.setValue("studio/sequence/start_value", linStartVal->text());
|
settings.setValue("studio/sequence/start_value", linStartVal->text());
|
||||||
settings.setValue("studio/sequence/end_value", linEndVal->text());
|
settings.setValue("studio/sequence/end_value", linEndVal->text());
|
||||||
settings.setValue("studio/sequence/increment", linIncVal->text());
|
settings.setValue("studio/sequence/increment", linIncVal->text());
|
||||||
@ -76,13 +76,13 @@ QString SequenceWindow::apply_format(QString raw_number)
|
|||||||
QString format;
|
QString format;
|
||||||
int format_len, input_len, i, inpos;
|
int format_len, input_len, i, inpos;
|
||||||
QChar format_qchar;
|
QChar format_qchar;
|
||||||
|
|
||||||
format = linFormat->text();
|
format = linFormat->text();
|
||||||
input_len = raw_number.length();
|
input_len = raw_number.length();
|
||||||
format_len = format.length();
|
format_len = format.length();
|
||||||
|
|
||||||
inpos = input_len;
|
inpos = input_len;
|
||||||
|
|
||||||
for(i = format_len; i > 0; i--) {
|
for(i = format_len; i > 0; i--) {
|
||||||
format_qchar = format[i - 1];
|
format_qchar = format[i - 1];
|
||||||
char format_char = format_qchar.toLatin1();
|
char format_char = format_qchar.toLatin1();
|
||||||
@ -116,11 +116,11 @@ QString SequenceWindow::apply_format(QString raw_number)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i = format_len; i > 0; i--) {
|
for(i = format_len; i > 0; i--) {
|
||||||
reversed += adjusted[i - 1];
|
reversed += adjusted[i - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return reversed;
|
return reversed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,32 +129,32 @@ void SequenceWindow::create_sequence()
|
|||||||
QString startval, endval, incval, part, outputtext;
|
QString startval, endval, incval, part, outputtext;
|
||||||
int start, stop, step, i;
|
int start, stop, step, i;
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
startval = linStartVal->text();
|
startval = linStartVal->text();
|
||||||
endval = linEndVal->text();
|
endval = linEndVal->text();
|
||||||
incval = linIncVal->text();
|
incval = linIncVal->text();
|
||||||
start = startval.toInt(&ok, 10);
|
start = startval.toInt(&ok, 10);
|
||||||
stop = endval.toInt(&ok, 10);
|
stop = endval.toInt(&ok, 10);
|
||||||
step = incval.toInt(&ok, 10);
|
step = incval.toInt(&ok, 10);
|
||||||
|
|
||||||
if((stop <= start) || (step <= 0)) {
|
if((stop <= start) || (step <= 0)) {
|
||||||
QMessageBox::critical(this, tr("Sequence Error"), tr("One or more of the input values is incorrect."));
|
QMessageBox::critical(this, tr("Sequence Error"), tr("One or more of the input values is incorrect."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i = start; i <= stop; i += step) {
|
for(i = start; i <= stop; i += step) {
|
||||||
part = apply_format(QString::number(i, 10));
|
part = apply_format(QString::number(i, 10));
|
||||||
part += '\n';
|
part += '\n';
|
||||||
outputtext += part;
|
outputtext += part;
|
||||||
}
|
}
|
||||||
|
|
||||||
txtPreview->setPlainText(outputtext);
|
txtPreview->setPlainText(outputtext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SequenceWindow::check_generate()
|
void SequenceWindow::check_generate()
|
||||||
{
|
{
|
||||||
QString preview_copy;
|
QString preview_copy;
|
||||||
|
|
||||||
preview_copy = txtPreview->toPlainText();
|
preview_copy = txtPreview->toPlainText();
|
||||||
if(preview_copy.isEmpty()) {
|
if(preview_copy.isEmpty()) {
|
||||||
btnExport->setEnabled(false);
|
btnExport->setEnabled(false);
|
||||||
@ -170,16 +170,16 @@ void SequenceWindow::import()
|
|||||||
QString filename;
|
QString filename;
|
||||||
QFile file;
|
QFile file;
|
||||||
QByteArray outstream;
|
QByteArray outstream;
|
||||||
|
|
||||||
import_dialog.setWindowTitle("Import File");
|
import_dialog.setWindowTitle("Import File");
|
||||||
import_dialog.setDirectory(settings.value("studio/default_dir", QDir::toNativeSeparators(QDir::homePath())).toString());
|
import_dialog.setDirectory(settings.value("studio/default_dir", QDir::toNativeSeparators(QDir::homePath())).toString());
|
||||||
|
|
||||||
if (import_dialog.exec()) {
|
if (import_dialog.exec()) {
|
||||||
filename = import_dialog.selectedFiles().at(0);
|
filename = import_dialog.selectedFiles().at(0);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
file.setFileName(filename);
|
file.setFileName(filename);
|
||||||
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
QMessageBox::critical(this, tr("Open Error"), tr("Could not open selected file."));
|
QMessageBox::critical(this, tr("Open Error"), tr("Could not open selected file."));
|
||||||
@ -190,7 +190,7 @@ void SequenceWindow::import()
|
|||||||
|
|
||||||
txtPreview->setPlainText(QString(outstream));
|
txtPreview->setPlainText(QString(outstream));
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
settings.setValue("studio/default_dir", filename.mid(0, filename.lastIndexOf(QDir::separator())));
|
settings.setValue("studio/default_dir", filename.mid(0, filename.lastIndexOf(QDir::separator())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,3 +201,4 @@ void SequenceWindow::generate_sequence()
|
|||||||
dlg.output_data = txtPreview->toPlainText();
|
dlg.output_data = txtPreview->toPlainText();
|
||||||
dlg.exec();
|
dlg.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,10 +31,10 @@ public:
|
|||||||
SequenceWindow();
|
SequenceWindow();
|
||||||
~SequenceWindow();
|
~SequenceWindow();
|
||||||
BarcodeItem *barcode;
|
BarcodeItem *barcode;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString apply_format(QString raw_number);
|
QString apply_format(QString raw_number);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void quit_now();
|
void quit_now();
|
||||||
void reset_preview();
|
void reset_preview();
|
||||||
@ -44,4 +44,4 @@ private slots:
|
|||||||
void generate_sequence();
|
void generate_sequence();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user