Sometimes the forums give me great ideas for write-ups which may be interesting to a lot of people. One forum thread, started by our very own OriginalGriff brought something to my attention: Often people think that it is only possible to use generated images to create or display barcodes. Some members replied to OG's post, stating that there are in fact fonts to display the barcode equivalent of a string (which is pretty awesome, you don't need to store any images to display a barcode).
I did a quick googling on that topic and found the Code 39 Barcode Font, introduced back in 1997 by Matthew Welch. Matthew was kind enough to leave his font in the public domain, allowing an unrestricted use of it to all of us!
The Code 39 font is a True Type font, meaning that it is available for all major browsers, programs and operating systems. "True Type" is a font standard to display fonts on screens and printers. The standard is integrated with Microsoft Windows and MacOS and available in Linux/Unix Environments under the name "FreeType". In difference to Bitmap-Based fonts, True Type fonts are based on vector graphics. The original True Type formate was introduced by the Apple Lead Engineer Sampo Kaasila, even though it was called "Bass" at first. True Type fonts were available within Windows since Windows 3.1, Apple introduced them a bit earlier in System 7.
Using the font within HTML
Modern browsers support True Type fonts embedded in the HTML, e.g. you can even use the Code 39 font within your HTML page (and with HTML I'm also referring to PHP, ASP.Net and all the other Web technologies). w3schools.com lists the browsers which support True Type fonts, currently all modern browsers support them (IE was a bit late to the party, versions before IE 9 do not support TTFs).
Whatsoever, to use a true type font within your HTML page you can simply use CSS3:
If you now set a Textbox' CSS class to "barcode", the text you set to it will be displayed as 3 of 9 Barcode.
Using the font with Desktop applications
Most of the common Desktop developmente frameworks (Qt, Java and .Net) use the fonts installed on then system. To install a True Type font to your system, just double-click the the font file (the one with the *.ttf extension) and then click on "Install" in the newly opened Window. After you have installed the font you can set it as font for your control in the Desing mode of your IDE. Please remember that you have to deploy and install the font with your program if you are using it within.
A big "Thank you!" goes out to Matthew Welch who developed the Code39 font and made it available to the public domain. If you decided to use his font, drop him an email at firstname.lastname@example.org to thank him.