FreeType 2.0 I/O Frames

© 2000 David Turner ([email protected])
© 2000 The FreeType Development Team ([email protected])




 

Introduction:


I. What frames are:


II. Accessing and reading a frame with macros:


III. Alternatives:

    It is sometimes useful to read small integers from a font file without using a frame. Some functions have been introduced in FreeType 2 to do just that, and they are of the form FT_Read_xxxx.

    For example, FT_Read_Short( stream, &error ) reads and returns a 2-byte big-endian short from a stream, and place an error code in the error variable.

    Thus, reading a single big-endian integer is shorter than using a frame for it.

    Note that there is also the macros READ_xxx() which translate to:

      ( FT_Read_xxx(stream,&error), error != FT_Err_Ok )

    and can be used as in:

      if ( READ_UShort(variable1) || READ_ULong (variable2) ) goto Fail;

    when error and stream are already defined locally..