Chapter 4. Selecting Fonts

Our font is relatively small in size so you can have more fonts residing in your printer, and you can select your desired font by specifying a couple of factors such as Symbol Set, Pitch, Height, Typeface Family, and Font ID.

4.1. Symbol Set Command

The symbol set command selects the font based on the symbol set. The command format takes such form:

    <ESC>(ID 

Where ID is the symbol set value. For example, to select Code39 barcode, use command

    <esc>(0Y

Some symbol set values are listed in the table below. More values can be found in the appendix.

Symbol SetSymbol Set ID
Code 390Y
UPC-A8Y
POSTNET15Y
OCR-A0O
OCR-B1O

4.2. Pitch Command

<esc>(s#H

where # is the pitch value in cpi (Character per inch). If a pitch specified is not available, the next greater available pitch is selected. If no greater value is available, the closest available less value is selected.

For example, to select a 10 pitch font, send

<esc>(s10H 

4.3. Height Command

<esc>(s#V

where # is the height of the font in points. If the requested height is unavailable, the closest height is selected.

For example, to select a 12-point font, send

<esc>(s12V

4.4. Typeface Family Command

<esc>(s#T

A typeface designates the design of the font. In HP PCL it is identified by a two-byte value. The typeface family values are found in Table A.2, “Typeface Family Values”

4.5. Font ID

A font ID is assigned when the font is downloaded into printer. The name number can be used to select the font. The command takes the following form:

<esc>(#X

Where # is the font ID of the soft font.

If the designated font is not present, the current font is used.

4.6. Best Practice

If you just need to install less than 5 soft fonts to a printer, you may assign each one Font ID and select the font by the ID. If you want to avoid font confliction, you may consider select by Symbol Set with Height or Pitch. By not hard coding Font ID in your application, it makes your application more portable.

4.7. Adding Human Readable Text

To be compatible with the original HP package, the PCL fonts in this package do not have human readable text characters. It is easy to add text with a separate print command. The following example select the default font (command <esc>(3@ ), and print the human readable below the barcode:

fprintf(prn, "\0x1B(0Y\0x1B(s0p4h12.0");
fprintf(prn, "*PN18906*");
fprintf(prn, "\0x1B(3@\n");
frpintf(prn, "PN18906"); 

4.8. Barcode String

Many people mistakenly believe that a barcode can be made easily by formatting the data encoded with the barcode font. Unfortunately, that only yields an un-readable barcode. There are a couple of reasons:

  • To tell the scanner where the barcode starts and ends, most of barcode formats require a start character and an end character.

  • Some barcode formats require one or two checksum characters. The checksum character is to ensure data integrity.

  • Compact barcode formats, such as Code 128, UPC-A and Interleaved 2 of 5, have very special encoding. In short, the same digit may have several encoding patterns.

The simplest barcode format is Code 39 (Code 3 of 9). All you need is to add two asterisks - one at the beginning, another one at the end of the data. For example, to encode 123-ABC you just need to enter *123-ABC* and format the latter with Morovia Code 39 fonts. Other cases may be more complicated [2].



[2] Please note that the character mapping in this package is different than the other ones from Morovia. This ensures the maximum compatibility with your legacy application. The Morovia Font Tools source code package is designed to work with Morovia Fontware product series.

Do you know?

This manual is specific to PCL Barcodes & More 1.5.
The current version is 1.5.0.

This Manual is also available in the following format: PDF.