stegosphere.containers.font package
Submodules
stegosphere.containers.font.ttf module
Module for interacting with ttf files.
stegosphere.containers.font.ttf_CustomTable module
Creating/reading a custom table within a ttf file.
- stegosphere.containers.font.ttf_CustomTable.embed(font, payload, table_name)
Create new table in ttf file.
- Parameters:
font (stegosphere.font.ttf.TTFContainer) – Font object
payload (str | bytes) – Payload to write into table
table_name (str) – 4-character table tag
- Returns:
Updated font object
- Return type:
stegosphere.font.ttf.TTFContainer
- Raises:
ValueError – If table_name is not 4 characters long
- Warns:
UserWarning – If table_name already exists, thus data will be overwritten
- stegosphere.containers.font.ttf_CustomTable.extract(font, table_name)
Extract table from ttf file.
- Parameters:
font (stegosphere.font.ttf.TTFContainer) – Font object
table_name (str) – Table to read
- Returns:
table data or None, if table_name not in font
- Raises:
ValueError – If table_name is not 4 characters long