3.1. X-dimension

Although font characters scale linearly and print any sizes required, not all sizes will produce best quality barcodes. The reason is that printers can only address individual pixels instead of a length specified in inches or centimeters. For example, a printer dot measures 3.33 mils on a 300-dpi printer. Certainly you can not print a size smaller than 3.33 mils. And you can not consistently print a length of 5 mils, because this printer either prints 3.33 mils, or 6.66 mils in this case. We call a font size optimal when the dots produced always remain constant. This is vital to small size barcodes where the barcode quality largely depends on the constant width of elements. On the other side, this is usually not a problem when X dimension is big enough especialy at normal sizes (such as 15 and 20 mils).

The optimal sizes for this version Code39 fonts are integral times of 4 on a 300-dpi printer and integral times of 2 on a 600-dpi printer. To quickly locate the font size based on X-dimension requirement, use the table below:

Table 3.1. X Dimensions List

Font Size X Dimension Font Size X Dimension
6 pt 5 mils 0.013 cm 28 pt 23 mils 0.059 cm
8 pt 7 mils 0.017 cm 30 pt 25 mils 0.063 cm
10 pt 8 mils 0.021 cm 32 pt 26 mils 0.065 cm
12 pt 10 mils 0.025 cm 34 pt 28 mils 0.071 cm
14 pt 12 mils 0.029 cm 36 pt 30 mils 0.076 cm
16 pt 13 mils 0.034 cm 38 pt 31 mils 0.080 cm
18 pt 15 mils 0.038 cm 40 pt 33 mils 0.084 cm
20 pt 17 mils 0.042 cm 42 pt 35 mils 0.088 cm
22 pt 18 mils 0.046 cm 44 pt 36 mils 0.092 cm
24 pt 20 mils 0.050 cm 46 pt 38 mils 0.097 cm
26 pt 22 mils 0.055 cm 48 pt 40 mils 0.101 cm

For example, suppose that X-dimension required is 15 mils, from Table 3.1, “X Dimensions List”, the optimal size is 18 points on 600-dpi printers, or 20 points. [2]

Many barcode standards require that a code 3 of 9 barcode to have a X-dimension at 7.5 mils or above on open systems. To meet this requirement, the font size should be at least 8 points.

Sometimes a requirement does not specify X-dimension. Instead, it gives the requirement of overall length or character per inch (cpi). Fortunately it is easy to derive X dimension from barcode length. A Code39 character always has 3 wide elements and 7 narrow elements [3]. When N (the ratio of the nominal wide element width to the nominal narrow-element width) is 3.0, the width of a code39 character is 16 times X dimension.

For example, assume that barcode density specified is is 8 characters per inch (including extra start and stop characters). It translates into 1/8" per character. Divide the value by 16 we get X dimension 0.008 inch. From the X-dimension table, assume that the printer has a resolution of 600 dpi, the font size to be used should be 10 points.



[2] Note that 18 pt is not an optimal size for 300-dpi printer, although the barcode printed might pass scan testing.

[3] Some specifications say that a code39 character consists of 9 elements, among which 3 are wide. This is how the name "3 of 9" comes from. This statement is correct. However, it did not take the inter-character gap into count. According to the code39 standard, a blank element with equal to X-dimension is required between characters. To simplify the calculation, we count this element in the character.