Code 128

 609,845 downloads (192 yesterday)   Public domain / GPL / OFL


Tom Evans  Mar 02, 2008
I like the idea of the barcode fonts, they print ok, but the barcode reader cannot decipher them, Am I doing something wrong?
nibblesmx  Jun 25, 2008
Grand Zebu, you rock!!!

You just saved my life man. If there's a way to donate some money, please let me know.

Thanks a lot dude
rjskoko  Sep 19, 2009
The Code 128 symbology has particular start and stop characters and a check sum. Look on Wikipedia or Google for Code 128 to find the "rules".
rjskoko  Sep 19, 2009
Additional: Try this site to generate a graphic of a valid symbol (supports a large number of symbologies) if you only need a single symbol (or to generate a symbol to verify yours against):
pushkar1210  Dec 29, 2014
Hi nibblesmx,
I want to print bar code - Code128 font with the following data.
123 ABC
the data contains space in between and code 128 does not support. can anybody help me?

nonlinearly  Mar 18, 2015
Hi. I used these fonts but barcode are not identified by the barcode reader. As "rjskoko" said must include the start and stop characters. In wikipedia say that start character in code 128 C is the ascii code 210 but how can I type it? Also as I see there isn't barcode for this ascii in the fonts!
nonlinearly  Mar 18, 2015
They do not work. The stop character (ASCII 206) is not the same as it appears to this web page!!!
karnaugh  Oct 02, 2015
I have confirmed that this barcode DOES work. You must use the correct start and stop characters, and remember the checksum character right before the stop. Go to this page for an automatic string generator so you don't have to manually calculate them:
david aguilar  Jun 02, 2016
I've implemented this font to print voucher codes, I choose Code 128 B but when the result of the checksum is a character for example 127, it prints a white square. This is part of the code that I wrote. This code works for me, most of times.

Private Sub onPrint(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
Dim printFont As New Font("code 128", 40)
Dim stringToBarCode As String = "251250000156"
Dim intChar As Integer
Dim stringBuild As New StringBuilder
Dim checksum As Integer = 104
Dim i As Integer = 1
Dim crcResult As Integer
For Each c As Char In stringToBarCode.ToCharArray
intChar = Encoding.ASCII.GetBytes(c)(0)
If intChar >= 32 And intChar <= 126 Then
checksum += (intChar - 32) * i
i += 1
End If
If checksum > 104 Then
crcResult = (checksum Mod 103) + 32
ev.Graphics.DrawString(stringBuild.ToString, printFont, Brushes.Black, 1, 1)
End If
End Sub

How can it be solved?, Do I need to edit the font? if so, how can i do it?
Holger Will  Sep 19, 2016
this has no characters for start, and stop codes.

Start A is ascii 208, start B is ascii 209 and start c ascii 210. The stop code is allways 211. All these characters are not available with this font...
abbass  Feb 04, 2017

Login to add a comment.

Privacy Policy  -  Contact
Links:  Planet Typography  -  On snot and fonts