Forum How do I...?

Get the barcode font to display asterix correctly

hereticswithin
I am using fontface to define a link to a barcode font.and the output charachter is not the same as the input character

My Pdf.css file
defined the font and the class

@font-face {
font-family: eanbarcode;
font-style: normal;
font-weight: normal;
src: url("Barcode3of9_0.ttf")
}

.list .ean { font-family: eanbarcode; font-size: 100%; white-space: nowrap; line-height: 3cm }


The issue is that the * at the front and end of my barcode is converted to a +
Which of course makes it non-scannable.

The HTML received by Prince is
<td align="left" valign="top" bgcolor="#ffffff" width="1%" nowrap="" class="ean"><font class="repData" color="#000000">*5023242333809*</font></td>

Do I need to escape the * somehow..
The same behaviour is received If I use any FONT for a barcode...

help! ;-)
hereticswithin
Figured it out!
The reason for this was that the + is the next character in the ascii table and so I changed my text to an ). The character before the * and the output is now correct and scans correctly.
I feel that this maybe a bug with the Prince software though?
mikeday
Hmm, is Prince using the wrong glyph for the character?

Have you tried using a latest build?
hereticswithin
Hi Mike,
for testing purposes I am using a version locally which I downloaded yesterday,

Prince 9.0 rev 5
hereticswithin
and just checked my customers site. They are using the same version.
mikeday
Could you attach the font file and a simple test document here?
hereticswithin
No, its not working, Its using the wrong glyph for every character, they are all shifted by 1 char.
)5023242333809)
becomes
*613435344491*

How can this be!?
mikeday
I'm not sure. I can take a look, if you like.
hereticswithin
hi, yes, attached now.

I have removed the html due to the information held in it being on this public site..
However, I have reattached with slightly different data..

  1. Barcode3of9_0.ttf84.0 kB
    The font file
  2. SO1501012 - 201504161304 BARCODE.html7.1 kB
  3. pdf.css16.8 kB
    The css file

Edited by hereticswithin

mikeday
The problem is that the font has two charmaps that map characters to glyphs: an MS Symbol char map, and an Adobe Roman charmap. Unfortunately they are inconsistent with each other. Firefox is using the Adobe Roman charmap, which appears to be correct, and Prince is using the MS Symbol char map, which appears to be off by one as you noted.

I will investigate further and see if Prince behaviour is wrong, or if the font charmap is wrong.

In the meantime, there are various ways to workaround the problem by using different characters, or by removing the symbol charmap from the font, if you need an urgent fix.
hereticswithin
Mike

Glad that you appear to know what the issue is. And that you are able to investigate. Can you advise how I remove the symbol char map from the font?

C
mikeday
It will require a font editing tool.

It also may be possible for us to change Prince to check the Adobe Roman charmap first, before the MS Symbol charmap. I will investigate.