mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-18 00:54:36 -04:00
Add -fullmultibyte to tcl frontend
This commit is contained in:
parent
22ba06a7cb
commit
2f99f0c4fd
2 changed files with 36 additions and 8 deletions
|
@ -68,7 +68,9 @@
|
|||
- Framework 2.7.0 update
|
||||
- Add symbology rmqr
|
||||
2020-02-01 2.7.1 HaO
|
||||
- Framework 2.7.1 update
|
||||
- Framework 2.7.1 update
|
||||
2020-04-06 HaO
|
||||
- Added option -fullmultibyte
|
||||
*/
|
||||
|
||||
#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
|
||||
|
@ -400,7 +402,8 @@ static char help_message[] = "zint tcl(stub,obj) dll\n"
|
|||
" -dotty bool: use dots instead of boxes for matrix codes\n"
|
||||
" -dotsize number: radius ratio of dots from 0.01 to 1.0\n"
|
||||
" -scale double: Scale the image to this factor\n"
|
||||
" -format binary|unicode|gs1: input data format. Default:unicode\n"
|
||||
" -format binary|unicode|gs1: input data format. Default:unicode\n"
|
||||
" -fullmultibyte: allow multibyte compaction for xQR, HanXin, Gridmatrix\n"
|
||||
" -gssep bool: for gs1, use gs as separator instead fnc1 (Datamatrix only)\n"
|
||||
" -eci number: ECI to use\n"
|
||||
" -notext bool: no interpretation line\n"
|
||||
|
@ -559,7 +562,8 @@ static int Encode(Tcl_Interp *interp, int objc,
|
|||
int destY0 = 0;
|
||||
int destWidth = 0;
|
||||
int destHeight = 0;
|
||||
int ECIIndex = 0;
|
||||
int ECIIndex = 0;
|
||||
int fFullMultiByte = 0;
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* >> Check if at least data and object is given and a pair number of */
|
||||
/* >> options */
|
||||
|
@ -589,13 +593,13 @@ static int Encode(Tcl_Interp *interp, int objc,
|
|||
"-dmre", "-dotsize", "-dotty", "-eci", "-fg", "-format", "-gssep",
|
||||
"-height", "-init", "-mode", "-notext", "-primary", "-rotate",
|
||||
"-rows", "-scale", "-secure", "-smalltext", "-square", "-to",
|
||||
"-vers", "-whitesp", NULL};
|
||||
"-vers", "-whitesp", "-fullmultibyte", NULL};
|
||||
enum iOption {
|
||||
iBarcode, iBG, iBind, iBold, iBorder, iBox, iCols,
|
||||
iDMRE, iDotSize, iDotty, iECI, iFG, iFormat, iGSSep, iHeight,
|
||||
iInit, iMode, iNoText, iPrimary, iRotate, iRows,
|
||||
iScale, iSecure, iSmallText, iSquare, iTo, iVers,
|
||||
iWhiteSp
|
||||
iWhiteSp, iFullMultiByte
|
||||
};
|
||||
int optionIndex;
|
||||
int intValue;
|
||||
|
@ -621,7 +625,8 @@ static int Encode(Tcl_Interp *interp, int objc,
|
|||
case iInit:
|
||||
case iNoText:
|
||||
case iSmallText:
|
||||
case iSquare:
|
||||
case iSquare:
|
||||
case iFullMultiByte:
|
||||
/* >> Binary options */
|
||||
if (TCL_OK != Tcl_GetBooleanFromObj(interp, objv[optionPos+1],
|
||||
&intValue))
|
||||
|
@ -725,7 +730,10 @@ static int Encode(Tcl_Interp *interp, int objc,
|
|||
} else {
|
||||
hSymbol->output_options &= ~GS1_GS_SEPARATOR;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case iFullMultiByte:
|
||||
fFullMultiByte = intValue;
|
||||
break;
|
||||
case iECI:
|
||||
if(Tcl_GetIndexFromObj(interp, objv[optionPos+1],
|
||||
(const char **) s_eci_list,"-eci", optionPos, &ECIIndex)
|
||||
|
@ -925,6 +933,23 @@ static int Encode(Tcl_Interp *interp, int objc,
|
|||
}
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* >>> Set fullmultibyte option if symbology matches*/
|
||||
/* On wrong symbology, option is ignored (as does the zint program)*/
|
||||
if (fFullMultiByte) {
|
||||
switch (hSymbol->symbology) {
|
||||
case BARCODE_QRCODE:
|
||||
case BARCODE_MICROQR:
|
||||
/*case BARCODE_HIBC_QR: Note character set restricted to ASCII subset*/
|
||||
/*case BARCODE_UPNQR: Note does not use Kanji mode*/
|
||||
case BARCODE_RMQR:
|
||||
case BARCODE_HANXIN:
|
||||
case BARCODE_GRIDMATRIX:
|
||||
hSymbol->option_3 = ZINT_FULL_MULTIBYTE;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* >>> Prepare input dstring and encode it to ECI encoding*/
|
||||
Tcl_DStringInit(& dsInput);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue