vfbLib.parsers.value.read_value
- vfbLib.parsers.value.read_value(stream: BufferedReader | BytesIO, signed=True) int
Read an encoded value from the stream, decode it to integer and return it.
The storage format in the stream of the “encoded value” is the same as described in the Type 1 specification, p. 48, “Charstring Number Encoding” <https://adobe-type-tools.github.io/font-tech-notes/pdfs/T1_SPEC.pdf>.
- Parameters:
stream (BufferedReader | BytesIO) – The input stream.
signed (bool, optional) – Whether to interpret the value as a signed integer. Defaults to True.
- Raises:
EOFError – When a 0 byte is encountered while reading the stream.
ValueError – When the byte that was read from the stream is < 0x20.
ValueError – When the byte that was read from the stream has any other undefined value.
- Returns:
The decoded value.
- Return type: