View Full Version : Resolved How do I get my CSS to use my barcode font ??

12-15-2010, 12:22 AM
I have a simple test page, and I'm trying to get some of the content to print out in a 3of9 barcode font (39251.ttf) I downloaded and installed.
I tested the font in OpenOfcWriter, and everything checks out.

I installed that font on the host machine (local), and on my development machine.

The target line of code reads: <p class="barcode">12345678</p>
And here's an example of what I'm trying in my CSS: p.barcode{ font:39251; }
NOTE: Other adjustments such as p.barcode{ font-size-adjust:2; } and p.barcode{ color:red; } work just fine.

What am I missing??
~ Mo

12-15-2010, 01:23 AM
This is an example of something I have. You will need to modify it for your font.

.barcode {
font-family:"Barcode 3 of 9";
mso-bidi-font-family:"Berlin Sans FB";

<p> <span class="barcode">*615$I*</span></p>

12-15-2010, 02:55 AM
If that doesn't work, this CSS3 technique (http://www.zenelements.com/blog/css3-embed-font-face/) might help.

12-15-2010, 04:52 AM
Thanks WJ. That gave me enough info for me to figure it out.
For Posterity, here's what I've boiled down to: .barcode{ font-family:'Free 3 of 9', '39251'; }
(don't forget the quotes)

And Optimus, thanks for that CSS3 solution. I am definitely putting that to use when I come around to refactor (right now, though, I just need to get it done :)).

Thanks a bunch.