mirror of
https://git.code.sf.net/p/zint/code
synced 2025-12-17 18:07:02 +00:00
Tweak Mode C blocks a bit more!
This commit is contained in:
@@ -305,19 +305,41 @@ int code16k(struct zint_symbol *symbol, unsigned char source[])
|
||||
c_count = 0;
|
||||
for(i = 0; i < read; i++) {
|
||||
if(set[i] == 'C') {
|
||||
if((source[i] == '[') && gs1) {
|
||||
if(c_count % 2) { set[i - c_count] = 'B'; }
|
||||
if(reduced[i] == '[') {
|
||||
if(c_count % 2) {
|
||||
if((i - c_count) != 0) {
|
||||
set[i - c_count] = 'B';
|
||||
} else {
|
||||
set[i - 1] = 'B';
|
||||
}
|
||||
}
|
||||
c_count = 0;
|
||||
} else {
|
||||
c_count++;
|
||||
}
|
||||
} else {
|
||||
if(c_count % 2) { set[i - c_count] = 'B'; }
|
||||
if(c_count % 2) {
|
||||
if((i - c_count) != 0) {
|
||||
set[i - c_count] = 'B';
|
||||
} else {
|
||||
set[i - 1] = 'B';
|
||||
}
|
||||
}
|
||||
c_count = 0;
|
||||
}
|
||||
}
|
||||
if(c_count % 2) { set[i - c_count] = 'B'; }
|
||||
|
||||
if(c_count % 2) {
|
||||
if((i - c_count) != 0) {
|
||||
set[i - c_count] = 'B';
|
||||
} else {
|
||||
set[i - 1] = 'B';
|
||||
}
|
||||
}
|
||||
for(i = 1; i < read - 1; i++) {
|
||||
if((set[i] == 'C') && ((set[i - 1] == 'B') && (set[i + 1] == 'B'))) {
|
||||
set[i] = 'B';
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure the data will fit in the symbol */
|
||||
last_set = ' ';
|
||||
|
||||
Reference in New Issue
Block a user