Free Barcode Font - Code 128

Code 128 is variable length format that can be read in either direction and incorporates
a checksum for built in validation. Code 128 was designed to reduce the amount of
space required by the Code 39 format which it does by about 30%, and to include
the full ASCII character set, with both upper and lower case alphabetical characters,
and punctuation.
There are three different sets of characters that are represent by 106 different
barcodes, these are shown in the
table
at the bottom of this page.

All set can be started, switch to another set and provide a stop mark.

Checksum calculation

The checksum for code 128 is mandatory and is calculated by adding the weighting
value of the character position to the character number and then applying a a modulus
of 103, this is probably best explained with a example:

Lets encode the word “BarCode”

Character

Value

Weighted value

Total

Start Set B

104

104

104

B

34

34 * 1

34

a

65

65 * 2

130

r

82

82 * 3

246

C

35

35 * 4

140

o

79

79 * 5

395

d

68

68 * 6

408

e

69

69 * 7

483

Total

1940

This results in a modulus of 86, i.e. 1940 / 103 = 18 remainder 86, so the checksum
value is 86 represented by the 'v' character.
So the fully encoded barcode becomes: 104(start set B)+34(B)+65(a)+82(r)+35(C)+79(o)+68(d)+69(e)+86(v)+106(stop)

As you can see from the above example this can become quite complicated to calculate,
especially when you need to start swapping between sets to produce the optimal barcode,
fortunately the code to calculate this optimization including the checksum algorithm
with the start hand stop characters built into the barcode has been done by myself
and others.

Free Barcode Font (code 128) and String Builder

Font

The code 128 font is freely available for download, no catches, no costs, just free.

To install the font, click on the barcode above and then select 'Save' placing the
file into the %WinDir%\Fonts folder.
For most users this folder will be: C:\Windows\Fonts

This font does not include any leading or trailing spaces
within the start and stop characters, for the original version of this font which
includes white spacing see
below.

A small static class written in C# is also available to generate the required output
characters is available free from
here.
This is provided as a .net assembly for use in any .net language, the source code
is also available along with coding examples.

Original Font and older code

The font was originally created by
grandzebu.net
where you can download the original font and see other coding examples in other
older languages such as FoxPro, Delphi, VB6 and others
(look towards the bottom of the page for this information).
Be aware, this site is in French, but there is an English version for most of the
information which is where the above link will redirect you.