Printing Line Drawing - Box Characters in AIX


Contents

About this document
Character set translation
What has changed between AIX 3.2.5 and AIX 4?
Printing the boxes and lines

About this document

This document describes how to print ASCII line drawing characters at all levels of AIX Version 4. At AIX Version 3.2.5, lines and boxes tend to print like other ASCII characters. At AIX Version 4.1 and above, they print like symbols or not at all.

This document applies to all levels of AIX 4 and to text documents containing PC type line drawing characters.


Character set translation

Most modern printers have multiple character sets that allow them to print standard text characters and special characters, such as characters specific to certain languages. AIX also supports multiple character sets to allow users in different countries using different languages to display readable text. The default AIX character set is based on the locale or LANG variable of the operating system.

The AIX virtual printer for text documents executes a character translation from the user's locale character set to a character set on the printer that matches the character from the user's locale character set. This is done by first translating each character to an intermediate character set by a stage one translation filter, and then from the intermediate character set to one of the characters in one of the printer's character sets. When switching from one printer character set to another, a command is also added to change the printer's character set. This usually only applies to characters with an ASCII code higher than 127.

The pseudocode for this operation follows:

   trans1:
      Find the character set from the _X virtual printer attribute.
      Convert the ASCII code from the _X defained character set to the
         intermediate character set.
   trans2:
      Set the printer character set to the default printer character
         set as defined by the 'c1' attribute.
      Read the character from the intermediate file.
      Look for a match in the currently defined printer character set.
      If the character is found in the current set
         Translate the ASCII code in the intermediate table to the
              printer character set ASCII code.
         Output the translated character.
      Else
         Check for the character in each of the other printer character sets.
         If the character is found
             Change the currently defined printer character set.
             Output a command to the printer to change character sets.
             Translate the ASCII code to the new printer character set.
             Output the translated character.
      EndIf

What has changed between AIX 3.2.5 and AIX 4?


Printing the boxes and lines

The solution is to change the _X virtual printer attribute to a code page (character set0), that contains the box characters. In the US, change the virtual printer value to _X=IBM-850 with lsvirprt, or print with qprt -XIBM-850.

The boxes will look different from printer to printer, but the following box will illustrate what you may see on the printer.

	ÚÄÄÄÄÄÄÄÄÄÄÄ¿
	³ Box Test  ³
	³ Cent ½    ³
	ÀÄÄÄÄÄÄÄÄÄÄÄÙ

Save this document from your browser to AIX file /tmp/testbox.txt. If you print this text (or the source of this document), with the command qprt -X IBM-850 /tmp/testbox.txt, it will print a box to most ASCII printers.

To change the virtual printer, follow these steps:

  1. Enter: lsvirprt
  2. Choose the printer.
  3. From input line enter:
      	X=IBM-850
    

NOTE: For non-US locations, change the _X attribute to an equivalent 850 codepage in the language required. There must be a matching file in /usr/lib/lpd/pio/trans1.


[ Doc Ref: 9174713089882     Publish Date: Feb. 13, 2001]