Skip to content

Commit

Permalink
Added monospace transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
jthlim committed Jul 8, 2022
1 parent c8eb3c2 commit 17eacc3
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Transformers:
* crytyping: I' finne,,, h ddon'nt w,,,orry about me, re,,el yy
* fullwidth: vaporwave
* medieval: 𝕸𝖊𝖉𝖎𝖊𝖛𝖆𝖑
* monospace: 𝚖𝚘𝚗𝚘𝚜𝚙𝚊𝚌𝚎
* morse: ... --- ...
* sarcasm: wELl ThIs IS cONvEnIeNt
* script: 𝓢𝓬𝓻𝓲𝓹𝓽 𝓯𝓸𝓻 𝓽𝓱𝓪𝓽 𝓱𝓪𝓷𝓭𝔀𝓻𝓲𝓽𝓽𝓮𝓷 𝓵𝓸𝓸𝓴
Expand Down
65 changes: 65 additions & 0 deletions plover_fancytext/character_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,71 @@
"9": "𝟡"
}

MONOSPACE_MAP = {
"A": "\U0001D670",
"B": "\U0001D671",
"C": "\U0001D672",
"D": "\U0001D673",
"E": "\U0001D674",
"F": "\U0001D675",
"G": "\U0001D676",
"H": "\U0001D677",
"I": "\U0001D678",
"J": "\U0001D679",
"K": "\U0001D67a",
"L": "\U0001D67b",
"M": "\U0001D67c",
"N": "\U0001D67d",
"O": "\U0001D67e",
"P": "\U0001D67f",
"Q": "\U0001D680",
"R": "\U0001D681",
"S": "\U0001D682",
"T": "\U0001D683",
"U": "\U0001D684",
"V": "\U0001D685",
"W": "\U0001D686",
"X": "\U0001D687",
"Y": "\U0001D688",
"Z": "\U0001D689",
"a": "\U0001D68a",
"b": "\U0001D68b",
"c": "\U0001D68c",
"d": "\U0001D68d",
"e": "\U0001D68e",
"f": "\U0001D68f",
"g": "\U0001D690",
"h": "\U0001D691",
"i": "\U0001D692",
"j": "\U0001D693",
"k": "\U0001D694",
"l": "\U0001D695",
"m": "\U0001D696",
"n": "\U0001D697",
"o": "\U0001D698",
"p": "\U0001D699",
"q": "\U0001D69a",
"r": "\U0001D69b",
"s": "\U0001D69c",
"t": "\U0001D69d",
"u": "\U0001D69e",
"v": "\U0001D69f",
"w": "\U0001D6a0",
"x": "\U0001D6a1",
"y": "\U0001D6a2",
"z": "\U0001D6a3",
"0": "\U0001D7f6",
"1": "\U0001D7f7",
"2": "\U0001D7f8",
"3": "\U0001D7f9",
"4": "\U0001D7fa",
"5": "\U0001D7fb",
"6": "\U0001D7fc",
"7": "\U0001D7fd",
"8": "\U0001D7fe",
"9": "\U0001D7ff"
}

COMBINING_MARKS = [
'\u0300', # ̀ 768 Combining Grave Accent
'\u0301', # ́ 769 Combining Acute Accent
Expand Down
3 changes: 2 additions & 1 deletion plover_fancytext/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from .character_helpers import \
BUBBLE_MAP, MEDIEVAL_MAP, UPSIDE_DOWN_MAP,\
FULLWIDTH_MAP, MORSE_MAP, SMALLCAPS_MAP,\
SCRIPT_MAP, BLACKBOARD_BOLD_MAP
SCRIPT_MAP, BLACKBOARD_BOLD_MAP, MONOSPACE_MAP

TRANSFORMERS = {
'bubble': lambda: Substitute(BUBBLE_MAP),
Expand All @@ -23,6 +23,7 @@
'smallcaps': lambda: Substitute(SMALLCAPS_MAP),
'script': lambda: Substitute(SCRIPT_MAP),
'blackboardbold': lambda: Substitute(BLACKBOARD_BOLD_MAP),
'monospace': lambda: Substitute(MONOSPACE_MAP),
'zalgo': lambda minimum=1, maximum=3: Zalgo(int(minimum),
int(maximum))
}

0 comments on commit 17eacc3

Please sign in to comment.