next up previous contents index
Next: The t1lib-Logfile Up: Initialization of t1lib and Previous: Summary of Search Path   Contents   Index


Bypassing the t1lib File Search Machinery

Usually, t1lib takes care for locating files according to the path specifications in the configuration file. There might, however, arise the need to explicitly tell t1lib which particular file to use. Forcing t1lib to use particular Type 1 font files can be achieved using the function T1_AddFont(), described just above. If a pathname passed to this function is a complete path, t1lib will use this complete path to locate the font file, forgetting about its own search path list. A filename path is assumed to be complete if If a font file whose complete path had been specified could not be found by t1lib, the paths from the configuration file are searched as a fallback mechanism.

What can be done for the Type 1 font files is also possible for AFM files, which are needed on a per-font basis. The function

 int T1_SetAfmFileName( int FontID, char *afm_name)

to 0pt \fbox{$\mathcal{F}()\Rightarrow$} allows to set the complete path of the AFM file belonging to the font identified by FontID, overriding the internal search mechanism. This function is to be called after initialization but before the font FontID is loaded. It returns 0 if all goes right and $-1$ otherwise. In the latter case T1_errno will also be set appropriately. Notice that FontID must also be valid with respect to its upper limit, it is an error condition if the font database has less than FontID entries.

There is also the function

 char *T1_GetAfmFileName( int FontID)

to 0pt \fbox{$\mathcal{F}()\Rightarrow$} which allows to query the AFM filename of a font. It returns a pointer to the filename if it had explicitly been specified or NULL otherwise. NULL will also be returned if FontID was invalid. In this case also T1_errno will be set.

Just for the sake of completeness we should mention that what has been said about absolute and relative path specification also applies to pathnames for encoding files (see [*]).


next up previous contents index
Next: The t1lib-Logfile Up: Initialization of t1lib and Previous: Summary of Search Path   Contents   Index
2004-10-04