Utilizing AFP Font Maps To Customize Font Display

Font Maps enable companies to standardize how AFP documents display by overriding the internal font objects with custom fonts and styles. Created as simple ASCII files, AFP font maps can be edited by users to define their own font definitions including font type, point size, color, and style.

Snowbound’s RasterMaster imaging SDK automatically loads the snbd_map.fnt file if it is found in one of the following directories: the \Windows directory, the directory into which images are being read, or the directory where your application exists as long as you are not changing directories with a dialog box.

Format of Font Mapping Data

Any AFP font name can now be mapped to the following:

  • face name
  • point size
  • bold attributes
  • italic attributes

The snbd_map.fnt file is a simple ASCII text file. Each entry is ended with a carriage return. For Example:

C0BC25I3,Courier,10,0,0

Variable Description
C0BC25I3 Font resource name in the AFP file.
Courier New face name to map to.
10 New size in points or 1/72 of an inch.
0 Bold attribute, 0 - off , 1 - on
0 Italic attribute 0 - off, 1 - on
 
   

Setting the path of the font mapping file using IMGLOW_set_fontmap_path()

int SNBDAPI IMGLOW_set_fontmap_path(char *path);

Variable Description
path A string pointer to the path to look for the snbd_map.fnt file. The
snbd_map.fnt file will be appended to the path name.
 
   

Setting font mapping using IMGLOW_set_fontmap()

int SNBDAPI IMGLOW_set_fontmap(char *font_map, int maplength);

Variable Description
font_map Pointer to font mapping data
maplength The integer length of font mapping data
 
   

More Information

For more information on how to identify and resolve font configuration issues, please see Configuring Support for Non-English Characters and Non-standard Fonts.

Category:

Online Demo