-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpipeline.py
More file actions
35 lines (26 loc) · 867 Bytes
/
pipeline.py
File metadata and controls
35 lines (26 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""Main pipeline for font perforation process.
This script orchestrates the font perforation process by:
1. Testing the perforation on a sample
2. Applying the perforation to create a new font file
"""
from src.fonteco.fonts import perforate_font
from src.fonteco.testing import visualize_perforation
INPUT_FONT_PATH = "fonts/Times_subset.ttf"
REDUCTION_PERCENTAGE = 50
OUTPUT_FONT_PATH = f"test_outputs/EcoTimes_{REDUCTION_PERCENTAGE}.ttf"
def main():
"""Run the font perforation pipeline."""
# Run test
visualize_perforation(
INPUT_FONT_PATH,
"test_outputs/test_output.png",
REDUCTION_PERCENTAGE
)
# Perforate font
perforate_font(
input_font_path=INPUT_FONT_PATH,
output_font_path=OUTPUT_FONT_PATH,
reduction_percentage=REDUCTION_PERCENTAGE
)
if __name__ == "__main__":
main()