BinaryWriter

Overview

BinaryWriter is a class in Aspose.Font FOSS for Python.

Accumulates bytes for binary font serialization.

This class provides 19 methods for working with BinaryWriter objects in Python programs. Available methods include: __init__, seek, tell, to_bytes, write_bytes, write_f2dot14, write_fixed, write_i16, write_i16_le, write_i32, write_i8, write_padding, and 7 additional methods. All public members are accessible to any Python application after installing the Aspose.Font FOSS for Python package.

Methods

SignatureDescription
__init__()Calls init on this BinaryWriter instance.
tell()intReturns the current write position as an integer
seek(offset: int)Seek to an absolute position for back-patching.
to_bytes()bytesReturns the accumulated binary data as a bytes object
write_u8(v: int)Writes an unsigned 8‑bit integer to the buffer
write_u16(v: int)Writes an unsigned 16‑bit integer in big‑endian order
write_u16_le(v: int)Calls write_u16_le on this BinaryWriter instance.
write_u32(v: int)Calls write_u32 on this BinaryWriter instance.
write_u32_le(v: int)Writes an unsigned 32‑bit integer in little‑endian order
write_u64(v: int)Calls write_u64 on this BinaryWriter instance.
write_i8(v: int)Writes a signed 8‑bit integer to the buffer
write_i16(v: int)Writes a signed 16‑bit integer in big‑endian order
write_i16_le(v: int)Calls write_i16_le on this BinaryWriter instance.
write_i32(v: int)Calls write_i32 on this BinaryWriter instance.
write_fixed(v: float)16.16 fixed-point.
write_f2dot14(v: float)2.14 fixed-point.
write_bytes(data: bytes | bytearray)Appends raw bytes or a bytearray to the buffer
write_tag(tag: str)Write a 4-character ASCII tag.
write_padding(n: int)Write n zero bytes.

See Also