Exporter
Details
- File:
FontGenerator/Exporter.py - Details: Python 3.9
- Date: 2022-10-08
- Version: v1.0.0
Description
Exporter for the font generator.
Author
Sebastian Oberschwendtner, sebastian.oberschwendtner@gmail.com
Code
get_namespace_for_size
def get_namespace_for_size(size: int) -> str
Converts the font size to a namespace.
Arguments:
sizeint - 1x1 [px] The font size in pixels.
Returns:
str- 1xn [str] The namespace for the font size.
write_copyright_header
def write_copyright_header(file: pathlib.Path)
Writes the copyright header to the file.
Arguments:
filepathlib.Path - 1x1 [-] The file to write to.
get_array_line
def get_array_line(line_number: int, array: list) -> str
Get the line of an array as a string.
Arguments:
line_numberint - 1x1 [-] The line number of the array in the file.arraylist - 1xn [-] The array to write.
Returns:
str- 1x1 [-] The line of the array.
write_lookup_table_preamble
def write_lookup_table_preamble(file: pathlib.Path, font_name: str)
Write the preamble of the lookup table.
Arguments:
filepathlib.Path - 1x1 [-] The file to write to.font_namestr - 1x1 [-] The name of the font.
write_lookup_table_begin
def write_lookup_table_begin(file: pathlib.Path, font_name: str, size: tuple)
Write the beginning of the lookup table.
Arguments:
filepathlib.Path - 1x1 [-] The file to write to.font_namestr - 1x1 [-] The name of the font.sizetuple - 1x2 [px] The (width, height) of the font.
write_lookup_table_end
def write_lookup_table_end(file: pathlib.Path, font_name: str, size: tuple,
stride: int)
Write the end of the lookup table.
Arguments:
filepathlib.Path - 1x1 [-] The file to write to.font_namestr - 1x1 [-] The name of the font.sizetuple - 1x2 [px] The (width, height) of the font.strideint - 1x1 [-] The stride of the font.
finalize_file
def finalize_file(file: pathlib.Path, font_name: str)
Finalize the file.
Arguments:
filepathlib.Path - 1x1 [-] The file to write to.font_namestr - 1x1 [-] The name of the font.