manimpango 0.2.6__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ManimPango-0.2.6 → ManimPango-0.3.1}/ManimPango.egg-info/PKG-INFO +6 -6
- {ManimPango-0.2.6 → ManimPango-0.3.1}/ManimPango.egg-info/SOURCES.txt +1 -2
- {ManimPango-0.2.6 → ManimPango-0.3.1}/PKG-INFO +6 -6
- {ManimPango-0.2.6 → ManimPango-0.3.1}/docs/RELEASE.rst +6 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/manimpango/_version.py +1 -1
- {ManimPango-0.2.6 → ManimPango-0.3.1}/manimpango/cmanimpango.pyx +33 -3
- {ManimPango-0.2.6 → ManimPango-0.3.1}/manimpango/glib.pxd +5 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/manimpango/register_font.pxd +14 -12
- {ManimPango-0.2.6 → ManimPango-0.3.1}/manimpango/register_font.pyx +73 -53
- ManimPango-0.3.1/pyproject.toml +11 -0
- ManimPango-0.3.1/requirements-dev.txt +4 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/setup.py +17 -10
- {ManimPango-0.2.6 → ManimPango-0.3.1}/tests/__init__.py +0 -8
- ManimPango-0.3.1/tests/_manim.py +219 -0
- ManimPango-0.3.1/tests/conftest.py +129 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/tests/fonts/LICENSE.txt +1 -1
- ManimPango-0.3.1/tests/fonts/MaShanZheng-Regular.ttf +0 -0
- ManimPango-0.3.1/tests/test_fonts.py +121 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/tests/test_list_fonts.py +6 -6
- {ManimPango-0.2.6 → ManimPango-0.3.1}/tests/test_markup.py +30 -18
- ManimPango-0.2.6/pyproject.toml +0 -2
- ManimPango-0.2.6/requirements-dev.txt +0 -5
- ManimPango-0.2.6/tests/_manim.py +0 -106
- ManimPango-0.2.6/tests/conftest.py +0 -10
- ManimPango-0.2.6/tests/fonts/NotoNastaliqUrdu-Regular.ttf +0 -0
- ManimPango-0.2.6/tests/test_fonts.py +0 -97
- ManimPango-0.2.6/tests/test_import.py +0 -5
- {ManimPango-0.2.6 → ManimPango-0.3.1}/.coveragerc +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/CODE_OF_CONDUCT.md +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/LICENSE +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/MANIFEST.in +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/ManimPango.egg-info/dependency_links.txt +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/ManimPango.egg-info/not-zip-safe +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/ManimPango.egg-info/top_level.txt +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/README.md +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/docs/_static/favicon.ico +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/docs/_templates/autosummary/class.rst +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/docs/_templates/autosummary/module.rst +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/docs/conf.py +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/docs/index.rst +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/docs/make.bat +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/docs/reference.rst +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/manimpango/__init__.py +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/manimpango/cairo.pxd +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/manimpango/cmanimpango.pxd +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/manimpango/enums.pyx +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/manimpango/pango.pxd +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/manimpango/utils.py +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/setup.cfg +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/tests/fonts/AdobeVFPrototype.ttf +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/tests/fonts/BungeeColor-Regular_colr_Windows.ttf +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/tests/fonts/BungeeOutline-Regular.ttf +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/tests/svg_tester.py +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/tests/test_utils.py +0 -0
- {ManimPango-0.2.6 → ManimPango-0.3.1}/tests/test_version.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ManimPango
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Bindings for Pango for using with Manim.
|
|
5
5
|
Home-page: https://manimpango.manim.community/
|
|
6
6
|
Author: Naveen M K
|
|
7
7
|
Author-email: naveen@syrusdark.website
|
|
8
8
|
Maintainer: The Manim Community Developers
|
|
9
|
-
License:
|
|
9
|
+
License: GPL-3.0-or-later
|
|
10
10
|
Project-URL: Documentation, https://manimpango.manim.community/
|
|
11
11
|
Project-URL: Source, https://github.com/ManimCommunity/manimpango
|
|
12
12
|
Project-URL: Release notes, https://github.com/ManimCommunity/ManimPango/releases/
|
|
@@ -193,14 +193,14 @@ Platform: Linux
|
|
|
193
193
|
Platform: macOS
|
|
194
194
|
Platform: Windows
|
|
195
195
|
Classifier: Programming Language :: Python :: 3
|
|
196
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
197
196
|
Classifier: Programming Language :: Python :: 3.7
|
|
198
197
|
Classifier: Programming Language :: Python :: 3.8
|
|
199
198
|
Classifier: Programming Language :: Python :: 3.9
|
|
200
|
-
Classifier:
|
|
199
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
200
|
+
Classifier: Development Status :: 4 - Beta
|
|
201
201
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
202
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
202
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
203
203
|
Classifier: Operating System :: OS Independent
|
|
204
204
|
Classifier: Programming Language :: Cython
|
|
205
|
-
Requires-Python: >=3.
|
|
205
|
+
Requires-Python: >=3.7
|
|
206
206
|
Description-Content-Type: text/markdown
|
|
@@ -36,7 +36,6 @@ tests/_manim.py
|
|
|
36
36
|
tests/conftest.py
|
|
37
37
|
tests/svg_tester.py
|
|
38
38
|
tests/test_fonts.py
|
|
39
|
-
tests/test_import.py
|
|
40
39
|
tests/test_list_fonts.py
|
|
41
40
|
tests/test_markup.py
|
|
42
41
|
tests/test_utils.py
|
|
@@ -45,4 +44,4 @@ tests/fonts/AdobeVFPrototype.ttf
|
|
|
45
44
|
tests/fonts/BungeeColor-Regular_colr_Windows.ttf
|
|
46
45
|
tests/fonts/BungeeOutline-Regular.ttf
|
|
47
46
|
tests/fonts/LICENSE.txt
|
|
48
|
-
tests/fonts/
|
|
47
|
+
tests/fonts/MaShanZheng-Regular.ttf
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ManimPango
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Bindings for Pango for using with Manim.
|
|
5
5
|
Home-page: https://manimpango.manim.community/
|
|
6
6
|
Author: Naveen M K
|
|
7
7
|
Author-email: naveen@syrusdark.website
|
|
8
8
|
Maintainer: The Manim Community Developers
|
|
9
|
-
License:
|
|
9
|
+
License: GPL-3.0-or-later
|
|
10
10
|
Project-URL: Documentation, https://manimpango.manim.community/
|
|
11
11
|
Project-URL: Source, https://github.com/ManimCommunity/manimpango
|
|
12
12
|
Project-URL: Release notes, https://github.com/ManimCommunity/ManimPango/releases/
|
|
@@ -193,14 +193,14 @@ Platform: Linux
|
|
|
193
193
|
Platform: macOS
|
|
194
194
|
Platform: Windows
|
|
195
195
|
Classifier: Programming Language :: Python :: 3
|
|
196
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
197
196
|
Classifier: Programming Language :: Python :: 3.7
|
|
198
197
|
Classifier: Programming Language :: Python :: 3.8
|
|
199
198
|
Classifier: Programming Language :: Python :: 3.9
|
|
200
|
-
Classifier:
|
|
199
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
200
|
+
Classifier: Development Status :: 4 - Beta
|
|
201
201
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
202
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
202
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
203
203
|
Classifier: Operating System :: OS Independent
|
|
204
204
|
Classifier: Programming Language :: Cython
|
|
205
|
-
Requires-Python: >=3.
|
|
205
|
+
Requires-Python: >=3.7
|
|
206
206
|
Description-Content-Type: text/markdown
|
|
@@ -31,13 +31,18 @@ This means older version would have a backport of bugs fixes.
|
|
|
31
31
|
Here, ``-s`` is used to sign the tag with gpg so that users
|
|
32
32
|
can later verify it, and a tag shouldn't be created with
|
|
33
33
|
signing because Github shows it unverified.
|
|
34
|
+
|
|
34
35
|
.. important::
|
|
35
36
|
|
|
36
37
|
The message should include the changelog of the release.
|
|
38
|
+
There is a github actions which will creates a draft `release`_
|
|
39
|
+
with the changelog. You can edit them and copy it to the tag you
|
|
40
|
+
create.
|
|
37
41
|
|
|
38
42
|
8. Push the tag to remote.
|
|
39
43
|
|
|
40
44
|
9. Go to `Github`_, and `draft a new release`_ with the same tag pushed.
|
|
45
|
+
You can copy the same changelog you copied when you created the tag.
|
|
41
46
|
|
|
42
47
|
10. Check whether the CI uploads the wheels and the ``.tar.gz`` file to
|
|
43
48
|
PyPi.
|
|
@@ -50,3 +55,4 @@ This means older version would have a backport of bugs fixes.
|
|
|
50
55
|
.. _Github: https://github.com
|
|
51
56
|
.. _draft a new release: https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/managing-releases-in-a-repository#creating-a-release
|
|
52
57
|
.. _PyPi: https://pypi.org/project/manimpango/
|
|
58
|
+
.. _release: https://github.com/ManimCommunity/ManimPango/releases
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
__version__ = "0.
|
|
2
|
+
__version__ = "0.3.1"
|
|
@@ -134,9 +134,39 @@ def text2svg(
|
|
|
134
134
|
|
|
135
135
|
class MarkupUtils:
|
|
136
136
|
@staticmethod
|
|
137
|
-
def validate(
|
|
138
|
-
|
|
139
|
-
return
|
|
137
|
+
def validate(markup: str) -> str:
|
|
138
|
+
"""Validates whether markup is a valid Markup
|
|
139
|
+
and return the error's if any.
|
|
140
|
+
|
|
141
|
+
Parameters
|
|
142
|
+
==========
|
|
143
|
+
markup : :class:`str`
|
|
144
|
+
The markup which should be checked.
|
|
145
|
+
|
|
146
|
+
Returns
|
|
147
|
+
=======
|
|
148
|
+
:class:`str`
|
|
149
|
+
Returns empty string if markup is valid. If markup
|
|
150
|
+
contains error it return the error message.
|
|
151
|
+
|
|
152
|
+
"""
|
|
153
|
+
cdef GError *err = NULL
|
|
154
|
+
text_bytes = markup.encode("utf-8")
|
|
155
|
+
res = pango_parse_markup(
|
|
156
|
+
text_bytes,
|
|
157
|
+
-1,
|
|
158
|
+
0,
|
|
159
|
+
NULL,
|
|
160
|
+
NULL,
|
|
161
|
+
NULL,
|
|
162
|
+
&err
|
|
163
|
+
)
|
|
164
|
+
if res:
|
|
165
|
+
return ""
|
|
166
|
+
else:
|
|
167
|
+
message = <bytes>err.message
|
|
168
|
+
g_error_free(err)
|
|
169
|
+
return message.decode('utf-8')
|
|
140
170
|
|
|
141
171
|
@staticmethod
|
|
142
172
|
def text2svg(
|
|
@@ -4,5 +4,10 @@ cdef extern from "glib.h":
|
|
|
4
4
|
ctypedef unsigned int guint
|
|
5
5
|
ctypedef gint gboolean
|
|
6
6
|
ctypedef unsigned short guint16
|
|
7
|
+
ctypedef char gchar
|
|
8
|
+
ctypedef struct GError:
|
|
9
|
+
gint code
|
|
10
|
+
gchar *message
|
|
11
|
+
void g_error_free (GError *error)
|
|
7
12
|
void g_object_unref(gpointer object)
|
|
8
13
|
void g_free(gpointer mem)
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
|
|
2
|
+
cdef extern from "fontconfig/fontconfig.h":
|
|
3
|
+
ctypedef int FcBool
|
|
4
|
+
ctypedef struct FcConfig:
|
|
5
|
+
pass
|
|
6
|
+
FcBool FcConfigAppFontAddFile(
|
|
7
|
+
FcConfig* config,
|
|
8
|
+
const unsigned char* file_name
|
|
9
|
+
)
|
|
10
|
+
FcConfig* FcConfigGetCurrent()
|
|
11
|
+
void FcConfigAppFontClear(void *)
|
|
12
|
+
|
|
13
|
+
# Windows and macOS specific API's
|
|
14
|
+
IF UNAME_SYSNAME == "Windows":
|
|
13
15
|
cdef extern from "windows.h":
|
|
14
16
|
ctypedef Py_UNICODE WCHAR
|
|
15
17
|
ctypedef const WCHAR* LPCWSTR
|
|
@@ -1,61 +1,74 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
from pango cimport *
|
|
3
3
|
import copy
|
|
4
|
-
IF UNAME_SYSNAME == "Linux":
|
|
5
|
-
cpdef bint register_font(str font_path):
|
|
6
|
-
"""This function registers the font file using ``fontconfig`` so that
|
|
7
|
-
it is available for use by Pango.
|
|
8
|
-
Parameters
|
|
9
|
-
==========
|
|
10
|
-
font_path : :class:`str`
|
|
11
|
-
Relative or absolute path to font file.
|
|
12
|
-
Returns
|
|
13
|
-
=======
|
|
14
|
-
:class:`bool`
|
|
15
|
-
True means it worked without any error.
|
|
16
|
-
False means there was an unknown error
|
|
17
|
-
Examples
|
|
18
|
-
--------
|
|
19
|
-
>>> register_font("/home/roboto.tff")
|
|
20
|
-
1
|
|
21
|
-
Raises
|
|
22
|
-
------
|
|
23
|
-
AssertionError
|
|
24
|
-
Font is missing.
|
|
25
|
-
"""
|
|
26
|
-
a=Path(font_path)
|
|
27
|
-
assert a.exists(), f"font doesn't exist at {a.absolute()}"
|
|
28
|
-
font_path = str(a.absolute())
|
|
29
|
-
font_path_bytes=font_path.encode('utf-8')
|
|
30
|
-
cdef const unsigned char* fontPath = font_path_bytes
|
|
31
|
-
fontAddStatus = FcConfigAppFontAddFile(FcConfigGetCurrent(), fontPath)
|
|
32
|
-
if fontAddStatus:
|
|
33
|
-
return True
|
|
34
|
-
else:
|
|
35
|
-
return False
|
|
36
|
-
cpdef bint unregister_font(str font_path):
|
|
37
|
-
"""This function unregisters(removes) the font file using
|
|
38
|
-
``fontconfig``. It is mostly optional to call this.
|
|
39
|
-
Mainly used in tests.
|
|
40
|
-
Note:
|
|
41
|
-
The API for Windows is different that this.
|
|
42
|
-
|
|
43
|
-
Parameters
|
|
44
|
-
==========
|
|
45
4
|
|
|
46
|
-
|
|
47
|
-
|
|
5
|
+
cpdef bint fc_register_font(str font_path):
|
|
6
|
+
"""This function registers the font file using ``fontconfig`` so that
|
|
7
|
+
it is available for use by Pango. On Linux it is aliased to
|
|
8
|
+
:func:`register_font` and on Windows and macOS this would work only when
|
|
9
|
+
using ``fontconfig`` backend.
|
|
48
10
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
11
|
+
Parameters
|
|
12
|
+
==========
|
|
13
|
+
font_path : :class:`str`
|
|
14
|
+
Relative or absolute path to font file.
|
|
15
|
+
Returns
|
|
16
|
+
=======
|
|
17
|
+
:class:`bool`
|
|
18
|
+
True means it worked without any error.
|
|
19
|
+
False means there was an unknown error
|
|
20
|
+
Examples
|
|
21
|
+
--------
|
|
22
|
+
>>> register_font("/home/roboto.tff")
|
|
23
|
+
True
|
|
54
24
|
|
|
55
|
-
|
|
56
|
-
|
|
25
|
+
Raises
|
|
26
|
+
------
|
|
27
|
+
AssertionError
|
|
28
|
+
Font is missing.
|
|
29
|
+
"""
|
|
30
|
+
a=Path(font_path)
|
|
31
|
+
assert a.exists(), f"font doesn't exist at {a.absolute()}"
|
|
32
|
+
font_path = str(a.absolute())
|
|
33
|
+
font_path_bytes=font_path.encode('utf-8')
|
|
34
|
+
cdef const unsigned char* fontPath = font_path_bytes
|
|
35
|
+
fontAddStatus = FcConfigAppFontAddFile(FcConfigGetCurrent(), fontPath)
|
|
36
|
+
if fontAddStatus:
|
|
57
37
|
return True
|
|
58
|
-
|
|
38
|
+
else:
|
|
39
|
+
return False
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
cpdef bint fc_unregister_font(str font_path):
|
|
43
|
+
"""This function unregisters(removes) the font file using
|
|
44
|
+
``fontconfig``. It is mostly optional to call this.
|
|
45
|
+
Mainly used in tests. On Linux it is aliased to
|
|
46
|
+
:func:`unregister_font` and on Windows and macOS this
|
|
47
|
+
would work only when using ``fontconfig`` backend.
|
|
48
|
+
|
|
49
|
+
Parameters
|
|
50
|
+
==========
|
|
51
|
+
|
|
52
|
+
font_path: :class:`str`
|
|
53
|
+
For compatibility with the windows function.
|
|
54
|
+
|
|
55
|
+
Returns
|
|
56
|
+
=======
|
|
57
|
+
:class:`bool`
|
|
58
|
+
True means it worked without any error.
|
|
59
|
+
False means there was an unknown error
|
|
60
|
+
|
|
61
|
+
"""
|
|
62
|
+
FcConfigAppFontClear(NULL)
|
|
63
|
+
return True
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
IF UNAME_SYSNAME == "Linux":
|
|
67
|
+
register_font = fc_register_font
|
|
68
|
+
unregister_font = fc_unregister_font
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
ELIF UNAME_SYSNAME == "Windows":
|
|
59
72
|
cpdef bint register_font(str font_path):
|
|
60
73
|
"""This function registers the font file using native windows API
|
|
61
74
|
so that it is available for use by Pango.
|
|
@@ -72,7 +85,7 @@ IF UNAME_SYSNAME == "Windows":
|
|
|
72
85
|
Examples
|
|
73
86
|
--------
|
|
74
87
|
>>> register_font("C:/home/roboto.tff")
|
|
75
|
-
|
|
88
|
+
True
|
|
76
89
|
Raises
|
|
77
90
|
------
|
|
78
91
|
AssertionError
|
|
@@ -90,6 +103,8 @@ IF UNAME_SYSNAME == "Windows":
|
|
|
90
103
|
return True
|
|
91
104
|
else:
|
|
92
105
|
return False
|
|
106
|
+
|
|
107
|
+
|
|
93
108
|
cpdef bint unregister_font(str font_path):
|
|
94
109
|
"""This function unregisters(removes) the font file using
|
|
95
110
|
native Windows API. It is mostly optional to call this.
|
|
@@ -116,6 +131,8 @@ IF UNAME_SYSNAME == "Windows":
|
|
|
116
131
|
FR_PRIVATE,
|
|
117
132
|
0
|
|
118
133
|
)
|
|
134
|
+
|
|
135
|
+
|
|
119
136
|
ELIF UNAME_SYSNAME == "Darwin":
|
|
120
137
|
cpdef bint register_font(str font_path):
|
|
121
138
|
"""This function registers the font file using ``CoreText`` API so that
|
|
@@ -132,7 +149,7 @@ ELIF UNAME_SYSNAME == "Darwin":
|
|
|
132
149
|
Examples
|
|
133
150
|
--------
|
|
134
151
|
>>> register_font("/home/roboto.tff")
|
|
135
|
-
|
|
152
|
+
True
|
|
136
153
|
Raises
|
|
137
154
|
------
|
|
138
155
|
AssertionError
|
|
@@ -149,6 +166,8 @@ ELIF UNAME_SYSNAME == "Darwin":
|
|
|
149
166
|
kCTFontManagerScopeProcess,
|
|
150
167
|
NULL
|
|
151
168
|
)
|
|
169
|
+
|
|
170
|
+
|
|
152
171
|
cpdef bint unregister_font(str font_path):
|
|
153
172
|
"""This function unregisters(removes) the font file using
|
|
154
173
|
native ``CoreText`` API. It is mostly optional to call this.
|
|
@@ -179,6 +198,7 @@ ELIF UNAME_SYSNAME == "Darwin":
|
|
|
179
198
|
NULL
|
|
180
199
|
)
|
|
181
200
|
|
|
201
|
+
|
|
182
202
|
cpdef list list_fonts():
|
|
183
203
|
"""Lists the fonts available to Pango.
|
|
184
204
|
This is usually same as system fonts but it also
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "wheel", "Cython>=0.27"]
|
|
3
|
+
|
|
4
|
+
[tool.isort]
|
|
5
|
+
# from https://black.readthedocs.io/en/stable/compatible_configs.html
|
|
6
|
+
multi_line_output = 3
|
|
7
|
+
include_trailing_comma = true
|
|
8
|
+
force_grid_wrap = 0
|
|
9
|
+
use_parentheses = true
|
|
10
|
+
ensure_newline_before_comments = true
|
|
11
|
+
line_length = 88
|
|
@@ -63,6 +63,7 @@ NEEDED_LIBS = [
|
|
|
63
63
|
"intl",
|
|
64
64
|
"harfbuzz",
|
|
65
65
|
"cairo",
|
|
66
|
+
"fontconfig",
|
|
66
67
|
]
|
|
67
68
|
|
|
68
69
|
|
|
@@ -89,8 +90,8 @@ class PKG_CONFIG:
|
|
|
89
90
|
return True
|
|
90
91
|
except Exception:
|
|
91
92
|
warnings.warn(
|
|
92
|
-
f"{self.pkg_config} doesn't exists or doesn't seem to work"
|
|
93
|
-
"We assume that you give the compiler flags using"
|
|
93
|
+
f"{self.pkg_config} doesn't exists or doesn't seem to work\n"
|
|
94
|
+
"We assume that you give the compiler flags using\n"
|
|
94
95
|
"corresponding environment variables.",
|
|
95
96
|
RuntimeWarning,
|
|
96
97
|
)
|
|
@@ -190,10 +191,15 @@ def update_dict(dict1: dict, dict2: dict):
|
|
|
190
191
|
|
|
191
192
|
ext = ".pyx" if USE_CYTHON else ".c"
|
|
192
193
|
base_file = Path(__file__).parent / "manimpango"
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
_pkg_config_pangocairo = PKG_CONFIG("pangocairo")
|
|
195
|
+
_pkg_config_fontconfig = PKG_CONFIG("pangofc")
|
|
196
|
+
if _pkg_config_pangocairo.check_pkgconfig:
|
|
197
|
+
_pkg_config_pangocairo.check_min_version(MINIMUM_PANGO_VERSION)
|
|
198
|
+
returns = update_dict(
|
|
199
|
+
_pkg_config_pangocairo.setuptools_args, _pkg_config_fontconfig.setuptools_args
|
|
200
|
+
)
|
|
201
|
+
else:
|
|
202
|
+
returns = {}
|
|
197
203
|
returns["libraries"] = NEEDED_LIBS
|
|
198
204
|
if sys.platform == "win32":
|
|
199
205
|
returns["libraries"] += ["Gdi32"]
|
|
@@ -245,18 +251,19 @@ setup(
|
|
|
245
251
|
zip_safe=False,
|
|
246
252
|
long_description_content_type="text/markdown",
|
|
247
253
|
packages=["manimpango"],
|
|
248
|
-
python_requires=">=3.
|
|
254
|
+
python_requires=">=3.7",
|
|
249
255
|
platforms=["Linux", "macOS", "Windows"],
|
|
250
256
|
keywords=["cython", "pango", "cairo", "manim"],
|
|
257
|
+
license="GPL-3.0-or-later",
|
|
251
258
|
classifiers=[
|
|
252
259
|
"Programming Language :: Python :: 3",
|
|
253
|
-
"Programming Language :: Python :: 3.6",
|
|
254
260
|
"Programming Language :: Python :: 3.7",
|
|
255
261
|
"Programming Language :: Python :: 3.8",
|
|
256
262
|
"Programming Language :: Python :: 3.9",
|
|
257
|
-
"
|
|
263
|
+
"Programming Language :: Python :: 3.10",
|
|
264
|
+
"Development Status :: 4 - Beta",
|
|
258
265
|
"Programming Language :: Python :: 3 :: Only",
|
|
259
|
-
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
|
266
|
+
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
|
|
260
267
|
"Operating System :: OS Independent",
|
|
261
268
|
"Programming Language :: Cython",
|
|
262
269
|
],
|
|
@@ -31,11 +31,3 @@ set_dll_search_path()
|
|
|
31
31
|
delete_media_dir()
|
|
32
32
|
CASES_DIR = Path(Path(__file__).parent, "cases").absolute()
|
|
33
33
|
FONT_DIR = Path(__file__).parent / "fonts"
|
|
34
|
-
|
|
35
|
-
import manimpango # noqa: E402
|
|
36
|
-
|
|
37
|
-
font = str((FONT_DIR / "BungeeOutline-Regular.ttf").absolute())
|
|
38
|
-
orig = manimpango.list_fonts()
|
|
39
|
-
assert manimpango.register_font(font)
|
|
40
|
-
final = manimpango.list_fonts()
|
|
41
|
-
main_font = list(set(final) - set(orig))[0]
|