Table of Contents
The feature 50 (center overlay) is introduced in version 5.3. This feature allows users to specify a pattern string in the input to construct a pattern in the center of the QR code. It supports two syntaxes:
~50[rows,cols,pattern]. For example
~50[7,7,007c6c446c7c]
~50[:keyword]. Currently the encoder supports only one keyword:
swiss7
. Using :swiss7 allows user to constructs a compliant Swiss payment QR Code.
The first method to use the feature is to specify the exact bit pattern of overlaid
image. The string format is rows, cols, pattern
.
To get the bit string, first convert all black pixels to 1 and white to 0. Each row must end at byte boundary with 0s appended. Convert 4 bits into a hexadecimal character (0-9, a-f). Trailing zeros can be omitted.
The image below has 7 pixels per row so add 0
to make it 8 bits per row. Convert the bits to hexadecimal value we get the string 007c6c446c7c00
. Because the encoder knows the number of rows and columns from
preceding parameter, the trailing zeros can be omitted. Therefore, both 007c6c446c7c00
and 007c6c446c7c
are valid.
In the center overlay pattern each unit has identical width and height, which are equal to the module width of the QR code (X dimension). Therefore, not all bitmaps can be implemented in this way while maintaining its size. Generally speaking, you can only implement simple bitmaps in this way, unless the QR code has a large size.
The current Swiss payment standard requires the QR code to have
a fixed size at 46 mm with a 7 x 7 mm swiss logo overlaid at the center. To
implement such a QR code, you will need to come up different pattern strings
for each QR code size. The keyword syntax greatly reduces the work; as all you need
is to insert ~50[:swiss7]
in the data encoded, and choose the
appropriate font and font size. Internally the encoder engine selects an overlay string
automatically based on the final size of the QR Code.
Note
The minimum Version to overlay a swiss logo is 6. If the version requested is less than 6, the engine will increase it to 6. If the version requested is less than 6 and the modifier byte forbids the increase, an error is returned.
You can use the MRV QRCode
font to produce the Swiss payment barcode.
However you need to set the font size accordingly based on the Version of the symbol in
order to achieve the required 46 mm x 46 mm size. The table below calculate the font size.
Table E.1. QRCode Font and Size Selection
Version | No. of Modules | Module width (mm) | Font | Font Size |
---|---|---|---|---|
6 | 41 | 1.12 | MRV QRCode | 12.72 |
7 | 45 | 1.02 | MRV QRCode | 11.59 |
8 | 49 | 0.94 | MRV QRCode | 10.64 |
9 | 53 | 0.87 | MRV QRCode | 9.84 |
10 | 57 | 0.80 | MRV QRCode | 9.15 |
11 | 61 | 0.75 | MRV QRCode | 8.55 |
12 | 65 | 0.70 | MRV QRCode | 8.02 |
13 | 69 | 0.67 | MRV QRCode | 7.56 |
14 | 73 | 0.63 | MRV QRCode | 7.14 |
15 | 77 | 0.60 | MRV QRCode | 6.77 |
16 | 81 | 0.57 | MRV QRCode | 6.44 |
17 | 85 | 0.54 | MRV QRCode | 6.14 |
18 | 89 | 0.52 | MRV QRCode | 5.86 |
19 | 93 | 0.49 | MRV QRCode | 5.61 |
20 | 97 | 0.47 | MRV QRCode | 5.38 |
21 | 101 | 0.45 | MRV QRCode | 5.16 |
22 | 105 | 0.44 | MRV QRCode | 4.97 |
Many software do not allow fractional font sizes. To work around the issue, version 5.3 release includes a series
of true type fonts that produce the same results at 12 points. The font name is MRV QRCode-SwissN, where
N is the version number. For example, font MRV QRCode-Swiss20
is designed
to format a Version 20 QR Code, and the ended symbol has a size of 46mm x 46mm.
Note that those accuracy fonts are not installed by default. In order to install the fonts into the system, run the installer and select feature "Fonts for Swiss Payment". You can install each font individually.
Table E.2. Swiss Font and Size Selection
Version | No. of Modules | Module width (mm) | Font | Font Size |
---|---|---|---|---|
6 | 41 | 1.12 | MRV QRCode-Swiss6 | 12 |
7 | 45 | 1.02 | MRV QRCode-Swiss7 | 12 |
8 | 49 | 0.94 | MRV QRCode-Swiss8 | 12 |
9 | 53 | 0.87 | MRV QRCode-Swiss9 | 12 |
10 | 57 | 0.80 | MRV QRCode-Swiss10 | 12 |
11 | 61 | 0.75 | MRV QRCode-Swiss11 | 12 |
12 | 65 | 0.70 | MRV QRCode-Swiss12 | 12 |
13 | 69 | 0.67 | MRV QRCode-Swiss13 | 12 |
14 | 73 | 0.63 | MRV QRCode-Swiss14 | 12 |
15 | 77 | 0.60 | MRV QRCode-Swiss15 | 12 |
16 | 81 | 0.57 | MRV QRCode-Swiss16 | 12 |
17 | 85 | 0.54 | MRV QRCode-Swiss17 | 12 |
18 | 89 | 0.52 | MRV QRCode-Swiss18 | 12 |
19 | 93 | 0.49 | MRV QRCode-Swiss19 | 12 |
20 | 97 | 0.47 | MRV QRCode-Swiss20 | 12 |
21 | 101 | 0.45 | MRV QRCode-Swiss21 | 12 |
22 | 105 | 0.44 | MRV QRCode-Swiss22 | 12 |