Appendix A. Font Character Set

In some circumstances, it is desirable to substitute the font with the custom drawing routines. This section explains the mapping of each character in the font.

The basic element in a QR codeis a square cell called module, in either black or white. If 1 represents a black module and 0 represents a white module, we can use an array of strings to represent a QR barcode. The result is further compressed by combining adjacent cells into a character. In QRCode font, four vertical modules are merged into one character, as illustrated below:

Figure A.1. QRCode Font Character Set

QRCode Font Character Set

The QRCode font uses 16 characters (0-9, A-F) to represent 16 possible scenarios. To draw the QRCode barcode from the encoding results, you have two options:

  • Convert the encoding results to an array of string consisting of 1 and 0 only, and draw cells from the left to the right, and from the top to the bottom.

  • Create a drawing routine to draw these 16 glyphs. Scan the encoding results and call the routine one by one.

When designing drawing routines, you may also consider joining adjacent dark cells into polygons to reduce the number of drawing commands.