freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Optional fields and stream reading in WOFF2


From: Werner LEMBERG
Subject: Re: [ft-devel] Optional fields and stream reading in WOFF2
Date: Thu, 13 Jun 2019 11:10:59 +0200 (CEST)

> [...] what is the point of using `FT_GET_XXX' if I can't use
> `FT_STREAM_SEEK' or `FT_STREAM_POS'?  How do I decide whether to use
> `FT_READ_XXX' or `FT_GET_XXX'?

FT_GET_XXX' calls are to be used within a frame (which sets up
`stream->cursor' and `stream->limit').

However, if you have to jump around in a file to get data here and
there, `FT_READ_XXX' is preferable since it does check the boundaries
while accessing the data (from `stream->pos').

To summarize:

    function      acts on      increases  does range   for    emits
                                pointer    checking   frames  error
  -------------------------------------------------------------------
  FT_PEEK_XXX  buffer pointer      no         no        no     no
  FT_NEXT_XXX  buffer pointer     yes         no        no     no
  FT_GET_XXX   stream->cursor     yes        yes       yes     no
  FT_READ_XXX  stream->pos        yes        yes        no    yes


    Werner



reply via email to

[Prev in Thread] Current Thread [Next in Thread]