Chapter Contents |
Previous |
Next |
The GKEYMAP Procedure |
About Key Maps and Device Maps |
The characters A through Z (upper- and lowercase), 0 through 9, and many symbols and national characters are represented by a set of hexadecimal codes. However, a character may be represented by one code for the keyboard, another code for the operating environment, and yet another for the output device. To resolve these differences, SAS/GRAPH software stores all characters using its own internal encoding scheme, which is a set of hexadecimal values that are associated with all supported characters. SAS/GRAPH Internal Character Encoding shows these internal character encoding (ICE) codes.
To accommodate differences in the encoding of characters, you must be able to translate the hexadecimal codes generated by your keyboard or operating environment into the corresponding SAS/GRAPH internal encoding. A key map gives you this ability.
You also must be able to convert the internal encoding that is used by SAS/GRAPHsoftware to the codes required to produce the corresponding hardware characters on your output device. A device map gives you this ability.
SAS/GRAPH Internal Character Encoding
A key map changes the code generated by a keyboard key to the value corresponding to the SAS/GRAPH internal character encoding. Otherwise, a different character (or no character) may be drawn when the character is requested in a SAS/GRAPH software font.
Note: In
SAS/GRAPH Internal Character Encoding, the diacritic characters specified
by the codes D2 through DB are backspaced before being drawn and can be used
to create new characters (characters resulting from codes B0 through B7, B9,
and BA are not backspaced before being drawn). See Modifying a Key Map for an example
of using a diacritic character as an accent. Two commonly used characters
have already been created for you: the character located in position F0 of
the ICE table could be created by combining DA with an uppercase C, and the
character located in position BC could be created by combining DB with an
uppercase G.
You usually use device maps in these two situations:
For example, if you use the GKEYMAP procedure to generate a key map called MYKEYMAP, you can specify it with a statement like this:
goptions keymap=mykeymap;
Once you specify MYKEYMAP as your current key map, you can press a key and the code it generates is translated by MYKEYMAP into the ICE code that is specified by the key map.
When you specify a device map with the DEVMAP= graphics
option and you use a hardware character set, mapped characters are converted
from their SAS/GRAPH internal encoding
to the codes required to display the corresponding characters on your device.
See Graphics Options and Device Parameters Dictionary
for more information on the KEYMAP= and DEVMAP= graphics options.
To see what characters in a font can be displayed if a particular key map is used, do the following:
The hexadecimal values and corresponding font characters that are displayed are the ones available under the specified map. If the map is not symmetrical, a warning is issued. See The GFONT Procedure for more information on using hexadecimal values to display special characters.
About the GKEYMAP Data Set |
To provide information on the character mapping that is to be performed for a key map or a device map, you must use a variable named FROM to specify the character that you are mapping from, and a variable named TO to specify the character to map to. For key maps, these are the only variables in the data set. For device maps, you may also need variables named CHARTYPE and TOLEN.
Here are definitions for these variables:
All of the characters in the TO string for a particular FROM value must use the same character set. The CHARTYPE variable is required if you use the MULTFONT option in the PROC GKEYMAP statement; otherwise, it is ignored. (The CHARTYPE variable is always ignored when you are creating a key map.) The CHARTYPE value must match a value listed in the Chartype field in the Chartype window of the device entry for the device to which the map is applied. However, you can set the CHARTYPE variable to a missing value to specify that the character can be drawn in any hardware character set.
Featured in: | Modifying a Key Map |
For device maps, if the TO variable contains more than one character, you must also specify TYPE=MAP1N in the PROC GKEYMAP statement to indicate that a single FROM character is being mapped to multiple TO characters. In addition, you must include the TOLEN variable in the data set to specify the length of each TO string. If you specify TYPE=MAP11 in the PROC GKEYMAP statement or if you do not use the TYPE= option, only the first byte of the TO string is recognized.
Featured in: | Modifying a Key Map |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.