Bindings for Pango for using with Manim.
Project description
ManimPango
ManimPango is a C binding for Pango using Cython, which is internally used in Manim to render (non-LaTeX) text.
INSTALL
Installing ManimPango is super easy, just use pip
. It is manimpango
in PyPi.
pip install manimpango
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 for more information.
WORKFLOW SETUP / CONTRIBUTING
To make it easier for developers to contribute, we have a pre-commit workflow that will check for black
formatting and flake
checking.
pip install pre-commit
pre-commit install
BUILDING
Linux/MacOS
For building ManimPango, you need
- a C compiler
- Python's development headers
pkg-config
- Pango along with its development headers and its dependencies.
If you are on MacOS, you can use brew to install those. Using MacPorts is also possible, but their version of Pango is old and will probably not be updated in the near future.
brew install pango pkg-config
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
apt install libpango1.0-dev pkg-config python3-dev
Arch Linux: pacman -S pango pkgconf
Fedora: dnf install pango-devel pkg-config python3-devel
Or similar in your system's package manager.
Using tar
archives
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
pip install manimpango --no-binary :all:
Note: pip
by default uses wheels, so make sure to pass the --no-binary
parameter.
Using git
clones / Contributing
Please remember to do this inside your virtual environment, if you want to use your Manimpango with Manim.
python -m venv ./venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows
If you are using a clone of this repository, you will need Cython which can be easily installed using pip
:
pip install Cython
After that you can use pip
to install the clone with the following command:
pip install -e .
pip install -r requirements-dev.txt .
Next, run the setup script:
python setup.py build_ext -i
After installation is complete, you should be able to run pytest:
pytest
You will need to this way if you want to contribute to ManimPango.
Contributing with Windows
If you are a normal user, don't read this, you have wheels which you can just install directly using pip.
If you want to contribute to ManimPango and you are on Windows, this section is for you.
As Windows does not include a C compiler by default, you will first need to install one. You have two choices:
-
MinGW/Msys2
-
Visual Studio
MinGW/Msys2
- Download MSYS2 from the download link provided on their page https://www.msys2.org/#installation and install it according to their instructions.
- 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.
- Run the following commands to install Python, Pango, Cython, Numpy, Scipy, Pillow, Pycairo and ffmpeg
pacman -S mingw-w64-x86_64-python
pacman -S mingw-w64-x86_64-python-pip
pacman -S mingw-w64-x86_64-pango
pacman -S mingw-w64-x86_64-cython
pacman -S mingw-w64-x86_64-python-numpy
pacman -S mingw-w64-x86_64-python-scipy
pacman -S mingw-w64-x86_64-python-pillow
pacman -S mingw-w64-x86_64-python-cairo
pacman -S mingw-w64-x86_64-ffmpeg
- Still in the same shell, install Manim using
pip install manim
. - Finally, get your clone of ManimPango,
cd
into that directory and then runpip install -e .
. 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 theMSYS2 MINGW64 shell
. - You can then use
manim
inside that shell, to run Manim. Hint: If you want to try out Python interactively, you can openidle
using the commandpython -m idlelib
inside that shell.
Visual Studio
First, install Visual Studio as specified in https://wiki.python.org/moin/WindowsCompilers. Possibly Visual Studio Build Tools 2019 with Windows10 SDK.
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
and C:\cibw\vendor\pkg-config\bin
to PATH.
Note: You can change the install location by editing line 24 of the file packing/download_dlls.py
.
Then set an environment variable PKG_CONFIG_PATH
=C:\cibw\vendor\lib\pkgconfig
.
Then you can install Cython using
pip install Cython
Finally, you can install your local ManimPango clone just like any other python package by typing:
pip install .
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.
import os
os.add_dll_directory('C:\cibw\vendor\bin')
Code of Conduct
Our full code of conduct, and how we enforce it, can be read on our website.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file ManimPango-0.4.0.post0.tar.gz
.
File metadata
- Download URL: ManimPango-0.4.0.post0.tar.gz
- Upload date:
- Size: 4.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d6e92592b83cd76c8ab7f82ab543822268d56cb81ebbb4da9021c2220674c17 |
|
MD5 | ec2d67324c7659d28a0352176dab0ad8 |
|
BLAKE2b-256 | 6c3eade7926be645a78fba0cd6a0cbf4ca6d456285e400df7d587145be97d654 |
File details
Details for the file ManimPango-0.4.0.post0-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: ManimPango-0.4.0.post0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1f595fc397fe154f1251f3f69a010c3c36ea83d961dff0d5d36a27a6e129a81 |
|
MD5 | 58e08295f9258c5b8097914646f73ba1 |
|
BLAKE2b-256 | c5f0f54910a5be1e95291f54ca28fab94018f165d9bdd5d22223b62dd9509534 |
File details
Details for the file ManimPango-0.4.0.post0-cp310-cp310-win32.whl
.
File metadata
- Download URL: ManimPango-0.4.0.post0-cp310-cp310-win32.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a5cad3e8a32cfae04871d6e21252b1b474ccc3b853d3ba6dacc955b15cf039d |
|
MD5 | c122902c0536f7f9c3cc2077ac78129f |
|
BLAKE2b-256 | a64b2655e6cac13f22256fdcd37a89bb59bdbb89a3b4ce1f159288c02f60c1d2 |
File details
Details for the file ManimPango-0.4.0.post0-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: ManimPango-0.4.0.post0-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e244daa4fe6f3660e4bc8a154cfb6d42523d80d79511cf07f2b6cf5c181fc1cc |
|
MD5 | 006512740fa840fdea002e7fb898bd6e |
|
BLAKE2b-256 | 72f99e2eb35975b4b8ba449947d113b229d5c351c9ad47b5da821f2c68f64538 |
File details
Details for the file ManimPango-0.4.0.post0-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: ManimPango-0.4.0.post0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05f09be578dd30e02c40818e2f3a9017f1797a101c4489a9121ed851cd8c97bb |
|
MD5 | cf4690335659a21b5f34c91f4a17e4a5 |
|
BLAKE2b-256 | e4134cfcf5402849b9d8ae4598d636dd94a71479d9acab77aa592bc8a3b4409b |
File details
Details for the file ManimPango-0.4.0.post0-cp39-cp39-win32.whl
.
File metadata
- Download URL: ManimPango-0.4.0.post0-cp39-cp39-win32.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.9, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bc42d1a4e7a0ddfa31b719d51f18af546098d311d083b72f222cd1a297bbb79 |
|
MD5 | e4321a68112fb877ccf9a9de9ec050d3 |
|
BLAKE2b-256 | 30890efc71539b6c6c674a11fabda4db91fdcf4a59fc4b85e33eed1fcbf02076 |
File details
Details for the file ManimPango-0.4.0.post0-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: ManimPango-0.4.0.post0-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00bc31f7f0d761d5e88722ba440f470609b62be42b5b106972d4b278ec2db815 |
|
MD5 | ba75af1dd4a8faf3865047cf50b2863d |
|
BLAKE2b-256 | 67512fc00f3539857fe42269cfdeae3bf46c041c58f368aeb20858971eacad3b |
File details
Details for the file ManimPango-0.4.0.post0-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: ManimPango-0.4.0.post0-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9006a7e8b3a07d5463449c08df13b89bd0bc1303b1f5a64db94e1e0743833135 |
|
MD5 | 8cbceda48b3f163e158efb2ebc02500d |
|
BLAKE2b-256 | e55484e8694fa9a647546436374eec3614db55f6edbcfe2c22b75441788dfe51 |
File details
Details for the file ManimPango-0.4.0.post0-cp38-cp38-win32.whl
.
File metadata
- Download URL: ManimPango-0.4.0.post0-cp38-cp38-win32.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.8, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8be96bf405243491cd9d9ff2feb1a2f6b14493566e3eb6d5edf96c0b270cabdf |
|
MD5 | b427cd15b769694ef426bccf13772bcf |
|
BLAKE2b-256 | b29f85bb9ded1e580647ad8d77c98ca2fde482625b5ee69310df92c65d1405e9 |
File details
Details for the file ManimPango-0.4.0.post0-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: ManimPango-0.4.0.post0-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e13eca3fe7e1b2a918e7810026de92a57b324ff7c4e21c22028fa9de17d6e61 |
|
MD5 | 1d972e0f56a5be0acb87336c351bab67 |
|
BLAKE2b-256 | 12b6ccffaa46ef38e37329a8befbb77dac6de99171f97f6e936df291fd72e25d |
File details
Details for the file ManimPango-0.4.0.post0-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: ManimPango-0.4.0.post0-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ab99c208bf9e5b16b77aca75ca66aae1b58f0e818ff215990886cbf3425251c |
|
MD5 | 3dc18719a313eb454b384790e7f5090b |
|
BLAKE2b-256 | f8711de9582bd35e89974b45a4829ec1d67d4d46a10c8f49f241246e49d42e5e |
File details
Details for the file ManimPango-0.4.0.post0-cp37-cp37m-win32.whl
.
File metadata
- Download URL: ManimPango-0.4.0.post0-cp37-cp37m-win32.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.7m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 096f4a8a8752639c1d1f99bfa3fc141b637cfc6b2758461eeb0501b316c649cb |
|
MD5 | acffb9802f71cbcfa9273b05fefb3f19 |
|
BLAKE2b-256 | 62e971604b706bf329465278eee2ff3bef3dc6c25e120c54c5e14d8bdfd9879a |
File details
Details for the file ManimPango-0.4.0.post0-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: ManimPango-0.4.0.post0-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 153e4d1a6a77b2e330e6b085a8e0479b7a129458059f5ff0c3f00f4dcb184f81 |
|
MD5 | 4cc560ab08a26a45ac51733613c72073 |
|
BLAKE2b-256 | 3fbc4fb2ad7f335f636098e3a7e3ab609e8c3d69342813b380d0c29b0c658fab |