A community-maintained Python framework for creating mathematical animations.
Add PangoText
Naveenca4155938065
diff --git a/.gitignore b/.gitignoreindex f7da3fa52..1de83cdd9 100644--- a/.gitignore+++ b/.gitignore@@ -16,6 +16,7 @@ eggs/.eggs/lib/lib64/+windows/parts/sdist/var/diff --git a/example_scenes/panT.py b/example_scenes/panT.pynew file mode 100644index 000000000..b4b68c1ff--- /dev/null+++ b/example_scenes/panT.py@@ -0,0 +1,17 @@+from manim import *++class Demo(Scene):+ CONFIG = {+ 'font' : 'sans-serif'+ }+ def construct(self):+ text = PangoText('見 角 言 谷 豆 豕 豸 貝 赤 走 足 身 車 辛 辰 辵 邑 酉 釆 里!')+ self.play(Write(text))+ self.wait(2)+ mess=PangoText('multi-language',style=ITALIC)+ self.play(Transform(text,mess))+ self.clear()+ #arb=PangoText('नमस्ते',font='sans-serif')+ arb=PangoText("Здравствуйте")+ self.play(Write(arb))+ self.wait(4)\ No newline at end of filediff --git a/manim/constants.py b/manim/constants.pyindex 1dc6bb5ab..63a847dab 100644--- a/manim/constants.py+++ b/manim/constants.py@@ -29,7 +29,7 @@ NO_SCENE_MESSAGE = """There are no scenes inside that module"""-# Cairo stuff+# Cairo and Pango stuffNORMAL = "NORMAL"ITALIC = "ITALIC"OBLIQUE = "OBLIQUE"diff --git a/manim/mobject/svg/text_mobject.py b/manim/mobject/svg/text_mobject.pyindex 6116fe3e9..cd0508d34 100644--- a/manim/mobject/svg/text_mobject.py+++ b/manim/mobject/svg/text_mobject.py@@ -1,6 +1,6 @@"""Mobjects used for displaying (non-LaTeX) text."""-__all__ = ["TextSetting", "Text", "Paragraph"]+__all__ = ["Text", "Paragraph","PangoText"]import re@@ -8,6 +8,9 @@ import osimport copyimport hashlibimport cairo+import pangocffi+import pangocairocffi+import cairocffifrom ... import config, file_writer_config, loggerfrom ...constants import *@@ -575,3 +578,273 @@ class Paragraph(VGroup):]))++class PangoText(SVGMobject):+ """Display (non-LaTeX) text rendered using `Pango <https://pango.gnome.org/>`_.++ Text objects behave like a :class:`.VGroup`-like iterable of all characters+ in the given text. In particular, slicing is possible.++ .. WARNING::++ Using a :class:`.Transform` on text with leading whitespace can look+ `weird <https://github.com/3b1b/manim/issues/1067>`_. Consider using+ :meth:`remove_invisible_chars` to resolve this issue.++ """++ CONFIG = {+ # Mobject+ "color": WHITE,+ "height": None,+ "width": None,+ "fill_opacity": 1,+ "stroke_width": 0,+ "should_center": True,+ "unpack_groups": True,+ # Text+ "font": "",+ "gradient": None,+ "line_spacing": -1,+ "size": 1,+ "slant": NORMAL,+ "weight": NORMAL,+ "t2c": {},+ "t2f": {},+ "t2g": {},+ "t2s": {},+ "t2w": {},+ "tab_width": 4,+ }++ def __init__(self, text, **config):+ self.full2short(config)+ digest_config(self, config)+ self.original_text = text+ text_without_tabs = text+ if text.find("\t") != -1:+ text_without_tabs = text.replace("\t", " " * self.tab_width)+ self.text = text_without_tabs+ if self.line_spacing == -1:+ self.line_spacing = self.size + self.size * 0.3+ else:+ self.line_spacing = self.size + self.size * self.line_spacing+ file_name = self.text2svg()+ self.remove_last_M(file_name)+ SVGMobject.__init__(self, file_name, **config)+ self.text = text+ self.submobjects = [*self.gen_chars()]+ self.chars = VGroup(*self.submobjects)+ self.text = text_without_tabs.replace(" ", "").replace("\n", "")+ nppc = self.n_points_per_cubic_curve+ for each in self:+ if len(each.points) == 0:+ continue+ points = each.points+ last = points[0]+ each.clear_points()+ for index, point in enumerate(points):+ each.append_points([point])+ if (+ index != len(points) - 1+ and (index + 1) % nppc == 0+ and any(point != points[index + 1])+ ):+ each.add_line_to(last)+ last = points[index + 1]+ each.add_line_to(last)+ if self.t2c:+ self.set_color_by_t2c()+ if self.gradient:+ self.set_color_by_gradient(*self.gradient)+ if self.t2g:+ self.set_color_by_t2g()+ # anti-aliasing+ if self.height is None and self.width is None:+ self.scale(TEXT_MOB_SCALE_FACTOR)++ def gen_chars(self):+ chars = VGroup()+ submobjects_char_index = 0+ for char_index in range(self.text.__len__()):+ if (+ self.text[char_index] in [" ","\t","\n"]+ ):+ space = Dot(redius=0, fill_opacity=0, stroke_opacity=0)+ if char_index == 0:+ space.move_to(self.submobjects[submobjects_char_index].get_center())+ else:+ space.move_to(+ self.submobjects[submobjects_char_index - 1].get_center()+ )+ chars.add(space)+ else:+ chars.add(self.submobjects[submobjects_char_index])+ submobjects_char_index += 1+ return chars++ def remove_last_M(self, file_name):+ with open(file_name, "r") as fpr:+ content = fpr.read()+ content = re.sub(r'Z M [^A-Za-z]*? "\/>', 'Z "/>', content)+ with open(file_name, "w") as fpw:+ fpw.write(content)++ def find_indexes(self, word, text):+ m = re.match(r"\[([0-9\-]{0,}):([0-9\-]{0,})\]", word)+ if m:+ start = int(m.group(1)) if m.group(1) != "" else 0+ end = int(m.group(2)) if m.group(2) != "" else len(text)+ start = len(text) + start if start < 0 else start+ end = len(text) + end if end < 0 else end+ return [(start, end)]+ indexes = []+ index = text.find(word)+ while index != -1:+ indexes.append((index, index + len(word)))+ index = text.find(word, index + len(word))+ return indexes++ def full2short(self, config):+ for kwargs in [config, self.CONFIG]:+ if kwargs.__contains__("text2color"):+ kwargs["t2c"] = kwargs.pop("text2color")+ if kwargs.__contains__("text2font"):+ kwargs["t2f"] = kwargs.pop("text2font")+ if kwargs.__contains__("text2gradient"):+ kwargs["t2g"] = kwargs.pop("text2gradient")+ if kwargs.__contains__("text2slant"):+ kwargs["t2s"] = kwargs.pop("text2slant")+ if kwargs.__contains__("text2weight"):+ kwargs["t2w"] = kwargs.pop("text2weight")++ def set_color_by_t2c(self, t2c=None):+ t2c = t2c if t2c else self.t2c+ for word, color in list(t2c.items()):+ for start, end in self.find_indexes(word, self.original_text):+ self.chars[start:end].set_color(color)++ def set_color_by_t2g(self, t2g=None):+ t2g = t2g if t2g else self.t2g+ for word, gradient in list(t2g.items()):+ for start, end in self.find_indexes(word, self.original_text):+ self.chars[start:end].set_color_by_gradient(*gradient)++ def str2style(self, string):+ if string == NORMAL:+ return pangocffi.Style.NORMAL+ elif string == ITALIC:+ return pangocffi.Style.ITALIC+ elif string == OBLIQUE:+ return pangocffi.Style.OBLIQUE+ else:+ raise AttributeError("There is no Style Called %s"%string)++ def str2weight(self, string):+ if string == NORMAL:+ return pangocffi.Weight.NORMAL+ elif string == BOLD:+ return pangocffi.Weight.BOLD+ # TODO: Add other font Weights https://pangocffi.readthedocs.io/en/latest/modules.html?highlight=normal#weight++ def text2hash(self):+ settings = "PANGO" + self.font + self.slant + self.weight #to differentiate Text and PangoText+ settings += str(self.t2f) + str(self.t2s) + str(self.t2w)+ settings += str(self.line_spacing) + str(self.size)+ id_str = self.text + settings+ hasher = hashlib.sha256()+ hasher.update(id_str.encode())+ return hasher.hexdigest()[:16]++ def text2settings(self):+ settings = []+ t2x = [self.t2f, self.t2s, self.t2w]+ for i in range(len(t2x)):+ fsw = [self.font, self.slant, self.weight]+ if t2x[i]:+ for word, x in list(t2x[i].items()):+ for start, end in self.find_indexes(word, self.text):+ fsw[i] = x+ settings.append(TextSetting(start, end, *fsw))+ # Set All text settings(default font slant weight)+ fsw = [self.font, self.slant, self.weight]+ settings.sort(key=lambda setting: setting.start)+ temp_settings = settings.copy()+ start = 0+ for setting in settings:+ if setting.start != start:+ temp_settings.append(TextSetting(start, setting.start, *fsw))+ start = setting.end+ if start != len(self.text):+ temp_settings.append(TextSetting(start, len(self.text), *fsw))+ settings = sorted(temp_settings, key=lambda setting: setting.start)++ if re.search(r"\n", self.text):+ line_num = 0+ for start, end in self.find_indexes("\n", self.text):+ for setting in settings:+ if setting.line_num == -1:+ setting.line_num = line_num+ if start < setting.end:+ line_num += 1+ new_setting = copy.copy(setting)+ setting.end = end+ new_setting.start = end+ new_setting.line_num = line_num+ settings.append(new_setting)+ settings.sort(key=lambda setting: setting.start)+ break+ for setting in settings:+ if setting.line_num == -1:+ setting.line_num = 0+ return settings++ def text2svg(self):+ # anti-aliasing+ size = self.size * 10+ line_spacing = self.line_spacing * 10++ if self.font == "":+ if NOT_SETTING_FONT_MSG != "":+ print(NOT_SETTING_FONT_MSG)+ dir_name = file_writer_config["text_dir"]+ hash_name = self.text2hash()+ file_name = os.path.join(dir_name, hash_name) + ".svg"+ if os.path.exists(file_name):+ return file_name+ surface = cairocffi.SVGSurface(file_name, 600, 400)+ context = cairocffi.Context(surface)+ #real coding++ #context.set_font_size(size)+ context.move_to(START_X, START_Y)++ settings = self.text2settings()+ offset_x = 0+ last_line_num = 0+ for setting in settings:+ family = setting.font+ style = self.str2style(setting.slant)+ weight = self.str2weight(setting.weight)+ text = self.text[setting.start : setting.end].replace("\n", " ")+ layout = pangocairocffi.create_layout(context)+ layout.set_width(pangocffi.units_from_double(600))+ fontdesc = pangocffi.FontDescription()+ fontdesc.set_size(pangocffi.units_from_double(size))+ if family:+ fontdesc.set_family("sans-serif")+ fontdesc.set_style(style)+ fontdesc.set_weight(weight)+ layout.set_font_description(fontdesc)+ if setting.line_num != last_line_num:+ offset_x = 0+ last_line_num = setting.line_num+ context.move_to(+ START_X + offset_x, START_Y + line_spacing * setting.line_num+ )+ layout.set_markup(text)+ print(text)+ pangocairocffi.show_layout(context, layout)+ offset_x += layout.get_extents()[0].x+ surface.finish()+ return file_name\ No newline at end of filediff --git a/poetry.lock b/poetry.lockindex 3378eb4ca..531d09aac 100644--- a/poetry.lock+++ b/poetry.lock@@ -22,12 +22,13 @@ description = "Classes Without Boilerplate"name = "attrs"optional = falsepython-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"-version = "20.1.0"+version = "20.2.0"[package.extras]dev = ["coverage (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "sphinx", "sphinx-rtd-theme", "pre-commit"]docs = ["sphinx", "sphinx-rtd-theme", "zope.interface"]tests = ["coverage (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"]+tests_no_zope = ["coverage (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"][[package]]category = "dev"@@ -48,14 +49,38 @@ toml = ">=0.10.1"typed-ast = ">=1.4.0"typing-extensions = ">=3.7.4"-[package.dependencies.dataclasses]-python = "<3.7"-version = ">=0.6"-[package.extras]colorama = ["colorama (>=0.4.3)"]d = ["aiohttp (>=3.3.2)", "aiohttp-cors"]+[[package]]+category = "main"+description = "cffi-based cairo bindings for Python"+name = "cairocffi"+optional = false+python-versions = ">= 3.5"+version = "1.1.0"++[package.dependencies]+cffi = ">=1.1.0"+setuptools = ">=39.2.0"++[package.extras]+doc = ["sphinx", "sphinx-rtd-theme"]+test = ["pytest-runner", "pytest-cov", "pytest-flake8", "pytest-isort"]+xcb = ["xcffib (>=0.3.2)"]++[[package]]+category = "main"+description = "Foreign Function Interface for Python calling C code."+name = "cffi"+optional = false+python-versions = "*"+version = "1.14.3"++[package.dependencies]+pycparser = "*"+[[package]]category = "dev"description = "Composable command line interface toolkit"@@ -95,15 +120,6 @@ version = "0.9.1"[package.extras]test = ["flake8 (3.7.8)", "hypothesis (3.55.3)"]-[[package]]-category = "main"-description = "A backport of the dataclasses module for Python 3.6"-marker = "python_version >= \"3.6\" and python_version < \"3.7\" or platform_python_implementation == \"CPython\" and python_version < \"3.7\""-name = "dataclasses"-optional = false-python-versions = ">=3.6, <3.7"-version = "0.7"-[[package]]category = "dev"description = "Read metadata from Python packages"@@ -151,7 +167,7 @@ description = "NumPy is the fundamental package for array computing with Python.name = "numpy"optional = falsepython-versions = ">=3.6"-version = "1.19.1"+version = "1.19.2"[[package]]category = "dev"@@ -165,6 +181,30 @@ version = "20.4"pyparsing = ">=2.0.2"six = "*"+[[package]]+category = "main"+description = "CFFI-based pango-cairo bindings for Python"+name = "pangocairocffi"+optional = false+python-versions = ">=3.5"+version = "0.3.0"++[package.dependencies]+cairocffi = ">=1.0.2"+cffi = ">=1.1.0"+pangocffi = ">=0.4.0"++[[package]]+category = "main"+description = "CFFI-based pango bindings for Python"+name = "pangocffi"+optional = false+python-versions = ">=3.5"+version = "0.6.0"++[package.dependencies]+cffi = ">=1.1.0"+[[package]]category = "dev"description = "Utility library for gitignore style pattern matching of file paths."@@ -225,9 +265,16 @@ version = "1.19.2"[package.source]reference = "testpypi"-type = "legacy"url = "https://test.pypi.org/simple"+[[package]]+category = "main"+description = "C parser in Python"+name = "pycparser"+optional = false+python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"+version = "2.20"+[[package]]category = "main"description = "Manipulate audio with an simple and easy high level interface"@@ -242,7 +289,7 @@ description = "Pygments is a syntax highlighting package written in Python."name = "pygments"optional = falsepython-versions = ">=3.5"-version = "2.6.1"+version = "2.7.1"[[package]]category = "dev"@@ -267,7 +314,7 @@ description = "pytest: simple powerful testing with Python"name = "pytest"optional = falsepython-versions = ">=3.5"-version = "6.0.1"+version = "6.0.2"[package.dependencies]atomicwrites = ">=1.0"@@ -303,7 +350,7 @@ description = "Render rich text, tables, progress bars, syntax highlighting, marname = "rich"optional = falsepython-versions = ">=3.6,<4.0"-version = "6.0.0"+version = "7.0.0"[package.dependencies]colorama = ">=0.4.0,<0.5.0"@@ -311,10 +358,6 @@ commonmark = ">=0.9.0,<0.10.0"pygments = ">=2.6.0,<3.0.0"typing-extensions = ">=3.7.4,<4.0.0"-[package.dependencies.dataclasses]-python = ">=3.6,<3.7"-version = ">=0.7,<0.8"-[package.extras]jupyter = ["ipywidgets (>=7.5.1,<8.0.0)"]@@ -351,7 +394,7 @@ description = "Fast, Extensible Progress Meter"name = "tqdm"optional = falsepython-versions = ">=2.6, !=3.0.*, !=3.1.*"-version = "4.48.2"+version = "4.49.0"[package.extras]dev = ["py-make (>=0.1.0)", "twine", "argopt", "pydoc-markdown"]@@ -380,16 +423,15 @@ marker = "python_version < \"3.8\""name = "zipp"optional = falsepython-versions = ">=3.6"-version = "3.1.0"+version = "3.2.0"[package.extras]docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"]-testing = ["jaraco.itertools", "func-timeout"]+testing = ["pytest (>=3.5,<3.7.3 || >3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "jaraco.test (>=3.2.0)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"][metadata]-content-hash = "56ddf8f8a518e174467f740b3556f330df02d9a4c5551afbdb33b342081a49f3"-lock-version = "1.0"-python-versions = "^3.6"+content-hash = "bf5bcbfced67910b7c6705810d505f4a256f1338f7908dbc45d476c6bc6d24f6"+python-versions = "^3.7"[metadata.files]appdirs = [@@ -401,13 +443,53 @@ atomicwrites = [{file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"},]attrs = [- {file = "attrs-20.1.0-py2.py3-none-any.whl", hash = "sha256:2867b7b9f8326499ab5b0e2d12801fa5c98842d2cbd22b35112ae04bf85b4dff"},- {file = "attrs-20.1.0.tar.gz", hash = "sha256:0ef97238856430dcf9228e07f316aefc17e8939fc8507e18c6501b761ef1a42a"},+ {file = "attrs-20.2.0-py2.py3-none-any.whl", hash = "sha256:fce7fc47dfc976152e82d53ff92fa0407700c21acd20886a13777a0d20e655dc"},+ {file = "attrs-20.2.0.tar.gz", hash = "sha256:26b54ddbbb9ee1d34d5d3668dd37d6cf74990ab23c828c2888dccdceee395594"},]black = [- {file = "black-20.8b1-py3-none-any.whl", hash = "sha256:70b62ef1527c950db59062cda342ea224d772abdf6adc58b86a45421bab20a6b"},{file = "black-20.8b1.tar.gz", hash = "sha256:1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea"},]+cairocffi = [+ {file = "cairocffi-1.1.0.tar.gz", hash = "sha256:f1c0c5878f74ac9ccb5d48b2601fcc75390c881ce476e79f4cfedd288b1b05db"},+]+cffi = [+ {file = "cffi-1.14.3-2-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:3eeeb0405fd145e714f7633a5173318bd88d8bbfc3dd0a5751f8c4f70ae629bc"},+ {file = "cffi-1.14.3-2-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:cb763ceceae04803adcc4e2d80d611ef201c73da32d8f2722e9d0ab0c7f10768"},+ {file = "cffi-1.14.3-2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:44f60519595eaca110f248e5017363d751b12782a6f2bd6a7041cba275215f5d"},+ {file = "cffi-1.14.3-2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c53af463f4a40de78c58b8b2710ade243c81cbca641e34debf3396a9640d6ec1"},+ {file = "cffi-1.14.3-2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:33c6cdc071ba5cd6d96769c8969a0531be2d08c2628a0143a10a7dcffa9719ca"},+ {file = "cffi-1.14.3-2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c11579638288e53fc94ad60022ff1b67865363e730ee41ad5e6f0a17188b327a"},+ {file = "cffi-1.14.3-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:3cb3e1b9ec43256c4e0f8d2837267a70b0e1ca8c4f456685508ae6106b1f504c"},+ {file = "cffi-1.14.3-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:f0620511387790860b249b9241c2f13c3a80e21a73e0b861a2df24e9d6f56730"},+ {file = "cffi-1.14.3-cp27-cp27m-win32.whl", hash = "sha256:005f2bfe11b6745d726dbb07ace4d53f057de66e336ff92d61b8c7e9c8f4777d"},+ {file = "cffi-1.14.3-cp27-cp27m-win_amd64.whl", hash = "sha256:2f9674623ca39c9ebe38afa3da402e9326c245f0f5ceff0623dccdac15023e05"},+ {file = "cffi-1.14.3-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:09e96138280241bd355cd585148dec04dbbedb4f46128f340d696eaafc82dd7b"},+ {file = "cffi-1.14.3-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:3363e77a6176afb8823b6e06db78c46dbc4c7813b00a41300a4873b6ba63b171"},+ {file = "cffi-1.14.3-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:0ef488305fdce2580c8b2708f22d7785ae222d9825d3094ab073e22e93dfe51f"},+ {file = "cffi-1.14.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:0b1ad452cc824665ddc682400b62c9e4f5b64736a2ba99110712fdee5f2505c4"},+ {file = "cffi-1.14.3-cp35-cp35m-win32.whl", hash = "sha256:85ba797e1de5b48aa5a8427b6ba62cf69607c18c5d4eb747604b7302f1ec382d"},+ {file = "cffi-1.14.3-cp35-cp35m-win_amd64.whl", hash = "sha256:e66399cf0fc07de4dce4f588fc25bfe84a6d1285cc544e67987d22663393926d"},+ {file = "cffi-1.14.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:15f351bed09897fbda218e4db5a3d5c06328862f6198d4fb385f3e14e19decb3"},+ {file = "cffi-1.14.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4d7c26bfc1ea9f92084a1d75e11999e97b62d63128bcc90c3624d07813c52808"},+ {file = "cffi-1.14.3-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:23e5d2040367322824605bc29ae8ee9175200b92cb5483ac7d466927a9b3d537"},+ {file = "cffi-1.14.3-cp36-cp36m-win32.whl", hash = "sha256:a624fae282e81ad2e4871bdb767e2c914d0539708c0f078b5b355258293c98b0"},+ {file = "cffi-1.14.3-cp36-cp36m-win_amd64.whl", hash = "sha256:de31b5164d44ef4943db155b3e8e17929707cac1e5bd2f363e67a56e3af4af6e"},+ {file = "cffi-1.14.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:f92cdecb618e5fa4658aeb97d5eb3d2f47aa94ac6477c6daf0f306c5a3b9e6b1"},+ {file = "cffi-1.14.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:22399ff4870fb4c7ef19fff6eeb20a8bbf15571913c181c78cb361024d574579"},+ {file = "cffi-1.14.3-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:f4eae045e6ab2bb54ca279733fe4eb85f1effda392666308250714e01907f394"},+ {file = "cffi-1.14.3-cp37-cp37m-win32.whl", hash = "sha256:b0358e6fefc74a16f745afa366acc89f979040e0cbc4eec55ab26ad1f6a9bfbc"},+ {file = "cffi-1.14.3-cp37-cp37m-win_amd64.whl", hash = "sha256:6642f15ad963b5092d65aed022d033c77763515fdc07095208f15d3563003869"},+ {file = "cffi-1.14.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:2791f68edc5749024b4722500e86303a10d342527e1e3bcac47f35fbd25b764e"},+ {file = "cffi-1.14.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:529c4ed2e10437c205f38f3691a68be66c39197d01062618c55f74294a4a4828"},+ {file = "cffi-1.14.3-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:8f0f1e499e4000c4c347a124fa6a27d37608ced4fe9f7d45070563b7c4c370c9"},+ {file = "cffi-1.14.3-cp38-cp38-win32.whl", hash = "sha256:3b8eaf915ddc0709779889c472e553f0d3e8b7bdf62dab764c8921b09bf94522"},+ {file = "cffi-1.14.3-cp38-cp38-win_amd64.whl", hash = "sha256:bbd2f4dfee1079f76943767fce837ade3087b578aeb9f69aec7857d5bf25db15"},+ {file = "cffi-1.14.3-cp39-cp39-manylinux1_i686.whl", hash = "sha256:cc75f58cdaf043fe6a7a6c04b3b5a0e694c6a9e24050967747251fb80d7bce0d"},+ {file = "cffi-1.14.3-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:bf39a9e19ce7298f1bd6a9758fa99707e9e5b1ebe5e90f2c3913a47bc548747c"},+ {file = "cffi-1.14.3-cp39-cp39-win32.whl", hash = "sha256:d80998ed59176e8cba74028762fbd9b9153b9afc71ea118e63bbf5d4d0f9552b"},+ {file = "cffi-1.14.3-cp39-cp39-win_amd64.whl", hash = "sha256:c150eaa3dadbb2b5339675b88d4573c1be3cb6f2c33a6c83387e10cc0bf05bd3"},+ {file = "cffi-1.14.3.tar.gz", hash = "sha256:f92f789e4f9241cd262ad7a555ca2c648a98178a953af117ef7fad46aa1d5591"},+]click = [{file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"},{file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"},@@ -424,10 +506,6 @@ commonmark = [{file = "commonmark-0.9.1-py2.py3-none-any.whl", hash = "sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9"},{file = "commonmark-0.9.1.tar.gz", hash = "sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"},]-dataclasses = [- {file = "dataclasses-0.7-py3-none-any.whl", hash = "sha256:3459118f7ede7c8bea0fe795bff7c6c2ce287d01dd226202f7c9ebc0610a7836"},- {file = "dataclasses-0.7.tar.gz", hash = "sha256:494a6dcae3b8bcf80848eea2ef64c0cc5cd307ffc263e17cdf42f3e5420808e6"},-]importlib-metadata = [{file = "importlib_metadata-1.7.0-py2.py3-none-any.whl", hash = "sha256:dc15b2969b4ce36305c51eebe62d418ac7791e9a157911d58bfb1f9ccd8e2070"},{file = "importlib_metadata-1.7.0.tar.gz", hash = "sha256:90bb658cdbbf6d1735b6341ce708fc7024a3e14e99ffdc5783edea9f9b077f83"},@@ -445,37 +523,43 @@ mypy-extensions = [{file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"},]numpy = [- {file = "numpy-1.19.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:b1cca51512299841bf69add3b75361779962f9cee7d9ee3bb446d5982e925b69"},- {file = "numpy-1.19.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:c9591886fc9cbe5532d5df85cb8e0cc3b44ba8ce4367bd4cf1b93dc19713da72"},- {file = "numpy-1.19.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:cf1347450c0b7644ea142712619533553f02ef23f92f781312f6a3553d031fc7"},- {file = "numpy-1.19.1-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:ed8a311493cf5480a2ebc597d1e177231984c818a86875126cfd004241a73c3e"},- {file = "numpy-1.19.1-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:3673c8b2b29077f1b7b3a848794f8e11f401ba0b71c49fbd26fb40b71788b132"},- {file = "numpy-1.19.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:56ef7f56470c24bb67fb43dae442e946a6ce172f97c69f8d067ff8550cf782ff"},- {file = "numpy-1.19.1-cp36-cp36m-win32.whl", hash = "sha256:aaf42a04b472d12515debc621c31cf16c215e332242e7a9f56403d814c744624"},- {file = "numpy-1.19.1-cp36-cp36m-win_amd64.whl", hash = "sha256:082f8d4dd69b6b688f64f509b91d482362124986d98dc7dc5f5e9f9b9c3bb983"},- {file = "numpy-1.19.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e4f6d3c53911a9d103d8ec9518190e52a8b945bab021745af4939cfc7c0d4a9e"},- {file = "numpy-1.19.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:5b6885c12784a27e957294b60f97e8b5b4174c7504665333c5e94fbf41ae5d6a"},- {file = "numpy-1.19.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:1bc0145999e8cb8aed9d4e65dd8b139adf1919e521177f198529687dbf613065"},- {file = "numpy-1.19.1-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:5a936fd51049541d86ccdeef2833cc89a18e4d3808fe58a8abeb802665c5af93"},- {file = "numpy-1.19.1-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:ef71a1d4fd4858596ae80ad1ec76404ad29701f8ca7cdcebc50300178db14dfc"},- {file = "numpy-1.19.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:b9792b0ac0130b277536ab8944e7b754c69560dac0415dd4b2dbd16b902c8954"},- {file = "numpy-1.19.1-cp37-cp37m-win32.whl", hash = "sha256:b12e639378c741add21fbffd16ba5ad25c0a1a17cf2b6fe4288feeb65144f35b"},- {file = "numpy-1.19.1-cp37-cp37m-win_amd64.whl", hash = "sha256:8343bf67c72e09cfabfab55ad4a43ce3f6bf6e6ced7acf70f45ded9ebb425055"},- {file = "numpy-1.19.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e45f8e981a0ab47103181773cc0a54e650b2aef8c7b6cd07405d0fa8d869444a"},- {file = "numpy-1.19.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:667c07063940e934287993366ad5f56766bc009017b4a0fe91dbd07960d0aba7"},- {file = "numpy-1.19.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:480fdd4dbda4dd6b638d3863da3be82873bba6d32d1fc12ea1b8486ac7b8d129"},- {file = "numpy-1.19.1-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:935c27ae2760c21cd7354402546f6be21d3d0c806fffe967f745d5f2de5005a7"},- {file = "numpy-1.19.1-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:309cbcfaa103fc9a33ec16d2d62569d541b79f828c382556ff072442226d1968"},- {file = "numpy-1.19.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:7ed448ff4eaffeb01094959b19cbaf998ecdee9ef9932381420d514e446601cd"},- {file = "numpy-1.19.1-cp38-cp38-win32.whl", hash = "sha256:de8b4a9b56255797cbddb93281ed92acbc510fb7b15df3f01bd28f46ebc4edae"},- {file = "numpy-1.19.1-cp38-cp38-win_amd64.whl", hash = "sha256:92feb989b47f83ebef246adabc7ff3b9a59ac30601c3f6819f8913458610bdcc"},- {file = "numpy-1.19.1-pp36-pypy36_pp73-manylinux2010_x86_64.whl", hash = "sha256:e1b1dc0372f530f26a03578ac75d5e51b3868b9b76cd2facba4c9ee0eb252ab1"},- {file = "numpy-1.19.1.zip", hash = "sha256:b8456987b637232602ceb4d663cb34106f7eb780e247d51a260b84760fd8f491"},+ {file = "numpy-1.19.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:b594f76771bc7fc8a044c5ba303427ee67c17a09b36e1fa32bde82f5c419d17a"},+ {file = "numpy-1.19.2-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:e6ddbdc5113628f15de7e4911c02aed74a4ccff531842c583e5032f6e5a179bd"},+ {file = "numpy-1.19.2-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:3733640466733441295b0d6d3dcbf8e1ffa7e897d4d82903169529fd3386919a"},+ {file = "numpy-1.19.2-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:4339741994c775396e1a274dba3609c69ab0f16056c1077f18979bec2a2c2e6e"},+ {file = "numpy-1.19.2-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:7c6646314291d8f5ea900a7ea9c4261f834b5b62159ba2abe3836f4fa6705526"},+ {file = "numpy-1.19.2-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:7118f0a9f2f617f921ec7d278d981244ba83c85eea197be7c5a4f84af80a9c3c"},+ {file = "numpy-1.19.2-cp36-cp36m-win32.whl", hash = "sha256:9a3001248b9231ed73894c773142658bab914645261275f675d86c290c37f66d"},+ {file = "numpy-1.19.2-cp36-cp36m-win_amd64.whl", hash = "sha256:967c92435f0b3ba37a4257c48b8715b76741410467e2bdb1097e8391fccfae15"},+ {file = "numpy-1.19.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:d526fa58ae4aead839161535d59ea9565863bb0b0bdb3cc63214613fb16aced4"},+ {file = "numpy-1.19.2-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:eb25c381d168daf351147713f49c626030dcff7a393d5caa62515d415a6071d8"},+ {file = "numpy-1.19.2-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:62139af94728d22350a571b7c82795b9d59be77fc162414ada6c8b6a10ef5d02"},+ {file = "numpy-1.19.2-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:0c66da1d202c52051625e55a249da35b31f65a81cb56e4c69af0dfb8fb0125bf"},+ {file = "numpy-1.19.2-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:2117536e968abb7357d34d754e3733b0d7113d4c9f1d921f21a3d96dec5ff716"},+ {file = "numpy-1.19.2-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:54045b198aebf41bf6bf4088012777c1d11703bf74461d70cd350c0af2182e45"},+ {file = "numpy-1.19.2-cp37-cp37m-win32.whl", hash = "sha256:aba1d5daf1144b956bc87ffb87966791f5e9f3e1f6fab3d7f581db1f5b598f7a"},+ {file = "numpy-1.19.2-cp37-cp37m-win_amd64.whl", hash = "sha256:addaa551b298052c16885fc70408d3848d4e2e7352de4e7a1e13e691abc734c1"},+ {file = "numpy-1.19.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:58d66a6b3b55178a1f8a5fe98df26ace76260a70de694d99577ddeab7eaa9a9d"},+ {file = "numpy-1.19.2-cp38-cp38-manylinux1_i686.whl", hash = "sha256:59f3d687faea7a4f7f93bd9665e5b102f32f3fa28514f15b126f099b7997203d"},+ {file = "numpy-1.19.2-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:cebd4f4e64cfe87f2039e4725781f6326a61f095bc77b3716502bed812b385a9"},+ {file = "numpy-1.19.2-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:c35a01777f81e7333bcf276b605f39c872e28295441c265cd0c860f4b40148c1"},+ {file = "numpy-1.19.2-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:d7ac33585e1f09e7345aa902c281bd777fdb792432d27fca857f39b70e5dd31c"},+ {file = "numpy-1.19.2-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:04c7d4ebc5ff93d9822075ddb1751ff392a4375e5885299445fcebf877f179d5"},+ {file = "numpy-1.19.2-cp38-cp38-win32.whl", hash = "sha256:51ee93e1fac3fe08ef54ff1c7f329db64d8a9c5557e6c8e908be9497ac76374b"},+ {file = "numpy-1.19.2-cp38-cp38-win_amd64.whl", hash = "sha256:1669ec8e42f169ff715a904c9b2105b6640f3f2a4c4c2cb4920ae8b2785dac65"},+ {file = "numpy-1.19.2-pp36-pypy36_pp73-manylinux2010_x86_64.whl", hash = "sha256:0bfd85053d1e9f60234f28f63d4a5147ada7f432943c113a11afcf3e65d9d4c8"},+ {file = "numpy-1.19.2.zip", hash = "sha256:0d310730e1e793527065ad7dde736197b705d0e4c9999775f212b03c44a8484c"},]packaging = [{file = "packaging-20.4-py2.py3-none-any.whl", hash = "sha256:998416ba6962ae7fbd6596850b80e17859a5753ba17c32284f67bfff33784181"},{file = "packaging-20.4.tar.gz", hash = "sha256:4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8"},]+pangocairocffi = [+ {file = "pangocairocffi-0.3.0.tar.gz", hash = "sha256:9bb95712b16c4f943fe7560fb2759fb4aa9fb4e4950f92f5a687c31c08a1478c"},+]+pangocffi = [+ {file = "pangocffi-0.6.0.tar.gz", hash = "sha256:bce26a098d0ce77bc5e9b6ce0cd0aa256e0abdaef22b2e667d80ad57ed4c4c1c"},+]pathspec = [{file = "pathspec-0.8.0-py2.py3-none-any.whl", hash = "sha256:7d91249d21749788d07a2d0f94147accd8f845507400749ea19c1ec9054a12b0"},{file = "pathspec-0.8.0.tar.gz", hash = "sha256:da45173eb3a6f2a5a487efba21f050af2b41948be6ab52b6a1e3ff22bb8b7061"},@@ -528,15 +612,21 @@ pycairo = [{file = "pycairo-1.19.2-cp37-cp37m-win_amd64.whl", hash = "sha256:927fbb4f62a60177d69e17d9049f98438a9fe5e6d6553754dca7d65ab73b1995"},{file = "pycairo-1.19.2-cp38-cp38-win32.whl", hash = "sha256:5041b1c8bafc45e46b7847d86bef34ad7a94b03a3a855b7bd637a03588a66734"},{file = "pycairo-1.19.2-cp38-cp38-win_amd64.whl", hash = "sha256:8dc94be70ef8b3df858ea21bb4664f2e67fc0e048bb03f4be25b26824e4883b0"},+ {file = "pycairo-1.19.2-cp39-cp39-win32.whl", hash = "sha256:fea7217a36fab37c93e1ad0b13c1ea82af721e8aaf0c57e0ded8e3ddf9ff69a9"},+ {file = "pycairo-1.19.2-cp39-cp39-win_amd64.whl", hash = "sha256:0216c5343ea58bfa12204d4baa79f8b46f6f8e4f7fd4937ef765e25e17b230ba"},{file = "pycairo-1.19.2.tar.gz", hash = "sha256:2c143183280feb67f5beb4e543fd49990c28e7df427301ede04fc550d3562e84"},]+pycparser = [+ {file = "pycparser-2.20-py2.py3-none-any.whl", hash = "sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705"},+ {file = "pycparser-2.20.tar.gz", hash = "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0"},+]pydub = [{file = "pydub-0.24.1-py2.py3-none-any.whl", hash = "sha256:25fdfbbfd4c69363006a27c7bd2346c4b886a0dd3da264c14d858b71a9593284"},{file = "pydub-0.24.1.tar.gz", hash = "sha256:630c68bfff9bb27cbc5e1f02923f717c3bc5f4d73fd685fda08b6ce90f76dc69"},]pygments = [- {file = "Pygments-2.6.1-py3-none-any.whl", hash = "sha256:ff7a40b4860b727ab48fad6360eb351cc1b33cbf9b15a0f689ca5353e9463324"},- {file = "Pygments-2.6.1.tar.gz", hash = "sha256:647344a061c249a3b74e230c739f434d7ea4d8b1d5f3721bc0f3558049b38f44"},+ {file = "Pygments-2.7.1-py3-none-any.whl", hash = "sha256:307543fe65c0947b126e83dd5a61bd8acbd84abec11f43caebaf5534cbc17998"},+ {file = "Pygments-2.7.1.tar.gz", hash = "sha256:926c3f319eda178d1bd90851e4317e6d8cdb5e292a3386aac9bd75eca29cf9c7"},]pyparsing = [{file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"},@@ -548,8 +638,8 @@ pyreadline = [{file = "pyreadline-2.1.zip", hash = "sha256:4530592fc2e85b25b1a9f79664433da09237c1a270e4d78ea5aa3a2c7229e2d1"},]pytest = [- {file = "pytest-6.0.1-py3-none-any.whl", hash = "sha256:8b6007800c53fdacd5a5c192203f4e531eb2a1540ad9c752e052ec0f7143dbad"},- {file = "pytest-6.0.1.tar.gz", hash = "sha256:85228d75db9f45e06e57ef9bf4429267f81ac7c0d742cc9ed63d09886a9fe6f4"},+ {file = "pytest-6.0.2-py3-none-any.whl", hash = "sha256:0e37f61339c4578776e090c3b8f6b16ce4db333889d65d0efb305243ec544b40"},+ {file = "pytest-6.0.2.tar.gz", hash = "sha256:c8f57c2a30983f469bf03e68cdfa74dc474ce56b8f280ddcb080dfd91df01043"},]regex = [{file = "regex-2020.7.14-cp27-cp27m-win32.whl", hash = "sha256:e46d13f38cfcbb79bfdb2964b0fe12561fe633caf964a77a5f8d4e45fe5d2ef7"},@@ -575,8 +665,8 @@ regex = [{file = "regex-2020.7.14.tar.gz", hash = "sha256:3a3af27a8d23143c49a3420efe5b3f8cf1a48c6fc8bc6856b03f638abc1833bb"},]rich = [- {file = "rich-6.0.0-py3-none-any.whl", hash = "sha256:75bb80a52a550424a9f36bfdc57dc2977a2b8d0a1eb3b011df258c017d8ba322"},- {file = "rich-6.0.0.tar.gz", hash = "sha256:53c683a79e3f949d675b1d04e6fe3ccd53fad97aa7e2f6a83f2985502663f420"},+ {file = "rich-7.0.0-py3-none-any.whl", hash = "sha256:941c679ea681f0915eb986e48c38fa74f661f31bf815a3be696b27588469faf3"},+ {file = "rich-7.0.0.tar.gz", hash = "sha256:291700f5c09fae83676f44781d01a292c39efad9505dd4724899646b794f9afb"},]scipy = [{file = "scipy-1.5.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cca9fce15109a36a0a9f9cfc64f870f1c140cb235ddf27fe0328e6afb44dfed0"},@@ -605,8 +695,8 @@ toml = [{file = "toml-0.10.1.tar.gz", hash = "sha256:926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f"},]tqdm = [- {file = "tqdm-4.48.2-py2.py3-none-any.whl", hash = "sha256:1a336d2b829be50e46b84668691e0a2719f26c97c62846298dd5ae2937e4d5cf"},- {file = "tqdm-4.48.2.tar.gz", hash = "sha256:564d632ea2b9cb52979f7956e093e831c28d441c11751682f84c86fc46e4fd21"},+ {file = "tqdm-4.49.0-py2.py3-none-any.whl", hash = "sha256:8f3c5815e3b5e20bc40463fa6b42a352178859692a68ffaa469706e6d38342a5"},+ {file = "tqdm-4.49.0.tar.gz", hash = "sha256:faf9c671bd3fad5ebaeee366949d969dca2b2be32c872a7092a1e1a9048d105b"},]typed-ast = [{file = "typed_ast-1.4.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3"},@@ -637,6 +727,6 @@ typing-extensions = [{file = "typing_extensions-3.7.4.3.tar.gz", hash = "sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c"},]zipp = [- {file = "zipp-3.1.0-py3-none-any.whl", hash = "sha256:aa36550ff0c0b7ef7fa639055d797116ee891440eac1a56f378e2d3179e0320b"},- {file = "zipp-3.1.0.tar.gz", hash = "sha256:c599e4d75c98f6798c509911d08a22e6c021d074469042177c8c86fb92eefd96"},+ {file = "zipp-3.2.0-py3-none-any.whl", hash = "sha256:43f4fa8d8bb313e65d8323a3952ef8756bf40f9a5c3ea7334be23ee4ec8278b6"},+ {file = "zipp-3.2.0.tar.gz", hash = "sha256:b52f22895f4cfce194bc8172f3819ee8de7540aa6d873535a8668b730b8b411f"},]diff --git a/pyproject.toml b/pyproject.tomlindex 1c02c39bf..8e618f10c 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -24,7 +24,7 @@ packages = [][tool.poetry.dependencies]-python = "^3.6"+python = "^3.7"colour = "*"numpy = "*"Pillow = "*"@@ -39,8 +39,11 @@ pycairo = [{ version = "^1.19", markers = "sys_platform != 'win32'"},{ version = "^1.19", markers = "sys_platform == 'win32'", source="testpypi" },]-dataclasses = {version = "^0.7", python = "~3.6"}+pangocffi = "^0.6.0"+pangocairocffi = "^0.3.0"+# add cairocffi+cairocffi = "^1.1.0"[tool.poetry.dev-dependencies]pytest = "^6.0"