views:

1637

answers:

7

I'm working on a small app where I can generate a list of barcodes. I have the correct fonts installed on my computer. Right now I am printing them directly to a webpage and it works properly in Chrome and IE 7, but not Firefox. Does anyone know what Firefox would be doing differently than IE and Chrome?

Here is my code:

<html>
    <head>
        <title>Barcode Font Test</title>

        <style type="text/css" media="screen">
            .barcode { font-family: "wasp 39 m", verdana, calibri; font-size: 36pt; }
        </style>
    </head>

    <body>
        <div class="barcode">*574656*</div>
    </body>
</html>

EDIT: I probably should have mentioned that this is more of a personal project at the moment and not meant to be released to the world. While I will take a solution that works, I would like something that does not involve Javascript/Flash/etc.

+2  A: 

Using non-standard fonts on web pages is a big pain in the ass. To make it easier you can use sIFR or the new typeface.js.

eyelidlessness
That's right, but it is not the problem that rodey experiences. He said he has that font installed on his computer and the question makes it seem that the tests he did were performed on his local machine.
hangy
Well, even with that being the case, my answer might benefit others who want a complete public-facing solution.
eyelidlessness
+1  A: 

At the company i'm working at now we use BarCode.dll of lesnikowski.com. It generates barcode images. It doesn't depend whether or not the font is installed on the client pc and works with all browser.

Hope this helps.

norbertB
+4  A: 

The Mozilla developers made a choice for symbol fonts to not work. You can enable them in the config as described in Getting Symbol Fonts to Work in Mozilla Firefox

Greg
This does not appear to work for Firefox 3. The author does not state which version(s) of Firefox this works for.
rodey
A: 

We have the same problem at my company. Luckily, only 1-2 people ever need to use the barcode fonts.

We have found that when they received new a PC, the fonts didn't work through any browsers. They had to open up a client application (like Word), choose a barcode font, and do some typing to "initialize" that font.

The best solution, I think, is to create a barcode image on the server on demand. The problem with this solution could be cleaning up old images. This solution requires more work up-front but pays off with less on-going issues and maintenance than the client side solution, in my opinion.

Chad Braun-Duin
A: 

A simpler solution might be to generate images server side to generate the bar codes. That way you don't have to rely on the user having a font installed and you don't have to access the font in your html.

Rune Grimstad
+2  A: 
Doug L.
A: 

Fonts tend to have problems because it relies on the browser to do the rendering. Image is better. I use Morovia Barcode Active Lite to create barcodes from IIS.