-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
zint.pas
3630 lines (3233 loc) · 116 KB
/
zint.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
unit zint;
{
Based on Zint (done by Robin Stuart and the Zint team)
http://github.com/zint/zint
Translation by TheUnknownOnes
http://theunknownones.net
License: Apache License 2.0
Status:
3432bc9aff311f2aea40f0e9883abfe6564c080b complete
Notes:
- the code of library.c is implemented here as part of TZintSymbol
}
{$IFDEF FPC}
{$mode objfpc}{$H+}
{$ENDIF}
interface
uses
Classes,
SysUtils;
{$IF declared(TEncoding)}
{$DEFINE UseTEncoding}
{$IFEND}
const
ZINT_ROWS_MAX = 178;
ZINT_COLS_MAX = 178;
DEFAULTVALUE_OPTION_1 = -1;
DEFAULTVALUE_OPTION_2 = 0;
DEFAULTVALUE_OPTION_3 = 928;
type
{$IF not declared(TBytes)}
TBytes = array of Byte;
{$IFEND}
TArrayOfByte = TBytes;
TArrayOfInteger = array of Integer;
TArrayOfCardinal = array of Cardinal;
TArrayOfWord = array of Word;
TArrayOfChar = array of Char;
// TArrayOfChar = array of AnsiChar;
TArrayOfArrayOfChar = array of array of Char;
TArrayOfSmallInt = array of SmallInt;
TZintSymbology = (zsCODE11,
zsC25MATRIX,
zsC25INTER,
zsC25IATA,
zsC25LOGIC,
zsC25IND,
zsCODE39,
zsEXCODE39,
zsEANX,
zsEAN128,
zsCODABAR,
zsCODE128,
zsDPLEIT,
zsDPIDENT,
zsCODE16K,
zsCODE49,
zsCODE93,
zsFLAT,
zsRSS14,
zsRSS_LTD,
zsRSS_EXP,
zsTELEPEN,
zsUPCA,
zsUPCE,
zsPOSTNET,
zsMSI_PLESSEY,
zsFIM,
zsLOGMARS,
zsPHARMA,
zsPZN,
zsPHARMA_TWO,
zsPDF417,
zsPDF417TRUNC,
zsMAXICODE,
zsQRCODE,
zsCODE128B,
zsAUSPOST,
zsAUSREPLY,
zsAUSROUTE,
zsAUSREDIRECT,
zsISBNX,
zsRM4SCC,
zsDATAMATRIX,
zsEAN14,
zsCODABLOCKF,
zsNVE18,
zsJAPANPOST,
zsKOREAPOST,
zsRSS14STACK,
zsRSS14STACK_OMNI,
zsRSS_EXPSTACK,
zsPLANET,
zsMICROPDF417,
zsONECODE,
zsPLESSEY,
zsTELEPEN_NUM,
zsITF14,
zsKIX,
zsAZTEC,
zsDAFT,
zsMICROQR,
zsHIBC_128,
zsHIBC_39,
zsHIBC_DM,
zsHIBC_QR,
zsHIBC_PDF,
zsHIBC_MICPDF,
zsHIBC_BLOCKF,
zsHIBC_AZTEC,
zsAZRUNE,
zsCODE32,
zsEANX_CC,
zsEAN128_CC,
zsRSS14_CC,
zsRSS_LTD_CC,
zsRSS_EXP_CC,
zsUPCA_CC,
zsUPCE_CC,
zsRSS14STACK_CC,
zsRSS14_OMNI_CC,
zsRSS_EXPSTACK_CC,
zsCHANNEL,
zsCODEONE,
zsGRIDMATRIX,
zsDOTCODE);
TZintCustomRenderTarget = class;
TZintSymbol = class;
TZintPersistent = class(TPersistent)
protected
FOwner : TPersistent;
FOnChanged: TNotifyEvent;
function GetOwner: TPersistent; override;
procedure Changed; virtual; // raises FOnChanged and informs the owner if it is a TZintPersistent
public
constructor Create(AOwner : TPersistent); virtual;
property Owner : TPersistent read FOwner;
property OnChange : TNotifyEvent read FOnChanged write FOnChanged;
end;
{ TCustomZintSymbolOptions }
TCustomZintSymbolOptions = class(TZintPersistent)
protected
FSymbol : TZintSymbol;
function GetBooleanOption(AIndex : Integer) : Boolean;
procedure SetBooleanOption(AIndex : Integer; AValue : Boolean);
public
constructor Create(ASymbol : TZintSymbol); reintroduce; virtual;
end;
TmpCheckDigitType = (cdtNone, cdtMod10, cdtMod1010, cdtMod11, cdtMod1110);
{ TZintMSIPlessyOptions }
TZintMSIPlessyOptions = class(TCustomZintSymbolOptions)
private
function GetCheckDigitType: TmpCheckDigitType;
procedure SetCheckDigitType(AValue: TmpCheckDigitType);
published
property CheckDigitType : TmpCheckDigitType read GetCheckDigitType write SetCheckDigitType default cdtNone;
end;
{ TZintExtCode39Options }
TZintExtCode39Options = class(TCustomZintSymbolOptions)
published
property AddCheckDigit : Boolean index 2 read GetBooleanOption write SetBooleanOption default false;
end;
TCompositeType = (ctAuto, ctCC_A, ctCC_B, ctCC_C);
{ TZintCompositeOptions }
TZintCompositeOptions = class(TCustomZintSymbolOptions)
protected
function GetCompositeType: TCompositeType;
procedure SetCompositeType(AValue: TCompositeType);
published
property CompositeType : TCompositeType read GetCompositeType write SetCompositeType default ctAuto;
end;
TgmSize = (gmsAuto, gms18, gms30, gms42, gms54, gms66, gms78, gms90, gms102, gms114, gms126, gms138, gms150, gms162);
TgmErrorCorrectCapacity = (gmeccAuto, gmecc10Percent, gmecc20Percent, gmecc30Percent, gmecc40Percent, gmecc50Percent);
{ TZintGridMatrixOptions }
TZintGridMatrixOptions = class(TCustomZintSymbolOptions)
protected
function GetErrorCorrectionCapacity: TgmErrorCorrectCapacity;
function GetSize: TgmSize;
procedure SetErrorCorrectionCapacity(AValue: TgmErrorCorrectCapacity);
procedure SetSize(AValue: TgmSize);
published
property Size : TgmSize read GetSize write SetSize default gmsAuto;
property ErrorCorrectionCapacity : TgmErrorCorrectCapacity read GetErrorCorrectionCapacity write SetErrorCorrectionCapacity default gmeccAuto;
end;
TpdfCheckDigitCount = -1..8;
TpdfColumns = 0..30;
{ TZintPDF417Options }
TZintPDF417Options = class(TCustomZintSymbolOptions)
protected
function GetCheckDigitCount: TpdfCheckDigitCount;
function GetColumns: TpdfColumns;
procedure SetCheckDigitCount(AValue: TpdfCheckDigitCount);
procedure SetColumns(AValue: TpdfColumns);
published
property CheckDigitCount : TpdfCheckDigitCount read GetCheckDigitCount write SetCheckDigitCount default -1;
property Columns : TpdfColumns read GetColumns write SetColumns default 0;
end;
TatErrorCorrectCapacity = (ateccAuto, atecc10Percent, atecc23Percent, atecc36Percent, atecc50Percent);
TatSize = (atsAuto, ats15Compact, ats19Compact, ats23Compact, ats27Compact, ats19, ats23, ats27, ats31, ats37, ats41, ats45, ats49, ats53, ats57, ats61, ats67, ats71, ats75, ats79, ats83, ats87, ats91, ats95, ats101, ats105, ats109, ats113, ats117, ats121, ats125, ats131, ats135, ats139, ats143, ats147, ats151);
{ TZintAztecOptions }
TZintAztecOptions = class(TCustomZintSymbolOptions)
protected
function GetErrorCorrectCapacity: TatErrorCorrectCapacity;
function GetSize: TatSize;
procedure SetGetErrorCorrectCapacity(AValue: TatErrorCorrectCapacity);
procedure SetSize(AValue: TatSize);
published
property ErrorCorrectCapacity : TatErrorCorrectCapacity read GetErrorCorrectCapacity write SetGetErrorCorrectCapacity;
property Size : TatSize read GetSize write SetSize;
end;
TmcMode = (mcmAuto, mcmMode2, mcmMode3, mcmMode4, mcmMode5, mcmMode6);
{ TZintMaxicodeOptions }
TZintMaxicodeOptions = class(TCustomZintSymbolOptions)
protected
function GetMode: TmcMode;
procedure SetMode(AValue: TmcMode);
published
property Mode : TmcMode read GetMode write SetMode;
end;
// TdmSize = (dmsAuto, dms10x10, dms12x12, dms14x14, dms16x16, dms18x18, dms20x20, dms22x22, dms24x24, dms26x26, dms32x32, dms36x36, dms40x40, dms44x44, dms48x48, dms52x52, dms64x64, dms72x72, dms80x80, dms88x88, dms96x96, dms104x104, dms120x120, dms132x132, dms144x144, dms8x18, dms8x32, dms12x26, dms12x36, dms16x36, dms16x48);
{fs 02/04/2018 added DMRE sizes}
TdmSize = (dmsAuto, dms10x10, dms12x12, dms14x14, dms16x16, dms18x18, dms20x20, dms22x22, dms24x24, dms26x26, dms32x32, dms36x36, dms40x40, dms44x44, dms48x48, dms52x52, dms64x64, dms72x72, dms80x80, dms88x88, dms96x96, dms104x104, dms120x120, dms132x132, dms144x144,
dmr8x18, dmr8x32, dmr12x26, dmr12x36, dmr16x36, dmr16x48,
dmre8x48, dmre8x64, dmre12x64, dmre16x64, dmre24x48, dmre24x64, dmre26x40, dmre26x48, dmre26x64);
{ TZintDatamatrixOptions }
TZintDatamatrixOptions = class(TCustomZintSymbolOptions)
private
{fs 30/08/2018 added ForceRectangle}
function GetForceRectangle: Boolean;
procedure SetForceRectangle(const AValue: Boolean);
function GetForceSquare: Boolean;
function GetSize: TdmSize;
procedure SetForceSquare(AValue: Boolean);
procedure SetSize(AValue: TdmSize);
published
property Size : TdmSize read GetSize write SetSize default dmsAuto;
property ForceSquare : Boolean read GetForceSquare write SetForceSquare default false;
{fs 30/08/2018 added ForceRectangle}
property ForceRectangle : Boolean read GetForceRectangle write SetForceRectangle default false;
end;
TqrECCLevel = (qreAuto, qreLevelL, qreLevelM, qreLevelQ, qreLevelH);
TqrSize = (qrsAuto, qrs21, qrs25, qrs29, qrs33, qrs37, qrs41, qrs45, qrs49, qrs53, qrs57, qrs61, qrs65, qrs69, qrs73, qrs77, qrs81, qrs85, qrs89, qrs93, qrs97, qrs101, qrs105, qrs109, qrs113, qrs117, qrs121, qrs125, qrs129, qrs133, qrs137, qrs141, qrs145, qrs149, qrs153, qrs157, qrs161, qrs165, qrs169, qrs173, qrs177);
{ TZintQRCodeOptions }
TZintQRCodeOptions = class(TCustomZintSymbolOptions)
private
function GetECCLevel: TqrECCLevel;
function GetSize: TqrSize;
procedure SetECCLevel(AValue: TqrECCLevel);
procedure SetSize(AValue: TqrSize);
published
property ECCLevel : TqrECCLevel read GetECCLevel write SetECCLevel default qreAuto;
property Size : TqrSize read GetSize write SetSize default qrsAuto;
end;
TmqVersion = (mqvAuto, mqv1, mqv2, mqv3, mqv4);
TmqECCLevel = (mqeAuto, mqeL, mqeM, mqeQ, mqeH);
{ TZintMicroQROptions }
TZintMicroQROptions = class(TCustomZintSymbolOptions)
private
function GetVersion: TmqVersion;
procedure SetVersion(AValue: TmqVersion);
function GetECCLevel: TmqECCLevel;
procedure SetECCLevel(const AValue: TmqECCLevel);
published
property ECCLevel : TmqECCLevel read GetECCLevel write SetECCLevel default mqeAuto;
property Version : TmqVersion read GetVersion write SetVersion default mqvAuto;
end;
Tc1Version = (c1vAuto, c1vA, c1vB, c1vC, c1vD, c1vE, c1vF, c1vG, c1vH, c1vS);
{ TZintCode1Options }
TZintCode1Options = class(TCustomZintSymbolOptions)
private
function GetVersion: Tc1Version;
procedure SetVersion(AValue: Tc1Version);
published
property Version : Tc1Version read GetVersion write SetVersion;
end;
{ TZintSymbol }
TZintSymbol = class(TZintPersistent)
protected
FMSIPlesseyOptions: TZintMSIPlessyOptions;
FExtCode39Options: TZintExtCode39Options;
FCompositeOptions : TZintCompositeOptions;
FGridMatrixOptions : TZintGridMatrixOptions;
FPDF417Options : TZintPDF417Options;
FAztecOptions : TZintAztecOptions;
FMaxicodeOptions : TZintMaxicodeOptions;
FDatamatrixOptions : TZintDatamatrixOptions;
FMicroQROptions : TZintMicroQROptions;
FCode1Options : TZintCode1Options;
FQRCodeOptions : TZintQRCodeOptions;
function GetSymbology: TZintSymbology; virtual;
procedure SetSymbology(const Value: TZintSymbology); virtual;
procedure DefineProperties(Filer : TFiler); override;
procedure LoadOption1(Reader : TReader); procedure SaveOption1(Writer : TWriter);
procedure LoadOption2(Reader : TReader); procedure SaveOption2(Writer : TWriter);
procedure LoadOption3(Reader : TReader); procedure SaveOption3(Writer : TWriter);
public
//please use the following vars *ONLY* if you *REALLY* know, what you're doing
//otherwise use the properties of the RenderTarget or the TZintSymbol.???Options - properties
symbology : Integer;
height: Integer;
whitespace_width : Integer;
border_width : Integer;
output_options : Integer;
option_1 : Integer;
option_2 : Integer;
option_3 : Integer;
input_mode : Integer;
eci: integer;
text : TArrayOfByte;
rows : Integer;
width : Integer;
primary : TArrayOfChar;
errtxt : TArrayOfChar;
Debug: Boolean;
encoded_data : array[0..ZINT_ROWS_MAX - 1] of array[0..ZINT_COLS_MAX - 1] of Byte;
row_height : array[0..ZINT_ROWS_MAX - 1] of Integer; { Largest symbol is 177x177 QR Code }
constructor Create(AOwner : TPersistent); override;
destructor Destroy; override;
procedure Assign(Source : TPersistent); override;
procedure Clear; virtual;
procedure Encode(AData : TArrayOfByte; ALength : Integer; ARaiseExceptions : Boolean = true); overload; virtual;
procedure Encode(AData : String; ARaiseExceptions : Boolean = true); overload; virtual;
procedure Render(ATarget : TZintCustomRenderTarget); virtual;
published
property SymbolType : TZintSymbology read GetSymbology write SetSymbology;
property MSIPlesseyOptions : TZintMSIPlessyOptions read FMSIPlesseyOptions;
property ExtCode39Options : TZintExtCode39Options read FExtCode39Options;
property CompositeOptions : TZintCompositeOptions read FCompositeOptions;
property GridMatrixOptions : TZintGridMatrixOptions read FGridMatrixOptions;
property PDF417Options : TZintPDF417Options read FPDF417Options;
property AztecOptions : TZintAztecOptions read FAztecOptions;
property MaxiCodeOptions : TZintMaxicodeOptions read FMaxicodeOptions;
property DatamatrixOptions : TZintDatamatrixOptions read FDatamatrixOptions;
property MicroQROptions : TZintMicroQROptions read FMicroQROptions;
property Code1Option : TZintCode1Options read FCode1Options;
property QRCodeOptions : TZintQRCodeOptions read FQRCodeOptions;
end;
zint_symbol = TZintSymbol;
TZintRenderAdjustMode = (ramScale, ramInflate);
{ TZintRenderValue }
TZintRenderValue = class(TZintPersistent)
protected
FTargetUnits : Single; //depends on the target; may be pixels, ...
FModules : Single; //will be used as multiplicator with the module[height|width]
procedure SetValue(const Index: Integer; const Value: Single); virtual;
//these are helpers for internal use
procedure IncTargetUnits(AValue : Single);
procedure IncModules(AValue : Single);
procedure DecTargetUnits(AValue : Single);
procedure DecModules(AValue : Single);
public
constructor Create(AOwner : TPersistent); override;
procedure Assign(Source : TPersistent); override;
published
property TargetUnits : Single index 0 read FTargetUnits write SetValue;
property Modules : Single index 1 read FModules write SetValue;
end;
{ TZintRenderBox }
TZintRenderBox = class(TZintPersistent)
protected
FTop, FBottom, FLeft, FRight : TZintRenderValue;
function GetSum(AIndex : Integer) : Single;
procedure SetValue(const Index: Integer; const Value: TZintRenderValue); virtual;
public
constructor Create(AOwner : TPersistent); override;
destructor Destroy; override;
procedure Assign(Source : TPersistent); override;
procedure SetModules(AValue : Single); virtual;
procedure SetTargetUnits(AValue : Single); virtual;
function GetModules: Single; virtual;
function GetTargetUnits: Single; virtual;
procedure AddModulesToTargetUnits(AModuleWidth, AModuleHeight : Single;
ATop : Boolean = true;
ABottom : Boolean = true;
ALeft : Boolean = true;
ARight : Boolean = true); virtual;
procedure RemoveModulesFromTargetUnits(AModuleWidth, AModuleHeight : Single;
ATop : Boolean = true;
ABottom : Boolean = true;
ALeft : Boolean = true;
ARight : Boolean = true); virtual;
property TopAndBottomTargetUnits : Single index 0 read GetSum;
property LeftAndRightTargetUnits : Single index 1 read GetSum;
property TopAndBottomModules : Single index 2 read GetSum;
property LeftAndRightModules : Single index 3 read GetSum;
published
property Top : TZintRenderValue index 0 read FTop write SetValue;
property Bottom : TZintRenderValue index 1 read FBottom write SetValue;
property Left : TZintRenderValue index 2 read FLeft write SetValue;
property Right : TZintRenderValue index 3 read FRight write SetValue;
property Modules : Single read GetModules write SetModules stored false;
property TargetUnits : Single read GetTargetUnits write SetTargetUnits stored false;
end;
TZintRenderRect = record
X, Y, Width, Height : Single;
end;
TZintHAlign = (haLeft, haCenter, haRight);
TZintVAlign = (vaTop, vaCenter, vaBottom);
TZintClearBackgroundParams = TZintRenderRect;
TZintDrawRectParams = TZintRenderRect;
TZintDrawHexagonParams = TZintRenderRect;
TZintDrawRingParams = record
X, Y, OuterRadius, InnerRadius : Single;
end;
TZintDrawTextParams = record
X, Y, Width, Height : Single;
Text : String;
end;
TZintCalcTextHeightParams = record
Text : String;
end;
TZintCalcTextWidthParams = TZintCalcTextHeightParams;
TZintEANUPCFlag = (euEAN8, euEAN13, euUPCA, euUPCE, euAddon2, euAddon5);
TZintEANUPCFlags = set of TZintEANUPCFlag;
{ TZintCustomRenderTarget }
TZintCustomRenderTarget = class(TZintPersistent)
protected
FSymbol : TZintSymbol;
FRowHeights : Integer; //sum of all rowheights measured in modules
FModuleWidth, FModuleHeight : Single;
FLargeBarCount : Integer; //count of rows, which height should be maximied
FLargeBarHeight : Single; //barheight of the rows, which height should be maximied
FTextSpacing : TZintRenderBox;
FHasText, FHasAddonText : Boolean;
FText, FAddonText, FLeadingText, FTrailingText : String;
FWhitespace : TZintRenderBox;
FMargin, FPadding, FBorder: TZintRenderBox;
FMarginRect, FBorderRect, FPaddingRect, FWhitespaceRect, FBarcodeRect, FTextSpacingRect, FTextRect : TZintRenderRect;
FHexagonScale: Single;
FTransparent: Boolean;
FRenderAdjustMode : TZintRenderAdjustMode;
FHeightDesired, FWidthDesired, FWidth, FHeight : Single;
FYDesired, FXDesired, FY, FX : Single;
FTextHeight : Single;
FMinModuleWidth,
FMaxModuleWidth: Single;
FHAlign : TZintHAlign;
FVAlign : TZintVAlign;
FStartTextBar : TZintRenderRect;
FTextDone : Boolean;
FEANUPCFlags : TZintEANUPCFlags;
FShowText : Boolean;
FLeadingTextWidth, FTrailingTextWidth : Single;
procedure SetBox(const Index: Integer; const Value: TZintRenderBox); virtual;
procedure SetHAlign(const Value: TZintHAlign); virtual;
procedure SetHexagonScale(const Value: Single); virtual;
procedure SetMaxModuleWidth(AValue: Single); virtual;
procedure SetMinModuleWidth(const Value: Single); virtual;
procedure SetRenderAdjustMode(const Value: TZintRenderAdjustMode); virtual;
procedure SetShowText(const Value: Boolean); virtual;
procedure SetTransparent(const Value: Boolean); virtual;
procedure SetVAlign(const Value: TZintVAlign); virtual;
//these functions calculates the zero-based values to absolute values based on the ...Desired-Values and FWidth & FHeight
function CalcX(AValue : Single) : Single;
function CalcY(AValue : Single) : Single;
procedure AddSymbolOptions; virtual; //adds options from the symbol to this render target (border, whitespace, ...)
procedure RemoveSymbolOptions; virtual; //removes options from this render target previously added by AddSymbolOptions
procedure AddBoxModulesToTargetUnits; virtual;
procedure RemoveBoxModulesFromTargetUnits; virtual;
procedure FetchRowInfos; virtual; //search for large bars and sum up the heights of the rows
procedure CalcSize; virtual;
procedure CalcText; virtual;
procedure CalcTextEANUPC; virtual;
procedure CheckEANUPC; virtual;
procedure CalcLargeBarHeight; virtual;
procedure CalcBoxes; virtual;
procedure DrawBorder; virtual;
procedure DrawMaxiRings; virtual;
procedure DrawMaxiModules; virtual;
procedure DrawModules; virtual;
procedure DrawRings; virtual;
procedure DrawTexts; virtual;
procedure RenderStart; virtual;
procedure RenderStop; virtual;
procedure DrawStart; virtual;
procedure DrawStop; virtual;
procedure HandleSpecialBarsEANUPC(ABarIndex : Integer; var ABar : TZintDrawRectParams); virtual;
procedure Inflate(const ANewWidth, ANewHeight : Single); virtual; abstract;
procedure ClearBackground(const AParams : TZintClearBackgroundParams); virtual; abstract;
procedure DrawRect(const AParams : TZintDrawRectParams); virtual; abstract;
procedure DrawHexagon(const AParams : TZintDrawHexagonParams); virtual; abstract;
procedure DrawRing(const AParams : TZintDrawRingParams); virtual; abstract;
procedure DrawRingFull(const AParams : TZintDrawRingParams); virtual; abstract;
procedure DrawText(const AParams : TZintDrawTextParams); virtual; abstract;
function CalcTextHeight(const AParams : TZintCalcTextHeightParams) : Single; virtual; abstract;
function CalcTextWidth(const AParams : TZintCalcTextWidthParams) : Single; virtual; abstract;
public
constructor Create(AOwner : TPersistent); override;
destructor Destroy; override;
procedure Assign(Source : TPersistent); override;
procedure Render(ASymbol : TZintSymbol); virtual;
property XDesired: Single read FXDesired write FXDesired;
property YDesired: Single read FYDesired write FYDesired;
property HeightDesired: Single read FHeightDesired write FHeightDesired;
property WidthDesired: Single read FWidthDesired write FWidthDesired;
property Y : Single read FY;
property X : Single read FX;
property Height : Single read FHeight;
property Width : Single read FWidth;
published
property RenderAdjustMode : TZintRenderAdjustMode read FRenderAdjustMode write SetRenderAdjustMode default ramScale;
property Transparent : Boolean read FTransparent write SetTransparent default false;
property HexagonScale : Single read FHexagonScale write SetHexagonScale;
property Margin : TZintRenderBox index 0 read FMargin write SetBox;
property Padding : TZintRenderBox index 1 read FPadding write SetBox;
property Border : TZintRenderBox index 2 read FBorder write SetBox;
property Whitespace : TZintRenderBox index 3 read FWhitespace write SetBox;
property TextSpacing : TZintRenderBox index 4 read FTextSpacing write SetBox;
property HAlign : TZintHAlign read FHAlign write SetHAlign default haLeft;
property VAlign : TZintVAlign read FVAlign write SetVAlign default vaTop;
property MinModuleWidth : Single read FMinModuleWidth write SetMinModuleWidth; //will only be applied if RenderAdjustMode = ramInflate
property MaxModuleWidth : Single read FMaxModuleWidth write SetMaxModuleWidth;
property ShowText : Boolean read FShowText write SetShowText default true;
end;
const
BARCODE_CODE11 = 1;
BARCODE_C25MATRIX = 2;
BARCODE_C25INTER = 3;
BARCODE_C25IATA = 4;
BARCODE_C25LOGIC = 6;
BARCODE_C25IND = 7;
BARCODE_CODE39 = 8;
BARCODE_EXCODE39 = 9;
BARCODE_EANX = 13;
BARCODE_EAN128 = 16;
BARCODE_CODABAR = 18;
BARCODE_CODE128 = 20;
BARCODE_DPLEIT = 21;
BARCODE_DPIDENT = 22;
BARCODE_CODE16K = 23;
BARCODE_CODE49 = 24;
BARCODE_CODE93 = 25;
BARCODE_FLAT = 28;
BARCODE_RSS14 = 29;
BARCODE_RSS_LTD = 30;
BARCODE_RSS_EXP = 31;
BARCODE_TELEPEN = 32;
BARCODE_UPCA = 34;
BARCODE_UPCE = 37;
BARCODE_POSTNET = 40;
BARCODE_MSI_PLESSEY = 47;
BARCODE_FIM = 49;
BARCODE_LOGMARS = 50;
BARCODE_PHARMA = 51;
BARCODE_PZN = 52;
BARCODE_PHARMA_TWO = 53;
BARCODE_PDF417 = 55;
BARCODE_PDF417TRUNC = 56;
BARCODE_MAXICODE = 57;
BARCODE_QRCODE = 58;
BARCODE_CODE128B = 60;
BARCODE_AUSPOST = 63;
BARCODE_AUSREPLY = 66;
BARCODE_AUSROUTE = 67;
BARCODE_AUSREDIRECT = 68;
BARCODE_ISBNX = 69;
BARCODE_RM4SCC = 70;
BARCODE_DATAMATRIX = 71;
BARCODE_EAN14 = 72;
BARCODE_CODABLOCKF = 74;
BARCODE_NVE18 = 75;
BARCODE_JAPANPOST = 76;
BARCODE_KOREAPOST = 77;
BARCODE_RSS14STACK = 79;
BARCODE_RSS14STACK_OMNI = 80;
BARCODE_RSS_EXPSTACK = 81;
BARCODE_PLANET = 82;
BARCODE_MICROPDF417 = 84;
BARCODE_ONECODE = 85;
BARCODE_PLESSEY = 86;
{ Tbarcode 8 codes }
BARCODE_TELEPEN_NUM = 87;
BARCODE_ITF14 = 89;
BARCODE_KIX = 90;
BARCODE_AZTEC = 92;
BARCODE_DAFT = 93;
BARCODE_MICROQR = 97;
{ Tbarcode 9 codes }
BARCODE_HIBC_128 = 98;
BARCODE_HIBC_39 = 99;
BARCODE_HIBC_DM = 102;
BARCODE_HIBC_QR = 104;
BARCODE_HIBC_PDF = 106;
BARCODE_HIBC_MICPDF = 108;
BARCODE_HIBC_BLOCKF = 110;
BARCODE_HIBC_AZTEC = 112;
{ Tbarcode 10 codes }
BARCODE_DOTCODE = 115;
// BARCODE_HANXIN = 116;
{ Zint specific }
BARCODE_AZRUNE = 128;
BARCODE_CODE32 = 129;
BARCODE_EANX_CC = 130;
BARCODE_EAN128_CC = 131;
BARCODE_RSS14_CC = 132;
BARCODE_RSS_LTD_CC = 133;
BARCODE_RSS_EXP_CC = 134;
BARCODE_UPCA_CC = 135;
BARCODE_UPCE_CC = 136;
BARCODE_RSS14STACK_CC = 137;
BARCODE_RSS14_OMNI_CC = 138;
BARCODE_RSS_EXPSTACK_CC = 139;
BARCODE_CHANNEL = 140;
BARCODE_CODEONE = 141;
BARCODE_GRIDMATRIX = 142;
{ Output Options }
GS1_GS_SEPARATOR = 512;
BARCODE_DOTTY_MODE = 256;
type
TZintSymbologyInfoEntry = record
DisplayName : String;
Symbology : TZintSymbology;
end;
const
ZintSymbologyInfos : array[0..84] of TZintSymbologyInfoEntry =
((DisplayName : 'Code 11'; Symbology : zsCODE11),
(DisplayName : 'Standard Code 2 of 5'; Symbology : zsC25MATRIX),
(DisplayName : 'Interleaved 2 of 5'; Symbology : zsC25INTER),
(DisplayName : 'Code 2 of 5 IATA'; Symbology : zsC25IATA),
(DisplayName : 'Code 2 of 5 Data Logic'; Symbology : zsC25LOGIC),
(DisplayName : 'Code 2 of 5 Industrial'; Symbology : zsC25IND),
(DisplayName : 'Code 3 of 9 (Code 39)'; Symbology : zsCODE39),
(DisplayName : 'Extended Code 3 of 9 (Code 39+)'; Symbology : zsEXCODE39),
(DisplayName : 'EAN'; Symbology : zsEANX),
(DisplayName : 'GS1-128 (UCC.EAN-128)'; Symbology : zsEAN128),
(DisplayName : 'Codabar'; Symbology : zsCODABAR),
(DisplayName : 'Code 128 (automatic subset switching)'; Symbology : zsCODE128),
(DisplayName : 'Deutsche Post Leitcode'; Symbology : zsDPLEIT),
(DisplayName : 'Deutsche Post Identcode'; Symbology : zsDPIDENT),
(DisplayName : 'Code 16K'; Symbology : zsCODE16K),
(DisplayName : 'Code 49'; Symbology : zsCODE49),
(DisplayName : 'Code 93'; Symbology : zsCODE93),
(DisplayName : 'Flattermarken'; Symbology : zsFLAT),
(DisplayName : 'GS1 DataBar-14'; Symbology : zsRSS14),
(DisplayName : 'GS1 DataBar Limited'; Symbology : zsRSS_LTD),
(DisplayName : 'GS1 DataBar Extended'; Symbology : zsRSS_EXP),
(DisplayName : 'Telepen Alpha'; Symbology : zsTELEPEN),
(DisplayName : 'UPC A'; Symbology : zsUPCA),
(DisplayName : 'UPC E'; Symbology : zsUPCE),
(DisplayName : 'PostNet'; Symbology : zsPOSTNET),
(DisplayName : 'MSI Plessey'; Symbology : zsMSI_PLESSEY),
(DisplayName : 'FIM'; Symbology : zsFIM),
(DisplayName : 'LOGMARS'; Symbology : zsLOGMARS),
(DisplayName : 'Pharmacode One-Track'; Symbology : zsPHARMA),
(DisplayName : 'PZN'; Symbology : zsPZN),
(DisplayName : 'Pharmacode Two-Track'; Symbology : zsPHARMA_TWO),
(DisplayName : 'PDF417'; Symbology : zsPDF417),
(DisplayName : 'PDF417 Truncated'; Symbology : zsPDF417TRUNC),
(DisplayName : 'Maxicode'; Symbology : zsMAXICODE),
(DisplayName : 'QR Code'; Symbology : zsQRCODE),
(DisplayName : 'Code 128 (Subset B)'; Symbology : zsCODE128B),
(DisplayName : 'Australia Post Standard Customer'; Symbology : zsAUSPOST),
(DisplayName : 'Australia Post Reply Paid'; Symbology : zsAUSREPLY),
(DisplayName : 'Australia Post Routing'; Symbology : zsAUSROUTE),
(DisplayName : 'Australia Post Redirection'; Symbology : zsAUSREDIRECT),
(DisplayName : 'ISBN (EAN-13 with verification stage)'; Symbology : zsISBNX),
(DisplayName : 'Royal Mail 4 State (RM4SCC)'; Symbology : zsRM4SCC),
(DisplayName : 'Data Matrix'; Symbology : zsDATAMATRIX),
(DisplayName : 'EAN-14'; Symbology : zsEAN14),
(DisplayName : 'CODABLOCKF'; Symbology : zsCODABLOCKF),
(DisplayName : 'NVE-18'; Symbology : zsNVE18),
(DisplayName : 'Japanese Postal Code'; Symbology : zsJAPANPOST),
(DisplayName : 'Korea Post'; Symbology : zsKOREAPOST),
(DisplayName : 'GS1 DataBar-14 Stacked'; Symbology : zsRSS14STACK),
(DisplayName : 'GS1 DataBar-14 Stacked Omnidirectional'; Symbology : zsRSS14STACK_OMNI),
(DisplayName : 'GS1 DataBar Expanded Stacked'; Symbology : zsRSS_EXPSTACK),
(DisplayName : 'PLANET'; Symbology : zsPLANET),
(DisplayName : 'MicroPDF417'; Symbology : zsMICROPDF417),
(DisplayName : 'USPS OneCode'; Symbology : zsONECODE),
(DisplayName : 'Plessey Code'; Symbology : zsPLESSEY),
(DisplayName : 'Telepen Numeric'; Symbology : zsTELEPEN_NUM),
(DisplayName : 'ITF-14'; Symbology : zsITF14),
(DisplayName : 'Dutch Post KIX Code'; Symbology : zsKIX),
(DisplayName : 'Aztec Code'; Symbology : zsAZTEC),
(DisplayName : 'DAFT Code'; Symbology : zsDAFT),
(DisplayName : 'Micro QR Code'; Symbology : zsMICROQR),
(DisplayName : 'HIBC Code 128'; Symbology : zsHIBC_128),
(DisplayName : 'HIBC Code 39'; Symbology : zsHIBC_39),
(DisplayName : 'HIBC Data Matrix'; Symbology : zsHIBC_DM),
(DisplayName : 'HIBC QR Code'; Symbology : zsHIBC_QR),
(DisplayName : 'HIBC PDF417'; Symbology : zsHIBC_PDF),
(DisplayName : 'HIBC MicroPDF417'; Symbology : zsHIBC_MICPDF),
(DisplayName : 'HIBC_BLOCKF'; Symbology : zsHIBC_BLOCKF),
(DisplayName : 'HIBC Aztec Code'; Symbology : zsHIBC_AZTEC),
(DisplayName : 'Aztec Runes'; Symbology : zsAZRUNE),
(DisplayName : 'Code 32'; Symbology : zsCODE32),
(DisplayName : 'Composite Symbol with EAN linear component'; Symbology : zsEANX_CC),
(DisplayName : 'Composite Symbol with GS1-128 linear component'; Symbology : zsEAN128_CC),
(DisplayName : 'Composite Symbol with GS1 DataBar-14 linear component'; Symbology : zsRSS14_CC),
(DisplayName : 'Composite Symbol with GS1 DataBar Limited component'; Symbology : zsRSS_LTD_CC),
(DisplayName : 'Composite Symbol with GS1 DataBar Extended component'; Symbology : zsRSS_EXP_CC),
(DisplayName : 'Composite Symbol with UPC A linear component'; Symbology : zsUPCA_CC),
(DisplayName : 'Composite Symbol with UPC E linear component'; Symbology : zsUPCE_CC),
(DisplayName : 'Composite Symbol with GS1 DataBar-14 Stacked component'; Symbology : zsRSS14STACK_CC),
(DisplayName : 'Composite Symbol with GS1 DataBar-14 Stacked Omnidirectional component'; Symbology : zsRSS14_OMNI_CC),
(DisplayName : 'Composite Symbol with GS1 DataBar Expanded Stacked component'; Symbology : zsRSS_EXPSTACK_CC),
(DisplayName : 'Channel Code'; Symbology : zsCHANNEL),
(DisplayName : 'Code One'; Symbology : zsCODEONE),
(DisplayName : 'Grid Matrix'; Symbology : zsGRIDMATRIX),
(DisplayName : 'Dotcode'; Symbology : zsDOTCODE));
BARCODE_BIND = 2;
BARCODE_BOX = 4;
READER_INIT = 16;
// Input Data type
DATA_MODE = 0;
UNICODE_MODE = 1;
GS1_MODE = 2;
KANJI_MODE = 3;
SJIS_MODE = 4;
ESCAPE_MODE = 8;
DM_SQUARE = 100;
{fs 02/04/2018 added DMRE}
DM_DMRE = 101;
DM_DMRE_Index = 31;
{fs 30/08/2018 added option to force Rectangle representation}
DM_RECT = 102;
ZWARN_INVALID_OPTION = 2;
ZERROR_TOO_LONG = 5;
ZERROR_INVALID_DATA = 6;
ZERROR_INVALID_CHECK = 7;
ZERROR_INVALID_OPTION = 8;
ZERROR_ENCODING_PROBLEM = 9;
//These are the functions from library.c
function gs1_compliant(_symbology : Integer) : boolean;
function supports_eci(const _symbology: Integer): boolean;
procedure error_tag(var error_string : TArrayOfChar; error_number : Integer);
function hibc(symbol : zint_symbol; source : TArrayOfByte; _length : Integer) : Integer;
function extended_charset(symbol : zint_symbol; source : TArrayOfByte; _length : Integer) : Integer;
function reduced_charset(symbol : zint_symbol; source : TArrayOfByte; _length : Integer) : Integer;
function ZBarcode_Encode(symbol : zint_symbol; source : TArrayOfByte; _length : Integer) : Integer;
function SymbologyToInt(ASymbology : TZintSymbology) : Integer;
function IntToSymbology(ASymbology : Integer) : TZintSymbology;
implementation
uses zint_common, zint_helper, zint_dmatrix,
zint_code128, zint_gs1, zint_2of5,
zint_aztec, zint_qr, zint_upcean,
zint_maxicode, zint_auspost, zint_code, zint_medical,
zint_code16k, zint_code49, zint_pdf417, zint_composite, zint_gridmtx,
zint_plessey, zint_code1, zint_telepen, zint_postal, zint_imail, zint_rss, zint_dotcode;
const
TECHNETIUM = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%';
EDesiredWithTooSmall = 'The desired width is too small.';
EDesiredHeightTooSmall = 'The desired height is too small.';
function SymbologyToInt(ASymbology : TZintSymbology) : Integer;
begin
case ASymbology of
zsCODE11 : Result := BARCODE_CODE11;
zsC25MATRIX : Result := BARCODE_C25MATRIX;
zsC25INTER : Result := BARCODE_C25INTER;
zsC25IATA : Result := BARCODE_C25IATA;
zsC25LOGIC : Result := BARCODE_C25LOGIC;
zsC25IND : Result := BARCODE_C25IND;
zsCODE39 : Result := BARCODE_CODE39;
zsEXCODE39 : Result := BARCODE_EXCODE39;
zsEANX : Result := BARCODE_EANX;
zsEAN128 : Result := BARCODE_EAN128;
zsCODABAR : Result := BARCODE_CODABAR;
zsCODE128 : Result := BARCODE_CODE128;
zsDPLEIT : Result := BARCODE_DPLEIT;
zsDPIDENT : Result := BARCODE_DPIDENT;
zsCODE16K : Result := BARCODE_CODE16K;
zsCODE49 : Result := BARCODE_CODE49;
zsCODE93 : Result := BARCODE_CODE93;
zsFLAT : Result := BARCODE_FLAT;
zsRSS14 : Result := BARCODE_RSS14;
zsRSS_LTD : Result := BARCODE_RSS_LTD;
zsRSS_EXP : Result := BARCODE_RSS_EXP;
zsTELEPEN : Result := BARCODE_TELEPEN;
zsUPCA : Result := BARCODE_UPCA;
zsUPCE : Result := BARCODE_UPCE;
zsPOSTNET : Result := BARCODE_POSTNET;
zsMSI_PLESSEY : Result := BARCODE_MSI_PLESSEY;
zsFIM : Result := BARCODE_FIM;
zsLOGMARS : Result := BARCODE_LOGMARS;
zsPHARMA : Result := BARCODE_PHARMA;
zsPZN : Result := BARCODE_PZN;
zsPHARMA_TWO : Result := BARCODE_PHARMA_TWO;
zsPDF417 : Result := BARCODE_PDF417;
zsPDF417TRUNC : Result := BARCODE_PDF417TRUNC;
zsMAXICODE : Result := BARCODE_MAXICODE;
zsQRCODE : Result := BARCODE_QRCODE;
zsCODE128B : Result := BARCODE_CODE128B;
zsAUSPOST : Result := BARCODE_AUSPOST;
zsAUSREPLY : Result := BARCODE_AUSREPLY;
zsAUSROUTE : Result := BARCODE_AUSROUTE;
zsAUSREDIRECT : Result := BARCODE_AUSREDIRECT;
zsISBNX : Result := BARCODE_ISBNX;
zsRM4SCC : Result := BARCODE_RM4SCC;
zsDATAMATRIX : Result := BARCODE_DATAMATRIX;
zsEAN14 : Result := BARCODE_EAN14;
zsCODABLOCKF : Result := BARCODE_CODABLOCKF;
zsNVE18 : Result := BARCODE_NVE18;
zsJAPANPOST : Result := BARCODE_JAPANPOST;
zsKOREAPOST : Result := BARCODE_KOREAPOST;
zsRSS14STACK : Result := BARCODE_RSS14STACK;
zsRSS14STACK_OMNI : Result := BARCODE_RSS14STACK_OMNI;
zsRSS_EXPSTACK : Result := BARCODE_RSS_EXPSTACK;
zsPLANET : Result := BARCODE_PLANET;
zsMICROPDF417 : Result := BARCODE_MICROPDF417;
zsONECODE : Result := BARCODE_ONECODE;
zsPLESSEY : Result := BARCODE_PLESSEY;
zsTELEPEN_NUM : Result := BARCODE_TELEPEN_NUM;
zsITF14 : Result := BARCODE_ITF14;
zsKIX : Result := BARCODE_KIX;
zsAZTEC : Result := BARCODE_AZTEC;
zsDAFT : Result := BARCODE_DAFT;
zsMICROQR : Result := BARCODE_MICROQR;
zsHIBC_128 : Result := BARCODE_HIBC_128;
zsHIBC_39 : Result := BARCODE_HIBC_39;
zsHIBC_DM : Result := BARCODE_HIBC_DM;
zsHIBC_QR : Result := BARCODE_HIBC_QR;
zsHIBC_PDF : Result := BARCODE_HIBC_PDF;
zsHIBC_MICPDF : Result := BARCODE_HIBC_MICPDF;
zsHIBC_BLOCKF : Result := BARCODE_HIBC_BLOCKF;
zsHIBC_AZTEC : Result := BARCODE_HIBC_AZTEC;
zsAZRUNE : Result := BARCODE_AZRUNE;
zsCODE32 : Result := BARCODE_CODE32;
zsEANX_CC : Result := BARCODE_EANX_CC;
zsEAN128_CC : Result := BARCODE_EAN128_CC;
zsRSS14_CC : Result := BARCODE_RSS14_CC;
zsRSS_LTD_CC : Result := BARCODE_RSS_LTD_CC;
zsRSS_EXP_CC : Result := BARCODE_RSS_EXP_CC;
zsUPCA_CC : Result := BARCODE_UPCA_CC;
zsUPCE_CC : Result := BARCODE_UPCE_CC;
zsRSS14STACK_CC : Result := BARCODE_RSS14STACK_CC;
zsRSS14_OMNI_CC : Result := BARCODE_RSS14_OMNI_CC;
zsRSS_EXPSTACK_CC : Result := BARCODE_RSS_EXPSTACK_CC;
zsCHANNEL : Result := BARCODE_CHANNEL;
zsCODEONE : Result := BARCODE_CODEONE;
zsGRIDMATRIX : Result := BARCODE_GRIDMATRIX;
zsDOTCODE : Result := BARCODE_DOTCODE;
else raise Exception.Create('unknown barcode IntToSymbology');
end;
end;
function IntToSymbology(ASymbology : Integer) : TZintSymbology;
begin
case ASymbology of
BARCODE_CODE11 : Result := zsCODE11;
BARCODE_C25MATRIX : Result := zsC25MATRIX;
BARCODE_C25INTER : Result := zsC25INTER;
BARCODE_C25IATA : Result := zsC25IATA;
BARCODE_C25LOGIC : Result := zsC25LOGIC;
BARCODE_C25IND : Result := zsC25IND;
BARCODE_CODE39 : Result := zsCODE39;
BARCODE_EXCODE39 : Result := zsEXCODE39;
BARCODE_EANX : Result := zsEANX;
BARCODE_EAN128 : Result := zsEAN128;
BARCODE_CODABAR : Result := zsCODABAR;
BARCODE_CODE128 : Result := zsCODE128;
BARCODE_DPLEIT : Result := zsDPLEIT;
BARCODE_DPIDENT : Result := zsDPIDENT;
BARCODE_CODE16K : Result := zsCODE16K;
BARCODE_CODE49 : Result := zsCODE49;
BARCODE_CODE93 : Result := zsCODE93;
BARCODE_FLAT : Result := zsFLAT;
BARCODE_RSS14 : Result := zsRSS14;
BARCODE_RSS_LTD : Result := zsRSS_LTD;
BARCODE_RSS_EXP : Result := zsRSS_EXP;
BARCODE_TELEPEN : Result := zsTELEPEN;
BARCODE_UPCA : Result := zsUPCA;
BARCODE_UPCE : Result := zsUPCE;
BARCODE_POSTNET : Result := zsPOSTNET;
BARCODE_MSI_PLESSEY : Result := zsMSI_PLESSEY;
BARCODE_FIM : Result := zsFIM;
BARCODE_LOGMARS : Result := zsLOGMARS;
BARCODE_PHARMA : Result := zsPHARMA;
BARCODE_PZN : Result := zsPZN;
BARCODE_PHARMA_TWO : Result := zsPHARMA_TWO;
BARCODE_PDF417 : Result := zsPDF417;
BARCODE_PDF417TRUNC : Result := zsPDF417TRUNC;
BARCODE_MAXICODE : Result := zsMAXICODE;
BARCODE_QRCODE : Result := zsQRCODE;
BARCODE_CODE128B : Result := zsCODE128B;
BARCODE_AUSPOST : Result := zsAUSPOST;
BARCODE_AUSREPLY : Result := zsAUSREPLY;
BARCODE_AUSROUTE : Result := zsAUSROUTE;
BARCODE_AUSREDIRECT : Result := zsAUSREDIRECT;
BARCODE_ISBNX : Result := zsISBNX;
BARCODE_RM4SCC : Result := zsRM4SCC;
BARCODE_DATAMATRIX : Result := zsDATAMATRIX;
BARCODE_EAN14 : Result := zsEAN14;
BARCODE_CODABLOCKF : Result := zsCODABLOCKF;
BARCODE_NVE18 : Result := zsNVE18;
BARCODE_JAPANPOST : Result := zsJAPANPOST;
BARCODE_KOREAPOST : Result := zsKOREAPOST;
BARCODE_RSS14STACK : Result := zsRSS14STACK;
BARCODE_RSS14STACK_OMNI : Result := zsRSS14STACK_OMNI;
BARCODE_RSS_EXPSTACK : Result := zsRSS_EXPSTACK;
BARCODE_PLANET : Result := zsPLANET;
BARCODE_MICROPDF417 : Result := zsMICROPDF417;
BARCODE_ONECODE : Result := zsONECODE;