vfbLib.vfb.entry.VfbEntry
- class vfbLib.vfb.entry.VfbEntry(parent: Vfb, parser: type[BaseParser] | None = None, compiler: type[BaseCompiler] | None = None, eid: int | None = None)
Bases:
StreamReader- __init__(parent: Vfb, parser: type[BaseParser] | None = None, compiler: type[BaseCompiler] | None = None, eid: int | None = None) None
Methods
__init__(parent[, parser, compiler, eid])as_dict([minimize])clean()Reset the entry to its original, un-decompiled state.
compile([force])Compile the entry.
Decompile the entry.
Merge any temporary masters data into the main decompiled structure.
read(stream)Read the entry from the stream without decompiling the data.
Return a double-precision float from the stream.
read_doubles(num)Return a tuple of num double-precision floats from the stream.
Return a float from the stream.
read_floats(num)Return a tuple of num floats from the stream.
Return a signed 16-bit integer from the stream.
Return a signed 32-bit integer from the stream.
Return a signed 8-bit integer from the stream.
read_str(size)Return a string of the specified size from the current stream with the current encoding
Return the remaining bytes of the current stream as a string with the current encoding.
Return an unsigned 16-bit integer from the stream.
Return an unsigned 32-bit integer from the stream.
Return an unsigned 8-bit integer from the stream.
read_value([signed])Return an encoded integer value from the stream.
Store a hash of the decompiled data.
Attributes
current_hashdatadecompiledencodingThe entry header.
idmodifiedThe size of the compiled data.
stream- property header: bytes
The entry header.
- Returns:
The data of the current entry header.
- Return type:
- merge_masters_data() None
Merge any temporary masters data into the main decompiled structure. Such data can be added as the result of drawing with a PointPen into a multiple master Vfb.
- read_double() float
Return a double-precision float from the stream.
- Returns:
The float
- Return type:
- read_str(size: int) str
Return a string of the specified size from the current stream with the current encoding
- read_str_all() str
Return the remaining bytes of the current stream as a string with the current encoding. Null bytes and whitespace are stripped from the string.
- Returns:
The string
- Return type:
- read_uint16() int
Return an unsigned 16-bit integer from the stream.
- Returns:
The integer
- Return type:
- read_uint32() int
Return an unsigned 32-bit integer from the stream.
- Returns:
The integer
- Return type:
- read_uint8() int
Return an unsigned 8-bit integer from the stream.
- Returns:
The integer
- Return type: