[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] Optional fields and stream reading in WOFF2
From: |
Nikhil Ramakrishnan |
Subject: |
[ft-devel] Optional fields and stream reading in WOFF2 |
Date: |
Sun, 9 Jun 2019 03:36:43 +0530 |
Hi,
I have been going through the WOFF2 specifications, and there a lot of
optional fields in various tables.
For example, the header size is fixed (48 bytes), but the table
directory (https://www.w3.org/TR/WOFF2/#table_dir_format) has 2
optional fields, `tag' and `transformLength'. In addition, the data
type 255UInt16 can be one to three bytes and UIntBase128 can be *upto*
5 bytes long.
My question is, how can reading these variable-length streams be
handled with `FT_FRAME_ENTER' and supporting macros? `FT_FRAME_ENTER'
requires a fixed frame size, which I believe is always the number of
bytes the cursor traverses by the time `FT_FRAME_EXIT' is called
(please correct me if I am wrong about this).
This would mean that if I take the frame size to be the sum of the
upper bounds of the sizes of all possible fields, I will be
overshooting in most cases. Is there a correct solution to this that
I'm missing?
Thanks!
--
Nikhil
- [ft-devel] Optional fields and stream reading in WOFF2,
Nikhil Ramakrishnan <=