{barcode} encodes its first parameter as a one-dimensional barcode and writes
it as inline SVG (tags/_lib/barcode.php) - the bars of a product, a ticket or a parcel
label, drawn on the server, no font or image needed.
Without type the tag decides by the text: twelve or thirteen digits are an
EAN-13, anything else Code 128. An EAN-13, EAN-8 or UPC-A number may be written without its
check digit, which is then computed and added; a number written with it has the digit
checked. These codes draw their guard bars longer and set the digits under the bars in their
groups. Code 128 takes printable ASCII, and packs a run of four digits or more two to a
symbol, so long numbers stay short.
scale is the width of the thinnest bar; keep it at 2 or more for a printed
label a scanner has to read. plain leaves the human-readable digits out. The
colours are fixed - black on white unless color and background say
otherwise - since a scanner needs the contrast.
A wrong check digit, a wrong length for the type, a character Code 128 cannot hold or an unknown type is an error under the strict check, and the tag writes nothing. For a code a phone camera reads, see {qr}.