diff --git a/.gitignore b/.gitignore index f2d8ffb46..4e69528b9 100644 --- a/.gitignore +++ b/.gitignore @@ -256,3 +256,6 @@ adb_port.ini !popup.exe *.zip .vscode/* + +#Typeface +*.ttf \ No newline at end of file diff --git a/assets/cn/relics/name/Band_of_Sizzling_Thunder.png b/assets/cn/relics/name/Band_of_Sizzling_Thunder.png new file mode 100644 index 000000000..48eb02452 Binary files /dev/null and b/assets/cn/relics/name/Band_of_Sizzling_Thunder.png differ diff --git a/assets/cn/relics/name/Belobog_of_the_Architects.png b/assets/cn/relics/name/Belobog_of_the_Architects.png new file mode 100644 index 000000000..470e0daaa Binary files /dev/null and b/assets/cn/relics/name/Belobog_of_the_Architects.png differ diff --git a/assets/cn/relics/name/Broken_Keel.png b/assets/cn/relics/name/Broken_Keel.png new file mode 100644 index 000000000..0ba291906 Binary files /dev/null and b/assets/cn/relics/name/Broken_Keel.png differ diff --git a/assets/cn/relics/name/Celestial_Differentiator.png b/assets/cn/relics/name/Celestial_Differentiator.png new file mode 100644 index 000000000..60d632032 Binary files /dev/null and b/assets/cn/relics/name/Celestial_Differentiator.png differ diff --git a/assets/cn/relics/name/Champion_of_Streetwise_Boxing.png b/assets/cn/relics/name/Champion_of_Streetwise_Boxing.png new file mode 100644 index 000000000..03721e712 Binary files /dev/null and b/assets/cn/relics/name/Champion_of_Streetwise_Boxing.png differ diff --git a/assets/cn/relics/name/Duran_Dynasty_of_Running_Wolves.png b/assets/cn/relics/name/Duran_Dynasty_of_Running_Wolves.png new file mode 100644 index 000000000..3839d5c4c Binary files /dev/null and b/assets/cn/relics/name/Duran_Dynasty_of_Running_Wolves.png differ diff --git a/assets/cn/relics/name/Eagle_of_Twilight_Line.png b/assets/cn/relics/name/Eagle_of_Twilight_Line.png new file mode 100644 index 000000000..30ddc9691 Binary files /dev/null and b/assets/cn/relics/name/Eagle_of_Twilight_Line.png differ diff --git a/assets/cn/relics/name/Firesmith_of_Lava_Forging.png b/assets/cn/relics/name/Firesmith_of_Lava_Forging.png new file mode 100644 index 000000000..a558bf007 Binary files /dev/null and b/assets/cn/relics/name/Firesmith_of_Lava_Forging.png differ diff --git a/assets/cn/relics/name/Firmament_Frontline_Glamoth.png b/assets/cn/relics/name/Firmament_Frontline_Glamoth.png new file mode 100644 index 000000000..2386edb6b Binary files /dev/null and b/assets/cn/relics/name/Firmament_Frontline_Glamoth.png differ diff --git a/assets/cn/relics/name/Fleet_of_the_Ageless.png b/assets/cn/relics/name/Fleet_of_the_Ageless.png new file mode 100644 index 000000000..72f7b8d47 Binary files /dev/null and b/assets/cn/relics/name/Fleet_of_the_Ageless.png differ diff --git a/assets/cn/relics/name/Forge_of_the_Kalpagni_Lantern.png b/assets/cn/relics/name/Forge_of_the_Kalpagni_Lantern.png new file mode 100644 index 000000000..67cc08963 Binary files /dev/null and b/assets/cn/relics/name/Forge_of_the_Kalpagni_Lantern.png differ diff --git a/assets/cn/relics/name/Genius_of_Brilliant_Stars.png b/assets/cn/relics/name/Genius_of_Brilliant_Stars.png new file mode 100644 index 000000000..ee2297ecb Binary files /dev/null and b/assets/cn/relics/name/Genius_of_Brilliant_Stars.png differ diff --git a/assets/cn/relics/name/Guard_of_Wuthering_Snow.png b/assets/cn/relics/name/Guard_of_Wuthering_Snow.png new file mode 100644 index 000000000..9f14fec13 Binary files /dev/null and b/assets/cn/relics/name/Guard_of_Wuthering_Snow.png differ diff --git a/assets/cn/relics/name/Hunter_of_Glacial_Forest.png b/assets/cn/relics/name/Hunter_of_Glacial_Forest.png new file mode 100644 index 000000000..49dc81bc1 Binary files /dev/null and b/assets/cn/relics/name/Hunter_of_Glacial_Forest.png differ diff --git a/assets/cn/relics/name/Inert_Salsotto.png b/assets/cn/relics/name/Inert_Salsotto.png new file mode 100644 index 000000000..80a1e0ef5 Binary files /dev/null and b/assets/cn/relics/name/Inert_Salsotto.png differ diff --git a/assets/cn/relics/name/Iron_Cavalry_Against_the_Scourge.png b/assets/cn/relics/name/Iron_Cavalry_Against_the_Scourge.png new file mode 100644 index 000000000..111511847 Binary files /dev/null and b/assets/cn/relics/name/Iron_Cavalry_Against_the_Scourge.png differ diff --git a/assets/cn/relics/name/Izumo_Gensei_and_Takama_Divine_Realm.png b/assets/cn/relics/name/Izumo_Gensei_and_Takama_Divine_Realm.png new file mode 100644 index 000000000..ab103fad3 Binary files /dev/null and b/assets/cn/relics/name/Izumo_Gensei_and_Takama_Divine_Realm.png differ diff --git a/assets/cn/relics/name/Knight_of_Purity_Palace.png b/assets/cn/relics/name/Knight_of_Purity_Palace.png new file mode 100644 index 000000000..54f034aa2 Binary files /dev/null and b/assets/cn/relics/name/Knight_of_Purity_Palace.png differ diff --git a/assets/cn/relics/name/Longevous_Disciple.png b/assets/cn/relics/name/Longevous_Disciple.png new file mode 100644 index 000000000..4b5281d07 Binary files /dev/null and b/assets/cn/relics/name/Longevous_Disciple.png differ diff --git a/assets/cn/relics/name/Messenger_Traversing_Hackerspace.png b/assets/cn/relics/name/Messenger_Traversing_Hackerspace.png new file mode 100644 index 000000000..3e71dfd6f Binary files /dev/null and b/assets/cn/relics/name/Messenger_Traversing_Hackerspace.png differ diff --git a/assets/cn/relics/name/Musketeer_of_Wild_Wheat.png b/assets/cn/relics/name/Musketeer_of_Wild_Wheat.png new file mode 100644 index 000000000..4d5d56a7c Binary files /dev/null and b/assets/cn/relics/name/Musketeer_of_Wild_Wheat.png differ diff --git a/assets/cn/relics/name/Pan_Cosmic_Commercial_Enterprise.png b/assets/cn/relics/name/Pan_Cosmic_Commercial_Enterprise.png new file mode 100644 index 000000000..176c3d8b4 Binary files /dev/null and b/assets/cn/relics/name/Pan_Cosmic_Commercial_Enterprise.png differ diff --git a/assets/cn/relics/name/Passerby_of_Wandering_Cloud.png b/assets/cn/relics/name/Passerby_of_Wandering_Cloud.png new file mode 100644 index 000000000..56233d4fa Binary files /dev/null and b/assets/cn/relics/name/Passerby_of_Wandering_Cloud.png differ diff --git a/assets/cn/relics/name/Penacony_Land_of_the_Dreams.png b/assets/cn/relics/name/Penacony_Land_of_the_Dreams.png new file mode 100644 index 000000000..08141227c Binary files /dev/null and b/assets/cn/relics/name/Penacony_Land_of_the_Dreams.png differ diff --git a/assets/cn/relics/name/Pioneer_Diver_of_Dead_Waters.png b/assets/cn/relics/name/Pioneer_Diver_of_Dead_Waters.png new file mode 100644 index 000000000..f30c4e9d7 Binary files /dev/null and b/assets/cn/relics/name/Pioneer_Diver_of_Dead_Waters.png differ diff --git a/assets/cn/relics/name/Prisoner_in_Deep_Confinement.png b/assets/cn/relics/name/Prisoner_in_Deep_Confinement.png new file mode 100644 index 000000000..8f6dccc04 Binary files /dev/null and b/assets/cn/relics/name/Prisoner_in_Deep_Confinement.png differ diff --git a/assets/cn/relics/name/Rutilant_Arena.png b/assets/cn/relics/name/Rutilant_Arena.png new file mode 100644 index 000000000..0b56ab4ec Binary files /dev/null and b/assets/cn/relics/name/Rutilant_Arena.png differ diff --git a/assets/cn/relics/name/Sigonia_the_Unclaimed_Desolation.png b/assets/cn/relics/name/Sigonia_the_Unclaimed_Desolation.png new file mode 100644 index 000000000..ddbba81d5 Binary files /dev/null and b/assets/cn/relics/name/Sigonia_the_Unclaimed_Desolation.png differ diff --git a/assets/cn/relics/name/Space_Sealing_Station.png b/assets/cn/relics/name/Space_Sealing_Station.png new file mode 100644 index 000000000..4b0bfb722 Binary files /dev/null and b/assets/cn/relics/name/Space_Sealing_Station.png differ diff --git a/assets/cn/relics/name/Sprightly_Vonwacq.png b/assets/cn/relics/name/Sprightly_Vonwacq.png new file mode 100644 index 000000000..a7c7530ef Binary files /dev/null and b/assets/cn/relics/name/Sprightly_Vonwacq.png differ diff --git a/assets/cn/relics/name/Talia_Kingdom_of_Banditry.png b/assets/cn/relics/name/Talia_Kingdom_of_Banditry.png new file mode 100644 index 000000000..fb70360c0 Binary files /dev/null and b/assets/cn/relics/name/Talia_Kingdom_of_Banditry.png differ diff --git a/assets/cn/relics/name/The_Ashblazing_Grand_Duke.png b/assets/cn/relics/name/The_Ashblazing_Grand_Duke.png new file mode 100644 index 000000000..d7597da05 Binary files /dev/null and b/assets/cn/relics/name/The_Ashblazing_Grand_Duke.png differ diff --git a/assets/cn/relics/name/The_Wind_Soaring_Valorous.png b/assets/cn/relics/name/The_Wind_Soaring_Valorous.png new file mode 100644 index 000000000..cd49fae99 Binary files /dev/null and b/assets/cn/relics/name/The_Wind_Soaring_Valorous.png differ diff --git a/assets/cn/relics/name/Thief_of_Shooting_Meteor.png b/assets/cn/relics/name/Thief_of_Shooting_Meteor.png new file mode 100644 index 000000000..3a229b561 Binary files /dev/null and b/assets/cn/relics/name/Thief_of_Shooting_Meteor.png differ diff --git a/assets/cn/relics/name/Wastelander_of_Banditry_Desert.png b/assets/cn/relics/name/Wastelander_of_Banditry_Desert.png new file mode 100644 index 000000000..457cd75c9 Binary files /dev/null and b/assets/cn/relics/name/Wastelander_of_Banditry_Desert.png differ diff --git a/assets/cn/relics/name/Watchmaker_Master_of_Dream_Machinations.png b/assets/cn/relics/name/Watchmaker_Master_of_Dream_Machinations.png new file mode 100644 index 000000000..5a4138ccd Binary files /dev/null and b/assets/cn/relics/name/Watchmaker_Master_of_Dream_Machinations.png differ diff --git a/assets/en/relics/name/Band_of_Sizzling_Thunder.png b/assets/en/relics/name/Band_of_Sizzling_Thunder.png new file mode 100644 index 000000000..de6338346 Binary files /dev/null and b/assets/en/relics/name/Band_of_Sizzling_Thunder.png differ diff --git a/assets/en/relics/name/Belobog_of_the_Architects.png b/assets/en/relics/name/Belobog_of_the_Architects.png new file mode 100644 index 000000000..7cf54d4ab Binary files /dev/null and b/assets/en/relics/name/Belobog_of_the_Architects.png differ diff --git a/assets/en/relics/name/Broken_Keel.png b/assets/en/relics/name/Broken_Keel.png new file mode 100644 index 000000000..bbc379110 Binary files /dev/null and b/assets/en/relics/name/Broken_Keel.png differ diff --git a/assets/en/relics/name/Celestial_Differentiator.png b/assets/en/relics/name/Celestial_Differentiator.png new file mode 100644 index 000000000..004e3c19a Binary files /dev/null and b/assets/en/relics/name/Celestial_Differentiator.png differ diff --git a/assets/en/relics/name/Champion_of_Streetwise_Boxing.png b/assets/en/relics/name/Champion_of_Streetwise_Boxing.png new file mode 100644 index 000000000..1679913c9 Binary files /dev/null and b/assets/en/relics/name/Champion_of_Streetwise_Boxing.png differ diff --git a/assets/en/relics/name/Duran_Dynasty_of_Running_Wolves.png b/assets/en/relics/name/Duran_Dynasty_of_Running_Wolves.png new file mode 100644 index 000000000..34a82623c Binary files /dev/null and b/assets/en/relics/name/Duran_Dynasty_of_Running_Wolves.png differ diff --git a/assets/en/relics/name/Eagle_of_Twilight_Line.png b/assets/en/relics/name/Eagle_of_Twilight_Line.png new file mode 100644 index 000000000..62519b0ac Binary files /dev/null and b/assets/en/relics/name/Eagle_of_Twilight_Line.png differ diff --git a/assets/en/relics/name/Firesmith_of_Lava_Forging.png b/assets/en/relics/name/Firesmith_of_Lava_Forging.png new file mode 100644 index 000000000..393dcc2a8 Binary files /dev/null and b/assets/en/relics/name/Firesmith_of_Lava_Forging.png differ diff --git a/assets/en/relics/name/Firmament_Frontline_Glamoth.png b/assets/en/relics/name/Firmament_Frontline_Glamoth.png new file mode 100644 index 000000000..90300c595 Binary files /dev/null and b/assets/en/relics/name/Firmament_Frontline_Glamoth.png differ diff --git a/assets/en/relics/name/Fleet_of_the_Ageless.png b/assets/en/relics/name/Fleet_of_the_Ageless.png new file mode 100644 index 000000000..32d12bce4 Binary files /dev/null and b/assets/en/relics/name/Fleet_of_the_Ageless.png differ diff --git a/assets/en/relics/name/Forge_of_the_Kalpagni_Lantern.png b/assets/en/relics/name/Forge_of_the_Kalpagni_Lantern.png new file mode 100644 index 000000000..7319d8d18 Binary files /dev/null and b/assets/en/relics/name/Forge_of_the_Kalpagni_Lantern.png differ diff --git a/assets/en/relics/name/Genius_of_Brilliant_Stars.png b/assets/en/relics/name/Genius_of_Brilliant_Stars.png new file mode 100644 index 000000000..bde641eb7 Binary files /dev/null and b/assets/en/relics/name/Genius_of_Brilliant_Stars.png differ diff --git a/assets/en/relics/name/Guard_of_Wuthering_Snow.png b/assets/en/relics/name/Guard_of_Wuthering_Snow.png new file mode 100644 index 000000000..f27a80b22 Binary files /dev/null and b/assets/en/relics/name/Guard_of_Wuthering_Snow.png differ diff --git a/assets/en/relics/name/Hunter_of_Glacial_Forest.png b/assets/en/relics/name/Hunter_of_Glacial_Forest.png new file mode 100644 index 000000000..8a384becf Binary files /dev/null and b/assets/en/relics/name/Hunter_of_Glacial_Forest.png differ diff --git a/assets/en/relics/name/Inert_Salsotto.png b/assets/en/relics/name/Inert_Salsotto.png new file mode 100644 index 000000000..938a6d3cf Binary files /dev/null and b/assets/en/relics/name/Inert_Salsotto.png differ diff --git a/assets/en/relics/name/Iron_Cavalry_Against_the_Scourge.png b/assets/en/relics/name/Iron_Cavalry_Against_the_Scourge.png new file mode 100644 index 000000000..f90bfcd66 Binary files /dev/null and b/assets/en/relics/name/Iron_Cavalry_Against_the_Scourge.png differ diff --git a/assets/en/relics/name/Izumo_Gensei_and_Takama_Divine_Realm.png b/assets/en/relics/name/Izumo_Gensei_and_Takama_Divine_Realm.png new file mode 100644 index 000000000..7b202b15c Binary files /dev/null and b/assets/en/relics/name/Izumo_Gensei_and_Takama_Divine_Realm.png differ diff --git a/assets/en/relics/name/Knight_of_Purity_Palace.png b/assets/en/relics/name/Knight_of_Purity_Palace.png new file mode 100644 index 000000000..0a952e149 Binary files /dev/null and b/assets/en/relics/name/Knight_of_Purity_Palace.png differ diff --git a/assets/en/relics/name/Longevous_Disciple.png b/assets/en/relics/name/Longevous_Disciple.png new file mode 100644 index 000000000..0ad975098 Binary files /dev/null and b/assets/en/relics/name/Longevous_Disciple.png differ diff --git a/assets/en/relics/name/Messenger_Traversing_Hackerspace.png b/assets/en/relics/name/Messenger_Traversing_Hackerspace.png new file mode 100644 index 000000000..d964bfb8a Binary files /dev/null and b/assets/en/relics/name/Messenger_Traversing_Hackerspace.png differ diff --git a/assets/en/relics/name/Musketeer_of_Wild_Wheat.png b/assets/en/relics/name/Musketeer_of_Wild_Wheat.png new file mode 100644 index 000000000..eb524ccf6 Binary files /dev/null and b/assets/en/relics/name/Musketeer_of_Wild_Wheat.png differ diff --git a/assets/en/relics/name/Pan_Cosmic_Commercial_Enterprise.png b/assets/en/relics/name/Pan_Cosmic_Commercial_Enterprise.png new file mode 100644 index 000000000..88c0ffe18 Binary files /dev/null and b/assets/en/relics/name/Pan_Cosmic_Commercial_Enterprise.png differ diff --git a/assets/en/relics/name/Passerby_of_Wandering_Cloud.png b/assets/en/relics/name/Passerby_of_Wandering_Cloud.png new file mode 100644 index 000000000..69b7580a8 Binary files /dev/null and b/assets/en/relics/name/Passerby_of_Wandering_Cloud.png differ diff --git a/assets/en/relics/name/Penacony_Land_of_the_Dreams.png b/assets/en/relics/name/Penacony_Land_of_the_Dreams.png new file mode 100644 index 000000000..c8670c204 Binary files /dev/null and b/assets/en/relics/name/Penacony_Land_of_the_Dreams.png differ diff --git a/assets/en/relics/name/Pioneer_Diver_of_Dead_Waters.png b/assets/en/relics/name/Pioneer_Diver_of_Dead_Waters.png new file mode 100644 index 000000000..ff0a7ad73 Binary files /dev/null and b/assets/en/relics/name/Pioneer_Diver_of_Dead_Waters.png differ diff --git a/assets/en/relics/name/Prisoner_in_Deep_Confinement.png b/assets/en/relics/name/Prisoner_in_Deep_Confinement.png new file mode 100644 index 000000000..c74376f21 Binary files /dev/null and b/assets/en/relics/name/Prisoner_in_Deep_Confinement.png differ diff --git a/assets/en/relics/name/Rutilant_Arena.png b/assets/en/relics/name/Rutilant_Arena.png new file mode 100644 index 000000000..997f15995 Binary files /dev/null and b/assets/en/relics/name/Rutilant_Arena.png differ diff --git a/assets/en/relics/name/Sigonia_the_Unclaimed_Desolation.png b/assets/en/relics/name/Sigonia_the_Unclaimed_Desolation.png new file mode 100644 index 000000000..eb96937af Binary files /dev/null and b/assets/en/relics/name/Sigonia_the_Unclaimed_Desolation.png differ diff --git a/assets/en/relics/name/Space_Sealing_Station.png b/assets/en/relics/name/Space_Sealing_Station.png new file mode 100644 index 000000000..5f4ec5d90 Binary files /dev/null and b/assets/en/relics/name/Space_Sealing_Station.png differ diff --git a/assets/en/relics/name/Sprightly_Vonwacq.png b/assets/en/relics/name/Sprightly_Vonwacq.png new file mode 100644 index 000000000..f858676f8 Binary files /dev/null and b/assets/en/relics/name/Sprightly_Vonwacq.png differ diff --git a/assets/en/relics/name/Talia_Kingdom_of_Banditry.png b/assets/en/relics/name/Talia_Kingdom_of_Banditry.png new file mode 100644 index 000000000..3a4011d3b Binary files /dev/null and b/assets/en/relics/name/Talia_Kingdom_of_Banditry.png differ diff --git a/assets/en/relics/name/The_Ashblazing_Grand_Duke.png b/assets/en/relics/name/The_Ashblazing_Grand_Duke.png new file mode 100644 index 000000000..182cb9942 Binary files /dev/null and b/assets/en/relics/name/The_Ashblazing_Grand_Duke.png differ diff --git a/assets/en/relics/name/The_Wind_Soaring_Valorous.png b/assets/en/relics/name/The_Wind_Soaring_Valorous.png new file mode 100644 index 000000000..3e255254d Binary files /dev/null and b/assets/en/relics/name/The_Wind_Soaring_Valorous.png differ diff --git a/assets/en/relics/name/Thief_of_Shooting_Meteor.png b/assets/en/relics/name/Thief_of_Shooting_Meteor.png new file mode 100644 index 000000000..5d1072fef Binary files /dev/null and b/assets/en/relics/name/Thief_of_Shooting_Meteor.png differ diff --git a/assets/en/relics/name/Wastelander_of_Banditry_Desert.png b/assets/en/relics/name/Wastelander_of_Banditry_Desert.png new file mode 100644 index 000000000..4cbc5fc89 Binary files /dev/null and b/assets/en/relics/name/Wastelander_of_Banditry_Desert.png differ diff --git a/assets/en/relics/name/Watchmaker_Master_of_Dream_Machinations.png b/assets/en/relics/name/Watchmaker_Master_of_Dream_Machinations.png new file mode 100644 index 000000000..42fd52659 Binary files /dev/null and b/assets/en/relics/name/Watchmaker_Master_of_Dream_Machinations.png differ diff --git a/dev_tools/text_draw.py b/dev_tools/text_draw.py new file mode 100644 index 000000000..bbcb87a20 --- /dev/null +++ b/dev_tools/text_draw.py @@ -0,0 +1,97 @@ +import cv2 +import re +import numpy as np +import os +from PIL import ImageFont, ImageDraw, Image +from module.config.utils import read_file +from module.logger import logger + + +def crop_to_text_edge(original_image): + gray = cv2.cvtColor(original_image, cv2.COLOR_BGR2GRAY) + + _, binary = cv2.threshold(gray, 100, 255, cv2.THRESH_BINARY_INV) + + contours, _ = cv2.findContours(binary, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) + + x_min, y_min = float('inf'), float('inf') + x_max, y_max = float('-inf'), float('-inf') + + for contour in contours: + x, y, w, h = cv2.boundingRect(contour) + x_min = min(x_min, x) + y_min = min(y_min, y) + x_max = max(x_max, x + w) + y_max = max(y_max, y + h) + + cropped_image = original_image[y_min:y_max, x_min:x_max] + return cropped_image + + +def split_string_at_last_space(input_string): + if all(ord(char) < 128 for char in input_string) and len(input_string) > 35: + last_space_index = input_string.rfind(' ') + + if last_space_index == -1: + return input_string, "" + + part1 = input_string[:last_space_index] + part2 = input_string[last_space_index + 1:] + + return part1, part2 + else: + return input_string, "" + + +def text_image_generator(chars, names, font, output_path='./'): + for char, name in zip(chars, names): + image_path = os.path.join(output_path, name + '.png') + if (os.path.isfile(image_path)): + logger.info(f'{name} already exists, skipping') + continue + else: + part = ['', ''] + part = split_string_at_last_space(char) + + image = np.ones((50, 370, 3), dtype=np.uint8) * 255 + + image_pil = Image.fromarray(cv2.cvtColor(image, cv2.COLOR_BGR2RGB)) + + draw = ImageDraw.Draw(image_pil) + + draw.text((2, 0.5), part[0], font=font, fill=(0, 0, 0)) + draw.text((2, 25), part[1], font=font, fill=(0, 0, 0)) + + image = cv2.cvtColor(np.array(image_pil), cv2.COLOR_RGB2BGR) + + crop_image = crop_to_text_edge(image) + cv2.imencode('.png', crop_image)[1].tofile(image_path) + logger.info(f'{name} generated') + + +def relics_name_image_generator(): + font_en = ImageFont.truetype("./dev_tools/zh-cn.ttf", 20) + font_cn = ImageFont.truetype("./dev_tools/zh-cn.ttf", 20) + output_path_cn = './assets/cn/relics/name/' + output_path_en = './assets/en/relics/name/' + + with open('./tasks/relics/keywords/relics.py', 'r', encoding='utf-8') as file: + content = file.read() + + cn_pattern = re.compile(r"cn='([^']*)'") + en_pattern = re.compile(r"en='([^']*)'") + name_pattern = re.compile(r"name='([^']*)'") + + cn_values = cn_pattern.findall(content) + en_values = en_pattern.findall(content) + name_values = name_pattern.findall(content) + + text_image_generator(cn_values, name_values, font=font_cn, output_path=output_path_cn) + text_image_generator(en_values, name_values, font=font_en, output_path=output_path_en) + + +if __name__ == '__main__': + relics_name_image_generator() + + +