mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-22 22:31:43 +03:00
Move font files to folder
This commit is contained in:
parent
b74914e841
commit
6c3c34d3ac
Before Width: | Height: | Size: 908 B After Width: | Height: | Size: 908 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
@ -263,8 +263,8 @@ class MetaGlyphFont:
|
||||
|
||||
covered_characters = R""" !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"""
|
||||
meta_glyph_fonts: dict[int, MetaGlyphFont] = {
|
||||
2: MetaGlyphFont(os.path.join(os.path.dirname(__file__), "../../NanoTiny_v14_2x2.flf"), 2, 2, covered_characters),
|
||||
# 4: MetaGlyphFont(os.path.join(os.path.dirname(__file__), "../../NanoTiny_v14_4x4.flf"), 4, 4, covered_characters),
|
||||
2: MetaGlyphFont(os.path.join(os.path.dirname(__file__), "../../fonts/NanoTiny/NanoTiny_v14_2x2.flf"), 2, 2, covered_characters),
|
||||
# 4: MetaGlyphFont(os.path.join(os.path.dirname(__file__), "../../fonts/NanoTiny/NanoTiny_v14_4x4.flf"), 4, 4, covered_characters),
|
||||
# TODO: less specialized (more practical) fonts for larger sizes
|
||||
}
|
||||
|
||||
|
@ -387,16 +387,16 @@ def extract_textures(image_path: str):
|
||||
|
||||
return extracted_image, half_size_font.createFigFileData(), full_size_font.createFigFileData()
|
||||
|
||||
base_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))
|
||||
samples_folder = os.path.join(base_folder, 'samples')
|
||||
image_path = os.path.join(samples_folder, 'NanoTiny_v14.png')
|
||||
output_path = os.path.join(samples_folder, 'NanoTiny_v14_no_border.png')
|
||||
half_size_flf_output_path = os.path.join(base_folder, 'NanoTiny_v14_2x2.flf')
|
||||
full_size_flf_output_path = os.path.join(base_folder, 'NanoTiny_v14_4x4.flf')
|
||||
repo_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))
|
||||
font_folder = os.path.join(repo_folder, 'fonts/NanoTiny')
|
||||
image_input_path = os.path.join(font_folder, 'NanoTiny_v14.png')
|
||||
image_output_path = os.path.join(font_folder, 'NanoTiny_v14_no_border.png')
|
||||
half_size_flf_output_path = os.path.join(font_folder, 'NanoTiny_v14_2x2.flf')
|
||||
full_size_flf_output_path = os.path.join(font_folder, 'NanoTiny_v14_4x4.flf')
|
||||
|
||||
extracted_image, extracted_text_half, extracted_text_full = extract_textures(image_path)
|
||||
extracted_image.save(output_path)
|
||||
print(f'Wrote extracted textures to {output_path}')
|
||||
extracted_image, extracted_text_half, extracted_text_full = extract_textures(image_input_path)
|
||||
extracted_image.save(image_output_path)
|
||||
print(f'Wrote extracted textures to {image_output_path}')
|
||||
with open(full_size_flf_output_path, 'w') as f:
|
||||
f.write(extracted_text_full)
|
||||
print(f'Wrote FIGlet font {full_size_flf_output_path}')
|
||||
|
Loading…
Reference in New Issue
Block a user