next up previous contents index
Next: Type 1 Font File Up: Using t1lib Previous: Caveats   Contents   Index


Error Handling

Although every function usually returns meaningful values, there are situations where indicating an error via the return value is not possible. For example, requesting a charspace bounding box from a char of a font which is not loaded will return a bounding box containing all zeroes. This cannot be considered an error-condition since for characters like ``space'' it is correct to return a bounding box containing all zeroes. Furthermore, there's no consistent scheme which value should indicate what type of error. In order to allow a unified error handling in applications, the global variable T1_errno has been introduced.

The functionality of T1_errno is analogous to that of the global errno in C programs. T1_errno is once set to 0 when the library is initialized and never reset by any t1lib-function. It is set to specific values when specific types of errors appear. An application may then act appropriately and reset T1_errno. The errors that might appear can be roughly split into three categories as described below.



Subsections
next up previous contents index
Next: Type 1 Font File Up: Using t1lib Previous: Caveats   Contents   Index
2004-10-04