
loadunimap Command in Linux
The loadunimap command in Linux is used to load the kernel unicode-to-font mapping table. Although its functionality is now built into the setfont command, loadunimap is still available for backward compatibility.
The loadunimap command in Linux is used to load the kernel unicode-to-font mapping table. This command is particularly useful for setting up the correct mapping between Unicode characters and the console font. Although its functionality is now integrated into the setfont command, loadunimap is still available for backward compatibility.
Table of Contents
Here is a comprehensive guide to the options available with the loadunimap command −
- Understanding loadunimap Command
- Syntax of loadunimap Command
- loadunimap Command Options
- Examples of loadunimap Command in Linux
Understanding loadunimap Command
The loadunimap command in Linux is used to load the kernel unicode-to-font mapping table. This command is particularly useful for setting up the correct mapping between Unicode characters and the console font. Although its functionality is now integrated into the setfont command, loadunimap is still available for backward compatibility.
Syntax of loadunimap Command
The basic syntax for the loadunimap command is −
loadunimap [options] [unimap_file]
unimap_file − This is the path to the Unicode map file you want to load.
loadunimap Command Options
- -C console − Specifies the console device to use. This is useful when working with multiple consoles.
- -o oldmap − Saves the old map to the specified file before loading the new map. This is useful for backup purposes.
Examples of loadunimap Command in Linux
Here are some detailed examples of how to use the loadunimap command −
Load a Specific Unicode Map
This command loads the specified unicode map file into the kernel unicode-to-font mapping table. Replace /path/to/unicode.map with the actual path to your unicode map file.
loadunimap /path/to/unicode.map

Load the Default Unicode Map
If no map is specified, the default unicode map (def.uni) is loaded. This is useful if you want to reset to the default mapping.
loadunimap

Save the Old Map
This command loads the new unicode map (/path/to/newmap.uni) and saves the old map to the specified file (/path/to/oldmap.uni). This is useful for backup purposes.
loadunimap -o /path/to/oldmap.uni /path/to/newmap.uni

Specify Console Device
-C console specifies the console device to use. This is useful when working with multiple consoles.
This command loads the specified unicode map for a specific console device (/dev/tty1). This is useful if you are working with multiple consoles.
loadunimap -C /dev/tty1 /path/to/unicode.map

Note − -o oldmap: Saves the old map to the specified file before loading the new map. This is useful for backup purposes.
Resetting to Default Mapping
This command resets the unicode-to-font mapping to the default settings.
loadunimap

Loading a Custom Mapping
This command loads a custom unicode map located at /lib/kbd/unimaps/custom.uni.
loadunimap /lib/kbd/unimaps/custom.uni

Switching Between Consoles
This command loads an alternate unicode map for the console device /dev/tty2.
loadunimap -C /dev/tty2 /lib/kbd/unimaps/alternate.uni

Backing Up and Loading a New Map
This command backs up the current unicode map to /lib/kbd/unimaps/backup.uni and then loads the new map from /lib/kbd/unimaps/newmap.uni.
loadunimap -o /lib/kbd/unimaps/backup.uni /lib/kbd/unimaps/newmap.uni

These examples should give you a good starting point for using loadunimap in various scenarios. You can find more details on the Linux man page.
Loading a Specific Unicode Map
This command loads the Lat15-Terminus24.psf.gz font map, which is a popular choice for console fonts. It defines the mapping between Unicode characters and the glyphs in the Terminus24 font.
loadunimap /usr/share/consolefonts/Lat15-Terminus24.psf.gz

Loading the Default Unicode Map
Without specifying a map file, loadunimap loads the default Unicode map, which is usually determined by the system's configuration. This map provides basic character support for most common languages.
loadunimap

Checking the Current Unicode Map
To check the currently loaded Unicode map, you can use the showfont command −
showfont

This will display information about the current font, including the Unicode mapping table.
Load a Specific Unicode Map
This command loads the specified unicode map file into the kernel unicode-to-font mapping table. Replace /path/to/unicode.map with the actual path to your unicode map file.
loadunimap /path/to/unicode.map

Load the Default Unicode Map
If no map is specified, the default unicode map (def.uni) is loaded. This is useful if you want to reset to the default mapping.
loadunimap

Save the Old Map
This command loads the new unicode map (/path/to/newmap.uni) and saves the old map to the specified file (/path/to/oldmap.uni). This is useful for backup purposes.
loadunimap -o /path/to/oldmap.uni /path/to/newmap.uni

Specify Console Device
This command loads the specified unicode map for a specific console device (/dev/tty1). This is useful if you are working with multiple consoles.
loadunimap -C /dev/tty1 /path/to/unicode.map

Resetting to Default Mapping
This command resets the unicode-to-font mapping to the default settings.
loadunimap

Loading a Custom Mapping
This command loads a custom unicode map located at /lib/kbd/unimaps/custom.uni.
loadunimap /lib/kbd/unimaps/custom.uni

Switching Between Consoles
This command loads an alternate unicode map for the console device /dev/tty2.
loadunimap -C /dev/tty2 /lib/kbd/unimaps/alternate.uni

Backing Up and Loading a New Map
This command backs up the current unicode map to /lib/kbd/unimaps/backup.uni and then loads the new map from /lib/kbd/unimaps/newmap.uni.
loadunimap -o /lib/kbd/unimaps/backup.uni /lib/kbd/unimaps/newmap.uni

These examples should give you a good starting point for using loadunimap in various scenarios. You can find more details on the Linux man page.
Important Considerations −
- Font Availability − Ensure that the fonts referenced in the Unicode map are installed on your system.
- Kernel Configuration − The kernel must be configured to support Unicode and the necessary font modules.
- Console Font − The Unicode map is primarily used for console fonts. For GUI applications, font selection is handled by the window manager and the specific applications.
- Custom Unicode Maps − You can create custom Unicode maps to support specific character sets or fonts. However, this requires knowledge of font formats and Unicode encoding.
Conclusion
By understanding the loadunimap command and its usage, you can effectively manage Unicode character rendering on your Linux system, particularly in console environments.
While loadunimap is still available for backward compatibility, its functionality is often integrated into other tools like setfont or the system's font configuration.