next up previous contents index
Next: The t1lib Configuration File Up: Runtime-Setup Previous: Runtime-Setup   Contents   Index

Searchpath and Environment Setup

t1lib basically needs four types of files: In order to tell t1lib where these files are located in the filesystem, a configuration file usually has to be set up by the user. At time of initialization (see [*] on page [*]) the library tries to locate all data it needs immediately or possibly later. The following actions take place in order:
  1. The library tries to read the variable T1LIB_CONFIG from the program's environment. The value of this variable is expected to be the pathname of a configuration file for t1lib.
  2. If the variable T1LIB_CONFIG exists, the file pointed to by this variable will be tried to be opened. In case no environment variable exists, the library will attempt to open a file called .t1librc in the user's home directory. If this file as well does not exist, the global configuration file t1lib.config is tried to be opened.1 If all these attempts to open a configuration file did not succeed, all searchpaths are left at defaults (.) and the font database file is setup to be ./FontDataBase. If this file cannot be opened, the call to T1_InitLib() returns a NULL-pointer thus indicating an error condition. The program should then exit because t1lib would not be able to do anything without an association of font IDs to font files.
  3. Assuming a configuration file has been found and opened at any of the above three locations, this file is parsed and all relevant information in this file is recorded.
  4. Using the paths specified in the configuration file, the font database is opened and processed. The existence of every Type 1 file that might later be needed is ensured. The existence of the corresponding AFM file is not verified during initialization, because this information is not ultimatively critical when generating a character bitmap.2 Aside from this, t1lib can generate the required part of the AFM information on the fly.


next up previous contents index
Next: The t1lib Configuration File Up: Runtime-Setup Previous: Runtime-Setup   Contents   Index
2005-01-12