Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added __pycache__/alphabets.cpython-38.pyc
Binary file not shown.
Binary file added __pycache__/utils.cpython-38.pyc
Binary file not shown.
4 changes: 4 additions & 0 deletions alphabets.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
"standard": "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"
}

BENGALI = {
"standard": "অআইঈউঊঋএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষস"
}

RUSSIAN = {
"standard": "АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя"
}
Expand Down
Binary file added data/output.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/bengali_output.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/nature.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fonts/NotoSerifBengali-Medium.ttf
Binary file not shown.
7 changes: 7 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def sort_chars(char_list, font, language):
char_width, char_height = font.getsize("A")
elif language == "russian":
char_width, char_height = font.getsize("A")
elif language == "bengali":
char_width, char_height = font.getsize("A")
num_chars = min(len(char_list), 100)
out_width = char_width * len(char_list)
out_height = char_height
Expand Down Expand Up @@ -102,6 +104,11 @@ def get_data(language, mode):
font = ImageFont.truetype("fonts/arial-unicode.ttf", size=10)
sample_character = "お"
scale = 1
elif language == "bengali":
from alphabets import BENGALI as character
font = ImageFont.truetype("fonts/NotoSerifBengali-Medium.ttf", size=12)
sample_character = "ক"
scale = 1
else:
print("Invalid language")
return None, None, None, None
Expand Down