-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFancyFonts.py
70 lines (46 loc) · 1.97 KB
/
FancyFonts.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import pyperclip
def fancy_bold(text):
bold_mapping = str.maketrans(
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
'𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙'
'𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐰𝐱𝐲𝐳'
)
return text.translate(bold_mapping)
def small_caps(text):
small_caps_mapping = str.maketrans(
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
'ᴬᴮᶜᴰᴱᶠᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᵠᴿˢᵀᵁᵛᵂˣʸᶻ'
'ᵃᵇᶜᵈᵉᶠᵍʰᶦʲᵏˡᵐⁿᵒᵖᵠʳˢᵗᵘᵛʷˣʸᶻ'
)
return text.translate(small_caps_mapping)
def wide_font(text):
wide_mapping = str.maketrans(
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
'abcdefghijklmnopqrstuvwxyz'
)
return text.translate(wide_mapping)
def main():
while True:
user_input = input("Enter text (or type 'exit' to quit): ")
if user_input.lower() == 'exit':
break
print("Choose a font style:")
print("1. Fancy Bold")
print("2. Small Caps")
print("3. Wide")
choice = input("Enter the number of your choice: ")
if choice == '1':
result = fancy_bold(user_input)
elif choice == '2':
result = small_caps(user_input)
elif choice == '3':
result = wide_font(user_input)
else:
print("Invalid choice. Please try again.")
continue
pyperclip.copy(result)
print(f"Copied to the clipboard: {result}")
print("Input something else to convert... ")
if __name__ == "__main__":
main()