ManimPango 0.5.0__tar.gz → 0.6.0__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.5.0 → manimpango-0.6.0}/MANIFEST.in +3 -2
- manimpango-0.6.0/ManimPango.egg-info/PKG-INFO +205 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/ManimPango.egg-info/SOURCES.txt +10 -2
- manimpango-0.6.0/PKG-INFO +205 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/README.md +3 -10
- {ManimPango-0.5.0 → manimpango-0.6.0}/docs/reference.rst +2 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/manimpango/__init__.py +1 -1
- ManimPango-0.5.0/manimpango/register_font.pxd → manimpango-0.6.0/manimpango/_register_font.pxd +8 -1
- manimpango-0.6.0/manimpango/_register_font.pyx +160 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/manimpango/_version.py +1 -1
- {ManimPango-0.5.0 → manimpango-0.6.0}/manimpango/cmanimpango.pyx +15 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/manimpango/pango.pxd +33 -0
- manimpango-0.6.0/manimpango/register_font.py +156 -0
- manimpango-0.6.0/manimpango/utils.pxi +23 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/pyproject.toml +1 -1
- {ManimPango-0.5.0 → manimpango-0.6.0}/requirements-dev.txt +2 -2
- {ManimPango-0.5.0 → manimpango-0.6.0}/setup.py +12 -7
- manimpango-0.6.0/tests/cases/color_red.svg +31 -0
- manimpango-0.6.0/tests/cases/hello_blue_world_green.svg +47 -0
- manimpango-0.6.0/tests/cases/hello_blue_world_green_space.svg +53 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/test_fonts.py +9 -3
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/test_version.py +2 -2
- ManimPango-0.5.0/ManimPango.egg-info/PKG-INFO +0 -211
- ManimPango-0.5.0/PKG-INFO +0 -211
- ManimPango-0.5.0/manimpango/register_font.pyx +0 -241
- {ManimPango-0.5.0 → manimpango-0.6.0}/.coveragerc +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/CODE_OF_CONDUCT.md +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/LICENSE +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/ManimPango.egg-info/dependency_links.txt +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/ManimPango.egg-info/not-zip-safe +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/ManimPango.egg-info/top_level.txt +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/docs/RELEASE.rst +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/docs/_static/favicon.ico +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/docs/_templates/autosummary/class.rst +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/docs/_templates/autosummary/module.rst +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/docs/conf.py +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/docs/index.rst +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/docs/make.bat +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/manimpango/cairo.pxd +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/manimpango/cmanimpango.pxd +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/manimpango/enums.pyx +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/manimpango/glib.pxd +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/manimpango/utils.py +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/setup.cfg +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/__init__.py +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/_manim.py +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/conftest.py +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/fonts/AdobeVFPrototype.ttf +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/fonts/BungeeColor-Regular_colr_Windows.ttf +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/fonts/BungeeOutline-Regular.ttf +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/fonts/LICENSE.txt +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/fonts/MaShanZheng-Regular.ttf +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/svg_tester.py +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/test_colors.py +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/test_list_fonts.py +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/test_markup.py +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/test_utils.py +0 -0
- {ManimPango-0.5.0 → manimpango-0.6.0}/tests/test_valid_svg.py +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
global-include *.pyx *.pxd
|
|
2
|
-
recursive-include tests *.py *.ttf LICENSE.txt
|
|
1
|
+
global-include *.pyx *.pxd *.pxi
|
|
2
|
+
recursive-include tests *.py *.ttf LICENSE.txt *.svg
|
|
3
3
|
recursive-include docs *.rst *.py make* _*/*
|
|
4
4
|
prune docs/_build
|
|
5
5
|
include *.md
|
|
6
6
|
include *.txt
|
|
7
7
|
include .coveragerc
|
|
8
8
|
include LICENSE*
|
|
9
|
+
prune *env*/
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: ManimPango
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: Bindings for Pango for using with Manim.
|
|
5
|
+
Home-page: https://manimpango.manim.community/
|
|
6
|
+
Author: Naveen M K
|
|
7
|
+
Author-email: naveen@manim.community
|
|
8
|
+
Maintainer: The Manim Community Developers
|
|
9
|
+
License: MIT
|
|
10
|
+
Project-URL: Documentation, https://manimpango.manim.community/
|
|
11
|
+
Project-URL: Source, https://github.com/ManimCommunity/manimpango
|
|
12
|
+
Project-URL: Release notes, https://github.com/ManimCommunity/ManimPango/releases/
|
|
13
|
+
Keywords: cython,pango,cairo,manim
|
|
14
|
+
Platform: Linux
|
|
15
|
+
Platform: macOS
|
|
16
|
+
Platform: Windows
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Development Status :: 4 - Beta
|
|
25
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
26
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
27
|
+
Classifier: Programming Language :: Cython
|
|
28
|
+
Requires-Python: >=3.8
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
|
|
32
|
+
# ManimPango
|
|
33
|
+
|
|
34
|
+
<p align="center">
|
|
35
|
+
<a href="https://pypi.org/project/manimpango/"><img src="https://img.shields.io/pypi/v/manimpango.svg?style=flat&logo=pypi" alt="PyPI Latest Release"></a>
|
|
36
|
+
<a href="https://pypi.org/project/manimpango/"><img alt="PyPI - Wheel" src="https://img.shields.io/pypi/wheel/manimpango"></a>
|
|
37
|
+
<a href="https://pypi.org/project/manimpango/"><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/manimpango"></a>
|
|
38
|
+
<a href="https://choosealicense.com/licenses/mit/"><img alt="PyPI - License" src="https://img.shields.io/pypi/l/manimpango"></a>
|
|
39
|
+
<a href="https://pypi.org/project/manimpango/"><img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/ManimPango.svg?style=flat"></a>
|
|
40
|
+
<a href='https://manimpango.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/manimpango/badge/?version=latest' alt='Documentation Status' /></a>
|
|
41
|
+
<br>
|
|
42
|
+
<img src="https://github.com/ManimCommunity/manimpango/workflows/Build%20Wheels/badge.svg">
|
|
43
|
+
</p>
|
|
44
|
+
|
|
45
|
+
**ManimPango** is a C binding for [Pango](https://pango.gnome.org/) using [Cython](https://cython.org/), which is internally used in [Manim](https://www.manim.community) to render (non-LaTeX) text.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## INSTALL
|
|
50
|
+
|
|
51
|
+
Installing **ManimPango** is super easy, just use `pip`. It is [`manimpango`](https://pypi.org/project/manimpango/) in PyPi.
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
pip install manimpango
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For **Linux Users**, there are no Wheels. You must have a C compiler as well as **Pango** and its dependencies along with the **Pango** development headers. See [BUILDING](#BUILDING) for more information.
|
|
58
|
+
|
|
59
|
+
## WORKFLOW SETUP / CONTRIBUTING
|
|
60
|
+
|
|
61
|
+
To make it easier for developers to contribute, we have a pre-commit workflow that will check for `black` formatting and `flake` checking.
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
pip install pre-commit
|
|
65
|
+
pre-commit install
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## BUILDING
|
|
69
|
+
|
|
70
|
+
### Linux/MacOS
|
|
71
|
+
|
|
72
|
+
For building **ManimPango**, you need
|
|
73
|
+
* a C compiler
|
|
74
|
+
* Python's development headers
|
|
75
|
+
* [`pkg-config`](https://www.freedesktop.org/wiki/Software/pkg-config/)
|
|
76
|
+
* [Pango](https://pango.gnome.org) along with its development headers and its dependencies.
|
|
77
|
+
|
|
78
|
+
If you are on MacOS, you can use [brew](https://brew.sh) to install those. Using [MacPorts](https://www.macports.org) is also possible.
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
brew install pango pkg-config
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
If you are on Linux, you can use a system package manager to do so. For example, if you are on Debian based system, you can use `apt`
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
apt install libpango1.0-dev pkg-config python3-dev
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Arch Linux:** `pacman -S pango pkgconf`
|
|
91
|
+
|
|
92
|
+
**Fedora:** `dnf install pango-devel pkg-config python3-devel`
|
|
93
|
+
|
|
94
|
+
Or similar in your system's package manager.
|
|
95
|
+
|
|
96
|
+
#### Using `tar` archives
|
|
97
|
+
|
|
98
|
+
If you don't want to contribute to this repository, you can use the tar archives published in PyPi, or just use `pip` to install using
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
pip install manimpango --no-binary :all:
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Note**: `pip` by default uses wheels, so make sure to pass the `--no-binary` parameter.
|
|
105
|
+
|
|
106
|
+
#### Using `git` clones / Contributing
|
|
107
|
+
|
|
108
|
+
Please remember to do this inside your virtual environment, if you want to use your **Manimpango** with **Manim**.
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
python -m venv ./venv
|
|
112
|
+
source venv/bin/activate # Linux/macOS
|
|
113
|
+
venv\Scripts\activate # Windows
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
If you are using a clone of this repository, you will need [Cython](https://cython.org) which can be easily installed using `pip`:
|
|
117
|
+
|
|
118
|
+
```sh
|
|
119
|
+
pip install Cython
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
After that you can use `pip` to install the clone with the following command:
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
pip install -e .
|
|
126
|
+
pip install -r requirements-dev.txt .
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Next, run the setup script:
|
|
130
|
+
|
|
131
|
+
```sh
|
|
132
|
+
python setup.py build_ext -i
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
After installation is complete, you should be able to run pytest:
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
pytest
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
You will need to this way if you want to *contribute* to **ManimPango**.
|
|
142
|
+
|
|
143
|
+
### Contributing with Windows
|
|
144
|
+
|
|
145
|
+
*If you are a normal user, don't read this, you have wheels which you can just install directly using pip.*
|
|
146
|
+
|
|
147
|
+
If you want to contribute to **ManimPango** and you are on Windows, this section is for you.
|
|
148
|
+
|
|
149
|
+
As Windows does not include a C compiler by default, you will first need to install one. You have two choices:
|
|
150
|
+
|
|
151
|
+
1. MinGW/Msys2
|
|
152
|
+
|
|
153
|
+
2. Visual Studio
|
|
154
|
+
|
|
155
|
+
#### MinGW/Msys2
|
|
156
|
+
|
|
157
|
+
1. Download **MSYS2** from the download link provided on their page https://www.msys2.org/#installation and install it according to their instructions.
|
|
158
|
+
2. Once you have **MSYS2** installed, it offers you three different shells: the **MinGW32** shell, the **MinGW64** shell and **MSYS** shell. In order for the following steps to work, you have to open the **MSYS2 MinGW64** shell (you can search for this). Small hint: it has a blue color logo.
|
|
159
|
+
3. Run the following commands to install Python, Pango, Cython, Numpy, Scipy, Pillow, Pycairo and ffmpeg
|
|
160
|
+
```sh
|
|
161
|
+
pacman -S mingw-w64-x86_64-python
|
|
162
|
+
pacman -S mingw-w64-x86_64-python-pip
|
|
163
|
+
pacman -S mingw-w64-x86_64-pango
|
|
164
|
+
pacman -S mingw-w64-x86_64-cython
|
|
165
|
+
pacman -S mingw-w64-x86_64-python-numpy
|
|
166
|
+
pacman -S mingw-w64-x86_64-python-scipy
|
|
167
|
+
pacman -S mingw-w64-x86_64-python-pillow
|
|
168
|
+
pacman -S mingw-w64-x86_64-python-cairo
|
|
169
|
+
pacman -S mingw-w64-x86_64-ffmpeg
|
|
170
|
+
```
|
|
171
|
+
4. Still in the same shell, install **Manim** using `pip install manim`.
|
|
172
|
+
5. Finally, get your clone of **ManimPango**, `cd` into that directory and then run `pip install -e .`.
|
|
173
|
+
**Note** You can't use it with your regular Python version. It will cause weird errors if you do so. For working with **ManimPango**, you must be inside the `MSYS2 MINGW64 shell`.
|
|
174
|
+
6. You can then use `manim` inside that shell, to run **Manim**.
|
|
175
|
+
**Hint**: If you want to try out Python interactively, you can open `idle` using the command `python -m idlelib` inside that shell.
|
|
176
|
+
|
|
177
|
+
#### Visual Studio
|
|
178
|
+
|
|
179
|
+
First, install Visual Studio as specified in https://wiki.python.org/moin/WindowsCompilers. Possibly Visual Studio Build Tools 2022 with Windows10 SDK.
|
|
180
|
+
|
|
181
|
+
Then run the script at `packing/download_dlls.py`. This will get a **Pango** build along with `pkg-config` and install it at `C:\cibw\vendor`. Add `C:\cibw\vendor\bin` to PATH.
|
|
182
|
+
|
|
183
|
+
**Note:** You can change the install location by editing line 24 of the file `packing/download_dlls.py`.
|
|
184
|
+
|
|
185
|
+
Then set an environment variable `PKG_CONFIG_PATH`=`C:\cibw\vendor\lib\pkgconfig`.
|
|
186
|
+
|
|
187
|
+
Then you can install Cython using
|
|
188
|
+
|
|
189
|
+
```sh
|
|
190
|
+
pip install Cython
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Finally, you can install your local **ManimPango** clone just like any other python package by typing:
|
|
194
|
+
|
|
195
|
+
```sh
|
|
196
|
+
pip install .
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Code of Conduct
|
|
200
|
+
|
|
201
|
+
Our full code of conduct, and how we enforce it, can be read on [our website](https://docs.manim.community/en/latest/conduct.html).
|
|
202
|
+
|
|
203
|
+
## License
|
|
204
|
+
|
|
205
|
+
This project is licensed under MIT License. The wheels distributed on PyPI contains compiled version of Pango and Cairo subject to terms of the GNU LGPL and other licenses. Consult the licenses of each library for more informations.
|
|
@@ -7,6 +7,9 @@ pyproject.toml
|
|
|
7
7
|
requirements-dev.txt
|
|
8
8
|
setup.cfg
|
|
9
9
|
setup.py
|
|
10
|
+
/home/runner/work/ManimPango/ManimPango/manimpango/_register_font.c
|
|
11
|
+
/home/runner/work/ManimPango/ManimPango/manimpango/cmanimpango.c
|
|
12
|
+
/home/runner/work/ManimPango/ManimPango/manimpango/enums.c
|
|
10
13
|
ManimPango.egg-info/PKG-INFO
|
|
11
14
|
ManimPango.egg-info/SOURCES.txt
|
|
12
15
|
ManimPango.egg-info/dependency_links.txt
|
|
@@ -21,6 +24,8 @@ docs/_static/favicon.ico
|
|
|
21
24
|
docs/_templates/autosummary/class.rst
|
|
22
25
|
docs/_templates/autosummary/module.rst
|
|
23
26
|
manimpango/__init__.py
|
|
27
|
+
manimpango/_register_font.pxd
|
|
28
|
+
manimpango/_register_font.pyx
|
|
24
29
|
manimpango/_version.py
|
|
25
30
|
manimpango/cairo.pxd
|
|
26
31
|
manimpango/cmanimpango.pxd
|
|
@@ -28,8 +33,8 @@ manimpango/cmanimpango.pyx
|
|
|
28
33
|
manimpango/enums.pyx
|
|
29
34
|
manimpango/glib.pxd
|
|
30
35
|
manimpango/pango.pxd
|
|
31
|
-
manimpango/register_font.
|
|
32
|
-
manimpango/
|
|
36
|
+
manimpango/register_font.py
|
|
37
|
+
manimpango/utils.pxi
|
|
33
38
|
manimpango/utils.py
|
|
34
39
|
tests/__init__.py
|
|
35
40
|
tests/_manim.py
|
|
@@ -42,6 +47,9 @@ tests/test_markup.py
|
|
|
42
47
|
tests/test_utils.py
|
|
43
48
|
tests/test_valid_svg.py
|
|
44
49
|
tests/test_version.py
|
|
50
|
+
tests/cases/color_red.svg
|
|
51
|
+
tests/cases/hello_blue_world_green.svg
|
|
52
|
+
tests/cases/hello_blue_world_green_space.svg
|
|
45
53
|
tests/fonts/AdobeVFPrototype.ttf
|
|
46
54
|
tests/fonts/BungeeColor-Regular_colr_Windows.ttf
|
|
47
55
|
tests/fonts/BungeeOutline-Regular.ttf
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: ManimPango
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: Bindings for Pango for using with Manim.
|
|
5
|
+
Home-page: https://manimpango.manim.community/
|
|
6
|
+
Author: Naveen M K
|
|
7
|
+
Author-email: naveen@manim.community
|
|
8
|
+
Maintainer: The Manim Community Developers
|
|
9
|
+
License: MIT
|
|
10
|
+
Project-URL: Documentation, https://manimpango.manim.community/
|
|
11
|
+
Project-URL: Source, https://github.com/ManimCommunity/manimpango
|
|
12
|
+
Project-URL: Release notes, https://github.com/ManimCommunity/ManimPango/releases/
|
|
13
|
+
Keywords: cython,pango,cairo,manim
|
|
14
|
+
Platform: Linux
|
|
15
|
+
Platform: macOS
|
|
16
|
+
Platform: Windows
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Development Status :: 4 - Beta
|
|
25
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
26
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
27
|
+
Classifier: Programming Language :: Cython
|
|
28
|
+
Requires-Python: >=3.8
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
|
|
32
|
+
# ManimPango
|
|
33
|
+
|
|
34
|
+
<p align="center">
|
|
35
|
+
<a href="https://pypi.org/project/manimpango/"><img src="https://img.shields.io/pypi/v/manimpango.svg?style=flat&logo=pypi" alt="PyPI Latest Release"></a>
|
|
36
|
+
<a href="https://pypi.org/project/manimpango/"><img alt="PyPI - Wheel" src="https://img.shields.io/pypi/wheel/manimpango"></a>
|
|
37
|
+
<a href="https://pypi.org/project/manimpango/"><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/manimpango"></a>
|
|
38
|
+
<a href="https://choosealicense.com/licenses/mit/"><img alt="PyPI - License" src="https://img.shields.io/pypi/l/manimpango"></a>
|
|
39
|
+
<a href="https://pypi.org/project/manimpango/"><img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/ManimPango.svg?style=flat"></a>
|
|
40
|
+
<a href='https://manimpango.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/manimpango/badge/?version=latest' alt='Documentation Status' /></a>
|
|
41
|
+
<br>
|
|
42
|
+
<img src="https://github.com/ManimCommunity/manimpango/workflows/Build%20Wheels/badge.svg">
|
|
43
|
+
</p>
|
|
44
|
+
|
|
45
|
+
**ManimPango** is a C binding for [Pango](https://pango.gnome.org/) using [Cython](https://cython.org/), which is internally used in [Manim](https://www.manim.community) to render (non-LaTeX) text.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## INSTALL
|
|
50
|
+
|
|
51
|
+
Installing **ManimPango** is super easy, just use `pip`. It is [`manimpango`](https://pypi.org/project/manimpango/) in PyPi.
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
pip install manimpango
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For **Linux Users**, there are no Wheels. You must have a C compiler as well as **Pango** and its dependencies along with the **Pango** development headers. See [BUILDING](#BUILDING) for more information.
|
|
58
|
+
|
|
59
|
+
## WORKFLOW SETUP / CONTRIBUTING
|
|
60
|
+
|
|
61
|
+
To make it easier for developers to contribute, we have a pre-commit workflow that will check for `black` formatting and `flake` checking.
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
pip install pre-commit
|
|
65
|
+
pre-commit install
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## BUILDING
|
|
69
|
+
|
|
70
|
+
### Linux/MacOS
|
|
71
|
+
|
|
72
|
+
For building **ManimPango**, you need
|
|
73
|
+
* a C compiler
|
|
74
|
+
* Python's development headers
|
|
75
|
+
* [`pkg-config`](https://www.freedesktop.org/wiki/Software/pkg-config/)
|
|
76
|
+
* [Pango](https://pango.gnome.org) along with its development headers and its dependencies.
|
|
77
|
+
|
|
78
|
+
If you are on MacOS, you can use [brew](https://brew.sh) to install those. Using [MacPorts](https://www.macports.org) is also possible.
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
brew install pango pkg-config
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
If you are on Linux, you can use a system package manager to do so. For example, if you are on Debian based system, you can use `apt`
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
apt install libpango1.0-dev pkg-config python3-dev
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Arch Linux:** `pacman -S pango pkgconf`
|
|
91
|
+
|
|
92
|
+
**Fedora:** `dnf install pango-devel pkg-config python3-devel`
|
|
93
|
+
|
|
94
|
+
Or similar in your system's package manager.
|
|
95
|
+
|
|
96
|
+
#### Using `tar` archives
|
|
97
|
+
|
|
98
|
+
If you don't want to contribute to this repository, you can use the tar archives published in PyPi, or just use `pip` to install using
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
pip install manimpango --no-binary :all:
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Note**: `pip` by default uses wheels, so make sure to pass the `--no-binary` parameter.
|
|
105
|
+
|
|
106
|
+
#### Using `git` clones / Contributing
|
|
107
|
+
|
|
108
|
+
Please remember to do this inside your virtual environment, if you want to use your **Manimpango** with **Manim**.
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
python -m venv ./venv
|
|
112
|
+
source venv/bin/activate # Linux/macOS
|
|
113
|
+
venv\Scripts\activate # Windows
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
If you are using a clone of this repository, you will need [Cython](https://cython.org) which can be easily installed using `pip`:
|
|
117
|
+
|
|
118
|
+
```sh
|
|
119
|
+
pip install Cython
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
After that you can use `pip` to install the clone with the following command:
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
pip install -e .
|
|
126
|
+
pip install -r requirements-dev.txt .
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Next, run the setup script:
|
|
130
|
+
|
|
131
|
+
```sh
|
|
132
|
+
python setup.py build_ext -i
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
After installation is complete, you should be able to run pytest:
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
pytest
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
You will need to this way if you want to *contribute* to **ManimPango**.
|
|
142
|
+
|
|
143
|
+
### Contributing with Windows
|
|
144
|
+
|
|
145
|
+
*If you are a normal user, don't read this, you have wheels which you can just install directly using pip.*
|
|
146
|
+
|
|
147
|
+
If you want to contribute to **ManimPango** and you are on Windows, this section is for you.
|
|
148
|
+
|
|
149
|
+
As Windows does not include a C compiler by default, you will first need to install one. You have two choices:
|
|
150
|
+
|
|
151
|
+
1. MinGW/Msys2
|
|
152
|
+
|
|
153
|
+
2. Visual Studio
|
|
154
|
+
|
|
155
|
+
#### MinGW/Msys2
|
|
156
|
+
|
|
157
|
+
1. Download **MSYS2** from the download link provided on their page https://www.msys2.org/#installation and install it according to their instructions.
|
|
158
|
+
2. Once you have **MSYS2** installed, it offers you three different shells: the **MinGW32** shell, the **MinGW64** shell and **MSYS** shell. In order for the following steps to work, you have to open the **MSYS2 MinGW64** shell (you can search for this). Small hint: it has a blue color logo.
|
|
159
|
+
3. Run the following commands to install Python, Pango, Cython, Numpy, Scipy, Pillow, Pycairo and ffmpeg
|
|
160
|
+
```sh
|
|
161
|
+
pacman -S mingw-w64-x86_64-python
|
|
162
|
+
pacman -S mingw-w64-x86_64-python-pip
|
|
163
|
+
pacman -S mingw-w64-x86_64-pango
|
|
164
|
+
pacman -S mingw-w64-x86_64-cython
|
|
165
|
+
pacman -S mingw-w64-x86_64-python-numpy
|
|
166
|
+
pacman -S mingw-w64-x86_64-python-scipy
|
|
167
|
+
pacman -S mingw-w64-x86_64-python-pillow
|
|
168
|
+
pacman -S mingw-w64-x86_64-python-cairo
|
|
169
|
+
pacman -S mingw-w64-x86_64-ffmpeg
|
|
170
|
+
```
|
|
171
|
+
4. Still in the same shell, install **Manim** using `pip install manim`.
|
|
172
|
+
5. Finally, get your clone of **ManimPango**, `cd` into that directory and then run `pip install -e .`.
|
|
173
|
+
**Note** You can't use it with your regular Python version. It will cause weird errors if you do so. For working with **ManimPango**, you must be inside the `MSYS2 MINGW64 shell`.
|
|
174
|
+
6. You can then use `manim` inside that shell, to run **Manim**.
|
|
175
|
+
**Hint**: If you want to try out Python interactively, you can open `idle` using the command `python -m idlelib` inside that shell.
|
|
176
|
+
|
|
177
|
+
#### Visual Studio
|
|
178
|
+
|
|
179
|
+
First, install Visual Studio as specified in https://wiki.python.org/moin/WindowsCompilers. Possibly Visual Studio Build Tools 2022 with Windows10 SDK.
|
|
180
|
+
|
|
181
|
+
Then run the script at `packing/download_dlls.py`. This will get a **Pango** build along with `pkg-config` and install it at `C:\cibw\vendor`. Add `C:\cibw\vendor\bin` to PATH.
|
|
182
|
+
|
|
183
|
+
**Note:** You can change the install location by editing line 24 of the file `packing/download_dlls.py`.
|
|
184
|
+
|
|
185
|
+
Then set an environment variable `PKG_CONFIG_PATH`=`C:\cibw\vendor\lib\pkgconfig`.
|
|
186
|
+
|
|
187
|
+
Then you can install Cython using
|
|
188
|
+
|
|
189
|
+
```sh
|
|
190
|
+
pip install Cython
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Finally, you can install your local **ManimPango** clone just like any other python package by typing:
|
|
194
|
+
|
|
195
|
+
```sh
|
|
196
|
+
pip install .
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Code of Conduct
|
|
200
|
+
|
|
201
|
+
Our full code of conduct, and how we enforce it, can be read on [our website](https://docs.manim.community/en/latest/conduct.html).
|
|
202
|
+
|
|
203
|
+
## License
|
|
204
|
+
|
|
205
|
+
This project is licensed under MIT License. The wheels distributed on PyPI contains compiled version of Pango and Cairo subject to terms of the GNU LGPL and other licenses. Consult the licenses of each library for more informations.
|
|
@@ -44,7 +44,7 @@ For building **ManimPango**, you need
|
|
|
44
44
|
* [`pkg-config`](https://www.freedesktop.org/wiki/Software/pkg-config/)
|
|
45
45
|
* [Pango](https://pango.gnome.org) along with its development headers and its dependencies.
|
|
46
46
|
|
|
47
|
-
If you are on MacOS, you can use [brew](https://brew.sh) to install those. Using [MacPorts](https://www.macports.org) is also possible
|
|
47
|
+
If you are on MacOS, you can use [brew](https://brew.sh) to install those. Using [MacPorts](https://www.macports.org) is also possible.
|
|
48
48
|
|
|
49
49
|
```sh
|
|
50
50
|
brew install pango pkg-config
|
|
@@ -145,9 +145,9 @@ pacman -S mingw-w64-x86_64-ffmpeg
|
|
|
145
145
|
|
|
146
146
|
#### Visual Studio
|
|
147
147
|
|
|
148
|
-
First, install Visual Studio as specified in https://wiki.python.org/moin/WindowsCompilers. Possibly Visual Studio Build Tools
|
|
148
|
+
First, install Visual Studio as specified in https://wiki.python.org/moin/WindowsCompilers. Possibly Visual Studio Build Tools 2022 with Windows10 SDK.
|
|
149
149
|
|
|
150
|
-
Then run the script at `packing/download_dlls.py`. This will get a **Pango** build along with `pkg-config` and install it at `C:\cibw\vendor`. Add `C:\cibw\vendor\bin`
|
|
150
|
+
Then run the script at `packing/download_dlls.py`. This will get a **Pango** build along with `pkg-config` and install it at `C:\cibw\vendor`. Add `C:\cibw\vendor\bin` to PATH.
|
|
151
151
|
|
|
152
152
|
**Note:** You can change the install location by editing line 24 of the file `packing/download_dlls.py`.
|
|
153
153
|
|
|
@@ -165,13 +165,6 @@ Finally, you can install your local **ManimPango** clone just like any other pyt
|
|
|
165
165
|
pip install .
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
**Important**: You have to to use https://docs.python.org/3/library/os.html#os.add_dll_directory before running **ManimPango**. Alternatively, you need to copy the `dll` at `C:\cibw\vendor\bin` to the folder where **ManimPango** is compiled. This is applicable for Python 3.8 and above.
|
|
169
|
-
|
|
170
|
-
```python
|
|
171
|
-
import os
|
|
172
|
-
os.add_dll_directory('C:\cibw\vendor\bin')
|
|
173
|
-
```
|
|
174
|
-
|
|
175
168
|
## Code of Conduct
|
|
176
169
|
|
|
177
170
|
Our full code of conduct, and how we enforce it, can be read on [our website](https://docs.manim.community/en/latest/conduct.html).
|
|
@@ -11,9 +11,9 @@ if os.name == "nt": # pragma: no cover
|
|
|
11
11
|
f"{os.environ['PATH']}"
|
|
12
12
|
)
|
|
13
13
|
try:
|
|
14
|
+
from .register_font import * # isort:skip # noqa: F403,F401
|
|
14
15
|
from .cmanimpango import * # noqa: F403,F401
|
|
15
16
|
from .enums import * # noqa: F403,F401
|
|
16
|
-
from .register_font import * # noqa: F403,F401
|
|
17
17
|
except ImportError as ie: # pragma: no cover
|
|
18
18
|
py_ver = ".".join(map(str, sys.version_info[:3]))
|
|
19
19
|
msg = f"""
|
ManimPango-0.5.0/manimpango/register_font.pxd → manimpango-0.6.0/manimpango/_register_font.pxd
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
1
|
from libc.stddef cimport wchar_t
|
|
2
|
+
from pango cimport *
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
cdef extern from "Python.h":
|
|
@@ -35,6 +35,13 @@ IF UNAME_SYSNAME == "Windows":
|
|
|
35
35
|
DWORD fl,
|
|
36
36
|
unsigned int pdv
|
|
37
37
|
)
|
|
38
|
+
|
|
39
|
+
ctypedef void* HANDLE
|
|
40
|
+
HANDLE CreateMutexA(void* lpMutexAttributes, int bInitialOwner, const char* lpName)
|
|
41
|
+
int ReleaseMutex(HANDLE hMutex)
|
|
42
|
+
int WaitForSingleObject(HANDLE hHandle, unsigned long dwMilliseconds)
|
|
43
|
+
int CloseHandle(HANDLE hObject)
|
|
44
|
+
|
|
38
45
|
ELIF UNAME_SYSNAME == "Darwin":
|
|
39
46
|
cdef extern from "Carbon/Carbon.h":
|
|
40
47
|
ctypedef struct CFURLRef:
|