diff --git a/dataobjs.py b/dataobjs.py index bfd65b4..f2dc448 100644 --- a/dataobjs.py +++ b/dataobjs.py @@ -32,6 +32,7 @@ _ctagre = re.compile("()", re.I) _smilere = re.compile("|".join(list(smiledict.keys()))) _memore = re.compile(r"(\s|^)(#[A-Za-z0-9_]+)") _handlere = re.compile(r"(\s|^)(@[A-Za-z0-9_]+)") +_alternian = re.compile(r".*?") class pesterQuirk: @@ -175,6 +176,7 @@ class pesterQuirks: re.finditer(_smilere, string), re.finditer(_handlere, string), re.finditer(_memore, string), + re.finditer(_alternian, string), ) excludes.extend(matches) diff --git a/fonts/alternian/AllisDaedric-VYWz.otf b/fonts/alternian/AllisDaedric-VYWz.otf new file mode 100644 index 0000000..1183577 Binary files /dev/null and b/fonts/alternian/AllisDaedric-VYWz.otf differ diff --git a/fonts/alternian/info.txt b/fonts/alternian/info.txt new file mode 100644 index 0000000..7cf5d40 --- /dev/null +++ b/fonts/alternian/info.txt @@ -0,0 +1,2 @@ +license: Public Domain +link: https://www.fontspace.com/allis-daedric-font-f20263 \ No newline at end of file diff --git a/parsetools.py b/parsetools.py index c0fa2c5..6ab2867 100644 --- a/parsetools.py +++ b/parsetools.py @@ -40,6 +40,7 @@ _oocre = re.compile(r"([\[(\{])\1.*([\])\}])\2") # _format_end = re.compile(r"(?i)") _honk = re.compile(r"(?i)\bhonk\b") _groupre = re.compile(r"\\([0-9]+)") +_alternian = re.compile(r".*?") # Matches get set to alternian font quirkloader = ScriptQuirks() _functionre = None @@ -184,6 +185,16 @@ class hyperlink_lazy(hyperlink): self.string = "http://" + string +class alternianTag(lexercon.Chunk): + def __init__(self, string): + self.string = string + + def convert(self, format): + if format == "html": + return f"{self.string}" + return self.string + + class imagelink(lexercon.Chunk): def __init__(self, string, img): self.string = string @@ -285,6 +296,7 @@ def kxlexMsg(msg: str): def lexMessage(string: str): lexlist = [ (mecmd, _mecmdre), + (alternianTag, _alternian), (colorBegin, _ctag_begin), # (colorBegin, _gtag_begin), (colorEnd, _ctag_end), diff --git a/pesterchum.py b/pesterchum.py index b590dc5..b750365 100755 --- a/pesterchum.py +++ b/pesterchum.py @@ -1653,9 +1653,10 @@ class PesterWindow(MovingWindow): if not self.config.defaultprofile(): self.changeProfile() - # Fuck you some more OSX leopard! >:( - # if not ostools.isOSXLeopard(): - # QtCore.QTimer.singleShot(1000, self.mspacheck) + # Load font + QtGui.QFontDatabase.addApplicationFont( + os.path.join("fonts", "alternian", "AllisDaedric-VYWz.otf") + ) self.pcUpdate[str, str].connect(self.updateMsg) diff --git a/pyinst.py b/pyinst.py index eb47b2f..00d6c3e 100644 --- a/pyinst.py +++ b/pyinst.py @@ -17,6 +17,7 @@ add_data = [ "smilies;smilies", "themes;themes", "docs;docs", + "fonts;fonts", "README.md;.", "LICENSE;.", "CHANGELOG.md;.", @@ -28,6 +29,7 @@ data_folders = { "smilies": "smilies", "themes": "themes", "docs": "docs", + "fonts": "fonts", } data_files = { "README.md": "README.md.txt", diff --git a/quirks/gradient.py b/quirks/gradient.py index a814af4..a72fb79 100644 --- a/quirks/gradient.py +++ b/quirks/gradient.py @@ -56,6 +56,7 @@ def rainbow(text): re.finditer(_smilere, text), re.finditer(_memore, text), re.finditer(_handlere, text), + re.finditer(_alternian_tags, text), ) for match in match_chain: for color_and_position in colors_and_positions: @@ -161,3 +162,4 @@ _smilere = re.compile("|".join(list(smiledict.keys()))) _urlre = re.compile(r"(?i)(?:^|(?<=\s))(?:(?:https?|ftp)://|magnet:)[^\s]+") _memore = re.compile(r"(\s|^)(#[A-Za-z0-9_]+)") _handlere = re.compile(r"(\s|^)(@[A-Za-z0-9_]+)") +_alternian_tags = re.compile(r"|")