By making the logical units closest to the integral times of the width of a pixel, we calculate the magic numbers as shown in the table below:
Table 6.3. Magic numbers
| dpi (dots per inch) | pixel size in mils | magic numbers (in mils) |
|---|---|---|
| 96 | 10.42 | 21, 31 |
| 150 | 6.67 | 14, 20 |
| 203 | 4.93 | 10, 15 |
| 240 | 4.17 | 8, 13, 17 |
| 300 | 3.33 | 7, 10, 14 |
| 600 | 1.67 | 7, 9, 10, 12 |
From the table above, the smallest width achievable on a 203-dpi
thermal printer is 10 mils. On a low-resolution printer you can
not achieve high precision - the achievable smallest width on a
203
dpi thermal printer is 5 mils and on the computer screen it is around
10 mils.
When you create barcodes under the screen
resolution (96 dpi), you end up with a big X dimension value - 21
mils. As previously analyzed, 1X does not work very well because
the accumulated rounding errors may result in a complete loss of
an element.